//
// sub_1800BB580 from 0x1800bb580 to 0x1800bb616 (150 bytes)
//
// 5 xrefs:
// > sub_1800BC770 @ 0x1800bc975
// > ??> @ 0x18018a2a0
// > ??> @ 0x18018a2b4
// > ??> @ 0x18018a2c4
// > ??> @ 0x1801fd59c
//
// 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_1800BB580(__int64 a1, void *a2, __int64 a3, _DWORD *a4, _DWORD *a5)
{
__int64 v5; // rax
__int64 result; // rax
__int64 v9; // rdi
__int64 v10; // rcx
unsigned int v11; // ebx
__int64 v12; // [rsp+30h] [rbp+8h] BYREF
v5 = *(_QWORD *)(a1 + 40);
v12 = 0;
result = (*(__int64 (__fastcall **)(__int64, __int64 *))(v5 + 88))(a1, &v12);
if ( !(_DWORD)result )
{
v9 = v12;
v10 = *(_QWORD *)(v12 + 32);
if ( v10 )
{
v11 = 4 * *a5 * *a4;
memmove(a2, (const void *)(v10 + *(unsigned int *)(v12 + 72)), v11);
*(_DWORD *)(v9 + 72) += v11;
return 0;
}
else
{
return sub_1801079D0(*(_QWORD *)(v12 + 16), a2, (unsigned int)*a4, *(unsigned int *)(v12 + 64));
}
}
return result;
}