//
// ThreadDescPopup::finishSave from 0x1400fe150 to 0x1400fe291 (321 bytes)
//
// 4 xrefs:
// > ThreadDescPopup::threadUpdateFinished @ 0x1400fe341
// > ThreadDescPopup::threadUpdateFinished @ 0x1400fe37a
// > ??> @ 0x14091556c
// > ??> @ 0x140915578
//
// 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:26:41 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall ThreadDescPopup::finishSave(__int64 a1, _BYTE *a2)
{
__int64 *v4; // rsi
size_t v5; // r8
__int64 v6; // rbx
__int64 v7; // rdx
__int64 v8; // r8
__int64 v9; // rax
__int64 v10; // rbx
__int64 v11; // rbx
__int64 v12; // rax
__int128 v14; // [rsp+30h] [rbp-48h] BYREF
__int64 v15; // [rsp+40h] [rbp-38h]
__int64 v16; // [rsp+48h] [rbp-30h]
__int128 v17; // [rsp+50h] [rbp-28h] BYREF
__int64 v18; // [rsp+60h] [rbp-18h]
__int64 v19; // [rsp+68h] [rbp-10h]
void *v20; // [rsp+80h] [rbp+8h]
*(_BYTE *)(a1 + 1113) = 0;
v4 = *(__int64 **)(cocos2d::CCDirector::sharedDirector(a1) + 272);
v14 = 0;
v15 = 0;
v16 = 15;
LOBYTE(v14) = 0;
v17 = 0;
v18 = 0;
v19 = 0;
v5 = -1;
do
++v5;
while ( a2[v5] );
sub_14003D230(&v17, a2, v5);
v6 = *v4;
v9 = TextAlertPopup::create(&v17, v7, v8, 150, &v14);
(*(void (__fastcall **)(__int64 *, __int64, __int64))(v6 + 456))(v4, v9, 1000);
v10 = *(_QWORD *)(a1 + 1024);
if ( v10 )
{
v11 = v10 + 672;
v12 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v20 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v20);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v12 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v12 + 1392) = v11;
}
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1104LL))(a1, 0);
}