//
// sub_EE99C0 from 0xee99c0 to 0xee9b08 (328 bytes)
//
// 1 xrefs:
// > sub_EE9B08 @ 0xee9b3c
//
// 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 13:11:54 +0000
//
_WORD *__fastcall sub_EE99C0(_WORD *result, __int64 a2)
{
int v2; // w2
int v3; // w2
v2 = (__int16)result[15];
*(_DWORD *)(a2 + 4) = -1;
if ( v2 )
{
*(_DWORD *)(a2 + 4) = 15;
}
else if ( result[14] )
{
*(_DWORD *)(a2 + 4) = 14;
}
else if ( result[13] )
{
*(_DWORD *)(a2 + 4) = 13;
}
else if ( result[12] )
{
*(_DWORD *)(a2 + 4) = 12;
}
else if ( result[11] )
{
*(_DWORD *)(a2 + 4) = 11;
}
else if ( result[10] )
{
*(_DWORD *)(a2 + 4) = 10;
}
else if ( result[9] )
{
*(_DWORD *)(a2 + 4) = 9;
}
else if ( result[8] )
{
*(_DWORD *)(a2 + 4) = 8;
}
else if ( result[7] )
{
*(_DWORD *)(a2 + 4) = 7;
}
else if ( result[6] )
{
*(_DWORD *)(a2 + 4) = 6;
}
else if ( result[5] )
{
*(_DWORD *)(a2 + 4) = 5;
}
else if ( result[4] )
{
*(_DWORD *)(a2 + 4) = 4;
}
else
{
if ( result[3] )
{
v3 = 3;
}
else if ( result[2] )
{
v3 = 2;
}
else if ( result[1] )
{
v3 = 1;
}
else
{
if ( !*result )
{
*(_QWORD *)(a2 + 8) = result;
return result;
}
v3 = 0;
}
*(_DWORD *)(a2 + 4) = v3;
}
*(_QWORD *)(a2 + 8) = result;
return result;
}