//
// sub_1005E8C80 from 0x1005e8c80 to 0x1005e8d20 (160 bytes)
//
// 1 xrefs:
// > ??> @ 0x10083d730
//
// 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_1005E8C80(__int64 a1, _BYTE *a2, int *a3, unsigned __int64 a4)
{
__int64 v4; // x19
unsigned __int64 v8; // x25
unsigned __int64 v9; // x8
v4 = a4;
if ( a4 )
{
if ( a4 >> 62 )
v8 = 0x4000000000000000LL;
else
v8 = a4;
do
{
sub_1005A11CC(a3, a2, v4, *(_QWORD *)(a1 + 120), a1 + 40, (int *)(a1 + 88), *(_DWORD *)(a1 + 16));
v9 = v4 - v8;
if ( v4 - v8 >= v8 )
v9 = v8;
v4 -= v8;
a3 = (int *)((char *)a3 + v8);
a2 += v8;
v8 = v9;
}
while ( v4 );
}
return 1;
}