//
// sub_1800C47B0 from 0x1800c47b0 to 0x1800c4853 (163 bytes)
//
// 2 xrefs:
// > sub_1800C3960 @ 0x1800c3a15
// > ??> @ 0x1801fde78
//
// 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_1800C47B0(
__int64 a1,
__int64 a2,
__int64 a3,
unsigned int a4,
_QWORD *a5,
int a6,
unsigned int *a7)
{
__int64 v7; // rbx
__int64 v11; // rcx
unsigned int v12; // edx
__int64 v13; // [rsp+50h] [rbp+8h] BYREF
__int64 v14; // [rsp+58h] [rbp+10h] BYREF
v13 = a1;
v7 = *(_QWORD *)(a2 + 40);
v14 = 0;
LODWORD(v13) = 0;
if ( (*(int (__fastcall **)(_QWORD, __int64 *, __int64, __int64 *, _QWORD, _QWORD))(**(_QWORD **)(v7 + 8) + 24LL))(
*(_QWORD *)(v7 + 8),
&v14,
v7 + 16,
&v13,
0,
0) < 0 )
return 49;
v11 = *(unsigned int *)(v7 + 20);
v12 = 4 * *(_DWORD *)(v7 + 16) * *(_DWORD *)(a2 + 32) - v11;
*a5 = v14 + v11;
if ( v12 <= a4 )
{
*(_DWORD *)(v7 + 20) = 0;
a4 = v12;
}
else
{
*(_DWORD *)(v7 + 20) += a4;
*(_DWORD *)(v7 + 16) = 0;
}
*a7 = a4;
return 0;
}