//
// sub_8ADD28 from 0x8add28 to 0x8addf8 (208 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:52 +0000
//
_DWORD *__fastcall sub_8ADD28(_DWORD *result, int a2)
{
_DWORD *v2; // r4
_DWORD *v3; // r6
int v4; // r5
int v5; // r4
int v6; // r5
void *v7; // t1
int (*v8)(); // r2
int v9; // r3
int v10; // r3
int v11; // r1
int v12; // r2
void *v13; // r0
size_t v14; // r7
v2 = result;
v3 = (_DWORD *)result[121];
v4 = v3[6];
if ( !result[22] )
{
if ( a2 )
goto LABEL_3;
v8 = sub_8AE860;
LABEL_9:
v3[1] = v8;
v3[2] = nullsub_29;
v9 = result[33];
if ( v9 <= 0 )
{
v10 = *result;
v11 = 58;
v12 = 1;
}
else
{
if ( v9 <= 256 )
{
if ( result[22] != 2 )
goto LABEL_12;
LABEL_17:
v13 = (void *)v3[8];
v14 = 6 * v2[28] + 12;
if ( !v13 )
{
v13 = (void *)(*(int (__fastcall **)(_DWORD *, int, size_t))(v2[1] + 4))(v2, 1, v14);
v3[8] = v13;
}
result = memset(v13, 0, v14);
if ( !v3[10] )
result = (_DWORD *)sub_8ADA58((int)v2);
v3[9] = 0;
LABEL_12:
if ( !v3[7] )
return result;
goto LABEL_4;
}
v10 = *result;
v11 = 59;
v12 = 256;
}
*(_DWORD *)(v10 + 20) = v11;
*(_DWORD *)(*result + 24) = v12;
result = (_DWORD *)(*(int (__fastcall **)(_DWORD *))*result)(result);
if ( v2[22] != 2 )
goto LABEL_12;
goto LABEL_17;
}
result[22] = 2;
if ( !a2 )
{
v8 = sub_8AE8F8;
goto LABEL_9;
}
LABEL_3:
v3[7] = 1;
v3[1] = sub_8AD9F0;
v3[2] = sub_8AEB4C;
LABEL_4:
v5 = v4 - 4;
v6 = v4 + 124;
do
{
v7 = *(void **)(v5 + 4);
v5 += 4;
result = memset(v7, 0, 0x1000u);
}
while ( v5 != v6 );
v3[7] = 0;
return result;
}