//
// sub_74222C from 0x74222c to 0x742270 (68 bytes)
//
// 4 xrefs:
// > sub_742448 @ 0x742486
// > sub_742448 @ 0x7424a8
// > sub_7424F0 @ 0x742922
// > sub_7424F0 @ 0x7429e4
//
// 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
//
unsigned __int8 *__fastcall sub_74222C(unsigned __int8 *a1, unsigned int a2, int a3, _DWORD *a4)
{
unsigned __int8 *v4; // r6
int i; // r7
unsigned __int8 *v6; // r5
int v7; // lr
int v8; // r4
int v9; // r4
v4 = a1;
for ( i = 0; ; i = v8 + a3 * i )
{
v6 = v4;
if ( (unsigned int)v4 >= a2 )
break;
v7 = *v4++;
v8 = v7 - 48;
if ( (unsigned int)(v7 - 48) > 9 )
{
v9 = v7 - 97;
if ( (unsigned int)(v7 - 97) > 5 )
{
v9 = v7 - 65;
if ( (unsigned int)(v7 - 65) > 5 )
break;
}
v8 = v9 + 10;
}
if ( v8 >= a3 )
break;
}
if ( v6 == a1 )
return nullptr;
*a4 = i;
return v6;
}