//
// sub_C75E24 from 0xc75e24 to 0xc76010 (492 bytes)
//
// 1 xrefs:
// > sub_C76D40 @ 0xc76df8
//
// 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 __int8 *__fastcall sub_C75E24(unsigned __int8 *result, int a2, int a3, int a4, int a5)
{
int v5; // w2
int v6; // w11
int v7; // w10
int v8; // w13
int v9; // w7
int v10; // w8
__int64 v11; // x5
int v12; // w18
int v13; // w17
int v14; // w6
int v15; // w12
int v16; // w12
int v17; // w20
int v18; // w19
int v19; // w6
int v20; // w6
int v21; // w8
v5 = 2 * a3 + 1;
v6 = 16;
do
{
while ( 1 )
{
v7 = *(result - 2);
v8 = result[1];
v9 = *(result - 1);
v10 = *result;
v11 = v7 - v8;
v12 = *(result - 3);
v13 = result[2];
if ( v5 < byte_F54BCF[v11] + 4 * byte_F54BCF[v9 - v10] )
goto LABEL_12;
if ( a4 < byte_F54BCF[*(result - 4) - v12] )
goto LABEL_12;
if ( a4 < byte_F54BCF[v12 - v7] )
goto LABEL_12;
v14 = byte_F54BCF[v7 - v9];
if ( a4 < v14 )
goto LABEL_12;
if ( a4 < byte_F54BCF[result[3] - v13] )
goto LABEL_12;
if ( a4 < byte_F54BCF[v13 - v8] )
goto LABEL_12;
v15 = byte_F54BCF[v8 - v10];
if ( a4 < v15 )
goto LABEL_12;
if ( a5 < v14 || a5 < v15 )
break;
v16 = byte_F546CC[3 * (v10 - v9) + byte_F546CC[v11]];
v17 = (9 * v16 + 63) >> 7;
v18 = (18 * v16 + 63) >> 7;
v19 = (27 * v16 + 63) >> 7;
*(result - 3) = byte_F53FDF[v12 + v17];
*(result - 2) = byte_F53FDF[v7 + v18];
*(result - 1) = byte_F53FDF[v9 + v19];
*result = byte_F53FDF[v10 - v19];
result[1] = byte_F53FDF[v8 - v18];
result[2] = byte_F53FDF[v13 - v17];
LABEL_12:
--v6;
result += a2;
if ( !v6 )
return result;
}
--v6;
v20 = 3 * (v10 - v9) + byte_F546CC[v11];
v21 = v10 - byte_F54250[(v20 + 4) >> 3];
*(result - 1) = byte_F53FDF[v9 + byte_F54250[(v20 + 3) >> 3]];
*result = byte_F53FDF[v21];
result += a2;
}
while ( v6 );
return result;
}