//
// sub_C8A238 from 0xc8a238 to 0xc8a2f4 (188 bytes)
//
// 1 xrefs:
// > sub_C8B49C @ 0xc8b4d8
//
// 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 __fastcall sub_C8A238(__int64 result, __int64 a2)
{
int v2; // w8
int v3; // w12
__int64 v4; // x14
int v5; // w6
int v6; // w11
int v7; // w2
unsigned __int64 v8; // x5
_DWORD *v9; // x10
int v10; // w4
int v11; // w7
__int64 v12; // x3
unsigned __int8 *v13; // x3
int v14; // w4
v2 = *(_DWORD *)(result + 8);
v3 = v2 * *(_DWORD *)(result + 52);
if ( v2 > 0 )
{
v4 = 0;
do
{
v5 = v4;
if ( v3 > (int)v4 )
{
v6 = v4;
v7 = 0;
LODWORD(v8) = 0;
v9 = (_DWORD *)(*(_QWORD *)(result + 96) + 4 * v4);
do
{
v10 = 0;
v11 = *(_DWORD *)(result + 40);
v7 += *(_DWORD *)(result + 36);
v12 = 0;
if ( v7 > 0 )
{
v13 = (unsigned __int8 *)(a2 + v5);
do
{
v7 -= v11;
v14 = *v13;
v5 += v2;
LODWORD(v8) = v8 + v14;
v13 += v2;
}
while ( v7 > 0 );
v12 = (unsigned int)-(v7 * v14);
v10 = -(v7 * v14);
}
v6 += v2;
*v9 = v11 * v8 - v10;
v9 += v2;
v8 = (v12 * (unsigned __int64)*(unsigned int *)(result + 12) + 0x80000000) >> 32;
}
while ( v3 > v6 );
}
++v4;
}
while ( v2 > (int)v4 );
}
return result;
}