//
// sub_5357C from 0x5357c to 0x5361e (162 bytes)
//
// 1 xrefs:
// > sub_534B6 @ 0x534ce
//
// 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 11:40:44 +0000
//
int __fastcall sub_5357C(_DWORD *a1, int a2)
{
int v3; // r0
int v5; // r1
bool v6; // zf
int result; // r0
int i; // r0
int v9; // lr
int j; // r1
int v11; // r6
int v12; // r3
int v13; // r5
_DWORD *k; // r6
v3 = a1[1];
if ( v3 >= a2 )
return 28;
v5 = a1[4];
v6 = v5 == v3;
if ( v5 == v3 )
v6 = a1[6] == -1;
if ( !v6 )
return 28;
result = sub_5361E(a1 + 3, a2);
if ( !result )
{
result = sub_53292((int)a1, a2);
if ( !result )
{
for ( i = 0; i < a2; ++i )
*(_DWORD *)(*a1 + 4 * i) = -1;
v9 = a1[4];
for ( j = 0; j < v9; ++j )
{
v11 = a1[1];
if ( !v11 )
return 28;
v12 = a1[3];
v13 = 3 * j;
for ( k = (_DWORD *)(*a1 + 4 * (*(_DWORD *)(v12 + 12 * j) & (v11 - 1))); *k != -1; k = (_DWORD *)(v12 + 12 * *k + 4) )
;
*k = j;
*(_DWORD *)(v12 + 4 * v13 + 4) = -1;
}
return 0;
}
}
return result;
}