//
// sub_1005F8CE4 from 0x1005f8ce4 to 0x1005f8db0 (204 bytes)
//
// 1 xrefs:
// > sub_1005F623C @ 0x1005f63c0
//
// 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_1005F8CE4(_DWORD *a1, void **a2, __int64 *a3, __int64 a4)
{
__int64 v6; // x21
__int64 v7; // x8
__int64 v9; // x22
if ( !a3 )
return 0;
v6 = *a3;
if ( !*a3 )
return 0;
v7 = *(_QWORD *)(a4 + 32);
if ( !v7 )
return 0;
if ( (*(_BYTE *)(v7 + 8) & 2) == 0 )
return 0;
v9 = *(int *)(v7 + 32);
if ( !(v6 + v9) )
return 0;
if ( *(_DWORD *)(v9 + v6 + 16) )
return 0;
if ( a2 )
{
memcpy(*a2, *(const void **)(v6 + v9), *(_QWORD *)(v6 + v9 + 8));
*a2 = (char *)*a2 + *(_QWORD *)(v6 + v9 + 8);
}
if ( a1 )
*a1 = *(_QWORD *)(v9 + v6 + 8);
return 1;
}