//
// xml_string_writer::write from 0xb4bf60 to 0xb4c024 (196 bytes)
//
// 2 xrefs:
// > ??> @ 0x4a5c8
// > ??> @ 0x121bef0
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall xml_string_writer::write(xml_string_writer *this, const void *a2, __int64 a3)
{
void *v4; // x0
unsigned int *v6; // x2
int v7; // w1
_BYTE v8[8]; // [xsp+30h] [xbp+30h] BYREF
__int64 v9; // [xsp+40h] [xbp+40h] BYREF
sub_D1527C(&v9, a2, a3, v8);
sub_D15E14((char *)this + 8, &v9);
v4 = (void *)(v9 - 24);
if ( (__int64 *)(v9 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v6 = (unsigned int *)(v9 - 8);
do
v7 = __ldaxr(v6);
while ( __stlxr(v7 - 1, v6) );
}
else
{
v7 = *(_DWORD *)(v9 - 8);
*(_DWORD *)(v9 - 8) = v7 - 1;
}
if ( v7 <= 0 )
operator delete(v4);
}
return _stack_chk_guard;
}