//
// sub_68C48 from 0x68c48 to 0x68d04 (188 bytes)
//
// 4 xrefs:
// > ??> @ 0x10ca38
// > ??> @ 0x10cbe0
// > ??> @ 0x10cd88
// > ??> @ 0x10cf18
//
// 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_68C48(__int64 a1, _DWORD *a2, int a3)
{
__int64 v4; // x8
float v5; // s0
__int64 result; // x0
unsigned int v7; // w1
__int64 v8; // x0
__int64 v10; // x0
__int64 (*v11)(void); // x3
_DWORD v12[16]; // [xsp+0h] [xbp-50h] BYREF
if ( !a2 )
return 31;
switch ( a3 )
{
case 1:
v5 = *(float *)(a1 + 108);
if ( v5 != 0.0 )
{
v4 = *(unsigned int *)(a1 + 68);
if ( (_DWORD)v4 != -1 )
{
*a2 = 1000 * v4 / (unsigned __int64)v5;
return 0;
}
goto LABEL_14;
}
goto LABEL_13;
case 4:
v7 = *(_DWORD *)(a1 + 68);
if ( v7 != -1 )
{
sub_66774(a1, v7, a2);
return 0;
}
LABEL_13:
LODWORD(v4) = -1;
goto LABEL_14;
case 2:
LODWORD(v4) = *(_DWORD *)(a1 + 68);
LABEL_14:
*a2 = v4;
return 0;
}
v8 = *(_QWORD *)(a1 + 96);
if ( !v8 )
return 31;
if ( a3 == 8 )
{
v10 = sub_D2E80();
result = (*(__int64 (__fastcall **)(__int64, _QWORD, _DWORD *))(v10 + 136))(v10, *(unsigned int *)(v10 + 284), v12);
if ( !(_DWORD)result )
*a2 = v12[5];
}
else
{
v11 = *(__int64 (**)(void))(v8 + 104);
if ( v11 )
{
return v11();
}
else
{
*a2 = 0;
return 68;
}
}
return result;
}