//
// PauseLayer::createStartPosPopupClosed from 0x1404d92e0 to 0x1404d93bf (223 bytes)
//
// 2 xrefs:
// > ??> @ 0x1407d2818
// > ??> @ 0x140929930
//
// 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:33:03 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall PauseLayer::createStartPosPopupClosed(__int64 a1)
{
unsigned int v2; // ebx
struct cocos2d::CCObject *v3; // rsi
cocos2d::CCArray *v4; // rcx
unsigned int v5; // eax
unsigned int v6; // edx
cocos2d::CCObject *v7; // rcx
__int64 v8; // rcx
cocos2d::CCObject *StartPosObjectsForCurrentMode; // rax
char v10; // bl
__int64 result; // rax
void *v12; // [rsp+30h] [rbp+8h]
v2 = 0;
v3 = nullptr;
if ( *(int *)(a1 + 32) > 0 )
{
v4 = *(cocos2d::CCArray **)(a1 + 40);
if ( v4 )
{
v5 = cocos2d::CCArray::count(v4);
v6 = *(_DWORD *)(a1 + 32);
if ( v6 <= v5 )
v3 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 40), v6 - 1);
}
}
v7 = *(cocos2d::CCObject **)(a1 + 40);
if ( v7 )
cocos2d::CCObject::release(v7);
v8 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v12 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v12);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v8 = qword_14090BFD0;
}
StartPosObjectsForCurrentMode = GJBaseGameLayer::getStartPosObjectsForCurrentMode(*(_QWORD *)(v8 + 560));
*(_QWORD *)(a1 + 40) = StartPosObjectsForCurrentMode;
cocos2d::CCObject::retain(StartPosObjectsForCurrentMode);
if ( v3 )
v2 = cocos2d::CCArray::indexOfObject(*(cocos2d::CCArray **)(a1 + 40), v3) + 1;
*(_DWORD *)(a1 + 32) = v2;
v10 = *(_BYTE *)(a1 + 48);
result = PauseLayer::onChangeStartpos(a1 - 568, 0);
*(_BYTE *)(a1 + 48) = v10;
return result;
}