//
// sub_E0F84 from 0xe0f84 to 0xe2450 (5324 bytes)
//
// 2 xrefs:
// > sub_E0F84 @ 0xe1da8
// > sub_E24E8 @ 0xe24f0
//
// 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 12:14:57 +0000
//
__int64 __fastcall sub_E0F84(
__int64 a1,
__int64 a2,
__int64 a3,
int a4,
__int64 a5,
unsigned int a6,
_WORD *a7,
__int64 a8,
int a9,
_BYTE *a10)
{
__int64 v10; // x27
_BYTE *v17; // x27
_BYTE *i; // x19
int v19; // w8
int v20; // w28
_BYTE *v21; // x8
_BYTE *j; // x19
unsigned int v23; // w10
unsigned __int8 *v24; // x26
__int64 k; // x23
int v26; // w9
unsigned int v27; // w8
__int64 v28; // x22
__int64 result; // x0
unsigned __int8 *m; // x9
__int64 v31; // x19
unsigned int v32; // w11
char nptr[1848]; // [xsp+1958h] [xbp-1858h] BYREF
_BYTE v35[1960]; // [xsp+2158h] [xbp-1058h] BYREF
if ( a10 )
*a10 = 0;
if ( (unsigned int)sub_E24B4("http://")
&& (unsigned int)sub_E24B4("http:\\\\")
&& (unsigned int)sub_E24CC("https://")
&& (unsigned int)sub_E24CC("https:\\\\") )
{
if ( (unsigned int)sub_E2510("mms://") && (unsigned int)sub_E2510("mms:\\\\") )
return 31;
if ( a10 )
*a10 = 1;
v10 = 6;
}
v17 = (_BYTE *)(a2 + v10);
for ( i = v17; ; ++i )
{
v19 = (unsigned __int8)*i;
if ( !*i || v19 == 47 )
{
v20 = 0;
goto LABEL_19;
}
if ( v19 == 64 )
break;
}
sub_E3C94(v35, v17, 4096);
v21 = (_BYTE *)(i - v17);
v17 = i + 1;
v35[(_QWORD)v21] = 0;
v20 = 1;
LABEL_19:
for ( j = v17 + 1; ; ++j )
{
v23 = (unsigned __int8)*(j - 1);
if ( v23 <= 0x3A && ((1LL << v23) & 0x400800000000001LL) != 0 )
break;
}
if ( (int)sub_E3BB0(v17) >= a4 )
return 31;
v24 = j - 1;
sub_E3C94(a3, v17, (unsigned int)a4);
*(_BYTE *)(a3 + j - 1 - v17) = 0;
if ( *(j - 1) != 47 && *(j - 1) )
{
for ( k = 0; k != 2048; ++k )
{
v26 = (unsigned __int8)j[k];
if ( (unsigned int)(v26 - 48) > 9 )
break;
nptr[k] = v26;
}
nptr[k] = 0;
v24 = &j[k];
*a7 = atoi(nptr);
}
else
{
*a7 = 80;
}
v27 = *v24;
if ( v27 > 0x20 || ((1LL << v27) & 0x100000601LL) == 0 )
{
if ( (int)sub_E3BB0(v24) < a9 )
{
v28 = a5;
for ( m = &v24[(int)sub_E3BB0(v24) - 1]; ; --m )
{
v31 = m - v24;
if ( m <= v24 )
break;
v32 = *m;
if ( v32 > 0x20 || ((1LL << v32) & 0x100000600LL) == 0 )
break;
}
sub_E3C94(a8, v24, (unsigned int)(v31 + 2));
*(_BYTE *)(v31 + a8 + 1) = 0;
goto LABEL_35;
}
return 31;
}
sub_E3C94(a8, "/", (unsigned int)a9);
v28 = a5;
LABEL_35:
if ( (v28 == 0) | (v20 ^ 1) & 1 )
return 0;
result = sub_E360C(v35, v28, a6);
if ( !(_DWORD)result )
return 0;
return result;
}