//
// sub_1800F4F00 from 0x1800f4f00 to 0x1800f5002 (258 bytes)
//
// 4 xrefs:
// > sub_1800F4F00 @ 0x1800f4f7f
// > sub_1800F4F00 @ 0x1800f4faa
// > sub_1800F5010 @ 0x1800f530e
// > ??> @ 0x1802007dc
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_1800F4F00(int *a1, int a2, int a3, int a4, int a5)
{
int v5; // edi
int v6; // r15d
int v10; // ebp
int v11; // eax
int v12; // eax
__int64 result; // rax
int v14; // ebx
v5 = a5;
v6 = a4;
if ( a4 == 1 )
{
LABEL_4:
v14 = v5 & a2;
}
else
{
while ( 1 )
{
v10 = a2 + a3;
if ( v6 == 2 )
break;
sub_1800F4F00((_DWORD)a1, a2, 2 * a3, v6 / 2, a5);
v5 = a5;
sub_1800F4F00((_DWORD)a1 + 4 * (v6 / 2), v10, 4 * a3, v6 / 4, a5);
v11 = v6 - 1;
v6 /= 4;
v12 = a3 * v11;
a3 *= 4;
a2 += v12;
result = (unsigned int)(3 * v6);
a1 += (int)result;
if ( v6 == 1 )
goto LABEL_4;
}
v14 = v5 & a2;
a1[1] = v5 & v10;
}
*a1 = v14;
return result;
}