//
// SecretLayer3::revealStep4 from 0x1004a73f0 to 0x1004a7a8c (1692 bytes)
//
// 2 xrefs:
// > SecretLayer3::revealStep3 @ 0x1004a73bd
// > SecretLayer3::dialogClosed @ 0x1004a8393
//
// 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::revealStep4(SecretLayer3 *a1)
{
__int64 v1; // rsi
cocos2d::CCArray *v2; // r14
char *v3; // rax
__int128 v4; // xmm0
char *v5; // rax
GameManager *v6; // rax
std::string *p_m_playerName; // rax
cocos2d::CCString *v8; // rax
const char *CString; // r15
size_t v10; // rax
size_t v11; // r12
char *v12; // r13
char *v13; // r15
size_t v14; // rbx
size_t v15; // rax
std::string::size_type v16; // r12
char *data; // r13
size_t v18; // rbx
char *v19; // rax
char *v20; // rax
char *v21; // rax
char *v22; // rax
DialogLayer *v23; // r14
char v24; // [rsp+0h] [rbp-190h]
SecretLayer3 *v25; // [rsp+8h] [rbp-188h]
__int128 v26; // [rsp+10h] [rbp-180h] BYREF
void *v27; // [rsp+20h] [rbp-170h]
__int128 v28; // [rsp+28h] [rbp-168h] BYREF
void *v29; // [rsp+38h] [rbp-158h]
__int128 v30; // [rsp+40h] [rbp-150h] BYREF
void *v31; // [rsp+50h] [rbp-140h]
__int128 v32; // [rsp+58h] [rbp-138h] BYREF
void *v33; // [rsp+68h] [rbp-128h]
__int128 v34; // [rsp+70h] [rbp-120h] BYREF
void *v35; // [rsp+80h] [rbp-110h]
__int128 v36; // [rsp+88h] [rbp-108h] BYREF
void *v37; // [rsp+98h] [rbp-F8h]
std::string v38; // [rsp+A0h] [rbp-F0h] BYREF
std::string v39; // [rsp+B8h] [rbp-D8h] BYREF
std::string v40; // [rsp+D0h] [rbp-C0h] BYREF
std::string v41; // [rsp+E8h] [rbp-A8h] BYREF
std::string v42; // [rsp+100h] [rbp-90h] BYREF
std::string v43; // [rsp+118h] [rbp-78h] BYREF
__int128 v44; // [rsp+130h] [rbp-60h] BYREF
void *longStorage; // [rsp+140h] [rbp-50h]
_QWORD __dst[2]; // [rsp+150h] [rbp-40h] BYREF
char *__s; // [rsp+160h] [rbp-30h]
v2 = (cocos2d::CCArray *)sub_10071F9E0(a1, v1);
LOBYTE(v26) = 6;
*(_DWORD *)((char *)&v26 + 1) = 3026478;
v38.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x50u);
v38.__r_.__value_.__r.__words[0] = 81;
v38.__r_.__value_.__l.__size_ = 79;
strcpy(
v38.__r_.__value_.__l.__data_,
"RubRub told me he was cooking some chicken. Then he locked me in.");
v3 = DialogObject::create(&v26, &v38, 16, 0, 0xFFFFFF, 0.80000001);
sub_10071FCD0(v2, v3);
if ( (*(_BYTE *)&v38.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v38.__r_.__value_.__l.__data_);
if ( (v26 & 1) != 0 )
operator delete(v27);
LOBYTE(v28) = 6;
*(_DWORD *)((char *)&v28 + 1) = 3026478;
v39.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v39.__r_.__value_.__r.__words[0] = 65;
v39.__r_.__value_.__l.__size_ = 58;
strcpy(v39.__r_.__value_.__l.__data_, "Now that you have freed me, I can continue my master plan.");
*(_QWORD *)&v4 = 1065353216;
v5 = DialogObject::create(&v28, &v39, 16, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v2, v5);
if ( (*(_BYTE *)&v39.__r_.__value_.__s.0 & 1) == 0 )
{
if ( (v28 & 1) == 0 )
goto LABEL_7;
LABEL_10:
operator delete(v29);
v6 = GameManager::sharedState();
if ( (v6->m_playerName.m_data.m_short.sizex2 & 1) == 0 )
goto LABEL_8;
goto LABEL_11;
}
operator delete(v39.__r_.__value_.__l.__data_);
if ( (v28 & 1) != 0 )
goto LABEL_10;
LABEL_7:
v6 = GameManager::sharedState();
if ( (v6->m_playerName.m_data.m_short.sizex2 & 1) == 0 )
{
LABEL_8:
p_m_playerName = &v6->m_playerName;
longStorage = p_m_playerName->m_data.m_long.longStorage;
v4 = *(_OWORD *)&p_m_playerName->m_data.m_short.sizex2;
v44 = *(_OWORD *)&p_m_playerName->m_data.m_short.sizex2;
v25 = a1;
goto LABEL_12;
}
LABEL_11:
sub_100006B70(
&v44,
v6->m_playerName.m_data.m_long.longStorage,
v6->m_playerName.m_data.m_long.size,
COERCE_DOUBLE(1065353216));
v25 = a1;
LABEL_12:
v8 = (cocos2d::CCString *)sub_1007AB580(
"DESTROY the world of Geometry Dash! And I couldn't have done it with"
"out you %s.",
v24);
CString = cocos2d::CCString::getCString(v8);
v10 = strlen(CString);
if ( v10 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v4);
v11 = v10;
if ( v10 >= 0x17 )
{
v14 = 26;
if ( (v10 | 7) != 0x17 )
v14 = (v10 | 7) + 1;
v12 = (char *)operator new(v14);
__s = v12;
__dst[0] = v14 | 1;
__dst[1] = v11;
}
else
{
LOBYTE(__dst[0]) = 2 * v10;
v12 = (char *)__dst + 1;
if ( !v10 )
{
BYTE1(__dst[0]) = 0;
if ( (v44 & 1) == 0 )
goto LABEL_17;
goto LABEL_16;
}
}
memmove(v12, CString, v11);
v12[v11] = 0;
if ( (v44 & 1) != 0 )
LABEL_16:
operator delete(longStorage);
LABEL_17:
LOBYTE(v30) = 6;
*(_DWORD *)((char *)&v30 + 1) = 3026478;
if ( (__dst[0] & 1) != 0 )
v13 = __s;
else
v13 = (char *)__dst + 1;
v15 = strlen(v13);
if ( v15 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v4);
v16 = v15;
if ( v15 >= 0x17 )
{
v18 = 26;
if ( (v15 | 7) != 0x17 )
v18 = (v15 | 7) + 1;
data = (char *)operator new(v18);
v43.__r_.__value_.__r.__words[2] = (std::string::size_type)data;
v43.__r_.__value_.__r.__words[0] = v18 | 1;
v43.__r_.__value_.__l.__size_ = v16;
goto LABEL_32;
}
v43.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v15);
data = v43.__r_.__value_.__s.__data_;
if ( v15 )
LABEL_32:
memmove(data, v13, v16);
data[v16] = 0;
v19 = DialogObject::create(&v30, &v43, 16, 0, 0xFFFFFF, 0.80000001);
sub_10071FCD0(v2, v19);
if ( (*(_BYTE *)&v43.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v43.__r_.__value_.__l.__data_);
if ( (v30 & 1) != 0 )
operator delete(v31);
LOBYTE(v32) = 6;
*(_DWORD *)((char *)&v32 + 1) = 3026478;
v40.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x60u);
v40.__r_.__value_.__r.__words[0] = 97;
v40.__r_.__value_.__l.__size_ = 90;
strcpy(
v40.__r_.__value_.__l.__data_,
"But I almost forgot, I left you a small gift. As a token of my appreciation.");
v20 = DialogObject::create(&v32, &v40, 16, 0, 0xFFFFFF, 0.80000001);
sub_10071FCD0(v2, v20);
if ( (*(_BYTE *)&v40.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v40.__r_.__value_.__l.__data_);
if ( (v32 & 1) != 0 )
operator delete(v33);
LOBYTE(v34) = 6;
*(_DWORD *)((char *)&v34 + 1) = 3026478;
v41.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x38u);
v41.__r_.__value_.__r.__words[0] = 57;
v41.__r_.__value_.__l.__size_ = 54;
strcpy(v41.__r_.__value_.__l.__data_, "You should prepare yourself for when I return.");
v21 = DialogObject::create(&v34, &v41, 16, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v2, v21);
if ( (*(_BYTE *)&v41.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v41.__r_.__value_.__l.__data_);
if ( (v34 & 1) != 0 )
operator delete(v35);
LOBYTE(v36) = 6;
*(_DWORD *)((char *)&v36 + 1) = 3026478;
v42.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x30u);
v42.__r_.__value_.__r.__words[0] = 49;
v42.__r_.__value_.__l.__size_ = 45;
strcpy(v42.__r_.__value_.__l.__data_, "You will need it...");
v22 = DialogObject::create(&v36, &v42, 16, 0, 0xFFFFFF, 1.0);
sub_10071FCD0(v2, v22);
if ( (*(_BYTE *)&v42.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v42.__r_.__value_.__l.__data_);
if ( (v36 & 1) != 0 )
operator delete(v37);
v23 = DialogLayer::createWithObjects(v2, 4);
((void (__fastcall *)(SecretLayer3 *, DialogLayer *, __int64))v25->addChild_0)(v25, v23, 100);
v23->m_delegate = &v25->DialogDelegate;
((void (__fastcall *)(DialogLayer *, __int64))v23->setTag)(v23, 4);
DialogLayer::updateChatPlacement(v23, Top);
DialogLayer::animateIn(v23, FromCenter);
if ( (__dst[0] & 1) != 0 )
operator delete(__s);
}