//
// sub_84D6D0 from 0x84d6d0 to 0x84d7b0 (224 bytes)
//
// 3 xrefs:
// > sub_847974 @ 0x847cfc
// > sub_848CAC @ 0x84901e
// > sub_849A64 @ 0x84a11e
//
// 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
//
char *__fastcall sub_84D6D0(const void *a1, char *a2, _DWORD *a3)
{
int v6; // r6
char **v7; // r5
const char *v8; // r1
const char *v9; // t1
char *v10; // r4
int v11; // r2
bool v12; // zf
char **v14; // r5
int v15; // r9
const char *v16; // t1
char *v17; // r4
int v18; // r3
bool v19; // zf
if ( a3 )
{
v6 = 0;
v7 = &off_C75930;
v8 = "LOGIN";
while ( 1 )
{
v10 = v7[1];
if ( v10 <= a2 && !memcmp(a1, v8, (size_t)v7[1]) )
{
*a3 = v10;
if ( v10 == a2 )
break;
v11 = (unsigned __int8)v10[(_DWORD)a1];
if ( (*(_BYTE *)(ctype_ + v11 + 1) & 1) == 0 && (unsigned int)(v11 - 48) > 9 )
{
v12 = v11 == 45;
if ( v11 != 45 )
v12 = v11 == 95;
if ( !v12 )
break;
}
}
v9 = v7[3];
v7 += 3;
v8 = v9;
++v6;
if ( !v9 )
return (char *)v8;
}
}
else
{
v6 = 0;
v14 = &off_C75930;
v8 = "LOGIN";
v15 = ctype_;
while ( 1 )
{
v17 = v14[1];
if ( a2 >= v17 && !memcmp(a1, v8, (size_t)v14[1]) )
{
if ( v17 == a2 )
break;
v18 = (unsigned __int8)v17[(_DWORD)a1];
if ( (*(_BYTE *)(v15 + v18 + 1) & 1) == 0 && (unsigned int)(v18 - 48) > 9 )
{
v19 = v18 == 45;
if ( v18 != 45 )
v19 = v18 == 95;
if ( !v19 )
break;
}
}
v16 = v14[3];
v14 += 3;
v8 = v16;
++v6;
if ( !v16 )
return (char *)v8;
}
}
return (&off_C75930)[3 * v6 + 2];
}