//
// sub_1005734B8 from 0x1005734b8 to 0x10057359c (228 bytes)
//
// 1 xrefs:
// > sub_10054E6A0 @ 0x10054ea58
//
// 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:08:19 +0000
//
__int64 __fastcall sub_1005734B8(__int64 a1, _QWORD *a2, __int64 a3)
{
__int64 v6; // x21
__int64 result; // x0
__int64 v8; // x8
__int64 v9; // x10
__int64 v10; // x22
signed int v11; // w8
signed int v12; // w9
int *v13; // x10
int v14; // t1
int v15; // w8
bool v16; // vf
int v17; // w8
__int64 v18; // x9
v6 = a1 + 1312;
result = sub_100572948((__int64 *)(a1 + 1312), 0, a3);
if ( (_DWORD)result == 45 )
goto LABEL_4;
if ( (_DWORD)result )
return result;
if ( *(_BYTE *)(a1 + 720) )
{
LABEL_4:
v8 = 0;
LABEL_5:
result = 0;
*a2 = v8;
return result;
}
v9 = *(_QWORD *)(a3 + 8);
v10 = -*(_BYTE *)(a3 + 8) & 3;
v11 = *(_DWORD *)(a3 + 24);
v12 = v10 | 4;
if ( (int)(v10 | 4) <= v11 && *(_DWORD *)(v9 + v10) == -1 )
{
v13 = (int *)(v10 + v9 + 4);
do
{
LODWORD(v10) = v12;
v12 += 4;
if ( v12 > v11 )
break;
v14 = *v13++;
}
while ( v14 == -1 );
}
result = sub_100572B94(v6, v10);
if ( !(_DWORD)result )
{
v15 = *(_DWORD *)(a3 + 24);
v16 = __OFSUB__(v15, (_DWORD)v10);
v17 = v15 - v10;
if ( (v17 < 0) ^ v16 | (v17 == 0) )
{
v18 = *(_QWORD *)(a3 + 16);
v17 = *(_DWORD *)(a3 + 28);
}
else
{
v18 = *(_QWORD *)(a3 + 8) + (unsigned int)v10;
}
if ( v17 <= 0 )
v8 = 0;
else
v8 = v18;
goto LABEL_5;
}
return result;
}