//
// fmt::BasicFormatter::ParseArgIndex from 0x180042db0 to 0x180042e59 (169 bytes)
//
// 5 xrefs:
// > fmt::BasicFormatter::format @ 0x180043be4
// > ??> @ 0x180136e2c
// > ??> @ 0x180136e3c
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b1530
//
// 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, _QWORD *a2)
{
unsigned int v3; // eax
int v4; // ecx
_WORD *v5; // r8
unsigned int v6; // r9d
unsigned int v7; // ecx
unsigned int v9; // eax
if ( (unsigned __int16)(*(_WORD *)*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 = *(unsigned __int16 *)*a2;
v5 = (_WORD *)(*a2 + 2LL);
*a2 = v5;
v6 = v4 + 2 * (v3 + 4 * (v3 - 6));
v7 = -1;
if ( v6 >= v3 )
v7 = v6;
v3 = v7;
}
while ( *v5 >= 0x30u && *v5 <= 0x39u );
if ( v7 > 0x7FFFFFFF )
v3 = 0;
return *(_QWORD *)(a1 + 8) + 24LL * v3;
}
}