//
// cocos2d::CCConfiguration::loadConfigFile from 0x10051b450 to 0x10051b75b (779 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:31:41 +0000
//
void __fastcall cocos2d::CCConfiguration::loadConfigFile(__int64 a1, char *a2)
{
__int64 v2; // r15
__int64 v3; // r14
const void *v4; // rbx
const void *v5; // rbx
_QWORD *v6; // rbx
__int128 *p_dst; // rsi
char *v8; // r12
char *v9; // rbx
__int64 v10; // r13
size_t v11; // rax
size_t v12; // r14
char *v13; // rbx
size_t v14; // r15
__int64 v15; // rbx
__int64 v16; // r13
size_t v17; // rax
size_t v18; // rbx
char *v19; // r14
size_t v20; // r15
__int64 v21; // rax
__int64 v22; // rdx
__int64 v23; // rcx
__int64 v24; // r8
char *__s; // [rsp+8h] [rbp-58h]
__int64 v26; // [rsp+10h] [rbp-50h]
__int128 __dst; // [rsp+20h] [rbp-40h] BYREF
void *__p; // [rsp+30h] [rbp-30h]
v2 = a1;
v3 = cocos2d::CCDictionary::createWithContentsOfFile(a2);
LOBYTE(__dst) = 16;
strcpy((char *)&__dst + 1, "metadata");
v4 = (const void *)cocos2d::CCDictionary::objectForKey(v3, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( v4
&& __dynamic_cast(
v4,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCDictionary,
0) )
{
LOBYTE(__dst) = 12;
*(_DWORD *)((char *)&__dst + 1) = 1836216166;
*(_WORD *)((char *)&__dst + 5) = 29793;
BYTE7(__dst) = 0;
v5 = (const void *)cocos2d::CCDictionary::objectForKey((__int64)v4, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( v5
&& __dynamic_cast(
v5,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCString,
0)
&& (unsigned int)cocos2d::CCString::intValue(v5) == 1 )
{
LOBYTE(__dst) = 8;
*(_DWORD *)((char *)&__dst + 1) = 1635017060;
BYTE5(__dst) = 0;
v6 = (_QWORD *)cocos2d::CCDictionary::objectForKey(v3, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( v6 )
{
p_dst = (__int128 *)&`typeinfo for'cocos2d::CCObject;
if ( __dynamic_cast(
v6,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCDictionary,
0) )
{
v8 = (char *)v6[7];
if ( v8 )
{
v9 = *((char **)v8 + 36);
v10 = *(_QWORD *)(a1 + 88);
v11 = strlen(v8);
if ( v11 > 0xFFFFFFFFFFFFFFF7LL )
LABEL_39:
sub_100003630();
v12 = v11;
while ( 1 )
{
__s = v9;
if ( v12 >= 0x17 )
break;
LOBYTE(__dst) = 2 * v12;
v13 = (char *)&__dst + 1;
if ( v12 )
goto LABEL_23;
LABEL_24:
v13[v12] = 0;
p_dst = &__dst;
v15 = cocos2d::CCDictionary::objectForKey(v10, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( v15 )
goto LABEL_37;
v16 = *((_QWORD *)v8 + 33);
v17 = strlen(v8);
if ( v17 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_39;
v18 = v17;
v26 = *(_QWORD *)(v2 + 88);
if ( v17 >= 0x17 )
{
v20 = (v17 | 7) + 1;
if ( (v17 | 7) == 0x17 )
v20 = 26;
v19 = (char *)operator new(v20);
__p = v19;
*(_QWORD *)&__dst = v20 + 1;
v2 = a1;
*((_QWORD *)&__dst + 1) = v18;
LABEL_34:
memmove(v19, v8, v18);
goto LABEL_35;
}
LOBYTE(__dst) = 2 * v17;
v19 = (char *)&__dst + 1;
if ( v17 )
goto LABEL_34;
LABEL_35:
v19[v18] = 0;
p_dst = (__int128 *)v16;
cocos2d::CCDictionary::setObject(v26, v16, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
LABEL_37:
v8 = __s;
if ( !__s )
goto LABEL_40;
v9 = *((char **)__s + 36);
v10 = *(_QWORD *)(v2 + 88);
v12 = strlen(__s);
if ( v12 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_39;
}
v14 = (v12 | 7) + 1;
if ( (v12 | 7) == 0x17 )
v14 = 26;
v13 = (char *)operator new(v14);
__p = v13;
*(_QWORD *)&__dst = v14 + 1;
v2 = a1;
*((_QWORD *)&__dst + 1) = v12;
LABEL_23:
memmove(v13, v8, v12);
goto LABEL_24;
}
LABEL_40:
v21 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::setDefaultValues(v21, (__int64)p_dst, v22, v23, v24);
}
}
}
}
}