//
// sub_1005DF2B0 from 0x1005df2b0 to 0x1005df318 (104 bytes)
//
// 7 xrefs:
// > sub_1005896CC @ 0x100589768
// > sub_10058A700 @ 0x10058a738
// > sub_10058A844 @ 0x10058a880
// > sub_10058A844 @ 0x10058a890
// > sub_10058A844 @ 0x10058a8a0
// > sub_1005D7B9C @ 0x1005d7bd4
// > sub_1006119C8 @ 0x100611a04
//
// 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_1005DF2B0(__int64 result, __int64 (__fastcall *a2)(_QWORD))
{
_QWORD *v3; // x20
int v4; // w8
__int64 v5; // x21
_QWORD *v6; // x8
_QWORD *v7; // x22
v3 = (_QWORD *)result;
if ( result )
{
v4 = *(_DWORD *)(result + 24) - 1;
if ( (v4 & 0x80000000) == 0 )
{
v5 = v4;
do
{
v6 = *(_QWORD **)(*v3 + 8 * v5);
if ( v6 )
{
do
{
v7 = (_QWORD *)v6[1];
result = a2(*v6);
v6 = v7;
}
while ( v7 );
}
}
while ( v5-- > 0 );
}
}
return result;
}