//
// pugi::xml_node::prepend_attribute from 0xdc81b4 to 0xdc82ec (312 bytes)
//
// 2 xrefs:
// > pugi::xml_node::prepend_copy @ 0xdc86fc
// > ??> @ 0x73a08
//
// 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:08:53 +0000
//
__int64 *__fastcall pugi::xml_node::prepend_attribute(pugi::xml_node *this, char *a2)
{
__int64 *result; // x0
__int64 *v5; // x0
__int64 v6; // x2
__int64 v7; // x1
_QWORD *v8; // x1
__int64 v9; // x1
__int64 *v10; // [xsp+38h] [xbp+38h] BYREF
__int64 v11; // [xsp+40h] [xbp+40h] BYREF
if ( (unsigned int)pugi::xml_node::type(this) != 2 && (unsigned int)pugi::xml_node::type(this) != 7 )
goto LABEL_3;
v5 = *(__int64 **)(**(_QWORD **)this & 0xFFFFFFFFFFFFFFE0LL);
v6 = v5[1];
if ( (unsigned __int64)(v6 + 40) > 0x8000 )
{
v8 = sub_DBE65C((__int64)v5, 0x28u, &v11);
}
else
{
v7 = *v5;
v5[1] = v6 + 40;
v11 = v7;
v8 = (_QWORD *)(v7 + v6 + 48);
}
if ( v8 )
{
*v8 = v11;
v8[1] = 0;
v8[2] = 0;
v8[3] = 0;
v8[4] = 0;
}
pugi::xml_attribute::xml_attribute(&v10, (__int64)v8);
if ( !pugi::xml_attribute::operator!(&v10) )
{
pugi::xml_attribute::set_name(&v10, a2);
v9 = *(_QWORD *)(*(_QWORD *)this + 56LL);
result = v10;
if ( v9 )
{
v10[3] = *(_QWORD *)(v9 + 24);
*(_QWORD *)(v9 + 24) = result;
}
else
{
v10[3] = (__int64)v10;
}
result[4] = v9;
*(_QWORD *)(*(_QWORD *)this + 56LL) = result;
}
else
{
LABEL_3:
pugi::xml_attribute::xml_attribute(&v11);
return (__int64 *)v11;
}
return result;
}