//
// fmt::internal::PrintfParser::HandleArgIndex from 0x180042c80 to 0x180042cf2 (114 bytes)
//
// 1 xrefs:
// > ??> @ 0x1801438a8
//
// 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
//
// Alternative name is '?HandleArgIndex@?$PrintfParser@D@internal@fmt@@AEAAAEBUArg@23@IAEAPEBD@Z'
void *__fastcall fmt::internal::PrintfParser::HandleArgIndex(__int64 a1, unsigned int a2, const char **a3)
{
int v3; // eax
const char *v4; // rax
v3 = *(_DWORD *)(a1 + 16);
if ( a2 == -1 )
{
if ( v3 >= 0 )
{
a2 = *(_DWORD *)(a1 + 16);
*(_DWORD *)(a1 + 16) = v3 + 1;
goto LABEL_11;
}
if ( !*a3 )
{
v4 = "cannot switch from manual to automatic argument indexing";
goto LABEL_10;
}
}
else
{
if ( v3 <= 0 )
{
*(_DWORD *)(a1 + 16) = -1;
--a2;
goto LABEL_11;
}
if ( !*a3 )
{
v4 = "cannot switch from automatic to manual argument indexing";
LABEL_10:
*a3 = v4;
}
}
LABEL_11:
if ( (unsigned __int64)a2 < *(_QWORD *)(a1 + 8) )
return (void *)(*(_QWORD *)a1 + 24LL * a2);
if ( !*a3 )
*a3 = "argument index is out of range in format";
return &unk_1800EAB38;
}