//
// sub_885B44 from 0x885b44 to 0x885d70 (556 bytes)
//
// 0 xrefs:
//
// 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:03:13 +0000
//
int __fastcall sub_885B44(_DWORD *a1)
{
_DWORD *v2; // r9
_DWORD *v3; // r5
int v4; // r4
int v5; // t1
int v6; // r0
int v7; // r3
int v8; // r3
unsigned int v9; // r1
int v10; // r3
int v11; // lr
_DWORD *v12; // r12
int v13; // r2
int v14; // r1
int v15; // t1
int v16; // r6
int v17; // r0
int v18; // r4
int v19; // r7
_DWORD *i; // r5
int v21; // r11
int v22; // r6
int v23; // r3
bool v24; // cc
int v25; // r3
_DWORD *v26; // r0
int result; // r0
unsigned int v28; // r1
unsigned int v29; // r2
_DWORD *v30; // r3
bool v31; // cf
int v32; // r2
int v33; // r2
unsigned int v34; // [sp+10h] [bp-24h]
int v35; // [sp+14h] [bp-20h]
int v36; // [sp+18h] [bp-1Ch]
_DWORD v37[5]; // [sp+20h] [bp-14h]
v2 = (_DWORD *)a1[113];
if ( (int)a1[85] > 0 )
{
v3 = a1 + 85;
v4 = 0;
do
{
v5 = v3[1];
++v3;
v6 = (*(int (__fastcall **)(_DWORD *, _DWORD, int, _DWORD, int))(a1[1] + 32))(
a1,
v2[*(_DWORD *)(v5 + 4) + 18],
a1[37] * *(_DWORD *)(v5 + 12),
*(_DWORD *)(v5 + 12),
1);
v7 = a1[85];
v37[v4++] = v6;
}
while ( v7 > v4 );
}
v36 = v2[6];
v8 = v2[7];
if ( v36 >= v8 )
goto LABEL_34;
v34 = v2[5];
v9 = v34;
v35 = 4 * v36;
do
{
if ( v9 >= a1[90] )
goto LABEL_33;
do
{
v10 = a1[85];
if ( v10 <= 0 )
goto LABEL_30;
v11 = 0;
v12 = a1 + 85;
v13 = 0;
do
{
v15 = v12[1];
++v12;
v14 = v15;
v16 = *(_DWORD *)(v15 + 60);
v17 = *(_DWORD *)(v15 + 56);
if ( v16 <= 0 )
goto LABEL_29;
v18 = 0;
v19 = v34 * (v17 << 7);
for ( i = (_DWORD *)(v37[v11] + v35); ; ++i )
{
v25 = *i + v19;
if ( v17 <= 0 )
goto LABEL_23;
v26 = &v2[v13];
v21 = v13 + 1;
v26[8] = v25;
if ( *(int *)(v14 + 56) <= 1 )
break;
v26[9] = v25 + 128;
v21 = v13 + 2;
if ( *(int *)(v14 + 56) <= 2 )
break;
v26[10] = v25 + 256;
v21 = v13 + 3;
if ( *(int *)(v14 + 56) <= 3 )
break;
v26[11] = v25 + 384;
v21 = v13 + 4;
if ( *(int *)(v14 + 56) <= 4 )
break;
v26[12] = v25 + 512;
v21 = v13 + 5;
if ( *(int *)(v14 + 56) <= 5 )
break;
v26[13] = v25 + 640;
v21 = v13 + 6;
if ( *(int *)(v14 + 56) <= 6 )
break;
v26[14] = v25 + 768;
v21 = v13 + 7;
if ( *(int *)(v14 + 56) <= 7 )
break;
v26[15] = v25 + 896;
v21 = v13 + 8;
if ( *(int *)(v14 + 56) <= 8 )
break;
v26[16] = v25 + 1024;
v22 = *(_DWORD *)(v14 + 56);
v23 = v25 + 1152;
v24 = v22 <= 9;
if ( v22 > 9 )
v26[17] = v23;
v16 = *(_DWORD *)(v14 + 60);
if ( v24 )
v13 += 9;
else
v13 += 10;
LABEL_23:
if ( ++v18 >= v16 )
goto LABEL_28;
LABEL_24:
v17 = *(_DWORD *)(v14 + 56);
}
v16 = *(_DWORD *)(v14 + 60);
++v18;
v13 = v21;
if ( v18 < v16 )
goto LABEL_24;
LABEL_28:
v10 = a1[85];
LABEL_29:
++v11;
}
while ( v11 < v10 );
LABEL_30:
result = (*(int (__fastcall **)(_DWORD *, _DWORD *))(a1[117] + 4))(a1, v2 + 8);
if ( !result )
{
v2[6] = v36;
v2[5] = v34;
return result;
}
++v34;
}
while ( a1[90] > v34 );
v8 = v2[7];
LABEL_33:
v2[5] = 0;
++v36;
v35 += 4;
v9 = 0;
v34 = 0;
}
while ( v36 < v8 );
LABEL_34:
v28 = a1[83];
v29 = a1[37] + 1;
a1[37] = v29;
if ( v29 >= v28 )
{
(*(void (__fastcall **)(_DWORD *))(a1[115] + 12))(a1);
return 4;
}
else
{
v30 = (_DWORD *)a1[113];
if ( (int)a1[85] <= 1 )
{
v31 = v29 >= v28 - 1;
v32 = a1[86];
if ( v31 )
v33 = *(_DWORD *)(v32 + 76);
else
v33 = *(_DWORD *)(v32 + 12);
v30[7] = v33;
}
else
{
v30[7] = 1;
}
v30[5] = 0;
v30[6] = 0;
return 3;
}
}