//
// sub_1005D8D58 from 0x1005d8d58 to 0x1005d8de4 (140 bytes)
//
// 1 xrefs:
// > sub_1005D64C4 @ 0x1005d653c
//
// 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_1005D8D58(__int64 result)
{
__int64 v1; // x19
__int64 (__fastcall *v2)(__int64, _QWORD, __int64 *, _QWORD); // x8
__int64 v3; // x20
int v4; // w21
__int64 v5; // [xsp+0h] [xbp-30h] BYREF
__int64 v6; // [xsp+8h] [xbp-28h] BYREF
v1 = result;
v2 = *(__int64 (__fastcall **)(__int64, _QWORD, __int64 *, _QWORD))(result + 88);
if ( v2 )
{
result = v2(result, 0, &v5, 0);
if ( (int)result >= 1 )
{
v3 = 0;
v4 = result;
do
{
result = (*(__int64 (__fastcall **)(__int64, __int64 *, _QWORD, _QWORD))(v1 + 88))(
v1,
&v6,
0,
*(unsigned int *)(v5 + 4 * v3));
if ( (_DWORD)result )
result = sub_1005EC3C8(v6);
++v3;
}
while ( v4 != (_DWORD)v3 );
}
}
return result;
}