//
// sub_EF7310 from 0xef7310 to 0xef7840 (1328 bytes)
//
// 1 xrefs:
// > sub_EF9454 @ 0xef94c8
//
// 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
//
unsigned __int64 __fastcall sub_EF7310(unsigned __int64 result, int a2, int a3, int a4, _BYTE *a5)
{
int v5; // w7
unsigned int v6; // w6
int v7; // w8
unsigned int v8; // w10
unsigned int v9; // w9
int v10; // w11
unsigned int v11; // w12
int8x16_t *v12; // x13
int8x16_t *v13; // x5
int8x16_t *v14; // x6
int8x16_t v15; // t1
int8x16_t v16; // q1
int8x16_t v17; // t1
int v18; // w5
int v19; // w8
unsigned __int8 *v20; // x5
__int64 v21; // x11
_BYTE *v22; // x4
int v23; // w12
unsigned __int8 *v24; // x13
int v25; // w6
unsigned __int8 *v26; // x10
_BYTE *v27; // x8
unsigned __int8 *v28; // x7
bool v29; // zf
int v30; // w6
int v31; // w0
int v32; // t1
__int64 v33; // x9
__int64 v34; // x5
_BYTE *v35; // x6
char v36; // w8
v5 = a2 - 1;
*a5 = *(_BYTE *)result;
if ( a2 - 1 <= 0 )
goto LABEL_41;
if ( (unsigned __int64)(a5 + 1) < result + 17 && result < (unsigned __int64)(a5 + 17) || (unsigned int)v5 <= 0x13 )
{
v33 = 0;
do
{
v34 = result + v33;
v35 = &a5[v33];
v36 = *(_BYTE *)(result + v33++);
v35[1] = *(_BYTE *)(v34 + 1) - v36;
}
while ( v5 > (int)v33 );
goto LABEL_41;
}
v6 = ~(_BYTE)result & 0xF;
if ( v5 <= v6 )
v6 = a2 - 1;
if ( !v6 )
{
v7 = 0;
goto LABEL_22;
}
a5[1] = *(_BYTE *)(result + 1) - *(_BYTE *)result;
if ( v6 == 1 )
goto LABEL_51;
a5[2] = *(_BYTE *)(result + 2) - *(_BYTE *)(result + 1);
if ( v6 == 2 )
goto LABEL_51;
a5[3] = *(_BYTE *)(result + 3) - *(_BYTE *)(result + 2);
if ( v6 == 3 )
goto LABEL_51;
a5[4] = *(_BYTE *)(result + 4) - *(_BYTE *)(result + 3);
if ( v6 == 4 )
goto LABEL_51;
a5[5] = *(_BYTE *)(result + 5) - *(_BYTE *)(result + 4);
if ( v6 == 5 )
goto LABEL_51;
a5[6] = *(_BYTE *)(result + 6) - *(_BYTE *)(result + 5);
if ( v6 != 6 )
{
a5[7] = *(_BYTE *)(result + 7) - *(_BYTE *)(result + 6);
if ( v6 != 7 )
{
a5[8] = *(_BYTE *)(result + 8) - *(_BYTE *)(result + 7);
if ( v6 != 8 )
{
a5[9] = *(_BYTE *)(result + 9) - *(_BYTE *)(result + 8);
if ( v6 != 9 )
{
a5[10] = *(_BYTE *)(result + 10) - *(_BYTE *)(result + 9);
if ( v6 != 10 )
{
a5[11] = *(_BYTE *)(result + 11) - *(_BYTE *)(result + 10);
if ( v6 != 11 )
{
a5[12] = *(_BYTE *)(result + 12) - *(_BYTE *)(result + 11);
if ( v6 != 12 )
{
a5[13] = *(_BYTE *)(result + 13) - *(_BYTE *)(result + 12);
if ( v6 != 13 )
{
a5[14] = *(_BYTE *)(result + 14) - *(_BYTE *)(result + 13);
if ( v6 == 15 )
{
v7 = 15;
a5[15] = *(_BYTE *)(result + 15) - *(_BYTE *)(result + 14);
}
else
{
v7 = 14;
}
goto LABEL_22;
}
}
}
}
}
}
}
LABEL_51:
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_59;
v11 = 0;
v12 = (int8x16_t *)(result + v6 + 1LL);
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 ( v9 > v11 );
v7 += v10;
if ( v10 != v8 )
{
LABEL_59:
a5[v7 + 1] = *(_BYTE *)(result + v7 + 1LL) - *(_BYTE *)(result + v7);
if ( v5 > v7 + 1 )
{
a5[v7 + 2] = *(_BYTE *)(result + v7 + 1 + 1LL) - *(_BYTE *)(result + v7 + 1);
if ( v5 > v7 + 2 )
{
a5[v7 + 3] = *(_BYTE *)(result + v7 + 2 + 1LL) - *(_BYTE *)(result + v7 + 2);
if ( v5 > v7 + 3 )
{
a5[v7 + 4] = *(_BYTE *)(result + v7 + 3 + 1LL) - *(_BYTE *)(result + v7 + 3);
if ( v5 > v7 + 4 )
{
a5[v7 + 5] = *(_BYTE *)(result + v7 + 4 + 1LL) - *(_BYTE *)(result + v7 + 4);
if ( v5 > v7 + 5 )
{
a5[v7 + 6] = *(_BYTE *)(result + v7 + 5 + 1LL) - *(_BYTE *)(result + v7 + 5);
if ( v5 > v7 + 6 )
{
a5[v7 + 7] = *(_BYTE *)(result + v7 + 6 + 1LL) - *(_BYTE *)(result + v7 + 6);
if ( v5 > v7 + 7 )
{
a5[v7 + 8] = *(_BYTE *)(result + v7 + 7 + 1LL) - *(_BYTE *)(result + v7 + 7);
if ( v5 > v7 + 8 )
{
a5[v7 + 9] = *(_BYTE *)(result + v7 + 8 + 1LL) - *(_BYTE *)(result + v7 + 8);
if ( v5 > v7 + 9 )
{
a5[v7 + 10] = *(_BYTE *)(result + v7 + 9 + 1LL) - *(_BYTE *)(result + v7 + 9);
if ( v5 > v7 + 10 )
{
a5[v7 + 11] = *(_BYTE *)(result + v7 + 10 + 1LL) - *(_BYTE *)(result + v7 + 10);
if ( v5 > v7 + 11 )
{
a5[v7 + 12] = *(_BYTE *)(result + v7 + 11 + 1LL) - *(_BYTE *)(result + v7 + 11);
if ( v5 > v7 + 12 )
{
v18 = v7 + 13;
a5[v7 + 13] = *(_BYTE *)(result + v7 + 12 + 1LL) - *(_BYTE *)(result + v7 + 12);
if ( v5 > v7 + 13 )
{
v19 = v7 + 14;
a5[v18 + 1] = *(_BYTE *)(result + v18 + 1LL) - *(_BYTE *)(result + v18);
if ( v5 > v19 )
a5[v19 + 1] = *(_BYTE *)(result + v19 + 1LL) - *(_BYTE *)(result + v19);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
LABEL_41:
if ( a3 > 1 )
{
v20 = (unsigned __int8 *)result;
v21 = result + a4 + 1;
v22 = &a5[a4 + 1];
v23 = 1;
do
{
v24 = &v20[a4];
v25 = *v20;
result = (unsigned int)*(unsigned __int8 *)(v21 - 1) - v25;
*(v22 - 1) = *(_BYTE *)(v21 - 1) - v25;
if ( a2 > 1 )
{
v26 = &v20[a2 - 2 + 1];
v27 = v22;
v28 = (unsigned __int8 *)v21;
do
{
v31 = v20[a4] + v20[1] - *v20;
v29 = (v31 & 0xFFFFFF00) == 0;
v30 = ~v31 >> 31;
v31 = (unsigned __int8)v31;
if ( !v29 )
v31 = (unsigned __int8)v30;
v32 = *v28++;
++v20;
result = (unsigned int)(v32 - v31);
*v27++ = result;
}
while ( v20 != v26 );
}
++v23;
v21 += a4;
v22 += a4;
v20 = v24;
}
while ( v23 != a3 );
}
return result;
}