//
// sub_10072C83C from 0x10072c83c to 0x10072c99c (352 bytes)
//
// 3 xrefs:
// > sub_100728FA0 @ 0x100728fa8
// > sub_100728FD0 @ 0x100728fd8
// > sub_100728FDC @ 0x100728fe0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:13:10 +0000
//
__int64 __fastcall sub_10072C83C(unsigned int *a1, int a2, int *a3, int *a4)
{
int v8; // w8
int v9; // w23
__int64 *v10; // x24
__int64 *v11; // x25
int v13; // w8
if ( !a1 )
{
if ( a4 )
*a4 = -1;
if ( !a3 )
return 0;
LABEL_31:
v13 = -1;
goto LABEL_32;
}
if ( a4 )
v8 = *a4 + 1;
else
v8 = 0;
if ( v8 >= 0 )
v9 = v8;
else
v9 = 0;
if ( v9 >= (int)sub_100704BB4(a1) )
{
LABEL_28:
if ( a4 )
*a4 = -1;
if ( !a3 )
return 0;
goto LABEL_31;
}
if ( a4 )
{
while ( 1 )
{
v10 = (__int64 *)sub_100704BC8((__int64)a1, v9);
if ( (unsigned int)sub_1006B0F78(*v10) == a2 )
break;
if ( ++v9 >= (int)sub_100704BB4(a1) )
goto LABEL_28;
}
*a4 = v9;
LABEL_24:
if ( v10 )
{
if ( a3 )
*a3 = sub_100728F6C((__int64)v10);
return sub_10072C74C(v10);
}
goto LABEL_28;
}
v10 = nullptr;
while ( 1 )
{
v11 = (__int64 *)sub_100704BC8((__int64)a1, v9);
if ( (unsigned int)sub_1006B0F78(*v11) == a2 )
break;
LABEL_21:
if ( ++v9 >= (int)sub_100704BB4(a1) )
goto LABEL_24;
}
if ( !v10 )
{
v10 = v11;
goto LABEL_21;
}
if ( a3 )
{
v13 = -2;
LABEL_32:
*a3 = v13;
}
return 0;
}