//
// sub_180035F90 from 0x180035f90 to 0x1800360ce (318 bytes)
//
// 2 xrefs:
// > sub_180035EF0 @ 0x180035f08
// > ??> @ 0x1801f7c08
//
// 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_180035F90(__int64 a1, __int64 a2, _DWORD *a3)
{
__int64 result; // rax
int v6; // ecx
__int64 v7; // r8
unsigned int v8; // r9d
__int64 v9; // rdx
unsigned __int64 v10; // rcx
*(_DWORD *)(a1 + 40) = 12;
*(_QWORD *)(a1 + 288) = 0;
*(_QWORD *)(a1 + 8) = a1 + 376;
*(_QWORD *)(a1 + 296) = 0;
*(_QWORD *)(a1 + 304) = 0;
*(_QWORD *)(a1 + 328) = 0;
*(_QWORD *)(a1 + 312) = 0;
*(_QWORD *)(a1 + 360) = 0;
*(_DWORD *)(a1 + 24) = 0;
result = (*(__int64 (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 368) + 16LL))(
*(_QWORD *)(a1 + 368),
a1 + 396);
if ( !(_DWORD)result )
{
*(_DWORD *)(a1 + 272) = 0;
v6 = a3[5];
if ( (unsigned int)(v6 - 1) > 4 )
{
return 19;
}
else
{
*(_DWORD *)(*(_QWORD *)(a1 + 8) + 8LL) = v6;
*(_DWORD *)(*(_QWORD *)(a1 + 8) + 12LL) = a3[3];
*(_DWORD *)(*(_QWORD *)(a1 + 8) + 16LL) = a3[4];
v7 = *(_QWORD *)(a1 + 8);
v8 = a3[3];
v9 = *(unsigned int *)(v7 + 20);
if ( v8 )
{
switch ( a3[5] )
{
case 1:
v10 = 8;
break;
case 2:
v10 = 16;
break;
case 3:
v10 = 24;
break;
default:
if ( (unsigned int)(a3[5] - 4) >= 2 )
{
*(_DWORD *)(v7 + 24) = v9;
*(_DWORD *)(a1 + 24) = 0;
return 0;
}
v10 = 32;
break;
}
*(_DWORD *)(v7 + 24) = (unsigned int)(8 * v9 / v10) / v8;
}
*(_DWORD *)(a1 + 24) = 0;
return 0;
}
}
return result;
}