//
// GameManager::stringForCustomObject from 0x140183970 to 0x140183abe (334 bytes)
//
// 3 xrefs:
// > EditorUI::createCustomItems @ 0x1400e48ba
// > EditorUI::onCreateObject @ 0x14010fbd8
// > ??> @ 0x1406cb5d4
//
// 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=1
_QWORD *__fastcall GameManager::stringForCustomObject(__int64 a1, _QWORD *a2, int a3)
{
cocos2d::CCString *v5; // rax
const char *CString; // rax
size_t v7; // rbx
size_t v8; // r8
cocos2d::CCString *v9; // rsi
void *v10; // rcx
const char *v11; // rax
void *Block[2]; // [rsp+30h] [rbp-48h] BYREF
__m128i si128; // [rsp+40h] [rbp-38h]
v5 = cocos2d::CCString::createWithFormat("%i", a3);
CString = cocos2d::CCString::getCString(v5);
*(_OWORD *)Block = 0;
si128 = 0;
v7 = -1;
v8 = -1;
do
++v8;
while ( CString[v8] );
sub_14003A930(Block, CString, v8);
v9 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 424), Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v10 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v10 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v10 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v10);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_140623F30);
LOBYTE(Block[0]) = 0;
if ( v9 )
{
v11 = cocos2d::CCString::getCString(v9);
*(_OWORD *)a2 = 0;
a2[2] = 0;
a2[3] = 0;
do
++v7;
while ( v11[v7] );
sub_14003A930(a2, v11, v7);
}
else
{
*(_OWORD *)a2 = 0;
a2[2] = 0;
a2[3] = 15;
*(_BYTE *)a2 = 0;
}
return a2;
}