//
// pugi::xml_node::insert_attribute_before from 0x812a8c to 0x812b38 (172 bytes)
//
// 1 xrefs:
// > pugi::xml_node::insert_copy_before @ 0x812d1c
//
// 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:38 +0000
//
int *__fastcall pugi::xml_node::insert_attribute_before(
pugi::xml_node *this,
char *a2,
const pugi::xml_attribute *a3,
int a4)
{
int v7; // r1
int *result; // r0
int i; // r3
char *v10; // r0
int v11; // r3
int *v12; // [sp+4h] [bp-Ch] BYREF
_DWORD v13[2]; // [sp+8h] [bp-8h] BYREF
v12 = (int *)a2;
v13[0] = a3;
v13[1] = a4;
if ( pugi::xml_node::type(this) != (int *)((char *)&dword_0 + 2) && pugi::xml_node::type(this) != (_DWORD *)&byte_7 )
goto LABEL_7;
if ( pugi::xml_attribute::empty(a3) )
goto LABEL_7;
for ( i = *(_DWORD *)a3; *(_DWORD *)(*(_DWORD *)(i + 12) + 16); i = *(_DWORD *)(i + 12) )
;
v7 = *(_DWORD *)(*(_DWORD *)this + 28);
if ( i == v7
&& (v10 = sub_8102A8(*(int **)(**(_DWORD **)this & 0xFFFFFFE0), v7, *(_DWORD *)this),
pugi::xml_attribute::xml_attribute(&v12, (int)v10),
!pugi::xml_attribute::operator!(&v12)) )
{
pugi::xml_attribute::set_name(&v12, a2);
result = v12;
v11 = *(_DWORD *)(*(_DWORD *)a3 + 12);
if ( *(_DWORD *)(v11 + 16) )
*(_DWORD *)(v11 + 16) = v12;
else
*(_DWORD *)(*(_DWORD *)this + 28) = v12;
result[3] = *(_DWORD *)(*(_DWORD *)a3 + 12);
result[4] = *(_DWORD *)a3;
*(_DWORD *)(*(_DWORD *)a3 + 12) = result;
}
else
{
LABEL_7:
pugi::xml_attribute::xml_attribute(v13);
return (int *)v13[0];
}
return result;
}