//
// sub_F9DB8 from 0xf9db8 to 0xf9e68 (176 bytes)
//
// 2 xrefs:
// > sub_F9E68 @ 0xf9eac
// > sub_FAFFC @ 0xfb004
//
// 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_F9DB8(__int64 a1, _DWORD *a2)
{
int v2; // w8
__int64 result; // x0
__int64 v5; // x0
__int64 v6; // x2
__int64 v7; // x8
__int64 v8; // x9
__int64 v9; // x1
int v10; // w0
__int64 v11; // x1
void *v12; // x2
__int64 v13; // x0
__int64 v14; // x1
__int64 v15; // x2
v2 = a2[32];
if ( v2 > 3 )
return 0;
if ( v2 != 3 )
return 4294967167LL;
if ( !a2[2] )
{
v13 = sub_FB07C(a1);
result = sub_F3E78(v13, v14, v15);
if ( (_DWORD)result == -139 )
return result;
if ( !(_DWORD)result )
goto LABEL_8;
return 4294967159LL;
}
v5 = sub_FB07C(a1);
result = sub_F3E78(v5, v9, v6 + v7 * v8);
if ( (_DWORD)result == -139 )
return result;
if ( (_DWORD)result )
return 4294967159LL;
LABEL_8:
v10 = sub_FB07C(result);
result = sub_F3AD0(v10, v11, v12);
if ( (_DWORD)result )
return 4294967157LL;
a2[32] = 4;
a2[35] = 0;
a2[36] = 0;
return result;
}