//
// sub_100591104 from 0x100591104 to 0x100591174 (112 bytes)
//
// 0 xrefs:
//
// 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:08:44 +0000
//
__int64 __fastcall sub_100591104(__int64 a1, void *__dst, int a3)
{
__int64 v4; // x8
unsigned int v5; // w9
int v6; // w20
v4 = *(unsigned int *)(a1 + 16);
v5 = *(_DWORD *)(a1 + 20);
if ( v5 <= (unsigned int)v4 )
{
*(_BYTE *)(a1 + 36) = 1;
return 16;
}
else
{
if ( (int)v4 + a3 <= v5 )
v6 = a3;
else
v6 = v5 - v4;
if ( __dst )
{
memcpy(__dst, (const void *)(*(_QWORD *)(a1 + 8) + v4), v6);
LODWORD(v4) = *(_DWORD *)(a1 + 16);
}
*(_DWORD *)(a1 + 16) = v4 + v6;
return 0;
}
}