//
// sub_180036320 from 0x180036320 to 0x180036393 (115 bytes)
//
// 1 xrefs:
// > sub_180035EF0 @ 0x180035f32
//
// 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_180036320(__int64 a1, __int64 a2, unsigned int a3, int a4)
{
unsigned __int64 v4; // r10
__int64 v5; // rdx
__int64 v6; // rax
LODWORD(v4) = a3;
if ( a4 != 8 && a3 )
{
v5 = *(_QWORD *)(a1 + 8);
switch ( *(_DWORD *)(v5 + 8) )
{
case 1:
v6 = 8;
break;
case 2:
v6 = 16;
break;
case 3:
v6 = 24;
break;
default:
if ( (unsigned int)(*(_DWORD *)(v5 + 8) - 4) > 1 )
{
LABEL_12:
LODWORD(v4) = *(_DWORD *)(v5 + 12) * v4;
return sub_1800B3990(*(_QWORD *)(a1 + 368), (unsigned int)(v4 + *(_DWORD *)(a1 + 272)), 0);
}
v6 = 32;
break;
}
v4 = (v6 * (unsigned __int64)a3) >> 3;
goto LABEL_12;
}
return sub_1800B3990(*(_QWORD *)(a1 + 368), (unsigned int)(v4 + *(_DWORD *)(a1 + 272)), 0);
}