//
// fmt::BasicWriter::FormatInt from 0x81e84c to 0x81e9bc (368 bytes)
//
// 2 xrefs:
// > fmt::BasicFormatter::format @ 0x81eca0
// > fmt::internal::PrintfParser::Format @ 0x81f0e0
//
// 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:48 +0000
//
void __fastcall fmt::BasicWriter::FormatInt(
unsigned int *a1,
fmt::internal *this,
int *a3)
{
unsigned int v4; // r5
int *v5; // r6
int v6; // r3
int v7; // r4
fmt::internal *v8; // r0
int v9; // r9
int v10; // r0
int v11; // r3
char *v12; // r2
unsigned int v13; // r3
int v14; // r1
_DWORD *v15; // r0
const char *v16; // r3
int v17; // r2
int v18; // r3
char *v19; // r2
unsigned int v20; // r3
int v21; // r1
_DWORD *v22; // r0
int v23; // r3
int v24; // r1
char *v25; // r3
unsigned int v26; // r3
_DWORD *v27; // r0
int v28; // r3
_DWORD v29[3]; // [sp+8h] [bp-Ch] BYREF
v4 = (unsigned int)this;
v5 = a3;
v29[0] = 0;
v6 = a3[3];
v7 = v6 & 1;
if ( (v6 & 1) != 0 )
{
v7 = 1;
if ( (v6 & 2) != 0 )
a3 = (_DWORD *)(&word_2A + 1);
else
a3 = &dword_20;
LOBYTE(v29[0]) = (_BYTE)a3;
}
v8 = (fmt::internal *)*((unsigned __int8 *)v5 + 20);
if ( v8 == (fmt::internal *)((char *)&dword_60 + 2) )
{
LABEL_25:
if ( (v6 & 4) != 0 )
{
v18 = v7 + 1;
v19 = (char *)&v29[2] + v7;
v7 += 2;
*(v19 - 8) = 48;
*((_BYTE *)v29 + v18) = (_BYTE)v8;
}
v20 = (unsigned int)this;
v21 = 0;
do
{
v20 >>= 1;
++v21;
}
while ( v20 );
v22 = (_DWORD *)fmt::BasicWriter::PrepareBufferForInt(
a1,
v21,
v5,
(unsigned __int8 *)v29,
v7);
do
{
v23 = v4 & 1;
v4 >>= 1;
*v22-- = v23 + 48;
}
while ( v4 );
return;
}
if ( (unsigned int)v8 <= 0x62 )
{
if ( v8 != (fmt::internal *)((char *)&dword_40 + 2) )
{
if ( v8 != (fmt::internal *)&dword_58 )
{
if ( !*((_BYTE *)v5 + 20) )
goto LABEL_15;
LABEL_39:
fmt::internal::ReportUnknownType(v8, (char)"integer", (const char *)a3);
return;
}
LABEL_16:
if ( (v6 & 4) != 0 )
{
v11 = v7 + 1;
v12 = (char *)&v29[2] + v7;
v7 += 2;
*(v12 - 8) = 48;
*((_BYTE *)v29 + v11) = (_BYTE)v8;
}
v13 = (unsigned int)this;
v14 = 0;
do
{
v13 >>= 4;
++v14;
}
while ( v13 );
v15 = (_DWORD *)fmt::BasicWriter::PrepareBufferForInt(
a1,
v14,
v5,
(unsigned __int8 *)v29,
v7);
if ( *((_BYTE *)v5 + 20) == 120 )
v16 = "0123456789abcdef";
else
v16 = "0123456789ABCDEF";
do
{
v17 = v4 & 0xF;
v4 >>= 4;
*v15-- = (unsigned __int8)v16[v17];
}
while ( v4 );
return;
}
goto LABEL_25;
}
if ( v8 != (fmt::internal *)((char *)&dword_6C + 3) )
{
if ( v8 != (fmt::internal *)&dword_78 )
{
if ( v8 == (fmt::internal *)&dword_64 )
{
LABEL_15:
v9 = fmt::internal::CountDigits((unsigned int)this, (unsigned int)this);
v10 = fmt::BasicWriter::PrepareBufferForInt(a1, v9, v5, (unsigned __int8 *)v29, v7);
fmt::internal::FormatDecimal(v10 + 4 - 4 * v9, v4, v9);
return;
}
goto LABEL_39;
}
goto LABEL_16;
}
v24 = 0;
if ( (v6 & 4) != 0 )
{
v25 = (char *)&v29[2] + v7++;
*(v25 - 8) = 48;
}
v26 = v4;
do
{
v26 >>= 3;
++v24;
}
while ( v26 );
v27 = (_DWORD *)fmt::BasicWriter::PrepareBufferForInt(
a1,
v24,
v5,
(unsigned __int8 *)v29,
v7);
do
{
v28 = v4 & 7;
v4 >>= 3;
*v27-- = v28 + 48;
}
while ( v4 );
}