//
// SetFolderPopup::setTextPopupClosed from 0x1403a6dc0 to 0x1403a6f6e (430 bytes)
//
// 2 xrefs:
// > ??> @ 0x14077c388
// > ??> @ 0x14092381c
//
// 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:31:19 +0000
//
// Hidden C++ exception states: #wind=5
void __fastcall SetFolderPopup::setTextPopupClosed(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v5; // rbp
__int64 v6; // rcx
__int64 v7; // rsi
cocos2d::CCString *v8; // rax
const char *CString; // rax
size_t v10; // r8
__int64 v11; // rax
void *v12; // rcx
void *v13; // [rsp+40h] [rbp-78h]
_BYTE v14[32]; // [rsp+48h] [rbp-70h] BYREF
__int64 v15; // [rsp+68h] [rbp-50h]
void *Block[2]; // [rsp+70h] [rbp-48h] BYREF
__int64 v17; // [rsp+80h] [rbp-38h]
unsigned __int64 v18; // [rsp+88h] [rbp-30h]
v15 = a3;
v5 = sub_14003F4F0((__int64)v14, a3);
v6 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v13 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v13);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v6 = *(_QWORD *)&qword_14090BFB0;
}
if ( *(_BYTE *)(a1 + 8) )
v7 = *(_QWORD *)(v6 + 936);
else
v7 = *(_QWORD *)(v6 + 928);
v8 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, *(unsigned int *)(a1 - 32));
CString = cocos2d::CCString::getCString(v8);
*(_OWORD *)Block = 0;
v17 = 0;
v18 = 0;
v10 = -1;
do
++v10;
while ( CString[v10] );
sub_14003D230(Block, CString, v10);
v11 = cocos2d::CCString::create(v5);
cocos2d::CCDictionary::setObject(v7, v11, Block);
if ( v18 > 0xF )
{
v12 = Block[0];
if ( v18 + 1 >= 0x1000 )
{
v12 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v12 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v12);
}
sub_14003D310(v5);
(*(void (__fastcall **)(__int64))(*(_QWORD *)(a1 - 704) + 1080LL))(a1 - 704);
sub_14003D310(a3);
}