//
// sub_940244 from 0x940244 to 0x940480 (572 bytes)
//
// 1 xrefs:
// > sub_93F008 @ 0x93f148
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:05:06 +0000
//
bool __fastcall sub_940244(int a1)
{
int v1; // r9
unsigned __int8 *v2; // r8
int v3; // r1
unsigned __int8 *v4; // r6
unsigned __int8 *v5; // r4
unsigned __int8 *v6; // r5
int v7; // r10
int v8; // r3
int v9; // t1
int v10; // r2
int v11; // t1
int v12; // r1
int v13; // r3
unsigned __int8 *v14; // r7
bool v15; // zf
int v16; // r4
int v17; // r1
_BOOL4 result; // r0
int v19; // r4
unsigned int v20; // r4
int v21; // r3
int v22; // [sp+0h] [bp-EDCh]
_BYTE *v23; // [sp+4h] [bp-ED8h]
int v24; // [sp+8h] [bp-ED4h]
_DWORD *v26; // [sp+14h] [bp-EC8h]
int v27[9]; // [sp+18h] [bp-EC4h] BYREF
unsigned __int8 *v28; // [sp+3Ch] [bp-EA0h]
unsigned __int8 *v29; // [sp+44h] [bp-E98h]
v1 = a1 + 56;
v26 = (_DWORD *)(a1 + 22480);
sub_9359A8((_DWORD *)a1, (int)v27);
do
{
v2 = v29;
v23 = v28;
if ( *(_DWORD *)(a1 + 28) )
{
v20 = (*v28 >> 5) & 3;
if ( sub_9436D4(v1, v20 > 1, *(unsigned __int8 *)(a1 + 3368)) )
v21 = a1 + 3369;
else
v21 = a1 + 3368;
sub_9436D4(v1, v20 & 1, *(unsigned __int8 *)(v21 + 1));
}
if ( *v26 )
sub_9436D4(v1, ((unsigned __int8)*v23 >> 4) & 1, *(unsigned __int8 *)(a1 + 3371));
v3 = *v23 & 3;
if ( (*v23 & 3) != 0 )
v3 = 1;
if ( sub_9436D4(v1, v3, 145) )
{
v19 = *v2;
if ( sub_9436D4(v1, (v19 & 0xFD) == 1, 156) )
sub_9436D4(v1, v19 == 1, 128);
else
sub_9436D4(v1, v19 == 2, 163);
}
else
{
v22 = 4;
v4 = &v2[3 - *(_DWORD *)(a1 + 48)];
v24 = *(_DWORD *)(a1 + 48);
do
{
v5 = v4 - 4;
v6 = v2 - 1;
v7 = *(v2 - 1);
do
{
v9 = *++v5;
v8 = v9;
v10 = 9 * v7;
v11 = *++v6;
v7 = v11;
v12 = v11;
v13 = 45 * v8;
if ( v11 )
v12 = 1;
v14 = (unsigned __int8 *)&unk_C48508 + 2 * v13 + v10;
if ( sub_9436D4(v1, v12, *v14) && sub_9436D4(v1, v7 != 1, v14[1]) && sub_9436D4(v1, v7 != 2, v14[2]) )
{
if ( sub_9436D4(v1, v7 > 5, v14[3]) )
{
if ( sub_9436D4(v1, v7 != 6, v14[6]) && sub_9436D4(v1, v7 != 7, v14[7]) )
sub_9436D4(v1, v7 != 8, v14[8]);
}
else if ( sub_9436D4(v1, v7 != 3, v14[4]) )
{
sub_9436D4(v1, v7 != 4, v14[5]);
}
}
}
while ( v4 != v5 );
v15 = v22-- == 1;
v2 += v24;
v4 += v24;
}
while ( !v15 );
}
v16 = ((unsigned __int8)*v23 >> 2) & 3;
v17 = v16;
if ( v16 )
v17 = 1;
if ( sub_9436D4(v1, v17, 142) )
{
if ( sub_9436D4(v1, v16 != 2, 114) )
sub_9436D4(v1, v16 != 3, 183);
}
result = sub_936934(v27);
}
while ( result );
return result;
}