//
// sub_C7DC50 from 0xc7dc50 to 0xc7dd58 (264 bytes)
//
// 1 xrefs:
// > sub_C7FCE4 @ 0xc7fe3c
//
// 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
//
bool __fastcall sub_C7DC50(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v3; // x5
int v4; // w12
int v5; // w11
__int64 v6; // x7
int v7; // w4
__int64 v8; // x9
__int64 v9; // x6
unsigned int v10; // w8
unsigned int v11; // w4
int v12; // w10
__int16 v13; // w9
unsigned int v14; // w3
__int16 v16; // w6
__int16 v17; // w4
v3 = 0;
v4 = -1;
do
{
while ( 1 )
{
while ( 1 )
{
v5 = v3;
v6 = byte_F54D30[v3];
v7 = *(__int16 *)(a1 + 2 * v6);
v8 = a3 + 2 * v6;
v9 = a3 + 4 * v6;
v10 = (unsigned int)v7 >> 31;
if ( v7 < 0 )
v7 = -v7;
v11 = v7 + *(unsigned __int16 *)(v8 + 192);
if ( v11 > *(_DWORD *)(v9 + 128) )
break;
*(_WORD *)(a2 + 2 * v3++) = 0;
*(_WORD *)(a1 + 2LL * (unsigned int)v6) = 0;
if ( v3 == 16 )
return v4 >= 0;
}
v12 = *(unsigned __int16 *)(v8 + 32);
v13 = *(_WORD *)(a3 + 2LL * (unsigned int)v6);
v14 = (*(_DWORD *)(v9 + 64) + v11 * v12) >> 17;
if ( v14 <= 0x7FF )
break;
if ( v10 )
{
v17 = -2047;
v16 = -2047;
v14 = -2047;
goto LABEL_11;
}
v4 = v3;
*(_WORD *)(a1 + 2LL * (unsigned int)v6) = 2047 * v13;
*(_WORD *)(a2 + 2 * v3++) = 2047;
if ( v3 == 16 )
return v4 >= 0;
}
if ( v10 )
{
v14 = -v14;
v17 = v14;
v16 = v14;
}
else
{
v16 = (*(_DWORD *)(v9 + 64) + v11 * v12) >> 17;
v17 = v14;
}
LABEL_11:
*(_WORD *)(a1 + 2LL * (unsigned int)v6) = v16 * v13;
*(_WORD *)(a2 + 2 * v3++) = v17;
if ( v14 )
v4 = v5;
}
while ( v3 != 16 );
return v4 >= 0;
}