//
// sub_EE9830 from 0xee9830 to 0xee99c0 (400 bytes)
//
// 1 xrefs:
// > sub_EE9B08 @ 0xee9b28
//
// 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:54 +0000
//
__int64 __fastcall sub_EE9830(int a1, int *a2)
{
int v2; // w8
__int64 v3; // x13
__int64 v4; // x9
__int64 v5; // x2
__int64 v6; // x10
__int64 v7; // x6
int v8; // w12
int v9; // w7
__int64 v10; // x14
__int64 v11; // x2
__int16 *v12; // x4
__int64 v13; // x5
__int64 v14; // t1
int v15; // w1
int v16; // w8
int v17; // w0
int v18; // w3
int v19; // w1
int v20; // w3
int v21; // w1
__int64 result; // x0
int v23; // w2
v2 = *a2;
v3 = *((_QWORD *)a2 + 3);
v4 = *((_QWORD *)a2 + 5);
v5 = 24LL * *a2;
v6 = *a2;
v7 = *(_QWORD *)(v4 + 8LL * a1 + v5);
if ( a1 )
{
v8 = a2[1];
v9 = 0;
if ( (v8 & 0x80000000) == 0 )
goto LABEL_3;
return word_11E2CA0[*(unsigned __int8 *)(v3 + 11LL * a1 + 33LL * *a2)];
}
v8 = a2[1];
v9 = word_11E2CA0[255 - *(unsigned __int8 *)(v3 + 33 * v6)];
if ( v8 < 0 )
return word_11E2CA0[*(unsigned __int8 *)(v3 + 11LL * a1 + 33LL * *a2)];
LABEL_3:
if ( v2 >= v8 )
{
v10 = *((_QWORD *)a2 + 1);
}
else
{
v10 = *((_QWORD *)a2 + 1);
v11 = v4 + v5 + 24;
v12 = (__int16 *)(v10 + 2LL * v2);
v13 = v4 + 24 * (v2 + (unsigned __int64)(unsigned int)(v8 - 1 - v2)) + 48;
do
{
v14 = *v12++;
v15 = abs64(v14);
if ( v15 > 67 )
v16 = 67;
else
v16 = v15;
if ( v15 > 2 )
v17 = 2;
else
v17 = v15;
v18 = word_11E2EA0[v15];
v19 = *(unsigned __int16 *)(v7 + 2LL * v16);
v7 = *(_QWORD *)(v11 + 8LL * v17);
v11 += 24;
v9 += v18 + v19;
}
while ( v11 != v13 );
v6 = v8;
v2 = v8;
}
v20 = abs16(*(_WORD *)(v10 + 2 * v6));
if ( v20 > 67 )
v21 = 67;
else
v21 = v20;
result = v9 + word_11E2EA0[v20] + (unsigned int)*(unsigned __int16 *)(v7 + 2LL * v21);
if ( v2 <= 14 )
{
if ( v20 == 1 )
v23 = 1;
else
v23 = 2;
return (unsigned int)result
+ word_11E2CA0[*(unsigned __int8 *)(v3 + 11LL * v23 + 33LL * (unsigned __int8)byte_11E3EA0[v2 + 1])];
}
return result;
}