//
// sub_10060BD2C from 0x10060bd2c to 0x10060bf4c (544 bytes)
//
// 3 xrefs:
// > ??> @ 0x1009ac460
// > ??> @ 0x1009ac4a0
// > ??> @ 0x1009ac4e0
//
// 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:10:07 +0000
//
_DWORD *__fastcall sub_10060BD2C(__int64 a1, __int64 a2, int *a3)
{
_DWORD *v6; // x19
__int64 v7; // x23
int v8; // w0
__int64 v9; // x25
__int64 v10; // x24
unsigned int v11; // w22
int v12; // w0
int v13; // w0
int v14; // w8
bool v15; // cc
int *v16; // x8
int v17; // w10
int v18; // w8
int v19; // w10
int v20; // w11
_DWORD *v21; // x22
__int64 v22; // x25
int v23; // w0
int v24; // w8
int *v25; // x9
__int64 v26; // x10
v6 = (_DWORD *)sub_10059EE34(a1, 1, 1812);
if ( v6 )
{
v7 = *(_QWORD *)(a2 + 32);
*v6 = sub_100552800(a3, 0x18u);
v6[1] = sub_100552800(a3, 0x18u);
v6[2] = sub_100552800(a3, 0x18u) + 1;
v6[3] = sub_100552800(a3, 6u) + 1;
v8 = sub_100552800(a3, 8u);
v6[4] = v8;
if ( v8 < 0 )
goto LABEL_30;
if ( (int)v6[3] >= 1 )
{
v9 = 0;
LODWORD(v10) = 0;
while ( 1 )
{
v11 = sub_100552800(a3, 3u);
v12 = sub_100552800(a3, 1u);
if ( v12 < 0 )
goto LABEL_30;
if ( v12 )
{
v13 = sub_100552800(a3, 5u);
if ( v13 < 0 )
goto LABEL_30;
v11 |= 8 * v13;
}
v6[v9 + 5] = v11;
v14 = 0;
if ( v11 )
{
do
{
v14 += v11 & 1;
v15 = v11 > 1;
v11 >>= 1;
}
while ( v15 );
}
v10 = (unsigned int)(v14 + v10);
if ( ++v9 >= (int)v6[3] )
{
if ( (int)v10 >= 1 )
{
v21 = v6 + 69;
v22 = v10;
do
{
v23 = sub_100552800(a3, 8u);
if ( v23 < 0 )
goto LABEL_30;
*v21++ = v23;
}
while ( --v22 );
}
v8 = v6[4];
v24 = *(_DWORD *)(v7 + 24);
if ( v8 >= v24 )
goto LABEL_30;
if ( (int)v10 >= 1 )
{
v25 = v6 + 69;
while ( 1 )
{
v26 = *v25;
if ( (int)v26 >= v24 || !*(_DWORD *)(*(_QWORD *)(v7 + 8 * v26 + 2848) + 16LL) )
goto LABEL_30;
++v25;
if ( !--v10 )
goto LABEL_14;
}
}
goto LABEL_14;
}
}
}
if ( v8 >= *(_DWORD *)(v7 + 24) )
{
LABEL_30:
bzero(v6, 0x714u);
sub_10059EEE8(a1, (__int64)v6);
return nullptr;
}
LABEL_14:
v16 = *(int **)(v7 + 8LL * v8 + 2848);
v17 = *v16;
if ( *v16 >= 1 )
{
v18 = v16[1];
v19 = v17 + 1;
v20 = 1;
while ( 1 )
{
v20 *= v6[3];
if ( v20 > v18 )
break;
if ( --v19 < 2 )
return v6;
}
goto LABEL_30;
}
}
return v6;
}