//
// sub_1005A779C from 0x1005a779c to 0x1005a782c (144 bytes)
//
// 1 xrefs:
// > sub_1005A7768 @ 0x1005a778c
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:09:05 +0000
//
__int64 __usercall sub_1005A779C@(_BYTE *a1@, __int64 a2@)
{
int v2; // w9
__int64 v3; // x11
unsigned int v4; // w11
unsigned int v5; // w10
int v6; // w10
char v7; // w9
v4 = (byte_1009DAE38[v3] * (unsigned int)(unsigned __int8)a1[268]) >> 6;
*(_DWORD *)(a2 + 76) = v4;
v5 = *(_DWORD *)(a2 + 68);
if ( v2 < 0 )
{
if ( (((_WORD)v5 - (_WORD)v4) & 0x8000) == 0 )
v5 = v4;
v6 = -v5;
}
else
{
if ( (int)(v5 + v4) < 65 )
goto LABEL_8;
v6 = 64 - v5;
}
*(_DWORD *)(a2 + 76) = v6;
LABEL_8:
v7 = a1[267] + v2;
if ( v7 > 31 )
v7 -= 64;
a1[266] = v7;
*(_BYTE *)(a2 + 60) |= 2u;
return 0;
}