//
// sub_1006A5F88 from 0x1006a5f88 to 0x1006a6100 (376 bytes)
//
// 3 xrefs:
// > sub_10069BF28 @ 0x10069c3bc
// > sub_10069E3FC @ 0x10069e7f8
// > sub_10069FB9C @ 0x1006a0130
//
// 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 11:11:42 +0000
//
__int64 __fastcall sub_1006A5F88(char *__s1, unsigned __int64 a2, unsigned __int64 *a3)
{
__int64 v6; // x23
char **v7; // x25
const char *v8; // x1
unsigned __int64 v9; // x22
int v10; // w8
__darwin_ct_rune_t v11; // w22
__uint32_t v12; // w0
bool v13; // cf
char *v15; // t1
unsigned __int64 v16; // x21
int v17; // w8
__int64 v18; // x26
__darwin_ct_rune_t v19; // w21
__uint32_t v20; // w0
bool v21; // cf
char *v23; // t1
v6 = 0;
v7 = &off_1009B2308;
v8 = "LOGIN";
if ( a3 )
{
while ( 1 )
{
v9 = (unsigned __int64)*(v7 - 2);
if ( v9 <= a2 && !memcmp(__s1, v8, (size_t)*(v7 - 2)) )
{
*a3 = v9;
if ( v9 == a2 )
break;
v10 = __s1[v9];
v11 = (unsigned __int8)__s1[v9];
v12 = v10 < 0 ? __maskrune(v11, 0x8000u) : _DefaultRuneLocale.__runetype[v11] & 0x8000;
if ( v11 != 95 )
{
v13 = v11 != 45 && (unsigned int)(v11 - 48) >= 0xA;
if ( v13 && v12 == 0 )
break;
}
}
++v6;
v15 = *v7;
v7 += 3;
v8 = v15;
if ( v6 == 9 )
return 0;
}
}
else
{
while ( 1 )
{
v16 = (unsigned __int64)*(v7 - 2);
if ( v16 <= a2 && !memcmp(__s1, v8, (size_t)*(v7 - 2)) )
{
if ( v16 == a2 )
break;
v17 = __s1[v16];
v18 = (unsigned __int8)__s1[v16];
v19 = (unsigned __int8)__s1[v16];
v20 = v17 < 0 ? __maskrune(v19, 0x8000u) : _DefaultRuneLocale.__runetype[v18] & 0x8000;
if ( v19 != 95 )
{
v21 = (_DWORD)v18 != 45 && (unsigned int)(v19 - 48) >= 0xA;
if ( v21 && v20 == 0 )
break;
}
}
++v6;
v23 = *v7;
v7 += 3;
v8 = v23;
if ( v6 == 9 )
return 0;
}
}
return LODWORD((&off_1009B22F0)[3 * v6 + 2]);
}