//
// sub_1005B409C from 0x1005b409c to 0x1005b4130 (148 bytes)
//
// 1 xrefs:
// > ??> @ 0x1009d98c0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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:09:12 +0000
//
__int64 __fastcall sub_1005B409C(_QWORD *a1, int a2, int a3)
{
int *v3; // x8
__int64 result; // x0
v3 = (int *)(*a1 + 33996LL);
if ( a2 == 1 )
{
v3 = (int *)(*a1 + 34000LL);
goto LABEL_9;
}
result = 31;
if ( a2 )
return result;
if ( a3 > 2047 )
{
if ( a3 >= 0x2000 )
{
if ( a3 == 0x4000 || a3 == 0x2000 )
goto LABEL_9;
}
else if ( a3 == 2048 || a3 == 4096 )
{
goto LABEL_9;
}
}
else
{
if ( a3 <= 511 )
{
if ( a3 != 128 && a3 != 256 )
return result;
LABEL_9:
result = 0;
*v3 = a3;
return result;
}
if ( a3 == 512 || a3 == 1024 )
goto LABEL_9;
}
return result;
}