//
// sub_F298C from 0xf298c to 0xf2b90 (516 bytes)
//
// 2 xrefs:
// > sub_F13AC @ 0xf1c9c
// > sub_F13AC @ 0xf1e34
//
// 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:06 +0000
//
__int64 __fastcall sub_F298C(__int64 a1, __int64 a2, unsigned int a3, unsigned int a4, _QWORD *a5, __int64 a6, int a7)
{
unsigned int v8; // w8
unsigned int *v9; // x9
unsigned int v12; // w28
unsigned int *v13; // x10
unsigned int v14; // w27
__int64 result; // x0
unsigned int v19; // w1
__int64 v20; // x1
unsigned int v21; // w26
unsigned int v22; // w24
__int64 v23; // x1
bool v24; // zf
__int64 v25; // x8
__int64 (__fastcall *v26)(__int64, __int64, __int64, _QWORD, _QWORD); // x9
__int64 v27; // x1
unsigned int v28; // w8
unsigned int v29; // w27
bool v30; // zf
unsigned int v31; // w27
unsigned int v32; // [xsp+10h] [xbp-60h]
unsigned int v33; // [xsp+14h] [xbp-5Ch]
int v34; // [xsp+18h] [xbp-58h] BYREF
unsigned int v35; // [xsp+1Ch] [xbp-54h] BYREF
v8 = *(_DWORD *)(*(_QWORD *)(a2 + 8) + 1368LL);
v9 = (unsigned int *)&unk_4EAC8;
if ( a4 )
v12 = v8 >> a4;
else
v12 = v8 - a3;
if ( !a7 )
v9 = (unsigned int *)&unk_4EAC4;
v13 = (unsigned int *)&unk_4EAD0;
v14 = *v9;
if ( a7 )
v13 = (unsigned int *)&unk_4EAD4;
v33 = *v13;
if ( a4 )
{
if ( v12 < a3 )
{
LABEL_10:
sub_F2CF0();
**(_DWORD **)a2 = 2;
return 1;
}
}
else if ( v8 < a3 )
{
goto LABEL_10;
}
if ( a4 <= 6 )
v19 = 6;
else
v19 = a4;
if ( (unsigned int)sub_EDCE4((__int64)a5, v19) )
{
v21 = 0;
v22 = 0;
v32 = v14;
while ( !(v22 >> a4) )
{
result = sub_F2B90(a1, v20, &v35, v14);
if ( !(_DWORD)result )
return result;
*(_DWORD *)(*a5 + 4LL * v22) = v35;
if ( v35 >= v33 )
{
result = sub_F2B90(a1, v23, &v35, 5);
if ( !(_DWORD)result )
return result;
if ( v22 )
v30 = 1;
else
v30 = a4 == 0;
*(_DWORD *)(a5[1] + 4LL * v22) = v35;
if ( v30 )
v31 = 0;
else
v31 = a3;
while ( v31 < v12 )
{
result = sub_ECF60(a1, *(_QWORD *)(*(_QWORD *)(a2 + 8) + 120LL), &v34, v35);
if ( !(_DWORD)result )
return result;
++v31;
*(_DWORD *)(a6 + 4LL * v21++) = v34;
}
}
else
{
if ( v22 )
v24 = 1;
else
v24 = a4 == 0;
*(_DWORD *)(a5[1] + 4LL * v22) = 0;
v25 = *(_QWORD *)(a2 + 8);
v26 = *(__int64 (__fastcall **)(__int64, __int64, __int64, _QWORD, _QWORD))(v25 + 96);
v27 = *(_QWORD *)(v25 + 120);
if ( v24 )
v28 = 0;
else
v28 = a3;
v29 = v12 - v28;
result = v26(a1, v27, a6 + 4LL * v21, v12 - v28, v35);
if ( !(_DWORD)result )
return result;
v21 += v29;
}
v14 = v32;
++v22;
}
return 1;
}
return sub_F2CFC();
}