//
// sub_84E0C8 from 0x84e0c8 to 0x84e210 (328 bytes)
//
// 2 xrefs:
// > sub_852C2C @ 0x852fea
// > sub_852C2C @ 0x853468
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:02:29 +0000
//
bool __fastcall sub_84E0C8(const char *a1, const char *a2)
{
bool v2; // zf
bool v3; // r5
char *v6; // r7
const char *v7; // r0
char *v8; // r8
size_t v9; // r0
size_t v10; // r0
char *v11; // r4
_BOOL4 v12; // r4
char *v13; // r0
char *v14; // r5
_BOOL4 v15; // r0
char *v16; // r9
int v17; // [sp+0h] [bp-24h] BYREF
_BYTE buf[24]; // [sp+Ch] [bp-18h] BYREF
if ( !a1 )
return 0;
v2 = a2 == nullptr;
if ( a2 )
v2 = *a1 == 0;
v3 = v2;
if ( v2 )
return 0;
if ( !*a2 )
return 0;
v6 = off_D200B8(a1);
if ( !v6 )
return 0;
v7 = off_D200B8(a2);
v8 = (char *)v7;
if ( !v7 )
{
v12 = 0;
goto LABEL_20;
}
v9 = strlen(v7) - 1;
if ( v8[v9] == 46 )
v8[v9] = v3;
v10 = strlen(v6) - 1;
if ( v6[v10] == 46 )
v6[v10] = 0;
v11 = strchr(v6, 42);
if ( !v11 )
goto LABEL_28;
if ( inet_pton(2, v8, &v17) <= 0 && inet_pton(10, v8, buf) <= 0 )
{
v13 = strchr(v6, 46);
v14 = v13;
if ( v13 )
{
v15 = !strchr(v13 + 1, 46) || v11 > v14;
if ( !v15 && !sub_83ABE4(v6, "xn--", 4) )
{
v16 = strchr(v8, 46);
if ( v16
&& sub_83AAF4(v14, v16)
&& v16 - v8 >= v14 - v6
&& sub_83ABE4(v6, v8, v11 - v6)
&& sub_83ABE4(v11 + 1, &v16[-(v14 - (v11 + 1))], v14 - (v11 + 1)) )
{
v12 = 1;
goto LABEL_19;
}
goto LABEL_18;
}
}
LABEL_28:
v12 = sub_83AAF4(v6, v8);
goto LABEL_19;
}
LABEL_18:
v12 = 0;
LABEL_19:
off_D200B0(v8);
LABEL_20:
off_D200B0(v6);
return v12;
}