//
// cocos2d::CCFileUtils::createCCArrayWithContentsOfFile from 0x18006e0b0 to 0x18006e1cf (287 bytes)
//
// 4 xrefs:
// > ??> @ 0x180100430
// > ??> @ 0x180101158
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b414c
//
// 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
//
// Hidden C++ exception states: #wind=3
__int64 __fastcall cocos2d::CCFileUtils::createCCArrayWithContentsOfFile(__int64 a1, _QWORD *a2)
{
float v2; // xmm1_4
const char *v3; // rbx
__int64 v4; // rbx
void *v5; // rcx
_BYTE v7[312]; // [rsp+20h] [rbp-138h] BYREF
if ( a2[3] > 0xFu )
a2 = (_QWORD *)*a2;
(*(void (__fastcall **)(__int64, _BYTE *, _QWORD *, _QWORD))(*(_QWORD *)a1 + 40LL))(a1, &v7[8], a2, 0);
sub_18006CBC0((__int64)&v7[48]);
v3 = &v7[8];
if ( *(_QWORD *)&v7[32] > 0xFu )
v3 = *(const char **)&v7[8];
*(_DWORD *)&v7[56] = 2;
pugi::xml_node::xml_node((cocos2d::CCThread *)v7);
if ( cocos2d::CCComponent::serialize((cocos2d::CCComponent *)v7, "UTF-8") )
{
cocos2d::CCSAXParser::setDelegator((cocos2d::CCSAXParser *)v7, (struct cocos2d::CCSAXDelegator *)&v7[48]);
cocos2d::CCSAXParser::parse((cocos2d::CCSAXParser *)v7, v3);
v4 = *(_QWORD *)&v7[200];
cocos2d::CCNode::updateTweenActionInt((cocos2d::CCNode *)v7, v2);
}
else
{
cocos2d::CCNode::updateTweenActionInt((cocos2d::CCNode *)v7, v2);
v4 = 0;
}
sub_18006CF70(&v7[48]);
if ( *(_QWORD *)&v7[32] > 0xFu )
{
v5 = *(void **)&v7[8];
if ( (unsigned __int64)(*(_QWORD *)&v7[32] + 1LL) >= 0x1000 )
{
v5 = *(void **)(*(_QWORD *)&v7[8] - 8LL);
if ( (unsigned __int64)(*(_QWORD *)&v7[8] - (_QWORD)v5 - 8LL) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v5);
}
return v4;
}