//
// fmt::BasicWriter
::FormatInt from 0xde04a4 to 0xde070c (616 bytes)
//
// 3 xrefs:
// > fmt::BasicFormatter::format @ 0xde0ce0
// > fmt::internal::PrintfParser::Format @ 0xde1ec0
// > ??> @ 0xae6b8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:09:08 +0000
//
__int64 __fastcall fmt::BasicWriter::FormatInt(
size_t *a1,
unsigned __int64 a2,
__int64 a3,
int a4,
int a5,
int a6,
int a7,
int a8,
char a9)
{
size_t v9; // x4
const char *v12; // x2
char v13; // w1
unsigned int v14; // w1
unsigned __int64 v16; // x2
unsigned int v17; // w1
char *v18; // x0
char v19; // w1
unsigned int *v20; // x2
unsigned int v21; // w21
char *v22; // x0
unsigned __int64 v23; // x2
unsigned int v24; // w1
char *v25; // x0
const char *v26; // x2
unsigned __int64 v27; // x1
unsigned __int64 v28; // x2
unsigned int v29; // w1
char *v30; // x0
char v31; // w1
unsigned int v32; // w2
char *v33; // x1
unsigned int v34; // w2
_DWORD v35[2]; // [xsp+30h] [xbp+30h] BYREF
v9 = 0;
v12 = (const char *)*(unsigned int *)(a3 + 12);
v35[0] = 0;
if ( ((unsigned __int8)v12 & 1) != 0 )
{
if ( ((unsigned __int8)v12 & 2) != 0 )
v13 = 43;
else
v13 = 32;
v9 = 1;
LOBYTE(v35[0]) = v13;
}
v14 = *(unsigned __int8 *)(a3 + 20);
if ( v14 == 98 )
{
LABEL_34:
if ( ((unsigned __int8)v12 & 4) != 0 )
{
*((_BYTE *)v35 + (unsigned int)v9) = 48;
v34 = v9 + 1;
v9 = (unsigned int)(v9 + 2);
*((_BYTE *)v35 + v34) = v14;
}
v28 = a2;
v29 = 0;
do
{
v28 >>= 1;
++v29;
}
while ( v28 );
v30 = fmt::BasicWriter::PrepareBufferForInt(a1, v29, (unsigned int *)a3, v35, v9);
do
{
v31 = a2 & 1;
a2 >>= 1;
*v30-- = v31 + 48;
}
while ( a2 );
return _stack_chk_guard;
}
if ( v14 <= 0x62 )
{
if ( v14 != 66 )
{
if ( v14 != 88 )
{
if ( *(_BYTE *)(a3 + 20) )
goto LABEL_11;
LABEL_23:
v20 = (unsigned int *)a3;
v21 = (int)(1233 * (64 - __clz(a2 | 1))) >> 12;
if ( a2 >= fmt::internal::POWERS_OF_10_64[v21] )
++v21;
v22 = fmt::BasicWriter::PrepareBufferForInt(a1, v21, v20, v35, v9);
fmt::internal::FormatDecimal(&v22[1LL - v21], a2, v21);
return _stack_chk_guard;
}
goto LABEL_26;
}
goto LABEL_34;
}
if ( v14 != 111 )
{
if ( v14 != 120 )
{
if ( v14 != 100 )
{
LABEL_11:
fmt::internal::ReportUnknownType((fmt::internal *)*(unsigned __int8 *)(a3 + 20), (char)"integer", v12);
return _stack_chk_guard;
}
goto LABEL_23;
}
LABEL_26:
if ( ((unsigned __int8)v12 & 4) != 0 )
{
*((_BYTE *)v35 + (unsigned int)v9) = 48;
v32 = v9 + 1;
v9 = (unsigned int)(v9 + 2);
*((_BYTE *)v35 + v32) = v14;
}
v23 = a2;
v24 = 0;
do
{
v23 >>= 4;
++v24;
}
while ( v23 );
v25 = fmt::BasicWriter::PrepareBufferForInt(a1, v24, (unsigned int *)a3, v35, v9);
if ( *(_BYTE *)(a3 + 20) == 120 )
v26 = "0123456789abcdef";
else
v26 = "0123456789ABCDEF";
do
{
v27 = a2 & 0xF;
a2 >>= 4;
*v25-- = v26[v27];
}
while ( a2 );
return _stack_chk_guard;
}
if ( ((unsigned __int8)v12 & 4) != 0 )
{
v33 = &a9 + (unsigned int)v9;
v9 = (unsigned int)(v9 + 1);
*(v33 - 16) = 48;
}
v16 = a2;
v17 = 0;
do
{
v16 >>= 3;
++v17;
}
while ( v16 );
v18 = fmt::BasicWriter::PrepareBufferForInt(a1, v17, (unsigned int *)a3, v35, v9);
do
{
v19 = a2 & 7;
a2 >>= 3;
*v18-- = v19 + 48;
}
while ( a2 );
return _stack_chk_guard;
}