//
// sub_1800B4320 from 0x1800b4320 to 0x1800b4394 (116 bytes)
//
// 2 xrefs:
// > ??> @ 0x180167160
// > ??> @ 0x1801fcf00
//
// This function is hookable on this platform (idp: pc, 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 10:53:58 +0000
//
__int64 __fastcall sub_1800B4320(__int64 a1, void *a2, unsigned int a3, unsigned int *a4)
{
__int64 v4; // rax
unsigned int v5; // edi
unsigned int v6; // r8d
unsigned int v8; // ecx
bool v10; // cf
unsigned int v11; // ebx
v4 = *(unsigned int *)(a1 + 496);
v5 = a3;
v6 = v4 + a3;
v8 = *(_DWORD *)(a1 + 36);
v10 = v8 < v6;
if ( v8 < v6 )
{
v5 = v8 - v4;
v10 = v8 < v6;
}
v11 = v10 ? 0x10 : 0;
memmove(a2, (const void *)(*(_QWORD *)(a1 + 504) + v4), v5);
*a4 = v5;
*(_DWORD *)(a1 + 496) += v5;
return v11;
}