//
// sub_100573D28 from 0x100573d28 to 0x100573e10 (232 bytes)
//
// 1 xrefs:
// > ??> @ 0x1009aa9f0
//
// 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_100573D28(__int64 a1, __int64 a2, unsigned int a3, unsigned int *a4)
{
__int64 v4; // x8
__int64 v6; // x0
_QWORD *v10; // x0
_QWORD *v11; // x23
unsigned int v12; // w24
__int64 v13; // x4
__int64 v14; // x3
__int64 result; // x0
int v16; // w8
int v17; // [xsp+Ch] [xbp-44h] BYREF
*a4 = 0;
v4 = *(_QWORD *)(a1 + 408);
if ( !v4 )
return 28;
v6 = *(_QWORD *)(v4 + 73968);
if ( !v6 )
return 13;
v10 = sub_10054ED58(v6, 10);
if ( !v10 )
return 13;
if ( a3 )
{
v11 = v10;
v12 = 0;
v13 = *(unsigned int *)(a1 + 496);
while ( 1 )
{
v14 = a3 >= 0x10000 ? 0x10000LL : a3;
v17 = 0;
result = sub_100575164(v11, *(_QWORD *)(a1 + 504), a2 + v12, v14, v13, &v17);
v16 = v17;
v13 = (unsigned int)(*(_DWORD *)(a1 + 496) + v17);
*(_DWORD *)(a1 + 496) = v13;
v12 += v16;
if ( (_DWORD)result )
break;
a3 -= v16;
if ( !a3 )
{
result = 0;
break;
}
}
}
else
{
v12 = 0;
result = 13;
}
*a4 = v12;
return result;
}