//
// sub_18006FB70 from 0x18006fb70 to 0x18006fca5 (309 bytes)
//
// 3 xrefs:
// > sub_18006F980 @ 0x18006fad1
// > sub_18006FB70 @ 0x18006fc41
// > ??> @ 0x1801b41b8
//
// 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
//
struct tinyxml2::XMLElement *__fastcall sub_18006FB70(__int64 a1, tinyxml2::XMLDocument *a2)
{
cocos2d::CCString *v4; // rdi
tinyxml2::XMLNode *v5; // rbx
std::string *CString; // rax
struct tinyxml2::XMLNode *v7; // rax
struct tinyxml2::XMLElement *result; // rax
__int64 v9; // rdi
struct tinyxml2::XMLElement *v10; // rax
unsigned int *v11; // rbx
tinyxml2::XMLNode *v12; // rsi
__int64 v13; // rax
_QWORD *v14; // rbx
_QWORD *i; // rdi
struct tinyxml2::XMLNode *v16; // rax
v4 = (cocos2d::CCString *)_RTDynamicCast(
a1,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::CCString `RTTI Type Descriptor',
0);
if ( v4 )
{
v5 = tinyxml2::XMLDocument::NewElement(a2, "string");
CString = cocos2d::CCString::getCString(v4);
v7 = tinyxml2::XMLDocument::NewText(a2, CString->m_data.m_smallStorage._Elems);
tinyxml2::XMLNode::InsertEndChild(v5, v7);
return v5;
}
else
{
v9 = _RTDynamicCast(a1, 0, &cocos2d::CCObject `RTTI Type Descriptor', &cocos2d::CCArray `RTTI Type Descriptor', 0);
if ( v9 )
{
v10 = tinyxml2::XMLDocument::NewElement(a2, "array");
v11 = *(unsigned int **)(v9 + 56);
v12 = v10;
v13 = *v11;
if ( (_DWORD)v13 )
{
v14 = *((_QWORD **)v11 + 2);
for ( i = &v14[v13 - 1]; v14 <= i; ++v14 )
{
if ( !*v14 )
break;
v16 = (struct tinyxml2::XMLNode *)sub_18006FB70(*v14, a2);
if ( v16 )
tinyxml2::XMLNode::InsertEndChild(v12, v16);
}
}
return v12;
}
else
{
result = (struct tinyxml2::XMLElement *)_RTDynamicCast(
a1,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::CCDictionary `RTTI Type Descriptor',
0);
if ( result )
return sub_18006F980((__int64)result, a2);
}
}
return result;
}