//
// sub_1800C2B60 from 0x1800c2b60 to 0x1800c2c66 (262 bytes)
//
// 2 xrefs:
// > sub_1800C2180 @ 0x1800c2243
// > ??> @ 0x1801fdcd4
//
// 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_1800C2B60(
__int64 a1,
_DWORD *a2,
unsigned int a3,
unsigned int a4,
_QWORD *a5,
_QWORD *a6,
unsigned int *a7,
unsigned int *a8)
{
unsigned __int64 v8; // r11
__int64 v9; // rax
unsigned int v10; // r11d
__int64 v12; // r10
unsigned int v13; // r9d
__int64 v14; // rax
v8 = (unsigned int)a2[9];
switch ( a2[6] )
{
case 1:
v9 = 8;
break;
case 2:
v9 = 16;
break;
case 3:
v9 = 24;
break;
default:
if ( (unsigned int)(a2[6] - 4) > 1 )
goto LABEL_10;
v9 = 32;
break;
}
v8 = (v9 * v8) >> 3;
LABEL_10:
v10 = a2[8] * v8;
if ( a4 > v10 )
a4 = v10;
if ( a3 < v10 )
{
v12 = a1 + 1200;
if ( !a1 )
v12 = 1208;
*a5 = *(_QWORD *)v12 + a3;
if ( a4 + a3 > v10 )
{
v13 = a3 + a4 - v10;
*a7 = v10 - a3;
v14 = *(_QWORD *)v12;
}
else
{
*a7 = a4;
v13 = 0;
v14 = 0;
}
*a6 = v14;
*a8 = v13;
return 0;
}
else
{
*a6 = 0;
*a5 = 0;
*a8 = 0;
*a7 = 0;
return 31;
}
}