//
// pugi::xml_writer_stream::write from 0x81ab7c to 0x81ac62 (230 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:01:45 +0000
//
int __fastcall pugi::xml_writer_stream::write(pugi::xml_writer_stream *this, const void *a2, unsigned int a3)
{
_DWORD *v4; // r4
char *v6; // r3
_DWORD *v7; // r0
int v8; // r0
_DWORD *v10; // r6
char *v11; // r3
_DWORD *v12; // r0
unsigned int v13; // r5
int v14; // r0
char v15[4]; // [sp+4h] [bp-10h] BYREF
_DWORD *v16; // [sp+8h] [bp-Ch]
v4 = *((_DWORD **)this + 1);
if ( v4 )
{
v16 = *((_DWORD **)this + 1);
v15[0] = 0;
v6 = (char *)v4 + *(_DWORD *)(*v4 - 12);
if ( !*((_DWORD *)v6 + 4) )
{
v7 = *((_DWORD **)v6 + 18);
if ( v7 )
std::ostream::flush(v7);
v15[0] = 1;
}
if ( v15[0] && a3 )
{
v8 = *(_DWORD *)((char *)v4 + *(_DWORD *)(*v4 - 12) + 24);
if ( (*(int (__fastcall **)(int, const void *, unsigned int))(*(_DWORD *)v8 + 48))(v8, a2, a3) != a3 )
std::ios_base::clear(
(std::ios_base *)((char *)v4 + *(_DWORD *)(*v4 - 12)),
*(_DWORD *)((char *)v4 + *(_DWORD *)(*v4 - 12) + 16) | 1);
}
return std::ostream::sentry::~sentry((int)v15);
}
else
{
v10 = *((_DWORD **)this + 2);
v15[0] = 0;
v16 = v10;
v11 = (char *)v10 + *(_DWORD *)(*v10 - 12);
if ( !*((_DWORD *)v11 + 4) )
{
v12 = *((_DWORD **)v11 + 18);
if ( v12 )
std::wostream::flush(v12);
v15[0] = 1;
}
if ( v15[0] )
{
v13 = a3 >> 2;
if ( v13 )
{
v14 = *(_DWORD *)((char *)v10 + *(_DWORD *)(*v10 - 12) + 24);
if ( (*(int (__fastcall **)(int, const void *, unsigned int))(*(_DWORD *)v14 + 48))(v14, a2, v13) != v13 )
std::ios_base::clear(
(std::ios_base *)((char *)v10 + *(_DWORD *)(*v10 - 12)),
*(_DWORD *)((char *)v10 + *(_DWORD *)(*v10 - 12) + 16) | 1);
}
}
return std::wostream::sentry::~sentry((int)v15);
}
}