//
// sub_602054 from 0x602054 to 0x6020b2 (94 bytes)
//
// 2 xrefs:
// > sub_6020B8 @ 0x6020e2
// > pugi::xml_node::remove_attribute @ 0x603c34
//
// 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_602054(_DWORD *result, _DWORD *a2)
{
_DWORD *v2; // r6
int v3; // r4
int v5; // r1
int v6; // r2
int v7; // r2
int v8; // r1
v2 = result;
v3 = *result;
if ( (*result & 0x10) != 0 )
result = sub_602004(a2, result[1]);
if ( (v3 & 8) != 0 )
result = sub_602004(a2, v2[2]);
if ( (v3 & 0xFFFFFFE0) == *a2 )
*(_DWORD *)((char *)&word_10 + (v3 & 0xFFFFFFE0)) = a2[1];
v5 = *(_DWORD *)((char *)&word_10 + (v3 & 0xFFFFFFE0));
v6 = *(int *)((char *)&dword_14 + (v3 & 0xFFFFFFE0)) + 20;
*(int *)((char *)&dword_14 + (v3 & 0xFFFFFFE0)) = v6;
if ( v6 == v5 )
{
v7 = *(_DWORD *)&byte_9[(v3 & 0xFFFFFFE0) + 3];
if ( v7 )
{
v8 = *(_DWORD *)&byte_8[v3 & 0xFFFFFFE0];
*(_DWORD *)(v8 + 12) = v7;
*(_DWORD *)(*(_DWORD *)&byte_9[(v3 & 0xFFFFFFE0) + 3] + 8) = v8;
return (_DWORD *)off_ABAE70(*(_DWORD *)&byte_4[v3 & 0xFFFFFFE0]);
}
else
{
*(int *)((char *)&dword_14 + (v3 & 0xFFFFFFE0)) = 0;
*(_DWORD *)((char *)&word_10 + (v3 & 0xFFFFFFE0)) = 0;
a2[1] = 0;
}
}
return result;
}