//
// SecretLayer3::dialogClosed from 0x1405849a0 to 0x140584e46 (1190 bytes)
//
// 2 xrefs:
// > ??> @ 0x1407df048
// > ??> @ 0x14092c9f0
//
// 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:34:27 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall SecretLayer3::dialogClosed(__int64 a1, __int64 a2)
{
int v4; // ebp
char v5; // al
struct cocos2d::CCLayerColor *v6; // rsi
struct cocos2d::CCFiniteTimeAction *v7; // rdi
__int64 v8; // rax
struct cocos2d::CCAction *v9; // rax
__int64 v10; // rdx
__int64 v11; // rcx
__int64 v12; // rdx
__int64 v13; // rax
float v14; // xmm0_4
__int64 v15; // rcx
__int64 v16; // rdx
struct cocos2d::CCActionInterval *v17; // rax
struct cocos2d::CCAction *v18; // rax
unsigned int v19; // ebp
struct cocos2d::CCObject *v20; // rbx
__int64 v21; // rdx
__int64 v22; // rdx
cocos2d::CCNode *v23; // rsi
struct cocos2d::CCFiniteTimeAction *v24; // rdi
struct cocos2d::CCActionInterval *v25; // rax
struct cocos2d::CCFiniteTimeAction *v26; // rbx
struct cocos2d::CCFiniteTimeAction *v27; // rax
struct cocos2d::CCSpawn *v28; // rbx
struct cocos2d::CCAction *v29; // rax
__int64 v30; // rbx
struct cocos2d::CCFiniteTimeAction *v31; // rax
struct cocos2d::CCAction *v32; // rax
__int64 v33; // rcx
int v34; // [rsp+A8h] [rbp+10h]
void *v35; // [rsp+A8h] [rbp+10h]
void *v36; // [rsp+A8h] [rbp+10h]
__int64 v37; // [rsp+B0h] [rbp+18h] BYREF
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2) == 4 )
{
v4 = 0;
LOWORD(v34) = -1;
BYTE2(v34) = -1;
v37 = 0x100000302LL;
do
{
v5 = 80;
if ( !v4 )
v5 = -1;
HIBYTE(v34) = v5;
LODWORD(v37) = v34;
v6 = cocos2d::CCLayerColor::create((const struct cocos2d::_ccColor4B *)&v37);
(*(void (__fastcall **)(__int64, struct cocos2d::CCLayerColor *, __int64))(*(_QWORD *)(a1 - 408) + 456LL))(
a1 - 408,
v6,
100);
(**((void (__fastcall ***)(__int64, __int64))v6 + 54))((__int64)v6 + 432, 0x100000302LL);
v7 = cocos2d::CCFadeTo::create(2.0, 0);
v8 = cocos2d::CCCallFunc::create(v6, sub_14003F5B0);
v9 = cocos2d::CCSequence::create(v7, v8, 0);
cocos2d::CCNode::runAction(v6, v9);
++v4;
}
while ( v4 < 2 );
cocos2d::CCNode::stopAllActions(*(cocos2d::CCNode **)(a1 + 32));
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 32) + 336LL))(*(_QWORD *)(a1 + 32), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 40) + 336LL))(*(_QWORD *)(a1 + 40), 0);
v11 = *(_QWORD *)(a1 + 48);
if ( v11 )
{
LOBYTE(v10) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 336LL))(v11, v10);
LOBYTE(v12) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 48) + 936LL))(*(_QWORD *)(a1 + 48), v12);
}
v13 = cocos2d::CCCallFunc::create(a1 - 408, SecretLayer3::revealStep5);
v14 = 3.0;
goto LABEL_19;
}
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2) == 5 )
{
v15 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v35 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v35);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v15 = qword_14090BFD0;
}
GameManager::setUGV(v15, "13", 1u);
}
else
{
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2) == 3 )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)(*(_QWORD *)(a1 + 40) + 320LL) + 40LL))(
*(_QWORD *)(a1 + 40) + 320LL,
0);
LOBYTE(v16) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 40) + 336LL))(*(_QWORD *)(a1 + 40), v16);
v17 = cocos2d::CCFadeIn::create(3.0);
v18 = cocos2d::CCEaseInOut::create(v17, 1.5);
cocos2d::CCNode::runAction(*(cocos2d::CCNode **)(a1 + 40), v18);
v13 = cocos2d::CCCallFunc::create(a1 - 408, SecretLayer3::revealStep4);
v14 = 4.0;
LABEL_19:
v30 = v13;
v31 = cocos2d::CCDelayTime::create(v14);
v32 = cocos2d::CCSequence::create(v31, v30, 0);
cocos2d::CCNode::runAction((cocos2d::CCNode *)(a1 - 408), v32);
return;
}
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2) == 1 )
{
v19 = 0;
while ( v19 < cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 24)) )
{
v20 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 24), v19);
LOBYTE(v21) = 1;
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v20 + 936LL))(v20, v21);
LOBYTE(v22) = 1;
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v20 + 336LL))(v20, v22);
v23 = (cocos2d::CCNode *)(*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v20 + 952LL))(v20);
v24 = cocos2d::CCDelayTime::create((float)(int)++v19 * 0.1);
v25 = cocos2d::CCScaleTo::create(0.5, 1.0);
v26 = cocos2d::CCEaseBounceOut::create(v25);
v27 = cocos2d::CCFadeIn::create(0.15000001);
v28 = cocos2d::CCSpawn::createWithTwoActions(v26, v27);
(*(void (__fastcall **)(cocos2d::CCNode *))(*(_QWORD *)v23 + 160LL))(v23);
(*(void (__fastcall **)(__int64, _QWORD))(*((_QWORD *)v23 + 40) + 40LL))((__int64)v23 + 320, 0);
v29 = cocos2d::CCSequence::create(v24, v28, 0);
cocos2d::CCNode::runAction(v23, v29);
}
v13 = cocos2d::CCCallFunc::create(a1 - 408, SecretLayer3::firstInteractionStep4);
v14 = 2.0;
goto LABEL_19;
}
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2) == 2 )
{
v33 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v36 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v36);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v33 = qword_14090BFD0;
}
GameManager::setUGV(v33, "12", 1u);
}
else if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2) != 6 )
{
return;
}
}
*(_BYTE *)(a1 + 16) = 0;
}