//
// sub_10047BC10 from 0x10047bc10 to 0x10047bcd4 (196 bytes)
//
// 1 xrefs:
// > sub_10047BBE4 @ 0x10047bc00
//
// 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 __usercall sub_10047BC10@(__int64 a1@, __int64 a2@)
{
char v2; // w9
int v3; // w11
signed int v4; // w10
int v5; // w12
unsigned int v6; // w13
int v7; // w14
signed int v8; // w12
char v9; // w9
v3 = *(unsigned __int8 *)(a1 + 268);
v4 = ((unsigned int)byte_100852D18[v2 & 0x1F] * v3) >> 6;
v5 = *(_DWORD *)(a2 + 68);
if ( v4 <= (__int16)v5 )
v6 = ((unsigned int)byte_100852D18[v2 & 0x1F] * v3) >> 6;
else
v6 = *(_DWORD *)(a2 + 68);
v7 = v5 + v4;
v8 = 64 - v5;
if ( v7 > 64 )
v4 = v8;
if ( v2 < 0 )
v4 = -v6;
*(_DWORD *)(a2 + 76) = v4;
v9 = v3 + v2;
if ( v9 > 31 )
v9 -= 64;
*(_BYTE *)(a1 + 266) = v9;
*(_BYTE *)(a2 + 60) |= 2u;
return 0;
}