//
// GameManager::switchCustomObjects from 0x14027f2f0 to 0x14027f626 (822 bytes)
//
// 2 xrefs:
// > GameManager::reorderKey @ 0x14027f2da
// > ??> @ 0x14091d03c
//
// 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 11:28:59 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall GameManager::switchCustomObjects(__int64 a1, unsigned int a2, unsigned int a3)
{
cocos2d::CCString *v6; // rax
const char *CString; // rax
size_t v8; // rbx
size_t v9; // r8
cocos2d::CCObject *v10; // rsi
void *v11; // r8
cocos2d::CCString *v12; // rax
const char *v13; // rax
size_t v14; // r8
__int64 v15; // rdi
void *v16; // r8
cocos2d::CCString *v17; // rax
const char *v18; // rax
size_t v19; // r8
void *v20; // rcx
cocos2d::CCString *v21; // rax
const char *v22; // rax
void *v23; // rcx
void *v24[2]; // [rsp+30h] [rbp-49h] BYREF
__int128 v25; // [rsp+40h] [rbp-39h]
void *Block[2]; // [rsp+50h] [rbp-29h] BYREF
__m128i si128; // [rsp+60h] [rbp-19h]
void *v28[2]; // [rsp+70h] [rbp-9h] BYREF
__m128i v29; // [rsp+80h] [rbp+7h]
v6 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8);
CString = cocos2d::CCString::getCString(v6);
*(_OWORD *)Block = 0;
si128 = 0;
v8 = -1;
v9 = -1;
do
++v9;
while ( CString[v9] );
sub_14003D230(Block, CString, v9);
v10 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 464), Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v11 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v11 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v11 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v11);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
v12 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, a3);
v13 = cocos2d::CCString::getCString(v12);
*(_OWORD *)v28 = 0;
v29 = 0;
v14 = -1;
do
++v14;
while ( v13[v14] );
sub_14003D230(v28, v13, v14);
v15 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 464), v28);
if ( v29.m128i_i64[1] > 0xFuLL )
{
v16 = v28[0];
if ( (unsigned __int64)(v29.m128i_i64[1] + 1) >= 0x1000 )
{
v16 = *((void **)v28[0] - 1);
if ( (unsigned __int64)((char *)v28[0] - (char *)v16 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v16);
}
v29 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(v28[0]) = 0;
cocos2d::CCObject::retain(v10);
v17 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, a2);
v18 = cocos2d::CCString::getCString(v17);
*(_OWORD *)v24 = 0;
v25 = 0;
v19 = -1;
do
++v19;
while ( v18[v19] );
sub_14003D230(v24, v18, v19);
cocos2d::CCDictionary::setObject(*(_QWORD *)(a1 + 464), v15, v24);
if ( *((_QWORD *)&v25 + 1) > 0xFu )
{
v20 = v24[0];
if ( (unsigned __int64)(*((_QWORD *)&v25 + 1) + 1LL) >= 0x1000 )
{
v20 = *((void **)v24[0] - 1);
if ( (unsigned __int64)((char *)v24[0] - (char *)v20 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v20);
}
v21 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, a3);
v22 = cocos2d::CCString::getCString(v21);
*(_OWORD *)v24 = 0;
v25 = 0;
do
++v8;
while ( v22[v8] );
sub_14003D230(v24, v22, v8);
cocos2d::CCDictionary::setObject(*(_QWORD *)(a1 + 464), v10, v24);
if ( *((_QWORD *)&v25 + 1) > 0xFu )
{
v23 = v24[0];
if ( (unsigned __int64)(*((_QWORD *)&v25 + 1) + 1LL) >= 0x1000 )
{
v23 = *((void **)v24[0] - 1);
if ( (unsigned __int64)((char *)v24[0] - (char *)v23 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v23);
}
cocos2d::CCObject::release(v10);
}