//
// sub_C68E18 from 0xc68e18 to 0xc68f90 (376 bytes)
//
// 1 xrefs:
// > sub_C68714 @ 0xc68960
//
// 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_C68E18(unsigned int *a1, int **a2)
{
_DWORD **v4; // x25
int v5; // w1
int v6; // w20
int v7; // w19
__int64 v8; // x2
unsigned int v9; // w22
__int64 v10; // x21
unsigned int i; // w26
int v12; // w0
__int64 v13; // x21
unsigned int v14; // w26
int v15; // w20
int v16; // w0
__int64 v17; // x20
_DWORD **v18; // x23
unsigned int v19; // w21
int v20; // w0
v4 = a2 + 6;
v5 = **a2;
v6 = a1[4];
v7 = (v6 + 1) >> 1;
if ( v5 == 1 || (unsigned int)(v5 - 3) <= 2 || v5 == 12 || (unsigned int)(v5 - 7) <= 3 )
{
v8 = *((_QWORD *)a1 + 19);
if ( v8 )
sub_C73200(*((_QWORD *)a1 + 3), a1[12], v8, *a1, a1[3], (unsigned int)v6, 0);
}
v9 = 0;
v10 = *((_QWORD *)a1 + 3);
for ( i = a1[12]; v6 > 0; v9 += sub_CBAEE8(v4) )
{
v12 = sub_CBADE0(v4, (unsigned int)v6, v10, i);
v6 -= v12;
v10 += (int)(i * v12);
}
v13 = *((_QWORD *)a1 + 4);
v14 = a1[13];
v15 = v7;
if ( v7 > 0 )
{
do
{
v16 = sub_CBADE0(a2 + 19, (unsigned int)v15, v13, v14);
v15 -= v16;
v13 += (int)(v14 * v16);
sub_CBAEE8(a2 + 19);
}
while ( v15 > 0 );
v17 = *((_QWORD *)a1 + 5);
v18 = a2 + 32;
v19 = a1[13];
do
{
v20 = sub_CBADE0(v18, (unsigned int)v7, v17, v19);
v7 -= v20;
v17 += (int)(v19 * v20);
sub_CBAEE8(v18);
}
while ( v7 > 0 );
}
return v9;
}