//
// sub_E1E038 from 0xe1e038 to 0xe1e278 (576 bytes)
//
// 2 xrefs:
// > sub_E08A98 @ 0xe0919c
// > sub_E1E278 @ 0xe1e750
//
// 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:45 +0000
//
__int64 __fastcall sub_E1E038(__int64 *a1, __int64 a2, __int64 a3)
{
__int64 v6; // x28
_QWORD *v7; // x19
__int64 v8; // x20
size_t v9; // x3
__int64 v10; // x5
int v11; // w23
unsigned __int64 v12; // x4
int v13; // w4
__int64 result; // x0
__int64 v15; // x4
v6 = *a1;
v7 = a1 + 195;
if ( !a3 )
{
if ( a1[210] != 5 )
return 0;
goto LABEL_37;
}
v8 = 0;
v9 = a1[210];
v10 = 0;
v11 = 0;
do
{
while ( 1 )
{
v13 = *(unsigned __int8 *)(a2 + v8);
if ( v13 != 13 )
break;
if ( v9 )
{
if ( v9 == 3 )
{
v7[15] = 4;
v12 = 4;
}
else
{
v7[15] = 1;
v12 = 1;
}
goto LABEL_20;
}
v7[15] = 1;
if ( !v8 )
{
v12 = 1;
goto LABEL_6;
}
result = sub_DF23A8((__int64)a1, 1, (char *)(a2 + v10), v8 - v10);
if ( (_DWORD)result )
return result;
v10 = v8++;
v12 = v7[15];
v9 = v12;
if ( v8 == a3 )
goto LABEL_12;
}
if ( v13 != 46 )
{
if ( v13 != 10 || v9 != 4 && v9 != 1 )
{
LABEL_5:
v7[15] = 0;
v12 = v9;
if ( !v9 )
goto LABEL_6;
goto LABEL_21;
}
v12 = v9 + 1;
v7[15] = v9 + 1;
LABEL_20:
if ( v12 > v9 )
goto LABEL_6;
LABEL_21:
v15 = v7[16];
goto LABEL_22;
}
if ( v9 == 2 )
{
v12 = 3;
v7[15] = 3;
goto LABEL_20;
}
if ( v9 != 3 )
goto LABEL_5;
v7[15] = 0;
v11 = 1;
v15 = v7[16];
LABEL_22:
while ( v15 )
{
--v15;
--v9;
v7[16] = v15;
if ( !v9 )
{
v12 = v7[15];
goto LABEL_6;
}
}
if ( v11 )
--v9;
result = sub_DF23A8((__int64)a1, 1, "\r\n.\r\n", v9);
if ( (_DWORD)result )
return result;
v12 = v7[15];
v10 = v8;
v11 = 0;
LABEL_6:
++v8;
v9 = v12;
}
while ( v8 != a3 );
LABEL_12:
if ( v12 == 5 )
{
LABEL_37:
result = sub_DF23A8((__int64)a1, 1, "\r\n.\r\n", 2u);
*(_DWORD *)(v6 + 484) &= ~1u;
v7[15] = 0;
return result;
}
if ( !v12 && v8 != v10 )
return sub_DF23A8((__int64)a1, 1, (char *)(a2 + v10), v8 - v10);
return 0;
}