//
// sub_10065A8E8 from 0x10065a8e8 to 0x10065aa34 (332 bytes)
//
// 1 xrefs:
// > sub_100659530 @ 0x10065981c
//
// 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 11:10:55 +0000
//
__int64 __fastcall sub_10065A8E8(__int64 result, unsigned __int64 a2, unsigned __int64 a3, unsigned __int8 *a4)
{
int v5; // w9
__int64 v6; // x10
__int64 v7; // x8
int v8; // w10
__int64 v9; // x11
int v10; // w2
if ( !result && !a2 && !a3 )
return result;
if ( !(result | a3) )
{
v7 = 0;
goto LABEL_16;
}
v5 = *a4;
if ( dword_1009E3A40 == v5 )
{
v6 = 0;
LABEL_13:
v7 = *((unsigned int *)&unk_1009E3A00 + 2 * v6 + 15);
goto LABEL_14;
}
v6 = 1;
if ( dword_1009E3A48 == v5 )
goto LABEL_13;
v6 = 2;
if ( dword_1009E3A50 == v5 )
goto LABEL_13;
v6 = 3;
if ( dword_1009E3A58 == v5 )
goto LABEL_13;
v6 = 4;
if ( dword_1009E3A60 == v5 )
goto LABEL_13;
v6 = 5;
if ( dword_1009E3A68 == v5 )
goto LABEL_13;
v7 = 0;
LABEL_14:
if ( result )
*(_DWORD *)result = v7;
LABEL_16:
if ( a2 | a3 )
{
v8 = a4[1];
if ( dword_1009E3A08 == v8 )
{
v9 = 0;
}
else
{
v9 = 1;
if ( dword_1009E3A10 != v8 )
{
v9 = 2;
if ( dword_1009E3A18 != v8 )
{
v10 = 0;
LABEL_23:
if ( a2 )
*(_DWORD *)a2 = v10;
goto LABEL_25;
}
}
}
v10 = *((_DWORD *)&unk_1009E3A00 + 2 * v9 + 1);
goto LABEL_23;
}
v10 = 0;
LABEL_25:
if ( a3 )
{
if ( !(_DWORD)v7 || !v10 || (result = sub_1006B2294(a3, v7), (int)result <= 0) )
*(_DWORD *)a3 = 0;
}
return result;
}