//
// pugi::xml_node::insert_attribute_after from 0x603468 to 0x60350c (164 bytes)
//
// 1 xrefs:
// > pugi::xml_node::insert_copy_after @ 0x6035e8
//
// 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
//
pugi::xml_attribute_struct *__fastcall pugi::xml_node::insert_attribute_after(
pugi::xml_node *this,
pugi::xml_attribute_struct *a2,
pugi::xml_attribute *a3,
pugi::xml_attribute_struct *a4)
{
unsigned int v7; // r1
pugi::xml_attribute_struct *result; // r0
pugi::xml_attribute_struct *i; // r3
_DWORD *v10; // r0
pugi::xml_attribute_struct *attr; // r3
pugi::xml_attribute *v12; // r2
pugi::xml_attribute v13; // [sp+4h] [bp-Ch] BYREF
pugi::xml_attribute v14[2]; // [sp+8h] [bp-8h] BYREF
v13._attr = a2;
v14[0]._attr = (pugi::xml_attribute_struct *)a3;
v14[1]._attr = a4;
if ( pugi::xml_node::type(this) != (pugi::xml_node_struct *)((char *)&dword_0 + 2)
&& pugi::xml_node::type(this) != (pugi::xml_node_struct *)&byte_7 )
{
goto LABEL_7;
}
if ( pugi::xml_attribute::empty(a3) )
goto LABEL_7;
for ( i = a3->_attr; *(_DWORD *)(*((_DWORD *)i + 3) + 16); i = *((pugi::xml_attribute_struct **)i + 3) )
;
v7 = *((_DWORD *)this->_root + 7);
if ( i == (pugi::xml_attribute_struct *)v7
&& (v10 = sub_600CE4(*(unsigned int **)(*(_DWORD *)this->_root & 0xFFFFFFE0), v7, (unsigned int)this->_root),
pugi::xml_attribute::xml_attribute(&v13, (int)v10),
!pugi::xml_attribute::operator!(&v13)) )
{
pugi::xml_attribute::set_name(&v13, (char *)a2);
attr = a3->_attr;
result = v13._attr;
v12 = *((pugi::xml_attribute **)a3->_attr + 4);
if ( v12 )
v12[3]._attr = v13._attr;
else
*(pugi::xml_attribute *)(*((_DWORD *)this->_root + 7) + 12) = v13;
*((_DWORD *)result + 4) = v12;
*((_DWORD *)result + 3) = attr;
*((_DWORD *)attr + 4) = result;
}
else
{
LABEL_7:
pugi::xml_attribute::xml_attribute(v14);
return v14[0]._attr;
}
return result;
}