//
// fmt::internal::PrintfParser::HandleArgIndex from 0xb674d8 to 0xb67598 (192 bytes)
//
// 4 xrefs:
// > fmt::internal::PrintfParser::Format @ 0xb6a964
// > fmt::internal::PrintfParser::Format @ 0xb6a9f4
// > fmt::internal::PrintfParser::Format @ 0xb6ad6c
// > ??> @ 0x5acc0
//
// 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
//
void *__fastcall fmt::internal::PrintfParser::HandleArgIndex(__int64 a1, unsigned __int64 a2, _QWORD *a3)
{
if ( (_DWORD)a2 == -1 )
{
LODWORD(a2) = *(_DWORD *)(a1 + 16);
if ( (a2 & 0x80000000) != 0 )
{
a2 = 0xFFFFFFFFLL;
if ( !*a3 )
*a3 = "cannot switch from manual to automatic argument indexing";
LABEL_5:
if ( *(_QWORD *)(a1 + 8) <= a2 )
return &unk_F1F960;
return (void *)(*(_QWORD *)a1 + 32 * a2);
}
*(_DWORD *)(a1 + 16) = a2 + 1;
}
else
{
if ( *(int *)(a1 + 16) > 0 )
{
a2 = (unsigned int)a2;
if ( !*a3 )
*a3 = "cannot switch from automatic to manual argument indexing";
goto LABEL_5;
}
LODWORD(a2) = a2 - 1;
*(_DWORD *)(a1 + 16) = -1;
}
a2 = (unsigned int)a2;
if ( (unsigned __int64)(unsigned int)a2 < *(_QWORD *)(a1 + 8) )
return (void *)(*(_QWORD *)a1 + 32 * a2);
if ( *a3 )
return &unk_F1F960;
*a3 = "argument index is out of range in format";
return &unk_F1F960;
}