//
// sub_180014FB0 from 0x180014fb0 to 0x180015092 (226 bytes)
//
// 2 xrefs:
// > sub_180013E20 @ 0x180013e62
// > ??> @ 0x1801f7014
//
// 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:52:47 +0000
//
__int64 __fastcall sub_180014FB0(__int64 a1, int a2, unsigned int a3)
{
unsigned __int64 v3; // r10
unsigned int v4; // r8d
int v5; // eax
int v6; // eax
__int64 v7; // r8
__int64 v8; // rax
int v9; // r11d
__int64 v10; // rax
__int64 result; // rax
v3 = a3;
v4 = 0;
if ( a2 >= 0 )
{
v5 = *(_DWORD *)(a1 + 24);
if ( !v5 || a2 < v5 )
{
if ( (*(_DWORD *)(*(_QWORD *)(a1 + 368) + 404LL) & 1) == 0 )
return v4;
v6 = *(_DWORD *)(a1 + 408);
if ( a2 != v6 )
{
*(_DWORD *)(a1 + 408) = a2;
v6 = a2;
}
v7 = v6;
v8 = *(_QWORD *)(a1 + 8);
v9 = *(_DWORD *)(56 * v7 + v8 + 12);
switch ( *(_DWORD *)(56 * v7 + v8 + 8) )
{
case 1:
v10 = 8;
break;
case 2:
v10 = 16;
break;
case 3:
v10 = 24;
break;
default:
if ( (unsigned int)(*(_DWORD *)(56 * v7 + v8 + 8) - 4) > 1 )
goto LABEL_16;
v10 = 32;
break;
}
v3 = (v10 * v3) >> 3;
LABEL_16:
result = sub_1800B3990(
*(_QWORD *)(a1 + 368),
(unsigned int)(*(_DWORD *)(296 * v7 + *(_QWORD *)(a1 + 400) + 256) + v3 * v9),
0);
v4 = result;
if ( (_DWORD)result )
return result;
return v4;
}
}
return 32;
}