//
// sub_100574888 from 0x100574888 to 0x100574980 (248 bytes)
//
// 1 xrefs:
// > sub_1005742CC @ 0x10057439c
//
// 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:20 +0000
//
__int64 __fastcall sub_100574888(__int64 a1, _DWORD *a2)
{
__int64 v4; // x19
int v5; // w9
int v6; // w8
int v7; // w10
__int64 v8; // x9
__int64 v9; // x21
unsigned int v10; // w8
size_t v11; // x2
__int64 v12; // x20
int v13; // w8
v4 = *(_QWORD *)(a1 + 56);
sub_1005DBDD8(v4);
if ( !*(_DWORD *)(a1 + 116) )
goto LABEL_16;
v5 = *(_DWORD *)(a1 + 88);
if ( !v5 )
goto LABEL_16;
v6 = a2[3];
v7 = *(_DWORD *)(*(_QWORD *)(a1 + 80) + 4LL * (v6 & (v5 - 1)));
if ( v7 == -1 )
goto LABEL_16;
v8 = *(_QWORD *)(a1 + 96);
while ( *(_DWORD *)(v8 + 16LL * v7) != v6 )
{
v7 = *(_DWORD *)(v8 + 16LL * v7 + 4);
if ( v7 == -1 )
goto LABEL_16;
}
v9 = *(_QWORD *)(v8 + 16LL * v7 + 8);
if ( !v9 )
goto LABEL_16;
v10 = a2[6];
if ( v10 == *(_DWORD *)(v9 + 40) )
{
v11 = (unsigned int)a2[7];
if ( (unsigned int)v11 <= v10 )
{
v13 = a2[4];
if ( v13 )
{
*(_DWORD *)(v9 + 48) = v13;
}
else
{
memcpy(*(void **)(v9 + 32), a2 + 8, v11);
*(_DWORD *)(v9 + 44) = a2[7];
}
sub_1005DBF3C(*(_QWORD *)(v9 + 8));
LABEL_16:
v12 = 0;
goto LABEL_17;
}
}
v12 = 28;
LABEL_17:
sub_1005DBE08(v4);
return v12;
}