//
// fmt::BasicWriter::write_str from 0xdde66c to 0xddeb58 (1260 bytes)
//
// 6 xrefs:
// > fmt::BasicWriter::FormatDouble @ 0xddebf0
// > fmt::BasicWriter::FormatDouble @ 0xddec94
// > fmt::BasicWriter::FormatDouble @ 0xddf0c0
// > fmt::BasicWriter::FormatDouble @ 0xddf190
// > fmt::BasicWriter::write_str @ 0xddf58c
// > ??> @ 0x98b90
//
// 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:07 +0000
//
int32x4_t *__fastcall fmt::BasicWriter::write_str(
unsigned __int64 *a1,
unsigned __int64 a2,
unsigned __int64 a3,
unsigned int *a4)
{
unsigned __int64 v6; // x1
unsigned __int64 v7; // x22
unsigned __int64 v8; // x21
unsigned __int64 v9; // x21
unsigned int v10; // w1
int32x4_t *result; // x0
unsigned int v12; // w20
bool v13; // zf
__int64 v14; // x1
__int64 v15; // x1
unsigned int *v16; // x4
unsigned __int64 v17; // x3
__int64 v18; // x5
int32x4_t v19; // q0
unsigned __int64 v20; // x6
int32x4_t *v21; // x22
unsigned __int64 v22; // x21
unsigned __int64 v23; // x22
unsigned __int64 v24; // x0
unsigned __int8 *v25; // x2
unsigned __int64 v26; // x5
uint8x16_t *v27; // x7
uint32x4_t *v28; // x3
unsigned __int64 v29; // x1
unsigned __int64 v30; // x6
__int64 v31; // x4
uint8x16_t v32; // t1
uint32x4_t *v33; // x10
uint32x4_t *v34; // x9
uint32x4_t *v35; // x8
uint16x8_t v36; // q1
uint16x8_t v37; // q0
unsigned __int8 *v38; // x1
int32x4_t *v39; // x3
unsigned __int64 v40; // x1
unsigned __int64 v41; // x4
__int64 v42; // x5
int32x4_t v43; // q0
int32x4_t *v44; // x7
unsigned __int64 v45; // x6
unsigned int *v46; // x4
unsigned __int8 *v47; // x1
unsigned __int8 *v48; // x2
unsigned __int64 v49; // x1
unsigned __int64 v50; // x3
unsigned __int64 v51; // x4
__int64 v52; // x5
int32x4_t v53; // q0
int32x4_t *v54; // x7
unsigned __int64 v55; // x6
unsigned int *v56; // x4
unsigned __int64 v57; // x5
unsigned __int64 v58; // x1
unsigned int *v59; // x5
unsigned __int64 v60; // x4
__int64 v61; // x6
int32x4_t v62; // q0
unsigned __int64 v63; // x7
int32x4_t *v64; // x21
unsigned int *v65; // [xsp+30h] [xbp+30h]
unsigned __int64 v66; // [xsp+38h] [xbp+38h]
unsigned __int64 v67; // [xsp+38h] [xbp+38h]
v6 = *a4;
if ( v6 > a3 )
{
v7 = *a1;
v8 = v6 + *a1;
if ( v8 > a1[1] )
{
v65 = a4;
v67 = a3;
fmt::internal::Array::grow(a1, v6 + *a1);
*a1 = v8;
a4 = v65;
v9 = a1[2];
a3 = v67;
v10 = v65[2];
result = (int32x4_t *)(v9 + 4 * v7);
v12 = v65[1];
if ( v10 != 2 )
{
LABEL_4:
v13 = v10 == 3;
v14 = *a4;
if ( !v13 )
{
v15 = v14 - a3;
v16 = (unsigned int *)result + a3;
if ( v15 )
{
v17 = ((unsigned __int64)(v15 - 4) >> 2) + 1;
v18 = 4 * v17;
if ( (unsigned __int64)(v15 - 1) <= 2 )
goto LABEL_72;
v19 = vdupq_n_s32(v12);
v20 = 0;
v21 = (int32x4_t *)(v9 + 4 * (v7 + a3));
do
{
*v21++ = v19;
++v20;
}
while ( v20 < v17 );
v13 = v15 == v18;
v16 += 4 * v17;
v15 -= v18;
if ( !v13 )
{
LABEL_72:
*v16 = v12;
if ( v15 != 1 )
{
v16[1] = v12;
if ( v15 != 2 )
v16[2] = v12;
}
}
}
goto LABEL_16;
}
v49 = v14 - a3;
v50 = v49 >> 1;
if ( !(v49 >> 1) )
goto LABEL_59;
v51 = ((v50 - 4) >> 2) + 1;
v52 = 4 * v51;
if ( v50 - 1 <= 2 )
{
v57 = v49 >> 1;
v56 = (unsigned int *)result;
}
else
{
v53 = vdupq_n_s32(v12);
v54 = result;
v55 = 0;
do
{
*v54++ = v53;
++v55;
}
while ( v55 < v51 );
v13 = v50 == v52;
v56 = (unsigned int *)&result[v51];
v57 = v50 - v52;
if ( v13 )
{
LABEL_59:
v58 = v49 - v50;
result = (int32x4_t *)((char *)result + 4 * v50);
v59 = (unsigned int *)result + a3;
if ( v58 )
{
v60 = ((v58 - 4) >> 2) + 1;
v61 = 4 * v60;
if ( v58 - 1 <= 2 )
goto LABEL_73;
v62 = vdupq_n_s32(v12);
v63 = 0;
v64 = (int32x4_t *)(v9 + 4 * (v7 + a3 + v50));
do
{
*v64++ = v62;
++v63;
}
while ( v63 < v60 );
v13 = v58 == v61;
v59 += 4 * v60;
v58 -= v61;
if ( !v13 )
{
LABEL_73:
*v59 = v12;
if ( v58 != 1 )
{
v59[1] = v12;
if ( v58 != 2 )
v59[2] = v12;
}
}
}
goto LABEL_16;
}
}
*v56 = v12;
if ( v57 != 1 )
{
v56[1] = v12;
if ( v57 != 2 )
v56[2] = v12;
}
goto LABEL_59;
}
}
else
{
*a1 = v8;
v9 = a1[2];
v10 = a4[2];
result = (int32x4_t *)(v9 + 4 * v7);
v12 = a4[1];
if ( v10 != 2 )
goto LABEL_4;
}
v40 = *a4 - a3;
if ( !v40 )
goto LABEL_16;
v41 = ((v40 - 4) >> 2) + 1;
v42 = 4 * v41;
if ( v40 - 1 <= 2 )
{
v46 = (unsigned int *)result;
}
else
{
v43 = vdupq_n_s32(v12);
v44 = result;
v45 = 0;
do
{
*v44++ = v43;
++v45;
}
while ( v45 < v41 );
v13 = v40 == v42;
v46 = (unsigned int *)&result[v41];
v40 -= v42;
if ( v13 )
{
LABEL_47:
result = (int32x4_t *)((char *)result + 4 * (*a4 - a3));
goto LABEL_16;
}
}
*v46 = v12;
if ( v40 != 1 )
{
v46[1] = v12;
if ( v40 != 2 )
v46[2] = v12;
}
goto LABEL_47;
}
v22 = *a1;
v23 = *a1 + a3;
if ( v23 > a1[1] )
{
v66 = a3;
fmt::internal::Array::grow(a1, *a1 + a3);
a3 = v66;
}
v24 = a1[2];
*a1 = v23;
result = (int32x4_t *)(v24 + 4 * v22);
LABEL_16:
v25 = (unsigned __int8 *)(a2 + a3);
if ( (unsigned __int8 *)a2 != v25 )
{
v26 = (unsigned __int64)&v25[-a2];
if ( (a2 >= (unsigned __int64)result->n128_u64 + 4 * (_QWORD)&v25[-a2] || result >= (int32x4_t *)v25) && v26 > 0xF )
{
v27 = (uint8x16_t *)a2;
v28 = result;
v29 = ((unsigned __int64)&v25[-a2 - 16] >> 4) + 1;
v30 = 0;
v31 = 16 * v29;
do
{
v32 = *v27++;
v33 = v28;
v34 = v28 + 2;
v35 = v28 + 3;
++v30;
v28 += 4;
v36 = vmovl_u8((uint8x8_t)v32.n128_u64[0]);
v37 = vmovl_high_u8(v32);
*v33 = vmovl_u16((uint16x4_t)v36.n128_u64[0]);
v33[1] = vmovl_high_u16(v36);
*v34 = vmovl_u16((uint16x4_t)v37.n128_u64[0]);
*v35 = vmovl_high_u16(v37);
}
while ( v30 < v29 );
v38 = (unsigned __int8 *)(a2 + v31);
v39 = &result[(unsigned __int64)v31 / 4];
if ( v26 != v31 )
{
result[(unsigned __int64)v31 / 4].n128_u32[0] = *(unsigned __int8 *)(a2 + v31);
if ( v25 != v38 + 1 )
{
v39->n128_u32[1] = v38[1];
if ( v25 != v38 + 2 )
{
v39->n128_u32[2] = v38[2];
if ( v25 != v38 + 3 )
{
v39->n128_u32[3] = v38[3];
if ( v25 != v38 + 4 )
{
v39[1].n128_u32[0] = v38[4];
if ( v25 != v38 + 5 )
{
v39[1].n128_u32[1] = v38[5];
if ( v25 != v38 + 6 )
{
v39[1].n128_u32[2] = v38[6];
if ( v25 != v38 + 7 )
{
v39[1].n128_u32[3] = v38[7];
if ( v25 != v38 + 8 )
{
v39[2].n128_u32[0] = v38[8];
if ( v25 != v38 + 9 )
{
v39[2].n128_u32[1] = v38[9];
if ( v25 != v38 + 10 )
{
v39[2].n128_u32[2] = v38[10];
if ( v25 != v38 + 11 )
{
v39[2].n128_u32[3] = v38[11];
if ( v25 != v38 + 12 )
{
v39[3].n128_u32[0] = v38[12];
if ( v25 != v38 + 13 )
{
v39[3].n128_u32[1] = v38[13];
if ( v25 != v38 + 14 )
v39[3].n128_u32[2] = v38[14];
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
else
{
v47 = nullptr;
v48 = &v25[-a2];
do
{
result->n128_u32[(_QWORD)v47] = v47[a2];
++v47;
}
while ( v47 != v48 );
}
}
return result;
}