//
// sub_F74E0 from 0xf74e0 to 0xf76b0 (464 bytes)
//
// 3 xrefs:
// > ??> @ 0x10f488
// > ??> @ 0x10f4c8
// > ??> @ 0x10f508
//
// 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 12:15:08 +0000
//
_DWORD *__fastcall sub_F74E0(__int64 a1, __int64 a2, int *a3)
{
__int64 v6; // x0
_DWORD *v7; // x20
__int64 v8; // x23
__int64 v9; // x0
__int64 v10; // x0
__int64 v11; // x0
__int64 v12; // x25
int v13; // w24
__int64 v14; // x0
unsigned int v15; // w22
int v16; // w8
int v17; // w8
__int64 v18; // x22
__int64 i; // x24
__int64 v20; // x8
int v21; // w9
__int64 v22; // x10
__int64 v23; // x11
int *v24; // x8
int v25; // w10
int v26; // w8
int v27; // w9
int v28; // w9
v6 = sub_9CE54(a1, 1, 1812);
v7 = (_DWORD *)v6;
if ( !v6 )
goto LABEL_27;
v8 = *(_QWORD *)(a2 + 32);
v9 = sub_F7D50(v6, 24);
*v7 = v9;
v10 = sub_F7D50(v9, 24);
v7[1] = v10;
v7[2] = sub_F7D50(v10, 24) + 1;
v7[3] = sub_F2EE8(a3, 6u) + 1;
v11 = sub_F2EE8(a3, 8u);
v7[4] = v11;
if ( (v11 & 0x80000000) != 0 )
goto LABEL_27;
v12 = 0;
v13 = 0;
while ( v12 < (int)v7[3] )
{
v14 = sub_F7D50(v11, 3);
v15 = v14;
v11 = sub_F7D50(v14, 1);
if ( (v11 & 0x80000000) != 0 )
goto LABEL_27;
if ( (_DWORD)v11 )
{
v11 = sub_F7D50(v11, 5);
v16 = 8 * v11;
if ( (int)v11 < 0 )
v16 = 0;
if ( (v11 & 0x80000000) != 0 )
goto LABEL_27;
v15 |= v16;
}
v17 = 0;
for ( v7[v12 + 5] = v15; v15; v15 >>= 1 )
v17 += v15 & 1;
v13 += v17;
++v12;
}
v18 = v13;
for ( i = 69; i - 69 < v18; v7[i++] = v11 )
{
v11 = sub_F7D50(v11, 8);
if ( (v11 & 0x80000000) != 0 )
goto LABEL_27;
}
v20 = (int)v7[4];
v21 = *(_DWORD *)(v8 + 24);
if ( (int)v20 >= v21 )
{
LABEL_27:
sub_F7400(a1, v7);
return nullptr;
}
else
{
v22 = 69;
while ( v22 - 69 < v18 )
{
v23 = (int)v7[v22];
if ( (int)v23 < v21 )
{
++v22;
if ( *(_DWORD *)(*(_QWORD *)(v8 + 8 * v23 + 2848) + 16LL) )
continue;
}
goto LABEL_27;
}
v24 = *(int **)(v8 + 8 * v20 + 2848);
v25 = 1;
v27 = *v24;
v26 = v24[1];
v28 = v27 + 1;
while ( --v28 >= 1 )
{
v25 *= v7[3];
if ( v25 > v26 )
goto LABEL_27;
}
}
return v7;
}