//
// sub_84E540 from 0x84e540 to 0x84e58a (74 bytes)
//
// 2 xrefs:
// > sub_83168C @ 0x832850
// > sub_83DFBC @ 0x83dfe2
//
// 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:02:29 +0000
//
int __fastcall sub_84E540(int result, int a2, int (__fastcall *a3)(int, int))
{
int *v5; // r7
int v6; // r4
int *v7; // r4
int v8; // r0
_DWORD v9[3]; // [sp+4h] [bp-Ch] BYREF
if ( result )
{
sub_83E714(result, v9);
result = sub_83E720((int)v9);
v5 = (int *)result;
LABEL_3:
while ( v5 )
{
v6 = *v5;
result = sub_83E720((int)v9);
v7 = **(int ***)(v6 + 8);
v5 = (int *)result;
if ( v7 )
{
while ( 1 )
{
v8 = *v7;
v7 = (int *)v7[2];
result = a3(v8, a2);
if ( result == 1 )
return result;
if ( !v7 )
goto LABEL_3;
}
}
}
}
return result;
}