//
// xml_string_writer::write from 0xddb6a4 to 0xddb7a4 (256 bytes)
//
// 2 xrefs:
// > ??> @ 0x68c98
// > ??> @ 0x15321a0
//
// 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:06 +0000
//
__int64 __fastcall xml_string_writer::write(xml_string_writer *this, void *a2, size_t a3)
{
char *v4; // x23
char *v5; // x3
__int64 v6; // x2
char *v7; // x1
size_t v8; // x2
unsigned __int64 v10; // x0
__int64 v11; // x22
char *v12; // x0
void *v13; // [xsp+48h] [xbp+48h]
__int64 v14; // [xsp+50h] [xbp+50h] BYREF
size_t v15; // [xsp+58h] [xbp+58h]
void *v16; // [xsp+60h] [xbp+60h]
v4 = (char *)this + 8;
v14 = 0;
v15 = 0;
v16 = nullptr;
if ( a3 > 0x16 )
{
v13 = a2;
v10 = (a3 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v11 = v10 | 1;
v12 = (char *)operator new(v10);
v14 = v11;
a2 = v13;
v5 = v12;
v16 = v12;
v15 = a3;
LABEL_9:
*((_BYTE *)memcpy(v5, a2, a3) + a3) = 0;
LOBYTE(v6) = v14;
if ( (v14 & 1) != 0 )
goto LABEL_4;
goto LABEL_10;
}
LOBYTE(v14) = 2 * a3;
v5 = (char *)&v14 + 1;
if ( a3 )
goto LABEL_9;
BYTE1(v14) = 0;
v6 = 0;
if ( (v14 & 1) != 0 )
{
LABEL_4:
v7 = (char *)v16;
v8 = v15;
goto LABEL_5;
}
LABEL_10:
v8 = (unsigned __int8)v6 >> 1;
v7 = (char *)&v14 + 1;
LABEL_5:
std::string::append((__int64)v4, v7, v8);
if ( (v14 & 1) != 0 )
operator delete(v16);
return _stack_chk_guard;
}