//
// sub_FBDBC from 0xfbdbc to 0xfbe4c (144 bytes)
//
// 7 xrefs:
// > sub_FD56C @ 0xfd700
// > sub_FD56C @ 0xfd748
// > sub_FD56C @ 0xfd7c8
// > sub_FDB10 @ 0xfdb1c
// > sub_FDB20 @ 0xfdb2c
// > sub_FDB30 @ 0xfdb3c
// > sub_FF90C @ 0xff914
//
// 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_FBDBC(__int64 a1, unsigned int **a2)
{
__int64 v2; // x21
int v3; // w22
__int64 v4; // x9
__int64 v5; // x10
__int64 v6; // x23
unsigned __int64 v9; // x3
int v10; // w2
int v11; // w8
v2 = (__int64)*a2;
v3 = *((_DWORD *)a2 + 4);
v4 = *(unsigned int *)(a1 + 112);
v5 = *(_QWORD *)(a1 + 48);
v6 = *(_QWORD *)(a1 + 56);
v9 = (unsigned __int64)**a2 >> v3;
v10 = *(unsigned __int16 *)(v5 + 2 * (v9 & v4));
if ( *(__int16 *)(v5 + 2 * (v9 & v4)) < 0 )
v10 = sub_FBCF8(a1, (__int64)a2, v10, v9);
v11 = v3 + *(unsigned __int8 *)(v6 + (v10 & 0x7FFF));
*((_DWORD *)a2 + 4) = v11 & 7;
*a2 = (unsigned int *)(v2 + (v11 >> 3));
return *(__int16 *)(*(_QWORD *)(a1 + 80) + 2LL * (unsigned int)(v10 - 1));
}