//
// sub_602224 from 0x602224 to 0x602280 (92 bytes)
//
// 4 xrefs:
// > sub_602284 @ 0x60228c
// > pugi::xml_node::prepend_child @ 0x603840
// > pugi::xml_node::insert_child_before @ 0x6038da
// > pugi::xml_node::insert_child_after @ 0x60397a
//
// 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
//
_DWORD *__fastcall sub_602224(unsigned int *a1, unsigned int a2)
{
unsigned int v4; // r3
_DWORD *result; // r0
unsigned int v6; // r0
unsigned int v7[2]; // [sp+0h] [bp-8h] BYREF
v7[0] = (unsigned int)a1;
v7[1] = a2;
v4 = a1[1];
if ( v4 + 32 <= 0x8000 )
{
v6 = *a1;
a1[1] = v4 + 32;
v7[0] = v6;
result = (_DWORD *)(v6 + v4 + 24);
}
else
{
result = (_DWORD *)sub_600C68((int)a1, 0x20u, v7);
}
if ( result )
{
*result = (a2 - 1) | v7[0];
result[1] = 0;
result[2] = 0;
result[3] = 0;
result[4] = 0;
result[5] = 0;
result[6] = 0;
result[7] = 0;
}
return result;
}