//
// sub_7D7F0 from 0x7d7f0 to 0x7d8a0 (176 bytes)
//
// 1 xrefs:
// > sub_7D92C @ 0x7d9f8
//
// 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
//
unsigned int *__fastcall sub_7D7F0(unsigned int *result, _WORD *a2, int a3, char a4, int *a5, int *a6, int a7)
{
int v7; // w16
int v8; // w10
int v9; // w11
int v10; // w15
int v11; // w8
char v12; // w9
unsigned int v13; // w17
int v14; // w2
int v15; // w3
int v16; // w15
v7 = *a5;
v8 = byte_2F8CF[a3];
v9 = byte_2F8D4[a3];
v10 = *a6;
v11 = 0;
v12 = 22 - a4;
while ( v11 != 4 )
{
v13 = *result;
v14 = 8;
while ( 1 )
{
v15 = v7;
if ( !v14 )
break;
v16 = ((int)(v13 << 28) >> v12) + v7 * v8 - v10 * v9;
v7 = v16 >> 6;
if ( v16 >> 6 >= 0x7FFF )
v7 = 0x7FFF;
if ( v16 < -2097152 )
v7 = -32768;
v13 >>= 4;
--v14;
*a2 = v7;
a2 += a7;
v10 = v15;
}
++result;
++v11;
}
*a5 = v7;
*a6 = v10;
return result;
}