//
// fmt::BasicWriter::write_str from 0xdde100 to 0xdde494 (916 bytes)
//
// 3 xrefs:
// > fmt::BasicFormatter::format @ 0xde50f8
// > fmt::internal::PrintfParser::Format @ 0xde5e18
// > ??> @ 0xac6f0
//
// 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, __int64 a2, unsigned int *a3)
{
fmt::internal *v5; // x0
size_t v6; // x19
const wchar_t *v7; // x24
__int64 v8; // x25
size_t v9; // x23
size_t v10; // x0
unsigned __int64 v11; // x22
unsigned __int64 v12; // x21
__int64 v13; // x3
unsigned __int64 v14; // x5
unsigned int v15; // w1
int32x4_t *result; // x0
unsigned int v17; // w4
bool v18; // zf
__int64 v19; // x1
size_t v20; // x19
unsigned int *v21; // x2
unsigned __int64 v22; // x1
__int64 v23; // x6
int32x4_t v24; // q0
int32x4_t *v25; // x3
unsigned __int64 v26; // x5
unsigned __int64 v27; // x21
unsigned __int64 v28; // x19
unsigned __int64 v29; // x0
size_t v30; // x0
size_t v31; // x1
unsigned __int64 v32; // x3
__int64 v33; // x5
int32x4_t v34; // q0
int32x4_t *v35; // x7
unsigned __int64 v36; // x6
unsigned int *v37; // x3
size_t v38; // x19
size_t v39; // x1
unsigned __int64 v40; // x2
__int64 v41; // x3
int32x4_t v42; // q0
int32x4_t *v43; // x7
unsigned __int64 v44; // x6
unsigned int *v45; // x2
size_t v46; // x3
__int64 v47; // x19
unsigned int *v48; // x3
unsigned __int64 v49; // x2
__int64 v50; // x6
size_t v51; // x22
int32x4_t v52; // q0
unsigned __int64 v53; // x1
int32x4_t *v54; // x22
unsigned int *v55; // [xsp+58h] [xbp+58h]
unsigned int *v56; // [xsp+58h] [xbp+58h]
unsigned int *v57; // [xsp+58h] [xbp+58h]
v5 = (fmt::internal *)*((unsigned __int8 *)a3 + 20);
if ( (_DWORD)v5 == 115 || !*((_BYTE *)a3 + 20) )
{
v6 = *(_QWORD *)(a2 + 8);
v7 = *(const wchar_t **)a2;
if ( !v6 )
goto LABEL_4;
LABEL_21:
v10 = *a3;
v9 = 4 * v6;
v8 = (__int64)(4 * v6) >> 2;
if ( v6 < v10 )
goto LABEL_7;
goto LABEL_22;
}
v55 = a3;
fmt::internal::ReportUnknownType(v5, (char)"string", (const char *)a3);
v6 = *(_QWORD *)(a2 + 8);
a3 = v55;
v7 = *(const wchar_t **)a2;
if ( v6 )
goto LABEL_21;
LABEL_4:
if ( *v7 )
{
v56 = a3;
v30 = wcslen(v7);
v9 = 4 * v30;
v6 = v30;
v8 = (__int64)(4 * v30) >> 2;
a3 = v56;
}
else
{
v8 = 0;
v9 = 0;
}
v10 = *a3;
if ( v6 < v10 )
{
LABEL_7:
v11 = *a1;
v12 = v10 + *a1;
if ( v12 > a1[1] )
{
v57 = a3;
fmt::internal::Array::grow(a1, v12);
*a1 = v12;
a3 = v57;
v13 = 4 * v11;
v14 = a1[2];
v15 = v57[2];
result = (int32x4_t *)(v14 + 4 * v11);
v17 = v57[1];
if ( v15 != 2 )
{
LABEL_9:
v18 = v15 == 3;
v19 = *a3;
if ( !v18 )
{
v20 = v19 - v6;
v21 = (unsigned int *)((char *)result + v9);
if ( v20 )
{
v22 = ((v20 - 4) >> 2) + 1;
v23 = 4 * v22;
if ( v20 - 1 <= 2 )
goto LABEL_15;
v24 = vdupq_n_s32(v17);
v25 = (int32x4_t *)(v14 + v13 + v9);
v26 = 0;
do
{
*v25++ = v24;
++v26;
}
while ( v26 < v22 );
v18 = v20 == v23;
v21 += 4 * v22;
v20 -= v23;
if ( !v18 )
{
LABEL_15:
*v21 = v17;
if ( v20 != 1 )
{
v21[1] = v17;
if ( v20 != 2 )
v21[2] = v17;
}
}
}
goto LABEL_18;
}
v38 = v19 - v6;
v39 = v38 >> 1;
if ( v38 >> 1 )
{
v40 = ((v39 - 4) >> 2) + 1;
v41 = 4 * v40;
if ( v39 - 1 <= 2 )
{
v46 = v38 >> 1;
v45 = (unsigned int *)result;
goto LABEL_42;
}
v42 = vdupq_n_s32(v17);
v43 = result;
v44 = 0;
do
{
*v43++ = v42;
++v44;
}
while ( v44 < v40 );
v18 = v39 == v41;
v45 = (unsigned int *)&result[v40];
v46 = v39 - v41;
if ( !v18 )
{
LABEL_42:
*v45 = v17;
if ( v46 != 1 )
{
v45[1] = v17;
if ( v46 != 2 )
v45[2] = v17;
}
}
}
v47 = v38 - v39;
result = (int32x4_t *)((char *)result + 4 * v39);
v48 = (unsigned int *)((char *)result + v9);
if ( v47 )
{
v49 = ((unsigned __int64)(v47 - 4) >> 2) + 1;
v50 = 4 * v49;
if ( (unsigned __int64)(v47 - 1) <= 2 )
goto LABEL_58;
v51 = v39 + v11;
v52 = vdupq_n_s32(v17);
v53 = 0;
v54 = (int32x4_t *)(v14 + v9 + 4 * v51);
do
{
*v54++ = v52;
++v53;
}
while ( v53 < v49 );
v18 = v47 == v50;
v48 += 4 * v49;
v47 -= v50;
if ( !v18 )
{
LABEL_58:
*v48 = v17;
if ( v47 != 1 )
{
v48[1] = v17;
if ( v47 != 2 )
v48[2] = v17;
}
}
}
LABEL_18:
if ( !v8 )
return result;
return (int32x4_t *)memmove(result, v7, v9);
}
}
else
{
*a1 = v12;
v13 = 4 * v11;
v14 = a1[2];
v15 = a3[2];
result = (int32x4_t *)(v14 + 4 * v11);
v17 = a3[1];
if ( v15 != 2 )
goto LABEL_9;
}
v31 = *a3 - v6;
if ( !v31 )
goto LABEL_18;
v32 = ((v31 - 4) >> 2) + 1;
v33 = 4 * v32;
if ( v31 - 1 <= 2 )
{
v37 = (unsigned int *)result;
}
else
{
v34 = vdupq_n_s32(v17);
v35 = result;
v36 = 0;
do
{
*v35++ = v34;
++v36;
}
while ( v36 < v32 );
v18 = v31 == v33;
v37 = (unsigned int *)&result[v32];
v31 -= v33;
if ( v18 )
{
LABEL_36:
result = (int32x4_t *)((char *)result + 4 * (*a3 - v6));
goto LABEL_18;
}
}
*v37 = v17;
if ( v31 != 1 )
{
v37[1] = v17;
if ( v31 != 2 )
v37[2] = v17;
}
goto LABEL_36;
}
LABEL_22:
v27 = *a1;
v28 = v6 + *a1;
if ( v28 > a1[1] )
fmt::internal::Array::grow(a1, v28);
v29 = a1[2];
*a1 = v28;
result = (int32x4_t *)(v29 + 4 * v27);
if ( v8 )
return (int32x4_t *)memmove(result, v7, v9);
return result;
}