//
// SecretLayer3::showUnlockDialog from 0x1004a6a80 to 0x1004a6df0 (880 bytes)
//
// 1 xrefs:
// > SecretLayer3::onClick @ 0x1004a5130
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall SecretLayer3::showUnlockDialog(SecretLayer3 *a1)
{
__int64 v1; // rsi
cocos2d::CCArray *v2; // r14
GameManager *v3; // rax
_BOOL4 UGV; // r15d
GameManager *v5; // rax
int v6; // r12d
GameManager *v7; // rax
char *v8; // rax
void **v9; // r15
char *v10; // rax
char *v11; // rax
char *v12; // rax
DialogLayer *v13; // r14
__int128 v14; // [rsp+0h] [rbp-E0h] BYREF
char v15; // [rsp+10h] [rbp-D0h] BYREF
__int128 v16; // [rsp+18h] [rbp-C8h] BYREF
char v17; // [rsp+28h] [rbp-B8h] BYREF
__int128 v18; // [rsp+30h] [rbp-B0h] BYREF
void *v19; // [rsp+40h] [rbp-A0h]
__int128 v20; // [rsp+48h] [rbp-98h] BYREF
void *v21; // [rsp+58h] [rbp-88h]
std::string v22; // [rsp+60h] [rbp-80h] BYREF
std::string v23; // [rsp+78h] [rbp-68h] BYREF
std::string v24; // [rsp+90h] [rbp-50h] BYREF
std::string v25; // [rsp+A8h] [rbp-38h] BYREF
v2 = (cocos2d::CCArray *)sub_10071F9E0(a1, v1);
v3 = GameManager::sharedState();
UGV = GameManager::getUGV(v3, "14");
v5 = GameManager::sharedState();
v6 = UGV + GameManager::getUGV(v5, "15");
v7 = GameManager::sharedState();
if ( v6 + GameManager::getUGV(v7, "16") == 2 )
{
LOBYTE(v18) = 6;
*(_DWORD *)((char *)&v18 + 1) = 3026478;
v22.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v22.__r_.__value_.__r.__words[0] = 65;
v22.__r_.__value_.__l.__size_ = 63;
strcpy(v22.__r_.__value_.__l.__data_, "You found a second key, impressive...");
v8 = DialogObject::create(&v18, &v22, 15, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v2, v8);
if ( (*(_BYTE *)&v22.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v22.__r_.__value_.__l.__data_);
if ( (v18 & 1) != 0 )
operator delete(v19);
v9 = (void **)&v15;
LOBYTE(v14) = 6;
*(_DWORD *)((char *)&v14 + 1) = 3026478;
v23.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x20u);
v23.__r_.__value_.__r.__words[0] = 33;
v23.__r_.__value_.__l.__size_ = 27;
strcpy(v23.__r_.__value_.__l.__data_, "Only one lock left.");
v10 = DialogObject::create(&v14, &v23, 15, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v2, v10);
if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v23.__r_.__value_.__l.__data_);
if ( (v14 & 1) == 0 )
goto LABEL_18;
LABEL_17:
operator delete(*v9);
goto LABEL_18;
}
LOBYTE(v20) = 6;
*(_DWORD *)((char *)&v20 + 1) = 3026478;
v24.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x20u);
v24.__r_.__value_.__r.__words[0] = 33;
v24.__r_.__value_.__l.__size_ = 30;
strcpy(v24.__r_.__value_.__l.__data_, "The key, you found it?");
v11 = DialogObject::create(&v20, &v24, 15, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v2, v11);
if ( (*(_BYTE *)&v24.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v24.__r_.__value_.__l.__data_);
if ( (v20 & 1) != 0 )
operator delete(v21);
v9 = (void **)&v17;
LOBYTE(v16) = 6;
*(_DWORD *)((char *)&v16 + 1) = 3026478;
v25.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x28u);
v25.__r_.__value_.__r.__words[0] = 41;
v25.__r_.__value_.__l.__size_ = 39;
strcpy(v25.__r_.__value_.__l.__data_, "Excellent, only two locks left.");
v12 = DialogObject::create(&v16, &v25, 15, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v2, v12);
if ( (*(_BYTE *)&v25.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v25.__r_.__value_.__l.__data_);
if ( (v16 & 1) != 0 )
goto LABEL_17;
LABEL_18:
v13 = DialogLayer::createWithObjects(v2, 4);
((void (__fastcall *)(SecretLayer3 *, DialogLayer *, __int64))a1->addChild_0)(a1, v13, 100);
((void (__fastcall *)(DialogLayer *, __int64))v13->setTag)(v13, 6);
v13->m_delegate = &a1->DialogDelegate;
DialogLayer::updateChatPlacement(v13, Center);
DialogLayer::animateInRandomSide(v13);
}