//
// GameManager::switchCustomObjects from 0x140183bc0 to 0x140183e98 (728 bytes)
//
// 2 xrefs:
// > GameManager::reorderKey @ 0x140183baa
// > ??> @ 0x1406cb5ec
//
// 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
void GameManager::switchCustomObjects(GameManager *a1, int a2, int a3)
{
cocos2d::CCString *v6; // rax
const char *CString; // rax
size_t v8; // rbx
size_t v9; // r8
cocos2d::CCObject *v10; // rsi
void *v11; // rcx
cocos2d::CCString *v12; // rax
const char *v13; // rax
size_t v14; // r8
__int64 v15; // rdi
void *v16; // rcx
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+20h] [rbp-49h] BYREF
__int128 v25; // [rsp+30h] [rbp-39h]
void *Block[2]; // [rsp+40h] [rbp-29h] BYREF
__m128i si128; // [rsp+50h] [rbp-19h]
void *v28[2]; // [rsp+60h] [rbp-9h] BYREF
__m128i v29; // [rsp+70h] [rbp+7h]
v6 = cocos2d::CCString::createWithFormat("%i", a2);
CString = cocos2d::CCString::getCString(v6);
*(_OWORD *)Block = 0;
si128 = 0;
v8 = -1;
v9 = -1;
do
++v9;
while ( CString[v9] );
sub_14003A930(Block, CString, v9);
v10 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(a1->m_customObjectDict, 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 )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v11);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_140623F30);
LOBYTE(Block[0]) = 0;
v12 = cocos2d::CCString::createWithFormat("%i", a3);
v13 = cocos2d::CCString::getCString(v12);
*(_OWORD *)v28 = 0;
v29 = 0;
v14 = -1;
do
++v14;
while ( v13[v14] );
sub_14003A930(v28, v13, v14);
v15 = cocos2d::CCDictionary::objectForKey(a1->m_customObjectDict, 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 )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v16);
}
v29 = _mm_load_si128((const __m128i *)&xmmword_140623F30);
LOBYTE(v28[0]) = 0;
cocos2d::CCObject::retain(v10);
v17 = cocos2d::CCString::createWithFormat("%i", a2);
v18 = cocos2d::CCString::getCString(v17);
*(_OWORD *)v24 = 0;
v25 = 0;
v19 = -1;
do
++v19;
while ( v18[v19] );
sub_14003A930(v24, v18, v19);
cocos2d::CCDictionary::setObject(a1->m_customObjectDict, 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 )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v20);
}
v21 = cocos2d::CCString::createWithFormat("%i", a3);
v22 = cocos2d::CCString::getCString(v21);
*(_OWORD *)v24 = 0;
v25 = 0;
do
++v8;
while ( v22[v8] );
sub_14003A930(v24, v22, v8);
cocos2d::CCDictionary::setObject(a1->m_customObjectDict, 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 )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v23);
}
cocos2d::CCObject::release(v10);
}