//
// sub_C75678 from 0xc75678 to 0xc758a8 (560 bytes)
//
// 1 xrefs:
// > sub_C76D40 @ 0xc76e28
//
// 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
//
_BYTE *__fastcall sub_C75678(__int64 a1, int a2, int a3, int a4, int a5)
{
__int64 v5; // x18
__int64 v6; // x16
int v7; // w25
_BYTE *result; // x0
int v9; // w28
_BYTE *v10; // x2
_BYTE *v11; // x26
int v12; // w8
int v13; // w11
int v14; // w7
int v15; // w9
__int64 v16; // x5
int v17; // w13
int v18; // w15
int v19; // w6
int v20; // w10
int v21; // w5
int v22; // w10
int v23; // w6
int v24; // w5
int v25; // w6
int v26; // w9
__int64 v27; // [xsp+58h] [xbp-8h]
v5 = -2 * a2;
v6 = -a2;
v27 = 4 * a2;
v7 = 2 * a3 + 1;
result = (_BYTE *)(a1 + v27);
v9 = 3;
do
{
v10 = result;
v11 = result + 16;
do
{
while ( 1 )
{
v12 = (unsigned __int8)v10[v5];
v13 = (unsigned __int8)v10[a2];
v14 = (unsigned __int8)v10[v6];
v15 = (unsigned __int8)*v10;
v16 = v12 - v13;
v17 = (unsigned __int8)v10[-3 * a2];
v18 = (unsigned __int8)v10[2 * a2];
if ( byte_F54BCF[v16] + 4 * byte_F54BCF[v14 - v15] > v7 )
goto LABEL_13;
if ( a4 < byte_F54BCF[(unsigned __int8)v10[-4 * a2] - v17] )
goto LABEL_13;
if ( a4 < byte_F54BCF[v17 - v12] )
goto LABEL_13;
v19 = byte_F54BCF[v12 - v14];
if ( a4 < v19 )
goto LABEL_13;
if ( a4 < byte_F54BCF[(unsigned __int8)v10[3 * a2] - v18] )
goto LABEL_13;
if ( a4 < byte_F54BCF[v18 - v13] )
goto LABEL_13;
v20 = byte_F54BCF[v13 - v15];
if ( a4 < v20 )
goto LABEL_13;
if ( a5 < v19 || a5 < v20 )
break;
v21 = 3 * (v15 - v14);
v22 = byte_F54250[(v21 + 4) >> 3];
v23 = byte_F54250[(v21 + 3) >> 3];
v24 = (v22 + 1) >> 1;
v10[v5] = byte_F53FDF[v12 + v24];
v10[v6] = byte_F53FDF[v14 + v23];
*v10 = byte_F53FDF[v15 - v22];
v10[a2] = byte_F53FDF[v13 - v24];
LABEL_13:
if ( ++v10 == v11 )
goto LABEL_14;
}
v25 = 3 * (v15 - v14) + byte_F546CC[v16];
v26 = v15 - byte_F54250[(v25 + 4) >> 3];
v10[v6] = byte_F53FDF[v14 + byte_F54250[(v25 + 3) >> 3]];
*v10++ = byte_F53FDF[v26];
}
while ( v10 != v11 );
LABEL_14:
--v9;
result += v27;
}
while ( v9 );
return result;
}