//
// sub_C76248 from 0xc76248 to 0xc76598 (848 bytes)
//
// 1 xrefs:
// > sub_C76D40 @ 0xc76e58
//
// 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_C76248(__int64 a1, __int64 a2, int a3, int a4, int a5, int a6)
{
unsigned __int8 *v6; // x0
int v7; // w3
int v8; // w11
int v9; // w10
int v10; // w20
int v11; // w9
int v12; // w8
__int64 v13; // x21
int v14; // w16
int v15; // w24
int v16; // w7
int v17; // w12
int v18; // w7
int v19; // w16
int v20; // w12
int v21; // w7
unsigned __int8 *v22; // x1
int v23; // w11
int v24; // w10
int v25; // w18
int v26; // w9
int v27; // w8
__int64 result; // x0
int v29; // w13
int v30; // w20
int v31; // w7
int v32; // w12
int v33; // w0
int v34; // w12
int v35; // w7
int v36; // w0
int v37; // w7
int v38; // w8
int v39; // w7
int v40; // w8
v6 = (unsigned __int8 *)(a1 + 4);
v7 = 2 * a4 + 1;
v8 = 8;
do
{
while ( 1 )
{
v9 = *(v6 - 2);
v10 = v6[1];
v11 = *(v6 - 1);
v12 = *v6;
v13 = v9 - v10;
v14 = *(v6 - 3);
v15 = v6[2];
if ( v7 < byte_F54BCF[v13] + 4 * byte_F54BCF[v11 - v12] )
goto LABEL_12;
if ( a5 < byte_F54BCF[*(v6 - 4) - v14] )
goto LABEL_12;
if ( a5 < byte_F54BCF[v14 - v9] )
goto LABEL_12;
v16 = byte_F54BCF[v9 - v11];
if ( a5 < v16 )
goto LABEL_12;
if ( a5 < byte_F54BCF[v6[3] - v15] )
goto LABEL_12;
if ( a5 < byte_F54BCF[v15 - v10] )
goto LABEL_12;
v17 = byte_F54BCF[v10 - v12];
if ( a5 < v17 )
goto LABEL_12;
if ( a6 < v16 || a6 < v17 )
break;
v18 = 3 * (v12 - v11);
v19 = byte_F54250[(v18 + 4) >> 3];
v20 = byte_F54250[(v18 + 3) >> 3];
v21 = (v19 + 1) >> 1;
*(v6 - 2) = byte_F53FDF[v9 + v21];
*(v6 - 1) = byte_F53FDF[v11 + v20];
*v6 = byte_F53FDF[v12 - v19];
v6[1] = byte_F53FDF[v10 - v21];
LABEL_12:
--v8;
v6 += a3;
if ( !v8 )
goto LABEL_13;
}
--v8;
v37 = 3 * (v12 - v11) + byte_F546CC[v13];
v38 = v12 - byte_F54250[(v37 + 4) >> 3];
*(v6 - 1) = byte_F53FDF[v11 + byte_F54250[(v37 + 3) >> 3]];
*v6 = byte_F53FDF[v38];
v6 += a3;
}
while ( v8 );
LABEL_13:
v22 = (unsigned __int8 *)(a2 + 4);
v23 = 8;
while ( 1 )
{
LABEL_14:
v24 = *(v22 - 2);
v25 = v22[1];
v26 = *(v22 - 1);
v27 = *v22;
result = v24 - v25;
v29 = *(v22 - 3);
v30 = v22[2];
if ( v7 < byte_F54BCF[result] + 4 * byte_F54BCF[v26 - v27] )
goto LABEL_24;
if ( a5 < byte_F54BCF[*(v22 - 4) - v29] )
goto LABEL_24;
if ( a5 < byte_F54BCF[v29 - v24] )
goto LABEL_24;
v31 = byte_F54BCF[v24 - v26];
if ( a5 < v31 )
goto LABEL_24;
if ( a5 < byte_F54BCF[v22[3] - v30] )
goto LABEL_24;
if ( a5 < byte_F54BCF[v30 - v25] )
goto LABEL_24;
v32 = byte_F54BCF[v25 - v27];
if ( a5 < v32 )
goto LABEL_24;
if ( a6 < v31 || a6 < v32 )
break;
v33 = 3 * (v27 - v26);
v34 = byte_F54250[(v33 + 4) >> 3];
v35 = byte_F54250[(v33 + 3) >> 3];
v36 = (v34 + 1) >> 1;
*(v22 - 2) = byte_F53FDF[v24 + v36];
*(v22 - 1) = byte_F53FDF[v26 + v35];
*v22 = byte_F53FDF[v27 - v34];
result = (unsigned __int8)byte_F53FDF[v25 - v36];
v22[1] = result;
LABEL_24:
--v23;
v22 += a3;
if ( !v23 )
return result;
}
--v23;
v39 = 3 * (v27 - v26) + byte_F546CC[result];
v40 = v27 - byte_F54250[(v39 + 4) >> 3];
*(v22 - 1) = byte_F53FDF[v26 + byte_F54250[(v39 + 3) >> 3]];
result = (unsigned __int8)byte_F53FDF[v40];
*v22 = result;
v22 += a3;
if ( v23 )
goto LABEL_14;
return result;
}