//
// sub_10042CAB0 from 0x10042cab0 to 0x10042cb4c (156 bytes)
//
// 3 xrefs:
// > sub_10042CB4C @ 0x10042cb64
// > sub_1004EBA68 @ 0x1004eba9c
// > sub_1004EBC24 @ 0x1004ebc50
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_10042CAB0(__int64 a1, __int64 a2)
{
_QWORD *v4; // x21
_QWORD *v5; // x22
int v6; // w8
__int64 v7; // x0
__int64 result; // x0
v4 = *(_QWORD **)(a2 + 112);
if ( v4 )
{
do
{
v5 = (_QWORD *)v4[1];
sub_100478D80(a1, *v4);
*v4 = 0;
v4[1] = 0;
sub_100478D80(a1, v4);
v4 = v5;
}
while ( v5 );
}
v6 = *(_DWORD *)(a2 + 104);
if ( v6 )
{
v7 = sub_100478D28(a1, *(_QWORD *)(a2 + 88), (unsigned int)(*(_DWORD *)(a2 + 100) + v6));
*(_QWORD *)(a2 + 88) = v7;
if ( v7 )
result = 0;
else
result = 4294967157LL;
*(_QWORD *)(a2 + 100) = (unsigned int)(*(_DWORD *)(a2 + 100) + *(_DWORD *)(a2 + 104));
}
else
{
result = 0;
}
*(_DWORD *)(a2 + 96) = 0;
*(_QWORD *)(a2 + 112) = 0;
return result;
}