//
// sub_EF81CC from 0xef81cc to 0xef8af0 (2340 bytes)
//
// 1 xrefs:
// > sub_EF9454 @ 0xef94bc
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:12:14 +0000
//
_BYTE *__fastcall sub_EF81CC(_BYTE *result, int a2, int a3, int a4, _BYTE *a5)
{
int v5; // w13
unsigned int v6; // w6
int v7; // w5
unsigned int v8; // w9
unsigned int v9; // w7
int v10; // w10
unsigned int v11; // w11
int8x16_t *v12; // x12
int8x16_t *v13; // x8
int8x16_t *v14; // x6
int8x16_t v15; // t1
int8x16_t v16; // q1
int8x16_t v17; // t1
int v18; // w6
int v19; // w5
_BYTE *v20; // x11
_BYTE *v21; // x5
_BYTE *v22; // x4
int v23; // w12
int v24; // w10
unsigned __int64 v25; // x7
unsigned int v26; // w6
int v27; // w8
unsigned int v28; // w15
unsigned int v29; // w9
int v30; // w16
int8x16_t *v31; // x19
int8x16_t *v32; // x18
unsigned int v33; // w17
int8x16_t *v34; // x6
int8x16_t v35; // t1
int8x16_t v36; // q1
int8x16_t v37; // t1
int v38; // w6
int v39; // w8
__int64 v40; // x6
__int64 v41; // x7
_BYTE *v42; // x5
_BYTE *v43; // x6
char v44; // w9
v5 = a2 - 1;
*a5 = *result;
if ( a2 - 1 <= 0 )
goto LABEL_41;
if ( result + 17 > a5 + 1 && result < a5 + 17 || (unsigned int)v5 <= 0x13 )
{
v41 = 0;
do
{
v42 = &result[v41];
v43 = &a5[v41];
v44 = result[v41++];
v43[1] = v42[1] - v44;
}
while ( v5 > (int)v41 );
goto LABEL_41;
}
v6 = ~(_BYTE)result & 0xF;
if ( v5 <= v6 )
v6 = a2 - 1;
if ( !v6 )
{
v7 = 0;
goto LABEL_22;
}
a5[1] = result[1] - *result;
if ( v6 == 1 )
goto LABEL_92;
a5[2] = result[2] - result[1];
if ( v6 == 2 )
goto LABEL_92;
a5[3] = result[3] - result[2];
if ( v6 == 3 )
goto LABEL_92;
a5[4] = result[4] - result[3];
if ( v6 == 4 )
goto LABEL_92;
a5[5] = result[5] - result[4];
if ( v6 == 5 )
goto LABEL_92;
a5[6] = result[6] - result[5];
if ( v6 != 6 )
{
a5[7] = result[7] - result[6];
if ( v6 != 7 )
{
a5[8] = result[8] - result[7];
if ( v6 != 8 )
{
a5[9] = result[9] - result[8];
if ( v6 != 9 )
{
a5[10] = result[10] - result[9];
if ( v6 != 10 )
{
a5[11] = result[11] - result[10];
if ( v6 != 11 )
{
a5[12] = result[12] - result[11];
if ( v6 != 12 )
{
a5[13] = result[13] - result[12];
if ( v6 != 13 )
{
a5[14] = result[14] - result[13];
if ( v6 == 15 )
{
v7 = 15;
a5[15] = result[15] - result[14];
}
else
{
v7 = 14;
}
goto LABEL_22;
}
}
}
}
}
}
}
LABEL_92:
v7 = v6;
goto LABEL_22;
}
v7 = 6;
LABEL_22:
v8 = v5 - v6;
v9 = ((v5 - v6 - 16) >> 4) + 1;
v10 = 16 * v9;
if ( a2 - 2 - v6 <= 0xE )
goto LABEL_102;
v11 = 0;
v12 = (int8x16_t *)&result[v6 + 1];
v13 = (int8x16_t *)&result[v6];
v14 = (int8x16_t *)&a5[v6 + 1];
do
{
v15 = *v13++;
v16 = v15;
++v11;
v17 = *v12++;
*v14++ = vsubq_s8(v17, v16);
}
while ( v11 < v9 );
v7 += v10;
if ( v8 != v10 )
{
LABEL_102:
a5[v7 + 1] = result[v7 + 1] - result[v7];
if ( v5 > v7 + 1 )
{
a5[v7 + 2] = result[v7 + 2] - result[v7 + 1];
if ( v5 > v7 + 2 )
{
a5[v7 + 3] = result[v7 + 3] - result[v7 + 2];
if ( v5 > v7 + 3 )
{
a5[v7 + 4] = result[v7 + 4] - result[v7 + 3];
if ( v5 > v7 + 4 )
{
a5[v7 + 5] = result[v7 + 5] - result[v7 + 4];
if ( v5 > v7 + 5 )
{
a5[v7 + 6] = result[v7 + 6] - result[v7 + 5];
if ( v5 > v7 + 6 )
{
a5[v7 + 7] = result[v7 + 7] - result[v7 + 6];
if ( v5 > v7 + 7 )
{
a5[v7 + 8] = result[v7 + 8] - result[v7 + 7];
if ( v5 > v7 + 8 )
{
a5[v7 + 9] = result[v7 + 9] - result[v7 + 8];
if ( v5 > v7 + 9 )
{
a5[v7 + 10] = result[v7 + 10] - result[v7 + 9];
if ( v5 > v7 + 10 )
{
a5[v7 + 11] = result[v7 + 11] - result[v7 + 10];
if ( v5 > v7 + 11 )
{
a5[v7 + 12] = result[v7 + 12] - result[v7 + 11];
if ( v5 > v7 + 12 )
{
v18 = v7 + 13;
a5[v7 + 13] = result[v7 + 13] - result[v7 + 12];
if ( v5 > v7 + 13 )
{
v19 = v7 + 14;
a5[v18 + 1] = result[v18 + 1] - result[v18];
if ( v5 > v19 )
a5[v19 + 1] = result[v19 + 1] - result[v19];
}
}
}
}
}
}
}
}
}
}
}
}
}
}
LABEL_41:
v20 = &result[a4];
v21 = v20;
if ( a3 > 1 )
{
v22 = &a5[a4 + 16];
v23 = -(int)v20;
v24 = 1;
while ( 1 )
{
v25 = (unsigned __int64)(v22 - 16);
if ( a2 <= 0 )
goto LABEL_83;
if ( (v25 >= (unsigned __int64)(v21 + 16) || v22 <= v21)
&& (v25 >= (unsigned __int64)(result + 16) || result >= v22)
&& (unsigned int)a2 > 0x13 )
{
break;
}
v40 = 0;
do
{
*(_BYTE *)(v25 + v40) = v21[v40] - result[v40];
++v40;
}
while ( a2 > (int)v40 );
++v24;
result = v20;
v21 += a4;
v22 += a4;
v23 -= a4;
if ( v24 == a3 )
return result;
LABEL_84:
v20 += a4;
}
v26 = v23 & 0xF;
if ( a2 <= v26 )
v26 = a2;
if ( v26 )
{
*(v22 - 16) = *v21 - *result;
if ( v26 == 1 )
goto LABEL_85;
*(v22 - 15) = v21[1] - result[1];
if ( v26 == 2 )
goto LABEL_85;
*(v22 - 14) = v21[2] - result[2];
if ( v26 == 3 )
goto LABEL_85;
*(v22 - 13) = v21[3] - result[3];
if ( v26 == 4 )
goto LABEL_85;
*(v22 - 12) = v21[4] - result[4];
if ( v26 == 5 )
goto LABEL_85;
*(v22 - 11) = v21[5] - result[5];
if ( v26 == 6 )
{
v27 = 6;
goto LABEL_64;
}
*(v22 - 10) = v21[6] - result[6];
if ( v26 == 7
|| (*(v22 - 9) = v21[7] - result[7], v26 == 8)
|| (*(v22 - 8) = v21[8] - result[8], v26 == 9)
|| (*(v22 - 7) = v21[9] - result[9], v26 == 10)
|| (*(v22 - 6) = v21[10] - result[10], v26 == 11)
|| (*(v22 - 5) = v21[11] - result[11], v26 == 12)
|| (*(v22 - 4) = v21[12] - result[12], v26 == 13) )
{
LABEL_85:
v27 = v26;
}
else
{
*(v22 - 3) = v21[13] - result[13];
if ( v26 == 15 )
{
v27 = 15;
*(v22 - 2) = v21[14] - result[14];
}
else
{
v27 = 14;
}
}
}
else
{
v27 = 0;
}
LABEL_64:
v28 = a2 - v26;
v29 = ((a2 - v26 - 16) >> 4) + 1;
v30 = 16 * v29;
if ( v5 - v26 <= 0xE )
goto LABEL_68;
v31 = (int8x16_t *)&v21[v26];
v32 = (int8x16_t *)&result[v26];
v33 = 0;
v34 = (int8x16_t *)(v25 + v26);
do
{
v35 = *v32++;
v36 = v35;
++v33;
v37 = *v31++;
*v34++ = vsubq_s8(v37, v36);
}
while ( v33 < v29 );
v27 += v30;
if ( v28 != v30 )
{
LABEL_68:
*(_BYTE *)(v25 + v27) = v21[v27] - result[v27];
if ( a2 > v27 + 1 )
{
*(_BYTE *)(v25 + v27 + 1) = v21[v27 + 1] - result[v27 + 1];
if ( a2 > v27 + 2 )
{
*(_BYTE *)(v25 + v27 + 2) = v21[v27 + 2] - result[v27 + 2];
if ( a2 > v27 + 3 )
{
*(_BYTE *)(v25 + v27 + 3) = v21[v27 + 3] - result[v27 + 3];
if ( a2 > v27 + 4 )
{
*(_BYTE *)(v25 + v27 + 4) = v21[v27 + 4] - result[v27 + 4];
if ( a2 > v27 + 5 )
{
*(_BYTE *)(v25 + v27 + 5) = v21[v27 + 5] - result[v27 + 5];
if ( a2 > v27 + 6 )
{
*(_BYTE *)(v25 + v27 + 6) = v21[v27 + 6] - result[v27 + 6];
if ( a2 > v27 + 7 )
{
*(_BYTE *)(v25 + v27 + 7) = v21[v27 + 7] - result[v27 + 7];
if ( a2 > v27 + 8 )
{
*(_BYTE *)(v25 + v27 + 8) = v21[v27 + 8] - result[v27 + 8];
if ( a2 > v27 + 9 )
{
*(_BYTE *)(v25 + v27 + 9) = v21[v27 + 9] - result[v27 + 9];
if ( a2 > v27 + 10 )
{
*(_BYTE *)(v25 + v27 + 10) = v21[v27 + 10] - result[v27 + 10];
if ( a2 > v27 + 11 )
{
*(_BYTE *)(v25 + v27 + 11) = v21[v27 + 11] - result[v27 + 11];
if ( a2 > v27 + 12 )
{
v38 = v27 + 13;
*(_BYTE *)(v25 + v27 + 12) = v21[v27 + 12] - result[v27 + 12];
if ( a2 > v27 + 13 )
{
v39 = v27 + 14;
*(_BYTE *)(v25 + v38) = v21[v38] - result[v38];
if ( a2 > v39 )
*(_BYTE *)(v25 + v39) = v21[v39] - result[v39];
}
}
}
}
}
}
}
}
}
}
}
}
}
}
LABEL_83:
++v24;
result = v20;
v21 += a4;
v22 += a4;
v23 -= a4;
if ( v24 == a3 )
return result;
goto LABEL_84;
}
return result;
}