//
// sub_F7DC8 from 0xf7dc8 to 0xf7fbc (500 bytes)
//
// 1 xrefs:
// > sub_F8320 @ 0xf83ac
//
// 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
//
__int64 __fastcall sub_F7DC8(__int64 a1, __int64 a2, int a3, int a4)
{
int v4; // w8
__int64 v9; // x19
__int64 v10; // x9
unsigned int v11; // w10
__int64 v12; // x13
int v13; // w14
unsigned int v14; // w14
__int64 v15; // x15
int v16; // w16
__int64 v17; // x17
int v18; // w1
int v19; // w14
_BYTE *v20; // x17
unsigned int v21; // w16
__int64 v22; // x9
int *v23; // x10
int v24; // t1
unsigned __int64 v25; // x13
__int64 v26; // x9
int v27; // w10
int v28; // w12
int v29; // w14
int v30; // w13
__int64 v31; // x11
int v32; // w15
_BYTE s[4]; // [xsp+Ch] [xbp-B4h] BYREF
int v35; // [xsp+10h] [xbp-B0h] BYREF
if ( a4 )
v4 = a4;
else
v4 = a3;
v9 = sub_9CDF4(a1, (unsigned int)(4 * v4));
if ( v9 )
{
memset(s, 0, 0x84u);
v10 = 0;
v11 = 0;
while ( v10 < a3 )
{
v12 = *(int *)(a2 + 4 * v10);
v13 = a4 == 0;
if ( (int)v12 >= 1 )
{
v14 = *(_DWORD *)&s[4 * v12];
if ( (int)v12 <= 31 && v14 >> v12 )
{
LABEL_26:
sub_9CF04(a1, v9);
return 0;
}
v15 = (v12 << 32) - 0x100000000LL;
v16 = v12 - 1;
v17 = *(int *)(a2 + 4 * v10);
*(_DWORD *)(v9 + 4LL * v11) = v14;
while ( v17 >= 1 )
{
v18 = *(_DWORD *)&s[4 * v17];
if ( (v18 & 1) != 0 )
{
if ( v16 )
*(_DWORD *)&s[4 * v17] = 2 * *(_DWORD *)&s[v15 >> 30];
else
++v35;
break;
}
v15 -= 0x100000000LL;
*(_DWORD *)&s[4 * v17] = v18 + 1;
--v16;
--v17;
}
while ( v12 + 1 <= 32 )
{
v20 = &s[4 * v12];
v21 = *((_DWORD *)v20 + 1);
if ( v14 != v21 >> 1 )
break;
v19 = *(_DWORD *)&s[4 * v12++];
*((_DWORD *)v20 + 1) = 2 * v19;
v14 = v21;
}
v13 = 1;
}
v11 += v13;
++v10;
}
if ( a4 != 1 )
{
v22 = 31;
v23 = &v35;
while ( v22 != -1 )
{
v24 = *v23++;
v25 = 0xFFFFFFFFuLL >> v22--;
if ( ((unsigned int)v25 & v24) != 0 )
goto LABEL_26;
}
}
v26 = 0;
v27 = 0;
while ( v26 < a3 )
{
v28 = *(_DWORD *)(a2 + 4 * v26);
v29 = 0;
v30 = 0;
v31 = v27;
while ( v29 < v28 )
{
v32 = (*(_DWORD *)(v9 + 4LL * v27) >> v29++) & 1 | (2 * v30);
v30 = v32;
}
if ( !a4 || v28 )
{
++v27;
*(_DWORD *)(v9 + 4 * v31) = v30;
}
++v26;
}
}
return v9;
}