//
// sub_D3C12 from 0xd3c12 to 0xd3c68 (86 bytes)
//
// 2 xrefs:
// > sub_D3B60 @ 0xd3b64
// > sub_D3B68 @ 0xd3b6c
//
// 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_D3C12(int a1, unsigned int a2, signed int a3, int *a4)
{
int v4; // lr
int v5; // r12
unsigned __int8 *v6; // r4
int v7; // r6
signed int v8; // r5
unsigned int v9; // r5
v4 = 0;
v5 = 0;
while ( 1 )
{
v6 = (unsigned __int8 *)(a1 + v4);
if ( a1 + v4 >= a2 )
break;
v7 = *v6;
v8 = v7 - 48;
if ( (unsigned int)(v7 - 48) >= 0xA )
{
v9 = v7 - 97;
if ( (unsigned int)(v7 - 97) > 5 )
v9 = v7 - 65;
if ( v9 > 5 )
break;
v8 = v9 + 10;
}
if ( v8 >= a3 )
break;
v5 = v8 + v5 * a3;
++v4;
}
if ( !v4 )
return nullptr;
*a4 = v5;
return v6;
}