//
// sub_9F0DC from 0x9f0dc to 0x9f188 (172 bytes)
//
// 1 xrefs:
// > sub_9F0A0 @ 0x9f0c0
//
// 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
//
// positive sp value has been detected, the output may be wrong!
__int64 __usercall sub_9F0DC@(char a1@)
{
__int64 v1; // x19
__int64 v2; // x20
int v3; // w9
int v4; // w11
signed int v5; // w10
int v6; // w12
signed int v7; // w11
char v8; // w8
v3 = *(unsigned __int8 *)(v1 + 268);
v4 = *(_DWORD *)(v2 + 68);
v5 = ((unsigned int)byte_114008[a1 & 0x1F] * v3) >> 6;
if ( a1 < 0 )
{
if ( v5 > (__int16)v4 )
v5 = *(_DWORD *)(v2 + 68);
v5 = -v5;
}
else
{
v6 = v5 + v4;
v7 = 64 - v4;
if ( v6 > 64 )
v5 = v7;
}
v8 = a1 + v3;
*(_DWORD *)(v2 + 76) = v5;
if ( v8 > 31 )
v8 -= 64;
*(_BYTE *)(v1 + 266) = v8;
*(_BYTE *)(v2 + 60) |= 2u;
return 0;
}