//
// sub_EE254C from 0xee254c to 0xee28f0 (932 bytes)
//
// 2 xrefs:
// > sub_EE53C8 @ 0xee5620
// > sub_EE53C8 @ 0xee562c
//
// 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:11:49 +0000
//
__int64 __fastcall sub_EE254C(__int64 result, int a2)
{
int v2; // w24
int v3; // w21
int v4; // w19
void *v5; // x25
__int64 v6; // x23
const void *v7; // x20
int v9; // w26
int v10; // w19
unsigned __int64 v11; // x0
void *v12; // x3
__int64 v13; // x19
__int64 v14; // x26
int v15; // w0
__int64 v16; // x1
unsigned __int64 v17; // x19
__int64 v18; // x3
unsigned __int64 v19; // x21
__int64 v20; // x2
unsigned __int64 v21; // x1
int v22; // w7
int v23; // w5
int8x16_t *v24; // x0
uint32x4_t *v25; // x1
unsigned int v26; // w4
unsigned int v27; // w3
int v28; // w6
uint32x4_t *v29; // x9
uint32x4_t *v30; // x8
uint32x4_t v31; // q1
uint32x4_t v32; // q3
int v33; // w1
v2 = *(_DWORD *)(result + 140);
v3 = a2 - v2;
v4 = *(_DWORD *)(result + 132);
if ( a2 - v2 > 0 )
{
v5 = *(void **)(result + 32);
v6 = result;
v7 = (const void *)(*(_QWORD *)(result + 24) + 4LL * v2 * v4);
v9 = *(_DWORD *)(result + 240);
memcpy(v5, v7, 4LL * v3 * v4);
v10 = v9 - 1;
if ( v9 > 0 )
{
v11 = v10 - (unsigned __int64)(unsigned int)v10;
v12 = (void *)v7;
v13 = v6 + 24LL * v10 + 248;
v14 = v6 + 24 * v11 + 224;
do
{
v15 = v13;
v13 -= 24;
sub_EFB46C(v15, v2, a2, v12);
v12 = v5;
}
while ( v13 != v14 );
}
v16 = *(_QWORD *)(v6 + 8);
v17 = *(_QWORD *)(v6 + 32);
v18 = *(_QWORD *)(v16 + 56);
v19 = (unsigned int)(*(_DWORD *)v16 * v3);
result = *(_DWORD *)v16 * *(_DWORD *)(v6 + 140);
if ( (int)v19 <= 0 )
goto LABEL_32;
v20 = v18 + result;
if ( (v18 + result >= v17 + 4LL * (int)v19 || v17 >= v18 + result + (int)v19) && (unsigned int)v19 > 0x13 )
{
v21 = -((v17 >> 2) & 3) & 3;
if ( (unsigned int)v19 <= (unsigned int)v21 )
v21 = v19;
if ( (_DWORD)v21 )
{
*(_BYTE *)(v18 + result) = BYTE1(*(_DWORD *)v17);
if ( (_DWORD)v21 == 1 )
{
v22 = 1;
}
else
{
*(_BYTE *)(v20 + 1) = BYTE1(*(_DWORD *)(v17 + 4));
if ( (_DWORD)v21 == 3 )
{
v22 = 3;
*(_BYTE *)(v20 + 2) = BYTE1(*(_DWORD *)(v17 + 8));
}
else
{
v22 = 2;
}
}
}
else
{
v22 = 0;
}
v23 = v19 - v21;
v24 = (int8x16_t *)(v18 + result + v21);
v25 = (uint32x4_t *)(v17 + 4 * v21);
v26 = ((unsigned int)(v23 - 16) >> 4) + 1;
v27 = 0;
v28 = 16 * v26;
do
{
v29 = v25 + 3;
++v27;
v30 = v25 + 1;
v31 = *v25;
v32 = v25[2];
v25 += 4;
*v24++ = vmovn_hight_s16(
vmovn_s16(vmovn_hight_s32(vmovn_s32(vshrq_n_u32(v31, 8u)), vshrq_n_u32(*v30, 8u))),
vmovn_hight_s32(vmovn_s32(vshrq_n_u32(v32, 8u)), vshrq_n_u32(*v29, 8u)));
}
while ( v27 < v26 );
result = (unsigned int)(v22 + v28);
if ( v23 != v28 )
{
*(_BYTE *)(v20 + (int)result) = BYTE1(*(_DWORD *)(v17 + 4LL * (int)result));
if ( (int)v19 > (int)result + 1 )
{
*(_BYTE *)(v20 + (int)result + 1) = BYTE1(*(_DWORD *)(v17 + 4LL * ((int)result + 1)));
if ( (int)v19 > (int)result + 2 )
{
*(_BYTE *)(v20 + (int)result + 2) = BYTE1(*(_DWORD *)(v17 + 4LL * ((int)result + 2)));
if ( (int)v19 > (int)result + 3 )
{
*(_BYTE *)(v20 + (int)result + 3) = BYTE1(*(_DWORD *)(v17 + 4LL * ((int)result + 3)));
if ( (int)v19 > (int)result + 4 )
{
*(_BYTE *)(v20 + (int)result + 4) = BYTE1(*(_DWORD *)(v17 + 4LL * ((int)result + 4)));
if ( (int)v19 > (int)result + 5 )
{
*(_BYTE *)(v20 + (int)result + 5) = BYTE1(*(_DWORD *)(v17 + 4LL * ((int)result + 5)));
if ( (int)v19 > (int)result + 6 )
{
*(_BYTE *)(v20 + (int)result + 6) = BYTE1(*(_DWORD *)(v17 + 4LL * ((int)result + 6)));
if ( (int)v19 > (int)result + 7 )
{
*(_BYTE *)(v20 + (int)result + 7) = BYTE1(*(_DWORD *)(v17 + 4LL * ((int)result + 7)));
if ( (int)v19 > (int)result + 8 )
{
*(_BYTE *)(v20 + (int)result + 8) = BYTE1(*(_DWORD *)(v17 + 4LL * ((int)result + 8)));
if ( (int)v19 > (int)result + 9 )
{
*(_BYTE *)(v20 + (int)result + 9) = BYTE1(*(_DWORD *)(v17 + 4LL * ((int)result + 9)));
if ( (int)v19 > (int)result + 10 )
{
*(_BYTE *)(v20 + (int)result + 10) = BYTE1(*(_DWORD *)(v17 + 4LL * ((int)result + 10)));
if ( (int)v19 > (int)result + 11 )
{
*(_BYTE *)(v20 + (int)result + 11) = BYTE1(*(_DWORD *)(v17 + 4LL * ((int)result + 11)));
if ( (int)v19 > (int)result + 12 )
{
v33 = result + 13;
*(_BYTE *)(v20 + (int)result + 12) = BYTE1(*(_DWORD *)(v17 + 4LL * ((int)result + 12)));
if ( (int)v19 > (int)result + 13 )
{
result = (unsigned int)(result + 14);
*(_BYTE *)(v20 + v33) = BYTE1(*(_DWORD *)(v17 + 4LL * v33));
if ( (int)v19 > (int)result )
*(_BYTE *)(v20 + (int)result) = BYTE1(*(_DWORD *)(v17 + 4LL * (int)result));
}
}
}
}
}
}
}
}
}
}
}
}
}
}
LABEL_32:
*(_DWORD *)(v6 + 148) = a2;
*(_DWORD *)(v6 + 140) = a2;
return result;
}
result = 0;
do
{
*(_BYTE *)(v20 + result) = BYTE1(*(_DWORD *)(v17 + 4 * result));
++result;
}
while ( (int)v19 > (int)result );
*(_DWORD *)(v6 + 148) = a2;
*(_DWORD *)(v6 + 140) = a2;
}
return result;
}