//
// RenameThreadPopup::onSave from 0xc7ae9c to 0xc7b108 (620 bytes)
//
// 3 xrefs:
// > ??> @ 0xd6e58
// > RenameThreadPopup::init @ 0xc6f290
// > ??> @ 0x1546678
//
// This function is hookable on this platform (idp: arm, 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 13:05:35 +0000
//
__int64 __fastcall RenameThreadPopup::onSave(RenameThreadPopup *this, cocos2d::CCObject *a2)
{
CCTextInputNode *v3; // x0
cocos2d::CCDirector *String; // x0
size_t v5; // x1
cocos2d::CCDirector *v6; // x3
__int64 *v7; // x20
__int64 v8; // x3
void (__fastcall *v9)(__int64 *, __int64, __int64); // x23
__int64 v10; // x0
cocos2d::CCDirector *v12; // x1
cocos2d::CCObject *v13; // x0
GameLevelManager *updated; // x0
char *v15; // x1
size_t v16; // x2
char v17; // w0
__int64 v18; // [xsp+40h] [xbp+40h] BYREF
size_t v19; // [xsp+48h] [xbp+48h]
void *v20; // [xsp+50h] [xbp+50h]
__int64 v21[2]; // [xsp+58h] [xbp+58h] BYREF
void *v22; // [xsp+68h] [xbp+68h]
__int64 v23[2]; // [xsp+70h] [xbp+70h] BYREF
void *v24; // [xsp+80h] [xbp+80h]
v3 = *((CCTextInputNode **)this + 130);
if ( v3 )
{
String = (cocos2d::CCDirector *)CCTextInputNode::getString(v3, &v18);
}
else
{
v18 = 0;
v19 = 0;
v20 = nullptr;
String = (cocos2d::CCDirector *)std::string::__init(&v18, &byte_11B8890, 0);
}
if ( (v18 & 1) != 0 )
{
v5 = v19;
v6 = (cocos2d::CCDirector *)v20;
if ( !v19 )
{
LABEL_5:
v7 = *(__int64 **)(cocos2d::CCDirector::sharedDirector(String) + 272);
v8 = *v7;
v21[0] = 0;
v21[1] = 0;
v9 = *(void (__fastcall **)(__int64 *, __int64, __int64))(v8 + 464);
v22 = nullptr;
std::string::__init(v21, "Enter a name", 0xCu);
v23[0] = 0;
v23[1] = 0;
v24 = nullptr;
std::string::__init(v23, &byte_11B8890, 0);
v10 = TextAlertPopup::create((char *)v21, 150, (char *)v23, 0.5, 0.6);
v9(v7, v10, 1000);
if ( (v23[0] & 1) != 0 )
operator delete(v24);
if ( (v21[0] & 1) != 0 )
operator delete(v22);
LABEL_9:
if ( (v18 & 1) == 0 )
return _stack_chk_guard;
LABEL_26:
operator delete(v20);
return _stack_chk_guard;
}
}
else
{
v5 = (unsigned __int8)v18 >> 1;
v6 = (cocos2d::CCDirector *)((char *)&v18 + 1);
if ( !((unsigned __int8)v18 >> 1) )
goto LABEL_5;
}
v12 = (cocos2d::CCDirector *)((char *)v6 + v5);
if ( v12 == v6 )
goto LABEL_5;
String = v6;
if ( *(_BYTE *)v6 == 32 )
{
while ( 1 )
{
String = (cocos2d::CCDirector *)((char *)String + 1);
if ( v12 == String )
goto LABEL_5;
if ( *(_BYTE *)String != 32 )
{
String = (cocos2d::CCDirector *)((char *)String - (__int64)v6);
if ( String == (cocos2d::CCDirector *)-1LL )
goto LABEL_5;
break;
}
}
}
v13 = (cocos2d::CCObject *)GameLevelManager::sharedState(String);
updated = (GameLevelManager *)(unsigned __int8)GameLevelManager::updateThread(
v13,
(char *)*(unsigned int *)(*((_QWORD *)this + 128) + 56LL),
2,
(char *)&v18);
if ( !(_BYTE)updated )
goto LABEL_9;
*(_QWORD *)(GameLevelManager::sharedState(updated) + 1264) = (char *)this + 1016;
if ( (__int64 *)((char *)this + 1048) != &v18 )
{
if ( (v18 & 1) != 0 )
{
v15 = (char *)v20;
v16 = v19;
}
else
{
v16 = (unsigned __int8)v18 >> 1;
v15 = (char *)&v18 + 1;
}
std::string::assign((__int64 *)this + 131, v15, v16);
}
v17 = v18;
*((_BYTE *)this + 1072) = 1;
if ( (v17 & 1) != 0 )
goto LABEL_26;
return _stack_chk_guard;
}