//
// sub_100607904 from 0x100607904 to 0x100607b14 (528 bytes)
//
// 7 xrefs:
// > sub_100593268 @ 0x1005932ec
// > sub_1005CCD74 @ 0x1005cd010
// > sub_1005F9900 @ 0x1005f9de0
// > sub_10060A0CC @ 0x10060a124
// > sub_10060F33C @ 0x10060f4f0
// > sub_10061A360 @ 0x10061a440
// > sub_10062D7F8 @ 0x10062d884
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
_BYTE *__fastcall sub_100607904(char *__s, _QWORD *a2)
{
char *v3; // x21
int v4; // w0
_BYTE *v5; // x0
_BYTE *v6; // x19
_BYTE *v7; // x25
__int16 v8; // w2
int v9; // w4
char *v10; // x27
__int64 v11; // x24
char v12; // w21
__int64 v13; // x23
__uint32_t v14; // w0
char v15; // w22
__uint32_t v16; // w0
char v17; // w8
char v18; // w9
v3 = __s;
if ( __s )
{
v4 = strlen(__s);
v5 = sub_100588710((unsigned int)(v4 >> 1), (__int64)"v3_utl.c", 445);
v6 = v5;
if ( v5 )
{
v7 = v5;
while ( 2 )
{
v10 = v3 - 1;
do
{
v11 = (unsigned __int8)v10[1];
if ( !v10[1] )
{
if ( a2 )
*a2 = v7 - v6;
return v6;
}
v12 = *++v10;
}
while ( (unsigned __int8)v11 == 58 );
v13 = (unsigned __int8)v10[1];
if ( !v10[1] )
{
sub_1005E0E48(34, 113, 112, (__int64)"v3_utl.c", 459);
sub_100588C44(v6);
return nullptr;
}
if ( (char)v11 < 0 )
v14 = __maskrune(v11, 0x8000u);
else
v14 = _DefaultRuneLocale.__runetype[v11] & 0x8000;
v15 = v13;
if ( v14 )
v12 = __tolower(v11);
if ( (char)v13 < 0 )
v16 = __maskrune(v13, 0x8000u);
else
v16 = _DefaultRuneLocale.__runetype[v13] & 0x8000;
if ( v16 )
v15 = __tolower(v13);
if ( (unsigned __int8)(v12 - 48) <= 9u )
{
v17 = v12 - 48;
goto LABEL_24;
}
if ( (unsigned __int8)(v12 - 97) <= 5u )
{
v17 = v12 - 87;
LABEL_24:
if ( (unsigned __int8)(v15 - 48) <= 9u )
{
v18 = v15 - 48;
LABEL_5:
v3 = v10 + 2;
*v7++ = v18 | (16 * v17);
continue;
}
if ( (unsigned __int8)(v15 - 97) <= 5u )
{
v18 = v15 - 87;
goto LABEL_5;
}
}
break;
}
sub_100588C44(v6);
v8 = 113;
v9 = 498;
}
else
{
v8 = 65;
v9 = 493;
}
}
else
{
v8 = 107;
v9 = 442;
}
sub_1005E0E48(34, 113, v8, (__int64)"v3_utl.c", v9);
return nullptr;
}