//
// fmt::BasicFormatter::format from 0x81d3d0 to 0x81d6c6 (758 bytes)
//
// 1 xrefs:
// > fmt::BasicFormatter::Format @ 0x81d75c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:01:47 +0000
//
char *__fastcall fmt::BasicFormatter::format(int a1, char *a2, int a3)
{
char *v6; // r1
int v7; // r3
char *v8; // r0
int v9; // r2
int v10; // t1
int v12; // r0
unsigned __int8 *v13; // r1
char *v14; // r2
unsigned __int8 *v15; // r12
unsigned int v16; // r7
int v17; // r3
int v18; // r3
int v19; // r3
char *v20; // r3
int v21; // r2
_DWORD *v22; // r0
__int64 v23; // r2
char *v24; // r3
char *v25; // r2
unsigned __int8 v26; // r7
unsigned int v27; // r0
_BYTE *v28; // r4
unsigned int v29; // r0
unsigned int *v30; // r0
_DWORD *v31; // r1
char *v32; // [sp+Ch] [bp-30h] BYREF
int v33; // [sp+10h] [bp-2Ch] BYREF
_DWORD v34[2]; // [sp+14h] [bp-28h] BYREF
unsigned int v35; // [sp+1Ch] [bp-20h] BYREF
int v36; // [sp+20h] [bp-1Ch]
int v37; // [sp+24h] [bp-18h]
int v38; // [sp+28h] [bp-14h]
int v39; // [sp+2Ch] [bp-10h]
fmt::internal *v40; // [sp+30h] [bp-Ch]
v32 = a2;
v36 = 32;
v39 = -1;
v33 = 0;
v35 = 0;
v37 = 0;
v38 = 0;
LOBYTE(v40) = 0;
if ( *a2 != 58 )
{
LABEL_52:
v25 = v32;
*(_DWORD *)(a1 + 16) = v32;
switch ( *(_DWORD *)a3 )
{
case 0:
fmt::BasicWriter::FormatInt(*(unsigned int **)a1, *(_DWORD *)(a3 + 8), (int)&v35);
return v32;
case 1:
goto LABEL_80;
case 2:
fmt::BasicWriter::FormatInt(
*(unsigned int **)a1,
*(_QWORD *)(a3 + 8),
(int)&v35);
return v32;
case 3:
fmt::BasicWriter::FormatInt(
*(unsigned int **)a1,
*(_QWORD *)(a3 + 8),
(int)&v35);
return v32;
case 4:
fmt::BasicWriter::FormatDouble(*(unsigned int **)a1, *(double *)(a3 + 8), (int)&v35);
return v32;
case 5:
fmt::BasicWriter::FormatDouble(*(unsigned int **)a1, *(double *)(a3 + 8), (int)&v35);
return v32;
case 6:
if ( (_BYTE)v40 && (unsigned __int8)v40 != 99 )
fmt::internal::ReportUnknownType((fmt::internal *)(unsigned __int8)v40, (char)"char", v25);
if ( v35 <= 1 )
{
v29 = fmt::BasicWriter::GrowBuffer(*(unsigned int **)a1, 1);
}
else
{
v26 = v36;
v27 = fmt::BasicWriter::GrowBuffer(*(unsigned int **)a1, v35);
v28 = (_BYTE *)v27;
if ( v37 == 2 )
{
if ( v35 != 1 )
memset((void *)v27, v26, v35 - 1);
v28 += v35 - 1;
goto LABEL_72;
}
if ( v37 != 3 )
{
if ( v35 != 1 )
memset((void *)(v27 + 1), v26, v35 - 1);
LABEL_72:
*v28 = *(_DWORD *)(a3 + 8);
return v32;
}
v29 = (unsigned int)fmt::BasicWriter::FillPadding((char *)v27, v35, 1, v26);
}
v28 = (_BYTE *)v29;
goto LABEL_72;
case 7:
v30 = *(unsigned int **)a1;
v31 = (_DWORD *)(a3 + 8);
goto LABEL_75;
case 8:
v30 = *(unsigned int **)a1;
v31 = v34;
v34[0] = &unk_B6B226;
v34[1] = 0;
LABEL_75:
fmt::BasicWriter::write_str(v30, (int)v31, (int)&v35);
return v32;
case 9:
if ( (_BYTE)v40 && (unsigned __int8)v40 != 112 )
fmt::internal::ReportUnknownType((fmt::internal *)(unsigned __int8)v40, (char)"pointer", v25);
v38 = 4;
LOBYTE(v40) = 120;
LABEL_80:
fmt::BasicWriter::FormatInt(
*(unsigned int **)a1,
*(fmt::internal **)(a3 + 8),
(int *)&v35);
return v32;
case 0xA:
(*(void (__fastcall **)(int, _DWORD, char *))(a3 + 12))(a1, *(_DWORD *)(a3 + 8), v25 - 1);
return v32;
default:
return v32;
}
}
if ( *(_DWORD *)a3 != 10 )
{
v12 = (unsigned __int8)a2[1];
v13 = (unsigned __int8 *)(a2 + 1);
v32 = a2 + 1;
if ( v12 )
{
v14 = a2 + 2;
while ( 1 )
{
v15 = (unsigned __int8 *)v14--;
v16 = *v15;
if ( v16 == 61 )
{
v37 = 4;
}
else if ( v16 > 0x3D )
{
if ( v16 == 62 )
{
v37 = 2;
}
else if ( v16 == 94 )
{
v37 = 3;
}
}
else if ( v16 == 60 )
{
v37 = 1;
}
if ( v37 )
break;
if ( v13 > (unsigned __int8 *)v14 )
goto LABEL_27;
}
if ( v15 == v13 )
{
v32 = a2 + 2;
}
else if ( v12 != 125 )
{
v36 = v12;
v32 = a2 + 3;
}
}
LABEL_27:
v17 = (unsigned __int8)*v32;
if ( v17 != 43 )
{
if ( v17 == 45 )
{
fmt::BasicFormatter::CheckSign(a1, &v32, a3);
}
else if ( v17 == 32 )
{
fmt::BasicFormatter::CheckSign(a1, &v32, a3);
v18 = v38 | 1;
LABEL_33:
v38 = v18;
}
if ( *v32 == 35 )
{
++v32;
v38 |= 4u;
}
v19 = (unsigned __int8)*v32;
if ( (unsigned int)(v19 - 48) <= 9 )
{
if ( v19 == 48 )
{
v36 = 48;
v37 = 4;
}
v35 = sub_81B86C(&v32, &v33);
}
v20 = v32;
if ( *v32 == 46 )
{
++v32;
v39 = 0;
v21 = (unsigned __int8)v20[1];
if ( (unsigned int)(v21 - 48) > 9 )
{
if ( v21 == 123 )
{
v32 = v20 + 2;
++*(_DWORD *)(a1 + 20);
v22 = (_DWORD *)fmt::BasicFormatter::ParseArgIndex(a1, &v32, 123);
switch ( *v22 )
{
case 0:
case 1:
LODWORD(v23) = v22[2];
break;
case 2:
case 3:
v23 = *((_QWORD *)v22 + 1);
break;
default:
LODWORD(v23) = 0;
break;
}
HIDWORD(v23) = *(_DWORD *)(a1 + 20);
v39 = v23;
*(_DWORD *)(a1 + 20) = HIDWORD(v23) - 1;
}
}
else
{
v39 = sub_81B86C(&v32, &v33);
}
}
v24 = v32;
if ( *v32 != 125 && *v32 )
{
++v32;
LOBYTE(v40) = *v24;
}
goto LABEL_52;
}
fmt::BasicFormatter::CheckSign(a1, &v32, a3);
v18 = v38 | 3;
goto LABEL_33;
}
(*(void (__fastcall **)(int, _DWORD, char *))(a3 + 12))(a1, *(_DWORD *)(a3 + 8), a2);
v6 = v32;
v7 = 1;
while ( 1 )
{
v8 = v6;
v10 = (unsigned __int8)*v6++;
v9 = v10;
if ( !v10 )
break;
if ( v9 == 123 )
{
++v7;
}
else if ( v9 == 125 && !--v7 )
{
return v8 + 1;
}
}
return v8 + 1;
}