//
// cocos2d::CCFileUtilsMac::createCCArrayWithContentsOfFile from 0x10060ceb0 to 0x10060d0ca (538 bytes)
//
// 1 xrefs:
// > ??> @ 0x100980628
//
// 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
//
void *__fastcall cocos2d::CCFileUtilsMac::createCCArrayWithContentsOfFile(__int64 a1, __int64 a2)
{
__int64 v3; // rsi
__int64 v4; // rbx
cocos2d::CCFileUtils *v5; // r15
NSString *v6; // rax
NSArray *v7; // r14
void *v8; // rbx
id v9; // r15
__int64 v10; // r12
void *i; // r13
__int128 v13; // [rsp+0h] [rbp-110h] BYREF
__int128 v14; // [rsp+10h] [rbp-100h]
__int128 v15; // [rsp+20h] [rbp-F0h]
__int128 v16; // [rsp+30h] [rbp-E0h]
char v17; // [rsp+48h] [rbp-C8h] BYREF
char v18[15]; // [rsp+49h] [rbp-C7h] BYREF
void *__p; // [rsp+58h] [rbp-B8h]
_BYTE v20[128]; // [rsp+60h] [rbp-B0h] BYREF
v3 = qword_1009A4FA0;
if ( qword_1009A4FA0 )
{
if ( (*(_BYTE *)a2 & 1) != 0 )
{
LABEL_3:
v4 = *(_QWORD *)(a2 + 16);
goto LABEL_6;
}
}
else
{
v5 = (cocos2d::CCFileUtils *)operator new(0x88u);
*(_OWORD *)&v5->__vftable = 0;
*(_OWORD *)&v5[2].__vftable = 0;
*(_OWORD *)&v5[4].__vftable = 0;
*(_OWORD *)&v5[6].__vftable = 0;
*(_OWORD *)&v5[8].__vftable = 0;
*(_OWORD *)&v5[10].__vftable = 0;
*(_OWORD *)&v5[12].__vftable = 0;
*(_OWORD *)&v5[14].__vftable = 0;
v5[16].__vftable = nullptr;
cocos2d::CCFileUtils::CCFileUtils((__int64)v5);
v5->__vftable = (cocos2d::CCFileUtils_vtbl *)off_100980528;
qword_1009A4FA0 = (__int64)v5;
cocos2d::CCFileUtils::init(v5);
v3 = qword_1009A4FA0;
if ( (*(_BYTE *)a2 & 1) != 0 )
goto LABEL_3;
}
v4 = a2 + 1;
LABEL_6:
(*(void (__fastcall **)(char *, __int64, __int64, _QWORD))(*(_QWORD *)v3 + 48LL))(&v17, v3, v4, 0);
if ( (v17 & 1) != 0 )
v6 = +[NSString stringWithUTF8String:](&OBJC_CLASS___NSString, "stringWithUTF8String:", __p);
else
v6 = +[NSString stringWithUTF8String:](&OBJC_CLASS___NSString, "stringWithUTF8String:", v18);
v7 = +[NSArray arrayWithContentsOfFile:](&OBJC_CLASS___NSArray, "arrayWithContentsOfFile:", v6);
v8 = operator new(0x40u);
sub_10071F890(v8);
v16 = 0;
v15 = 0;
v14 = 0;
v13 = 0;
v9 = -[NSArray countByEnumeratingWithState:objects:count:](
v7,
"countByEnumeratingWithState:objects:count:",
&v13,
v20,
16);
if ( v9 )
{
v10 = *(_QWORD *)v14;
do
{
for ( i = nullptr; i != v9; i = (char *)i + 1 )
{
if ( *(_QWORD *)v14 != v10 )
objc_enumerationMutation(v7);
sub_10060D130(*(id *)(*((_QWORD *)&v13 + 1) + 8LL * (_QWORD)i));
}
v9 = -[NSArray countByEnumeratingWithState:objects:count:](
v7,
"countByEnumeratingWithState:objects:count:",
&v13,
v20,
16);
}
while ( v9 );
}
if ( (v17 & 1) != 0 )
operator delete(__p);
return v8;
}