//
// sub_1005E1230 from 0x1005e1230 to 0x1005e12c0 (144 bytes)
//
// 1 xrefs:
// > sub_1005E0F38 @ 0x1005e0f68
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:09:40 +0000
//
__int64 __fastcall sub_1005E1230(unsigned int **a1)
{
_QWORD *v1; // x19
__int64 result; // x0
signed __int64 v3; // x2
signed __int64 v4; // x8
__int64 v5; // x9
v1 = *a1;
result = ((__int64 (__fastcall *)(unsigned int **, _QWORD, _QWORD))a1[1])(a1, *((_QWORD *)*a1 + 3), (*a1)[2]);
if ( !(_DWORD)result )
{
if ( *((_DWORD *)v1 + 4) == 1 )
{
v3 = *((unsigned int *)v1 + 3);
if ( (int)v3 >= 1 )
{
v4 = 0;
v5 = v1[3];
do
{
*(_BYTE *)(v5 + v4++) ^= 0x80u;
v3 = *((int *)v1 + 3);
}
while ( v4 < v3 );
}
}
else
{
v3 = *((unsigned int *)v1 + 3);
}
result = sub_1005DB898((FILE *)v1[4], (void *)v1[3], v3, 0);
if ( !(_DWORD)result )
*((_DWORD *)v1 + 5) += *((_DWORD *)v1 + 3);
}
return result;
}