//
// SecretLayer::onSubmit from 0x1403dddb0 to 0x1403df818 (6760 bytes)
//
// 3 xrefs:
// > SecretLayer::init @ 0x1403ddced
// > ??> @ 0x1406d7e2c
// > ??> @ 0x1406d7e38
//
// 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
//
// Hidden C++ exception states: #wind=21
void SecretLayer::onSubmit(SecretLayer *a1, cocos2d::CCObject *a2)
{
cocos2d::CCLabelProtocol *v2; // rcx
_BYTE *v3; // rax
size_t v4; // r8
__int64 v5; // rdx
__int64 v6; // rcx
__int64 v7; // r8
__int64 v8; // r9
void **v9; // r12
__int64 v10; // r15
unsigned __int64 v11; // rbx
unsigned int v12; // r12d
__int64 v13; // rbx
void **v14; // r15
char *v15; // rax
__int64 v16; // rdx
unsigned int v17; // r15d
__int64 v18; // rax
_QWORD *v19; // rcx
_BYTE *v20; // rbx
unsigned __int64 v21; // rdi
unsigned __int64 v22; // rbx
void **v23; // rcx
char *v24; // r12
int v25; // r13d
char *v26; // rbx
SecretLayer *v27; // rdi
void *v28; // rcx
void **v29; // rcx
unsigned __int64 v30; // r12
size_t v31; // r8
__int64 v32; // rbx
unsigned __int64 v33; // rbx
char *v34; // r9
AchievementManager *v35; // rbx
cocos2d::CCString *v36; // rax
int v37; // ebx
bool v38; // r9
void *v39; // rcx
GameManager *v40; // rcx
int v41; // ebx
AchievementManager *v42; // rbx
cocos2d::CCString *v43; // rax
int v44; // ebx
void *v45; // rcx
int v46; // ebx
__int64 v47; // rax
__int64 v48; // r8
__int64 v49; // r9
bool v50; // r9
GameManager *v51; // rcx
GameStatsManager *v52; // rcx
GameStatsManager *v53; // rcx
int v54; // ebx
AchievementManager *v55; // rbx
cocos2d::CCString *v56; // rax
int v57; // ebx
bool v58; // r9
void *v59; // rcx
GameManager *v60; // rcx
void **v61; // rcx
void **v62; // r13
unsigned __int64 v63; // rbx
size_t v64; // r8
__int64 v65; // r12
AchievementManager *v66; // rbx
cocos2d::CCString *v67; // rax
int v68; // ebx
bool v69; // r9
void *v70; // rcx
GameManager *v71; // rcx
void **v72; // rcx
size_t v73; // r8
__int64 v74; // r12
AchievementManager *v75; // rbx
cocos2d::CCString *v76; // rax
int v77; // ebx
bool v78; // r9
void *v79; // rcx
GameManager *v80; // rcx
_QWORD *v81; // rax
__int16 v82; // cx
char v83; // r12
void **v84; // rcx
size_t v85; // r8
char *v86; // r15
void **v87; // rcx
size_t v88; // r8
char *v89; // rax
AchievementManager *v90; // rbx
cocos2d::CCString *v91; // rax
int v92; // ebx
bool v93; // r9
void *v94; // rcx
GameManager *v95; // rcx
void **v96; // rcx
size_t v97; // r8
AchievementManager *v98; // rbx
cocos2d::CCString *v99; // rax
int v100; // ebx
bool v101; // r9
void *v102; // rcx
GameManager *v103; // rcx
void **v104; // rcx
unsigned __int64 v105; // rbx
size_t v106; // r8
__int64 v107; // r13
AchievementManager *v108; // rbx
cocos2d::CCString *v109; // rax
int v110; // ebx
void *v111; // rcx
GameManager *v112; // rax
bool v113; // r9
__int64 v114; // rax
void **v115; // rcx
size_t v116; // r8
AchievementManager *v117; // rbx
cocos2d::CCString *v118; // rax
int v119; // ebx
void *v120; // rcx
GameManager *v121; // rax
bool v122; // r9
__int64 v123; // rax
_QWORD *v124; // rax
bool v125; // bl
AchievementManager *v126; // rax
GameManager *v127; // rax
bool v128; // r9
__int64 v129; // rax
bool v130; // bl
AchievementManager *v131; // rcx
GameManager *v132; // rax
bool v133; // r9
__int64 v134; // rax
bool v135; // bl
__int64 BasicMessage; // rax
bool v137; // bl
void ***v138; // rdx
bool v139; // bl
const char *v140; // rdx
bool v141; // bl
bool v142; // bl
bool v143; // bl
__int64 v144; // rax
GameManager *v145; // rax
bool v146; // r9
int m_selectedThread; // esi
const char *Message; // rax
__int64 v149; // rbx
const char *v150; // rdx
void ***v151; // rdx
bool v152; // [rsp+30h] [rbp-D0h]
bool v153; // [rsp+30h] [rbp-D0h]
FMODAudioEngine *v154; // [rsp+38h] [rbp-C8h]
void *v155; // [rsp+38h] [rbp-C8h]
void *v156; // [rsp+38h] [rbp-C8h]
void *v157; // [rsp+38h] [rbp-C8h]
void *v158; // [rsp+38h] [rbp-C8h]
void *v159; // [rsp+38h] [rbp-C8h]
void *v160; // [rsp+38h] [rbp-C8h]
void *v161; // [rsp+38h] [rbp-C8h]
void *v162; // [rsp+38h] [rbp-C8h]
void **v163; // [rsp+40h] [rbp-C0h] BYREF
SecretLayer *v164; // [rsp+48h] [rbp-B8h]
_BYTE v165[32]; // [rsp+50h] [rbp-B0h] BYREF
void *Buf2[2]; // [rsp+70h] [rbp-90h] BYREF
__int64 v167; // [rsp+80h] [rbp-80h]
unsigned __int64 v168; // [rsp+88h] [rbp-78h]
void *Block[2]; // [rsp+90h] [rbp-70h] BYREF
size_t v170; // [rsp+A0h] [rbp-60h]
unsigned __int64 v171; // [rsp+A8h] [rbp-58h]
void *Buf1[2]; // [rsp+B0h] [rbp-50h] BYREF
unsigned __int64 v173; // [rsp+C0h] [rbp-40h]
unsigned __int64 v174; // [rsp+C8h] [rbp-38h]
_QWORD v175[2]; // [rsp+D0h] [rbp-30h] BYREF
unsigned __int64 v176; // [rsp+E0h] [rbp-20h]
unsigned __int64 v177; // [rsp+E8h] [rbp-18h]
void *Src[2]; // [rsp+F0h] [rbp-10h] BYREF
unsigned __int64 v179; // [rsp+100h] [rbp+0h]
unsigned __int64 v180; // [rsp+108h] [rbp+8h]
v164 = a1;
LODWORD(v163) = 0;
v2 = &a1->m_searchInput->m_textField->cocos2d::CCLabelProtocol;
v3 = (_BYTE *)((__int64 (__fastcall *)(cocos2d::CCLabelProtocol *, cocos2d::CCObject *))v2->getString)(v2, a2);
*(_OWORD *)Src = 0;
v179 = 0;
v180 = 0;
v4 = -1;
do
++v4;
while ( v3[v4] );
sub_14003A930(Src, v3, v4);
*(_OWORD *)Buf1 = 0;
v173 = 0;
v174 = 0;
v9 = Src;
if ( v180 > 0xF )
v9 = (void **)Src[0];
v10 = 0x7FFFFFFFFFFFFFFFLL;
v11 = v179;
if ( v179 > 0x7FFFFFFFFFFFFFFFLL )
sub_140007B50(v6, v5, v7, v8);
v174 = 15;
if ( v179 > 0xF )
{
if ( (v179 | 0xF) <= 0x7FFFFFFFFFFFFFFFLL )
{
v10 = v179 | 0xF;
if ( (v179 | 0xF) < 0x16 )
v10 = 22;
}
Buf1[0] = sub_14003AA10(v10 + 1);
v173 = v11;
v174 = v10;
memcpy(Buf1[0], v9, v11 + 1);
}
else
{
v173 = v179;
*(_OWORD *)Buf1 = *(_OWORD *)v9;
}
v12 = 0;
if ( v11 )
{
v13 = 0;
do
{
if ( v174 <= 0xF )
{
v15 = (char *)Buf1 + v13;
v14 = Buf1;
}
else
{
v14 = (void **)Buf1[0];
v15 = (char *)Buf1[0] + v13;
}
*((_BYTE *)v14 + v13) = tolower(*v15);
v13 = ++v12;
}
while ( v12 < v173 );
}
v16 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v163 = (void **)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v163);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v16 = qword_1406C2ED8;
}
sub_14003BDB0((__int64)v175, v16 + 616);
v17 = 0;
if ( v176 )
{
v18 = 0;
do
{
if ( v177 <= 0xF )
{
v20 = (char *)v175 + v18;
v19 = v175;
}
else
{
v19 = (_QWORD *)v175[0];
v20 = (_BYTE *)(v175[0] + v18);
}
*v20 = tolower(*((char *)v19 + v18));
v18 = ++v17;
}
while ( v17 < v176 );
}
*(_OWORD *)Block = 0;
v170 = 0;
v21 = 15;
v171 = 15;
LOBYTE(Block[0]) = 0;
*(_OWORD *)Buf2 = 0;
v167 = 1;
v168 = 15;
LOWORD(Buf2[0]) = (unsigned __int8)asc_140518984[0];
v22 = 0;
while ( 1 )
{
v23 = Buf1;
if ( v174 > 0xF )
v23 = (void **)Buf1[0];
v163 = v23;
if ( !v173 )
break;
if ( v22 > v173 - 1 )
break;
v24 = (char *)v23 + v173 - 1;
v25 = SLOBYTE(Buf2[0]);
v26 = (char *)memchr((char *)v23 + v22, SLOBYTE(Buf2[0]), v173 - v22);
if ( !v26 )
break;
while ( memcmp(v26, Buf2, 1u) )
{
v26 = (char *)memchr(v26 + 1, v25, v24 - v26);
if ( !v26 )
goto LABEL_34;
}
v33 = v26 - (char *)v163;
if ( v33 == -1 )
break;
v34 = (char *)Block;
if ( v21 > 0xF )
v34 = (char *)Block[0];
sub_140041FF0(Buf1, v33, 1u, v34, v170);
v22 = v170 + v33;
v21 = v171;
}
LABEL_34:
v27 = v164;
if ( v171 > 0xF )
{
v28 = Block[0];
if ( v171 + 1 >= 0x1000 )
{
v28 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v28 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v28);
}
*(_OWORD *)Buf2 = 0;
v167 = 0;
v168 = 15;
LOBYTE(Buf2[0]) = 0;
CCTextInputNode::setString((__int64)v164->m_searchInput, Buf2);
LODWORD(v163) = v164->m_doomedIndex;
v164->m_doomedIndex = 0;
*(_OWORD *)Buf2 = 0;
v167 = 5;
v168 = 15;
strcpy((char *)Buf2, "lenny");
v29 = Buf1;
if ( v174 > 0xF )
v29 = (void **)Buf1[0];
v30 = v173;
v31 = v173;
if ( v173 > 5 )
v31 = 5;
LODWORD(v32) = memcmp(v29, Buf2, v31);
if ( !(_DWORD)v32 )
{
if ( v30 >= 5 )
v32 = v30 > 5;
else
LODWORD(v32) = -1;
}
if ( !(_DWORD)v32 )
{
v35 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v170 = 0;
v171 = 15;
Block[0] = sub_14003AA10(0x20u);
v170 = 21;
v171 = 31;
strcpy((char *)Block[0], "geometry.ach.secret05");
v36 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v35->m_reportedAchievements, Block);
v37 = cocos2d::CCString::intValue(v36);
if ( v171 > 0xF )
{
v39 = Block[0];
if ( v171 + 1 >= 0x1000 )
{
v39 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v39 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v39);
}
v170 = 0;
v171 = 15;
LOBYTE(Block[0]) = 0;
if ( v37 < 100 )
{
v40 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v164 = (SecretLayer *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v164);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v40 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v40, "geometry.ach.secret05", 100, v38);
v167 = 11;
v168 = 15;
Buf2[0] = (void *)0x216F6F6F6F6F6F4ELL;
Buf2[1] = (void *)2171169;
SecretLayer::updateMessageLabel(v27, Buf2);
v27->m_selectedThread = 0;
goto LABEL_235;
}
goto LABEL_225;
}
*(_OWORD *)Buf2 = 0;
v167 = 6;
v168 = 15;
strcpy((char *)Buf2, "sparky");
v41 = sub_14003A760(Buf1, Buf2);
sub_14003A830((__int64)Buf2);
if ( !v41 )
{
v42 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v170 = 0;
v171 = 15;
Block[0] = sub_14003AA10(0x20u);
v170 = 21;
v171 = 31;
strcpy((char *)Block[0], "geometry.ach.secret06");
v43 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v42->m_reportedAchievements, Block);
v44 = cocos2d::CCString::intValue(v43);
if ( v171 > 0xF )
{
v45 = Block[0];
if ( v171 + 1 >= 0x1000 )
{
v45 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v45 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v45);
}
v170 = 0;
v171 = 15;
LOBYTE(Block[0]) = 0;
if ( v44 < 100 )
{
v164 = (SecretLayer *)Buf2;
*(_OWORD *)Buf2 = 0;
v167 = 0;
v168 = 15;
Buf2[0] = sub_14003AA10(0x20u);
v167 = 18;
v168 = 31;
strcpy((char *)Buf2[0], "highscoreGet02.ogg");
v163 = Buf2;
v46 = qword_1406C2E88;
if ( !qword_1406C2E88 )
{
v154 = (FMODAudioEngine *)operator new(0x888u);
qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v154);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);
v46 = qword_1406C2E88;
}
v47 = sub_14003BDB0((__int64)v165, (__int64)Buf2);
FMODAudioEngine::playEffect(v46, v47, v48, v49, 1065353216);
sub_14003A830((__int64)Buf2);
v51 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v155 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v155);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v51 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v51, "geometry.ach.secret06", 100, v50);
v52 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v156 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v156);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v52 = (GameStatsManager *)qword_1406C2EE8;
}
GameStatsManager::storeSecretCoin(v52, "secret06");
v53 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v157 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v157);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v53 = (GameStatsManager *)qword_1406C2EE8;
}
GameStatsManager::incrementStat(v53, "8", 1);
*(_OWORD *)Buf2 = 0;
v167 = 0;
v168 = 15;
Buf2[0] = sub_14003AA10(0x20u);
v167 = 20;
v168 = 31;
strcpy((char *)Buf2[0], "My coin.. NOOOOOO!!!");
SecretLayer::updateMessageLabel(v27, Buf2);
SecretLayer::playCoinEffect(v27);
v27->m_selectedThread = 0;
goto LABEL_235;
}
goto LABEL_225;
}
*(_OWORD *)Buf2 = 0;
v167 = 6;
v168 = 15;
strcpy((char *)Buf2, "spooky");
v54 = sub_14003A760(Buf1, Buf2);
sub_14003A830((__int64)Buf2);
if ( !v54 )
{
v55 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v170 = 0;
v171 = 15;
Block[0] = sub_14003AA10(0x20u);
v170 = 21;
v171 = 31;
strcpy((char *)Block[0], "geometry.ach.secret07");
v56 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v55->m_reportedAchievements, Block);
v57 = cocos2d::CCString::intValue(v56);
if ( v171 > 0xF )
{
v59 = Block[0];
if ( v171 + 1 >= 0x1000 )
{
v59 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v59 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v59);
}
v170 = 0;
v171 = 15;
LOBYTE(Block[0]) = 0;
if ( v57 >= 100 )
goto LABEL_225;
v60 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v158 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v158);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v60 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v60, "geometry.ach.secret07", 100, v58);
*(_OWORD *)Buf2 = 0;
v167 = 0;
v168 = 15;
Buf2[0] = sub_14003AA10(0x30u);
v167 = 34;
v168 = 47;
strcpy((char *)Buf2[0], "WHAT!? How did you know my name!?!");
SecretLayer::updateMessageLabel(v27, Buf2);
v27->m_selectedThread = 0;
goto LABEL_235;
}
Buf2[1] = (void *)101;
v167 = 9;
v168 = 15;
Buf2[0] = (void *)0x7469626B636F6C62LL;
v61 = Buf1;
v62 = (void **)Buf1[0];
if ( v174 > 0xF )
v61 = (void **)Buf1[0];
v63 = v173;
v64 = v173;
if ( v173 > 9 )
v64 = 9;
LODWORD(v65) = memcmp(v61, Buf2, v64);
if ( !(_DWORD)v65 )
{
if ( v63 >= 9 )
v65 = v63 > 9;
else
LODWORD(v65) = -1;
}
if ( !(_DWORD)v65 )
{
v66 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v170 = 0;
v171 = 15;
Block[0] = sub_14003AA10(0x20u);
v170 = 21;
v171 = 31;
strcpy((char *)Block[0], "geometry.ach.secret08");
v67 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v66->m_reportedAchievements, Block);
v68 = cocos2d::CCString::intValue(v67);
if ( v171 > 0xF )
{
v70 = Block[0];
if ( v171 + 1 >= 0x1000 )
{
v70 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v70 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v70);
}
v170 = 0;
v171 = 15;
LOBYTE(Block[0]) = 0;
if ( v68 >= 100 )
goto LABEL_225;
v71 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v159 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v159);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v71 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v71, "geometry.ach.secret08", 100, v69);
*(_OWORD *)Buf2 = 0;
v167 = 0;
v168 = 15;
Buf2[0] = sub_14003AA10(0x20u);
v167 = 28;
v168 = 31;
strcpy((char *)Buf2[0], "How do you know my secrets!?");
LABEL_154:
SecretLayer::updateMessageLabel(v27, Buf2);
v27->m_selectedThread = 0;
goto LABEL_235;
}
Buf2[1] = nullptr;
v167 = 7;
v168 = 15;
Buf2[0] = (void *)0x706F746F626F72LL;
v72 = Buf1;
if ( v174 > 0xF )
v72 = v62;
v73 = v63;
if ( v63 > 7 )
v73 = 7;
LODWORD(v74) = memcmp(v72, Buf2, v73);
if ( !(_DWORD)v74 )
{
if ( v63 >= 7 )
v74 = v63 > 7;
else
LODWORD(v74) = -1;
}
if ( !(_DWORD)v74 )
{
v75 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v170 = 0;
v171 = 15;
Block[0] = sub_14003AA10(0x20u);
v170 = 21;
v171 = 31;
strcpy((char *)Block[0], "geometry.ach.secret09");
v76 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v75->m_reportedAchievements, Block);
v77 = cocos2d::CCString::intValue(v76);
if ( v171 > 0xF )
{
v79 = Block[0];
if ( v171 + 1 >= 0x1000 )
{
v79 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v79 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v79);
}
v170 = 0;
v171 = 15;
LOBYTE(Block[0]) = 0;
if ( v77 >= 100 )
goto LABEL_225;
v80 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v160 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v160);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v80 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v80, "geometry.ach.secret09", 100, v78);
*(_OWORD *)Buf2 = 0;
v167 = 0;
v168 = 15;
v81 = sub_14003AA10(0x20u);
Buf2[0] = v81;
v167 = 18;
v168 = 31;
*(_OWORD *)v81 = xmmword_1405D0188;
v82 = 11822;
goto LABEL_153;
}
*(_OWORD *)Block = 0;
v170 = 5;
v171 = 15;
strcpy((char *)Block, "ahead");
v83 = 13;
v84 = Buf1;
v152 = v174 > 0xF;
if ( v174 > 0xF )
v84 = v62;
v85 = v63;
if ( v63 > 5 )
v85 = 5;
if ( !memcmp(v84, Block, v85) && v63 == 5 )
{
v86 = (char *)Buf2[0];
v153 = 1;
}
else
{
*(_OWORD *)Buf2 = 0;
v167 = 6;
v168 = 15;
strcpy((char *)Buf2, "a head");
v83 = 15;
v86 = (char *)Buf2[0];
v87 = Buf1;
if ( v152 )
v87 = v62;
v88 = v63;
if ( v63 > 6 )
v88 = 6;
v153 = !memcmp(v87, Buf2, v88) && v63 == 6;
}
if ( (v83 & 2) != 0 && v168 > 0xF )
{
v89 = v86;
if ( v168 + 1 >= 0x1000 )
{
v86 = *((char **)v86 - 1);
if ( (unsigned __int64)(v89 - v86 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v86);
v63 = v173;
v62 = (void **)Buf1[0];
}
if ( v153 )
{
v90 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v170 = 0;
v171 = 15;
Block[0] = sub_14003AA10(0x20u);
v170 = 21;
v171 = 31;
strcpy((char *)Block[0], "geometry.ach.secret10");
v91 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v90->m_reportedAchievements, Block);
v92 = cocos2d::CCString::intValue(v91);
if ( v171 > 0xF )
{
v94 = Block[0];
if ( v171 + 1 >= 0x1000 )
{
v94 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v94 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v94);
}
v170 = 0;
v171 = 15;
LOBYTE(Block[0]) = 0;
if ( v92 >= 100 )
goto LABEL_225;
v95 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v161 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v161);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v95 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v95, "geometry.ach.secret10", 100, v93);
*(_OWORD *)Buf2 = 0;
v167 = 0;
v168 = 15;
v81 = sub_14003AA10(0x20u);
Buf2[0] = v81;
v167 = 18;
v168 = 31;
*(_OWORD *)v81 = xmmword_1405D01F8;
v82 = 8569;
goto LABEL_153;
}
*(_OWORD *)Buf2 = 0;
v167 = 4;
v168 = 15;
strcpy((char *)Buf2, "mule");
v96 = Buf1;
if ( v174 > 0xF )
v96 = v62;
v97 = v63;
if ( v63 > 4 )
v97 = 4;
if ( !memcmp(v96, Buf2, v97) && v63 == 4 )
{
sub_14003A830((__int64)Buf2);
v98 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
v170 = 0;
v171 = 15;
Block[0] = sub_14003AA10(0x20u);
v170 = 21;
v171 = 31;
strcpy((char *)Block[0], "geometry.ach.secret13");
v99 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v98->m_reportedAchievements, Block);
v100 = cocos2d::CCString::intValue(v99);
if ( v171 > 0xF )
{
v102 = Block[0];
if ( v171 + 1 >= 0x1000 )
{
v102 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v102 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v102);
}
v170 = 0;
v171 = 15;
LOBYTE(Block[0]) = 0;
if ( v100 >= 100 )
goto LABEL_225;
v103 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v162 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v162);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v103 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v103, "geometry.ach.secret13", 100, v101);
*(_OWORD *)Buf2 = 0;
v167 = 0;
v168 = 15;
v81 = sub_14003AA10(0x20u);
Buf2[0] = v81;
v167 = 18;
v168 = 31;
*(_OWORD *)v81 = xmmword_1405D01D8;
v82 = 11877;
LABEL_153:
*((_WORD *)v81 + 8) = v82;
*((_BYTE *)v81 + 18) = 0;
goto LABEL_154;
}
sub_14003A830((__int64)Buf2);
v167 = 11;
v168 = 15;
Buf2[0] = (void *)0x646E65726576656ELL;
Buf2[1] = (void *)6778473;
v104 = Buf1;
if ( v174 > 0xF )
v104 = (void **)Buf1[0];
v105 = v173;
v106 = v173;
if ( v173 > 0xB )
v106 = 11;
LODWORD(v107) = memcmp(v104, Buf2, v106);
if ( !(_DWORD)v107 )
{
if ( v105 >= 0xB )
v107 = v105 > 0xB;
else
LODWORD(v107) = -1;
}
if ( !(_DWORD)v107 )
{
v108 = AchievementManager::sharedState();
*(_OWORD *)Buf2 = 0;
v167 = 0;
v168 = 15;
Buf2[0] = sub_14003AA10(0x20u);
v167 = 21;
v168 = 31;
strcpy((char *)Buf2[0], "geometry.ach.secret14");
v109 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v108->m_reportedAchievements, Buf2);
v110 = cocos2d::CCString::intValue(v109);
if ( v168 > 0xF )
{
v111 = Buf2[0];
if ( v168 + 1 >= 0x1000 )
{
v111 = *((void **)Buf2[0] - 1);
if ( (unsigned __int64)((char *)Buf2[0] - (char *)v111 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v111);
}
if ( v110 < 100 )
{
v112 = GameManager::sharedState();
GameManager::reportAchievementWithID(v112, "geometry.ach.secret14", 100, v113);
v114 = sub_14003A7F0((__int64)v165, (__int64)"You're pretty good at this");
SecretLayer::updateMessageLabel(v27, v114);
v27->m_selectedThread = 0;
goto LABEL_235;
}
goto LABEL_225;
}
v170 = 13;
v171 = 15;
strcpy((char *)Block, "gandalfpotter");
HIWORD(Block[1]) = 0;
v115 = Buf1;
if ( v174 > 0xF )
v115 = (void **)Buf1[0];
v116 = v105;
if ( v105 > 0xD )
v116 = 13;
if ( !memcmp(v115, Block, v116) && v105 == 13 )
{
sub_14003A830((__int64)Block);
v117 = AchievementManager::sharedState();
*(_OWORD *)Buf2 = 0;
v167 = 0;
v168 = 15;
Buf2[0] = sub_14003AA10(0x20u);
v167 = 21;
v168 = 31;
strcpy((char *)Buf2[0], "geometry.ach.secret15");
v118 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v117->m_reportedAchievements, Buf2);
v119 = cocos2d::CCString::intValue(v118);
if ( v168 > 0xF )
{
v120 = Buf2[0];
if ( v168 + 1 >= 0x1000 )
{
v120 = *((void **)Buf2[0] - 1);
if ( (unsigned __int64)((char *)Buf2[0] - (char *)v120 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v120);
}
if ( v119 < 100 )
{
v121 = GameManager::sharedState();
GameManager::reportAchievementWithID(v121, "geometry.ach.secret15", 100, v122);
v123 = sub_14003A7F0((__int64)v165, (__int64)"That was weird...");
SecretLayer::updateMessageLabel(v27, v123);
v27->m_selectedThread = 0;
goto LABEL_235;
}
goto LABEL_225;
}
sub_14003A830((__int64)Block);
v124 = sub_14003A7D0(v175);
sub_14003A7F0((__int64)Buf2, (__int64)v124);
v125 = Current_set(Buf1, Buf2);
sub_14003A830((__int64)Buf2);
if ( v125 )
{
v126 = AchievementManager::sharedState();
if ( !AchievementManager::isAchievementEarned(v126, "geometry.ach.secret17") )
{
v127 = GameManager::sharedState();
GameManager::reportAchievementWithID(v127, "geometry.ach.secret17", 100, v128);
v129 = sub_14003A7F0((__int64)v165, (__int64)"He could be watching right now...");
SecretLayer::updateMessageLabel(v27, v129);
v27->m_selectedThread = 0;
goto LABEL_235;
}
goto LABEL_225;
}
sub_14003A7F0((__int64)Buf2, (__int64)"finalboss");
v130 = Current_set(Buf1, Buf2);
sub_14003A830((__int64)Buf2);
v131 = AchievementManager::sharedState();
if ( v130 )
{
if ( !AchievementManager::isAchievementEarned(v131, "geometry.ach.secret19") )
{
v132 = GameManager::sharedState();
GameManager::reportAchievementWithID(v132, "geometry.ach.secret19", 100, v133);
v134 = sub_14003A7F0((__int64)v165, (__int64)"Maybe Rub should add some of these");
SecretLayer::updateMessageLabel(v27, v134);
v27->m_selectedThread = 0;
goto LABEL_235;
}
goto LABEL_225;
}
if ( AchievementManager::isAchievementEarned(v131, "geometry.ach.secret16") )
{
LABEL_225:
m_selectedThread = v27->m_selectedThread;
Message = (const char *)SecretLayer::getMessage(v27, v165);
v149 = (__int64)Message;
v150 = Message;
if ( *((_QWORD *)Message + 3) > 0xFu )
v150 = *(const char **)Message;
v27->m_messageLabel->setString(&v27->m_messageLabel->cocos2d::CCLabelProtocol, v150);
cocos2d::CCLabelBMFont::limitLabelWidth(v27->m_messageLabel, 320.0, 0.60000002, 0.0);
sub_14003A830(v149);
if ( m_selectedThread > 0 || v27->m_selectedThread > 0 )
{
if ( v27->m_selectedThread > 100 || m_selectedThread > 100 )
{
LOWORD(v163) = -256;
BYTE2(v163) = -56;
v151 = &v163;
}
else
{
v151 = (void ***)&unk_140529BFC;
}
}
else
{
v151 = (void ***)&unk_140529BF8;
}
v27->m_messageLabel->setColor(&v27->m_messageLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)v151);
goto LABEL_235;
}
switch ( (int)v163 )
{
case 0:
sub_14003A7F0((__int64)Buf2, (__int64)"8");
v135 = Current_set(Buf1, Buf2);
sub_14003A830((__int64)Buf2);
if ( !v135 )
goto LABEL_225;
BasicMessage = SecretLayer::getBasicMessage(v27, v165);
goto LABEL_212;
case 1:
sub_14003A7F0((__int64)Buf2, (__int64)&word_140544454);
v137 = Current_set(Buf1, Buf2);
sub_14003A830((__int64)Buf2);
if ( !v137 )
goto LABEL_225;
BasicMessage = sub_14003A7F0((__int64)v165, (__int64)"...");
LABEL_212:
SecretLayer::updateMessageLabel(v27, BasicMessage);
v27->m_doomedIndex = (_DWORD)v163 + 1;
v138 = (void ***)&unk_140529BF8;
goto LABEL_222;
case 2:
sub_14003A7F0((__int64)Buf2, (__int64)"30");
v139 = Current_set(Buf1, Buf2);
sub_14003A830((__int64)Buf2);
if ( !v139 )
goto LABEL_225;
v140 = "What do you think you're doing?";
goto LABEL_221;
case 3:
sub_14003A7F0((__int64)Buf2, (__int64)&word_1405579D4);
v141 = Current_set(Buf1, Buf2);
sub_14003A830((__int64)Buf2);
if ( !v141 )
goto LABEL_225;
v140 = "Those numbers, aren't they...";
goto LABEL_221;
case 4:
sub_14003A7F0((__int64)Buf2, (__int64)"46");
v142 = Current_set(Buf1, Buf2);
sub_14003A830((__int64)Buf2);
if ( !v142 )
goto LABEL_225;
v140 = "NO NO NO NO!!!";
goto LABEL_221;
case 5:
sub_14003A7F0((__int64)Buf2, (__int64)"84");
v143 = Current_set(Buf1, Buf2);
sub_14003A830((__int64)Buf2);
if ( !v143 )
goto LABEL_225;
v140 = "GAH!! You have doomed us all!";
LABEL_221:
v144 = sub_14003A7F0((__int64)v165, (__int64)v140);
SecretLayer::updateMessageLabel(v27, v144);
v27->m_doomedIndex = (_DWORD)v163 + 1;
LOWORD(v163) = 25855;
BYTE2(v163) = 0;
v138 = &v163;
LABEL_222:
v27->m_messageLabel->setColor(&v27->m_messageLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)v138);
if ( v27->m_doomedIndex > 5 )
{
v27->m_doomedIndex = 0;
v145 = GameManager::sharedState();
GameManager::reportAchievementWithID(v145, "geometry.ach.secret16", 100, v146);
}
v27->m_selectedThread = 0;
break;
default:
goto LABEL_225;
}
LABEL_235:
sub_14003A830((__int64)v175);
sub_14003A830((__int64)Buf1);
sub_14003A830((__int64)Src);
}