//
// sub_E0E2F4 from 0xe0e2f4 to 0xe0e488 (404 bytes)
//
// 2 xrefs:
// > sub_E0E9B8 @ 0xe0ed44
// > sub_E0E9B8 @ 0xe0f00c
//
// 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:09:37 +0000
//
__int64 __fastcall sub_E0E2F4(__int64 a1, int a2, int a3)
{
__int64 v4; // x0
unsigned int v5; // w22
unsigned int v6; // w25
__int64 v8; // x26
__int64 v9; // x0
int v10; // w23
__int64 v11; // x19
unsigned int *v12; // x24
__int64 v13; // x21
__int64 v14; // x0
v4 = a1 + 4LL * a3;
v5 = *(_DWORD *)(v4 + 616);
*(_DWORD *)(v4 + 616) = -1;
if ( a2 )
goto LABEL_2;
v8 = a1 + 8LL * a3;
v9 = *(_QWORD *)(v8 + 104);
if ( v9 )
{
v10 = *(_DWORD *)(v9 + 4);
v11 = *(_QWORD *)(v9 + 40);
}
else
{
v14 = *(_QWORD *)(a1 + 104);
if ( !v14 )
goto LABEL_2;
v11 = *(_QWORD *)(v14 + 40);
if ( *(_DWORD *)(v14 + 4) == 2 )
v10 = 10;
else
v10 = 2;
}
if ( !v11 )
{
LABEL_2:
v6 = 7;
goto LABEL_3;
}
v12 = (unsigned int *)(a1 + 4LL * a3 + 616);
v13 = 8 * ((a3 ^ 1) + 12LL);
while ( 1 )
{
if ( *(_QWORD *)(a1 + v13 + 8) )
{
while ( v10 != *(_DWORD *)(v11 + 4) )
{
v11 = *(_QWORD *)(v11 + 40);
if ( !v11 )
{
v6 = 7;
if ( v5 != -1 )
goto LABEL_4;
return 7;
}
}
}
v6 = sub_E0D708(a1, v11, v12);
if ( v6 != 7 )
break;
v11 = *(_QWORD *)(v11 + 40);
if ( !v11 )
goto LABEL_2;
}
*(_QWORD *)(v8 + 104) = v11;
LABEL_3:
if ( v5 == -1 )
return v6;
LABEL_4:
if ( !*(_QWORD *)(a1 + 56) )
{
LABEL_8:
sub_E11734(a1, v5);
close(v5);
return v6;
}
if ( v5 == *(_DWORD *)(a1 + 612) && *(_BYTE *)(a1 + 625) )
{
*(_BYTE *)(a1 + 625) = 0;
goto LABEL_8;
}
sub_E11734(a1, v5);
(*(void (__fastcall **)(_QWORD, _QWORD))(a1 + 56))(*(_QWORD *)(a1 + 64), v5);
return v6;
}