//
// sub_1800DEC00 from 0x1800dec00 to 0x1800decf3 (243 bytes)
//
// 4 xrefs:
// > ??> @ 0x18016d128
// > ??> @ 0x18016d318
// > ??> @ 0x18016d4b0
// > ??> @ 0x18016d680
//
// 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:54:15 +0000
//
__int64 __fastcall sub_1800DEC00(__int64 a1, int *a2, int a3)
{
float v5; // xmm1_4
int v6; // eax
__int64 v7; // rdx
unsigned __int64 v8; // rax
unsigned __int64 v9; // rdx
unsigned __int64 v10; // rdx
int v11; // r8d
int v12; // ecx
int v13; // ecx
int v14; // ecx
__int64 v15; // rax
__int64 v16; // rcx
if ( !a2 )
return 31;
if ( a3 == 2 )
{
*a2 = *(_DWORD *)(a1 + 68);
return 0;
}
if ( a3 != 1 )
{
if ( a3 == 4 )
{
v10 = *(unsigned int *)(a1 + 68);
v6 = -1;
if ( (_DWORD)v10 == -1 )
{
LABEL_23:
*a2 = v6;
return 0;
}
v11 = *(_DWORD *)(a1 + 104);
v12 = *(_DWORD *)(a1 + 40) - 1;
if ( v12 )
{
v13 = v12 - 1;
if ( v13 )
{
v14 = v13 - 1;
if ( v14 )
{
if ( (unsigned int)(v14 - 1) > 1 )
{
LABEL_22:
v6 = v11 * v10;
goto LABEL_23;
}
v15 = 32;
}
else
{
v15 = 24;
}
}
else
{
v15 = 16;
}
}
else
{
v15 = 8;
}
v10 = (v15 * v10) >> 3;
goto LABEL_22;
}
v16 = *(_QWORD *)(a1 + 96);
if ( v16 )
return sub_180012370(v16, a2, a3);
return 31;
}
v5 = *(float *)(a1 + 108);
v6 = -1;
if ( v5 == 0.0 )
goto LABEL_23;
v7 = *(unsigned int *)(a1 + 68);
if ( (_DWORD)v7 == -1 )
goto LABEL_23;
v8 = 1000 * v7;
v9 = 0;
if ( v5 >= 9.223372e18 )
{
v5 = v5 - 9.223372e18;
if ( v5 < 9.223372e18 )
v9 = 0x8000000000000000uLL;
}
*a2 = v8 / (v9 + (unsigned int)(int)v5);
return 0;
}