//
// fmt::BasicFormatter::ParseArgIndex from 0x180042d00 to 0x180042da1 (161 bytes)
//
// 5 xrefs:
// > fmt::BasicFormatter::format @ 0x1800435f1
// > ??> @ 0x180136d4c
// > ??> @ 0x180136d5c
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b150c
//
// 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
//
__int64 __fastcall fmt::BasicFormatter::ParseArgIndex(__int64 a1, char **a2)
{
unsigned int v3; // eax
int v4; // ecx
char *v5; // r8
unsigned int v6; // r9d
unsigned int v7; // ecx
unsigned int v9; // eax
if ( (unsigned __int8)(**a2 - 48) > 9u )
{
v9 = *(_DWORD *)(a1 + 24);
*(_DWORD *)(a1 + 24) = v9 + 1;
return *(_QWORD *)(a1 + 8) + 24LL * v9;
}
else
{
v3 = 0;
*(_DWORD *)(a1 + 24) = -1;
do
{
v4 = **a2;
v5 = *a2 + 1;
*a2 = v5;
v6 = v4 + 2 * (v3 + 4 * (v3 - 6));
v7 = -1;
if ( v6 >= v3 )
v7 = v6;
v3 = v7;
}
while ( *v5 >= 48 && *v5 <= 57 );
if ( v7 > 0x7FFFFFFF )
v3 = 0;
return *(_QWORD *)(a1 + 8) + 24LL * v3;
}
}