//
// SecretLayer2::onSubmit from 0x1403e5270 to 0x1403e6d76 (6918 bytes)
//
// 2 xrefs:
// > SecretLayer2::init @ 0x1403e30f2
// > ??> @ 0x1406d7f70
//
// 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=20
void SecretLayer2::onSubmit(SecretLayer2 *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
size_t v10; // rdi
__int64 v11; // rbx
unsigned int v12; // r12d
__int64 v13; // rbx
void **v14; // rdi
char *v15; // rax
unsigned __int64 v16; // r14
size_t v17; // rbx
FMODAudioEngine *v18; // rax
size_t v19; // rdi
char *v20; // rdi
int v21; // r13d
char *v22; // rbx
SecretLayer2 *v23; // r14
void *v24; // rcx
void **v25; // rcx
unsigned __int64 v26; // r12
size_t v27; // r8
__int64 v28; // rbx
unsigned __int64 v29; // rbx
char *v30; // r9
AchievementManager *v31; // rbx
cocos2d::CCString *v32; // rax
int v33; // ebx
bool v34; // r9
void *v35; // rcx
GameManager *v36; // rcx
GameManager *v37; // rcx
int v38; // ebx
void **v39; // rcx
AchievementManager *v40; // rbx
cocos2d::CCString *v41; // rax
int v42; // ebx
bool v43; // r9
void *v44; // rcx
GameManager *v45; // rcx
bool UGV; // al
unsigned __int64 v47; // rbx
unsigned __int64 v48; // r13
__int64 v49; // rdi
void **v50; // rcx
size_t v51; // r8
char v52; // r12
__int64 v53; // rax
AchievementManager *v54; // rbx
cocos2d::CCString *v55; // rax
int v56; // ebx
void *v57; // rcx
int v58; // ecx
bool v59; // r9
GameManager *v60; // rcx
GameStatsManager *v61; // rcx
GameStatsManager *v62; // rcx
void **v63; // rcx
size_t v64; // r8
AchievementManager *v65; // rbx
cocos2d::CCString *v66; // rax
int v67; // ebx
bool v68; // r9
void *v69; // rcx
GameManager *v70; // rcx
float v71; // xmm1_4
GameStatsManager *v72; // rcx
int Stat; // eax
cocos2d::CCString *v74; // rax
const char *CString; // rax
size_t v76; // r8
void **v77; // rdx
_BYTE *v78; // rdi
void **v79; // rcx
size_t v80; // r12
size_t v81; // r8
size_t v82; // r13
__int64 v83; // rbx
_BYTE *v84; // rax
AchievementManager *v85; // rbx
cocos2d::CCString *v86; // rax
int v87; // ebx
bool v88; // r9
void *v89; // rcx
GameManager *v90; // rcx
void **v91; // rcx
void **v92; // r13
unsigned __int64 v93; // rbx
size_t v94; // r8
__int64 v95; // r12
AchievementManager *v96; // rbx
cocos2d::CCString *v97; // rax
int v98; // ebx
bool v99; // r9
void *v100; // rcx
GameManager *v101; // rcx
__int64 v102; // rdx
void **v103; // rcx
size_t v104; // r8
__int64 v105; // rdi
AchievementManager *v106; // rbx
cocos2d::CCString *v107; // rax
int v108; // ebx
bool v109; // r9
void *v110; // rcx
GameManager *v111; // rcx
char *v112; // rbx
void **v113; // rcx
unsigned __int64 v114; // rdi
size_t v115; // r8
AchievementManager *v116; // rbx
cocos2d::CCString *v117; // rax
int v118; // ebx
bool v119; // r9
void *v120; // rcx
GameManager *v121; // rcx
void **v122; // rcx
unsigned __int64 v123; // r12
size_t v124; // r8
__int64 v125; // rbx
AchievementManager *v126; // rbx
cocos2d::CCString *v127; // rax
int v128; // ebx
void *v129; // rcx
GameManager *v130; // rax
bool v131; // r9
const char *v132; // rdx
bool v133; // bl
AchievementManager *v134; // rax
GameManager *v135; // rax
bool v136; // r9
bool v137; // bl
GameManager *v138; // rax
__int64 v139; // rax
bool v140; // bl
__int64 v141; // rax
GameManager *v142; // rax
GameManager *v143; // rcx
SecretNumberLayer *v144; // rbx
GameManager *v145; // rax
bool v146; // bl
__int64 ErrorMessage; // rax
bool v148; // bl
bool v149; // bl
bool v150; // bl
bool v151; // bl
__int16 *v152; // rdx
int m_selectedThread; // ebx
__int64 Message; // rax
int v155; // [rsp+30h] [rbp-89h] BYREF
bool v156; // [rsp+34h] [rbp-85h]
SecretLayer2 *v157; // [rsp+38h] [rbp-81h]
FMODAudioEngine *v158; // [rsp+40h] [rbp-79h]
void *Block[2]; // [rsp+48h] [rbp-71h] BYREF
size_t Size; // [rsp+58h] [rbp-61h]
unsigned __int64 v161; // [rsp+60h] [rbp-59h]
void *Buf2[2]; // [rsp+68h] [rbp-51h] BYREF
__int64 v163; // [rsp+78h] [rbp-41h]
__int64 v164; // [rsp+80h] [rbp-39h]
void *Buf1[2]; // [rsp+88h] [rbp-31h] BYREF
unsigned __int64 v166; // [rsp+98h] [rbp-21h]
unsigned __int64 v167; // [rsp+A0h] [rbp-19h]
__int128 v168; // [rsp+A8h] [rbp-11h] BYREF
__int64 v169; // [rsp+B8h] [rbp-1h]
__int64 v170; // [rsp+C0h] [rbp+7h]
void *Src[2]; // [rsp+C8h] [rbp+Fh] BYREF
size_t v172; // [rsp+D8h] [rbp+1Fh]
unsigned __int64 v173; // [rsp+E0h] [rbp+27h]
v157 = a1;
v155 = 0;
v2 = &a1->m_searchInput->m_textField->cocos2d::CCLabelProtocol;
v3 = (_BYTE *)((__int64 (__fastcall *)(cocos2d::CCLabelProtocol *, cocos2d::CCObject *))v2->getString)(v2, a2);
*(_OWORD *)Src = 0;
v172 = 0;
v173 = 0;
v4 = -1;
do
++v4;
while ( v3[v4] );
sub_14003A930(Src, v3, v4);
v155 = 2;
*(_OWORD *)Buf1 = 0;
v166 = 0;
v167 = 0;
v9 = Src;
if ( v173 > 0xF )
v9 = (void **)Src[0];
v10 = v172;
v11 = 0x7FFFFFFFFFFFFFFFLL;
if ( v172 > 0x7FFFFFFFFFFFFFFFLL )
sub_140007B50(v6, v5, v7, v8);
v167 = 15;
if ( v172 > 0xF )
{
if ( (v172 | 0xF) <= 0x7FFFFFFFFFFFFFFFLL )
{
v11 = v172 | 0xF;
if ( (v172 | 0xF) < 0x16 )
v11 = 22;
}
Buf1[0] = sub_14003AA10(v11 + 1);
v166 = v10;
v167 = v11;
memcpy(Buf1[0], v9, v10 + 1);
}
else
{
v166 = v172;
*(_OWORD *)Buf1 = *(_OWORD *)v9;
}
v12 = 0;
if ( v10 )
{
v13 = 0;
do
{
if ( v167 <= 0xF )
{
v15 = (char *)Buf1 + v13;
v14 = Buf1;
}
else
{
v14 = (void **)Buf1[0];
v15 = (char *)Buf1[0] + v13;
}
*((_BYTE *)v14 + v13) = tolower(*v15);
v13 = ++v12;
v10 = v166;
}
while ( v12 < v166 );
}
*(_OWORD *)Block = 0;
Size = 0;
v16 = 15;
v161 = 15;
LOBYTE(Block[0]) = 0;
*(_OWORD *)Buf2 = 0;
v163 = 1;
v164 = 15;
LOWORD(Buf2[0]) = (unsigned __int8)asc_140518984[0];
v17 = 0;
while ( 1 )
{
v18 = (FMODAudioEngine *)Buf1;
if ( v167 > 0xF )
v18 = (FMODAudioEngine *)Buf1[0];
v158 = v18;
if ( !v10 )
break;
v19 = v10 - 1;
if ( v17 > v19 )
break;
v20 = (char *)v18 + v19;
v21 = SLOBYTE(Buf2[0]);
v22 = (char *)memchr((char *)v18 + v17, SLOBYTE(Buf2[0]), v20 + 1 - ((char *)v18 + v17));
if ( !v22 )
break;
while ( memcmp(v22, Buf2, 1u) )
{
v22 = (char *)memchr(v22 + 1, v21, v20 - v22);
if ( !v22 )
goto LABEL_26;
}
v29 = v22 - (char *)v158;
if ( v29 == -1 )
break;
v30 = (char *)Block;
if ( v16 > 0xF )
v30 = (char *)Block[0];
sub_140041FF0(Buf1, v29, 1u, v30, Size);
v17 = Size + v29;
v10 = v166;
v16 = v161;
}
LABEL_26:
v23 = v157;
if ( v161 > 0xF )
{
v24 = Block[0];
if ( v161 + 1 >= 0x1000 )
{
v24 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v24 - 8) > 0x1F )
goto LABEL_174;
}
j_j_free(v24);
}
v168 = 0;
v169 = 0;
v170 = 15;
LOBYTE(v168) = 0;
CCTextInputNode::setString((__int64)v157->m_searchInput, &v168);
Buf2[1] = (void *)29285;
v163 = 10;
v164 = 15;
Buf2[0] = (void *)0x776F706E69617262LL;
v25 = Buf1;
if ( v167 > 0xF )
v25 = (void **)Buf1[0];
v26 = v166;
v27 = v166;
if ( v166 > 0xA )
v27 = 10;
LODWORD(v28) = memcmp(v25, Buf2, v27);
if ( !(_DWORD)v28 )
{
if ( v26 >= 0xA )
v28 = v26 > 0xA;
else
LODWORD(v28) = -1;
}
if ( !(_DWORD)v28 )
{
v31 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
Size = 0;
v161 = 15;
Block[0] = sub_14003AA10(0x20u);
Size = 24;
v161 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret01");
v32 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v31->m_reportedAchievements, Block);
v33 = cocos2d::CCString::intValue(v32);
if ( v161 > 0xF )
{
v35 = Block[0];
if ( v161 + 1 >= 0x1000 )
{
v35 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v35 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v35);
}
Size = 0;
v161 = 15;
LOBYTE(Block[0]) = 0;
if ( v33 < 100 )
{
v36 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v157 = (SecretLayer2 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v157);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v36 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v36, "geometry.ach.v2.secret01", 100, v34);
*(_OWORD *)Buf2 = 0;
v163 = 0;
v164 = 15;
Buf2[0] = sub_14003AA10(0x30u);
v163 = 46;
v164 = 47;
strcpy((char *)Buf2[0], "O-oooooooooo AAAAE-A-A-I-A-U- JO-oooooooooooo!");
SecretLayer2::updateMessageLabel(v23, Buf2);
LOWORD(v155) = -256;
BYTE2(v155) = -1;
v23->m_messageLabel->setColor(&v23->m_messageLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v155);
cocos2d::CCLabelBMFont::limitLabelWidth(v23->m_messageLabel, 400.0, 0.80000001, 0.0);
v23->m_selectedThread = 0;
goto LABEL_241;
}
goto LABEL_237;
}
v37 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v157 = (SecretLayer2 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v157);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v37 = (GameManager *)qword_1406C2ED8;
}
v38 = v37->m_secretNumber.seed - v37->m_secretNumber.random;
if ( v38 > 0 )
{
v39 = Src;
if ( v173 > 0xF )
v39 = (void **)Src[0];
if ( atoi((const char *)v39) == v38 )
{
v40 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
Size = 0;
v161 = 15;
Block[0] = sub_14003AA10(0x20u);
Size = 24;
v161 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret02");
v41 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v40->m_reportedAchievements, Block);
v42 = cocos2d::CCString::intValue(v41);
if ( v161 > 0xF )
{
v44 = Block[0];
if ( v161 + 1 >= 0x1000 )
{
v44 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v44 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v44);
}
Size = 0;
v161 = 15;
LOBYTE(Block[0]) = 0;
if ( v42 < 100 )
{
v45 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v157 = (SecretLayer2 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v157);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v45 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v45, "geometry.ach.v2.secret02", 100, v43);
Size = 13;
v161 = 15;
qmemcpy(Block, "Impressive..", 12);
HIDWORD(Block[1]) = (unsigned __int8)aImpressive[12];
SecretLayer2::updateMessageLabel(v23, Block);
LOWORD(v155) = -256;
BYTE2(v155) = -1;
v23->m_messageLabel->setColor(&v23->m_messageLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v155);
v23->m_selectedThread = 0;
goto LABEL_241;
}
LABEL_237:
m_selectedThread = v23->m_selectedThread;
Message = SecretLayer2::getMessage(v23, &v168);
SecretLayer2::updateMessageLabel(v23, Message);
if ( m_selectedThread > 0 || (v152 = &word_140529C08, v23->m_selectedThread > 0) )
v152 = (__int16 *)&unk_140529C0C;
goto LABEL_240;
}
v37 = (GameManager *)qword_1406C2ED8;
}
if ( !v37 )
{
v157 = (SecretLayer2 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v157);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v37 = (GameManager *)qword_1406C2ED8;
}
UGV = GameManager::getUGV(v37, (const char *)&word_140531E9C);
v47 = v166;
if ( !UGV )
{
v48 = v161;
v49 = (__int64)Block[0];
goto LABEL_79;
}
Block[1] = nullptr;
Size = 7;
v48 = 15;
v161 = 15;
Block[0] = (void *)0x62756662756C67LL;
v155 = 3;
v49 = 0x62756662756C67LL;
v50 = Buf1;
if ( v167 > 0xF )
v50 = (void **)Buf1[0];
v51 = v166;
if ( v166 > 7 )
v51 = 7;
if ( memcmp(v50, Block, v51) || v47 != 7 )
{
LABEL_79:
v52 = 0;
if ( (v155 & 1) == 0 )
goto LABEL_100;
goto LABEL_80;
}
v52 = 1;
LABEL_80:
if ( v48 > 0xF )
{
v53 = v49;
if ( v48 + 1 >= 0x1000 )
{
v49 = *(_QWORD *)(v49 - 8);
if ( (unsigned __int64)(v53 - v49 - 8) > 0x1F )
goto LABEL_174;
}
j_j_free((void *)v49);
v47 = v166;
}
if ( v52 )
{
v54 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
Size = 0;
v161 = 15;
Block[0] = sub_14003AA10(0x20u);
Size = 24;
v161 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret03");
v55 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v54->m_reportedAchievements, Block);
v56 = cocos2d::CCString::intValue(v55);
if ( v161 > 0xF )
{
v57 = Block[0];
if ( v161 + 1 >= 0x1000 )
{
v57 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v57 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v57);
}
Size = 0;
v161 = 15;
LOBYTE(Block[0]) = 0;
if ( v56 >= 100 )
goto LABEL_237;
v157 = (SecretLayer2 *)Buf2;
*(_OWORD *)Buf2 = 0;
v163 = 0;
v164 = 15;
Buf2[0] = sub_14003AA10(0x20u);
v163 = 18;
v164 = 31;
strcpy((char *)Buf2[0], "highscoreGet02.ogg");
v58 = qword_1406C2E88;
if ( !qword_1406C2E88 )
{
v158 = (FMODAudioEngine *)operator new(0x888u);
qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v158);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);
v58 = qword_1406C2E88;
}
FMODAudioEngine::playEffect_1(v58, (__int64)Buf2);
v60 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v157 = (SecretLayer2 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v157);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v60 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v60, "geometry.ach.v2.secret03", 100, v59);
v61 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v157 = (SecretLayer2 *)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v157);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v61 = (GameStatsManager *)qword_1406C2EE8;
}
GameStatsManager::storeSecretCoin(v61, "secretB03");
v62 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v157 = (SecretLayer2 *)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v157);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v62 = (GameStatsManager *)qword_1406C2EE8;
}
GameStatsManager::incrementStat(v62, "8", 1);
*(_OWORD *)Buf2 = 0;
v163 = 0;
v164 = 15;
Buf2[0] = sub_14003AA10(0x20u);
v163 = 21;
v164 = 31;
strcpy((char *)Buf2[0], "NOOOO!! THIEF! THIEF!");
SecretLayer2::updateMessageLabel(v23, Buf2);
SecretLayer2::playCoinEffect(v23);
v23->m_selectedThread = 0;
goto LABEL_241;
}
LABEL_100:
Block[1] = nullptr;
Size = 8;
v161 = 15;
Block[0] = (void *)0x656275636F74636FLL;
v63 = Buf1;
if ( v167 > 0xF )
v63 = (void **)Buf1[0];
v64 = v47;
if ( v47 > 8 )
v64 = 8;
if ( !memcmp(v63, Block, v64) && v47 == 8 )
{
sub_14003A830((__int64)Block);
v65 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
Size = 0;
v161 = 15;
Block[0] = sub_14003AA10(0x20u);
Size = 24;
v161 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret04");
v66 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v65->m_reportedAchievements, Block);
v67 = cocos2d::CCString::intValue(v66);
if ( v161 > 0xF )
{
v69 = Block[0];
if ( v161 + 1 >= 0x1000 )
{
v69 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v69 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v69);
}
Size = 0;
v161 = 15;
LOBYTE(Block[0]) = 0;
if ( v67 >= 100 )
goto LABEL_241;
v70 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v157 = (SecretLayer2 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v157);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v70 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v70, "geometry.ach.v2.secret04", 100, v68);
Size = 15;
v161 = 15;
strcpy((char *)Block, "Ugh... Slippery");
SecretLayer2::updateMessageLabel(v23, Block);
LOWORD(v155) = -256;
BYTE2(v155) = -1;
v23->m_messageLabel->setColor(&v23->m_messageLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v155);
v71 = 400.0;
LABEL_213:
cocos2d::CCLabelBMFont::limitLabelWidth(v23->m_messageLabel, v71, 0.80000001, 0.0);
v23->m_selectedThread = 0;
goto LABEL_241;
}
sub_14003A830((__int64)Block);
v72 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v157 = (SecretLayer2 *)operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v157);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v72 = (GameStatsManager *)qword_1406C2EE8;
}
Stat = GameStatsManager::getStat(v72, "6");
v74 = cocos2d::CCString::createWithFormat("%i", Stat);
CString = cocos2d::CCString::getCString(v74);
*(_OWORD *)Block = 0;
Size = 0;
v161 = 0;
v76 = -1;
do
++v76;
while ( CString[v76] );
sub_14003A930(Block, CString, v76);
v77 = Block;
v156 = v161 > 0xF;
v78 = Block[0];
if ( v161 > 0xF )
v77 = (void **)Block[0];
v79 = Src;
if ( v173 > 0xF )
v79 = (void **)Src[0];
v80 = v172;
v81 = v172;
v82 = Size;
if ( Size < v172 )
v81 = Size;
LODWORD(v83) = memcmp(v79, v77, v81);
if ( !(_DWORD)v83 )
{
if ( v80 >= v82 )
v83 = v80 > v82;
else
LODWORD(v83) = -1;
}
if ( v156 )
{
v84 = v78;
if ( v161 + 1 < 0x1000 || (v78 = *((_BYTE **)v78 - 1), (unsigned __int64)(v84 - v78 - 8) <= 0x1F) )
{
j_j_free(v78);
goto LABEL_133;
}
LABEL_174:
invalid_parameter_noinfo_noreturn();
}
LABEL_133:
if ( !(_DWORD)v83 )
{
v85 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
Size = 0;
v161 = 15;
Block[0] = sub_14003AA10(0x20u);
Size = 24;
v161 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret05");
v86 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v85->m_reportedAchievements, Block);
v87 = cocos2d::CCString::intValue(v86);
if ( v161 > 0xF )
{
v89 = Block[0];
if ( v161 + 1 >= 0x1000 )
{
v89 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v89 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v89);
}
Size = 0;
v161 = 15;
LOBYTE(Block[0]) = 0;
if ( v87 >= 100 )
goto LABEL_237;
v90 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v157 = (SecretLayer2 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v157);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v90 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v90, "geometry.ach.v2.secret05", 100, v88);
*(_OWORD *)Buf2 = 0;
v163 = 0;
v164 = 15;
Buf2[0] = sub_14003AA10(0x30u);
v163 = 33;
v164 = 47;
strcpy((char *)Buf2[0], "I wish I had that many shinies...");
SecretLayer2::updateMessageLabel(v23, Buf2);
LOWORD(v155) = -256;
BYTE2(v155) = -1;
v23->m_messageLabel->setColor(&v23->m_messageLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v155);
v23->m_selectedThread = 0;
goto LABEL_241;
}
*(_OWORD *)Buf2 = 0;
v163 = 5;
v164 = 15;
strcpy((char *)Buf2, "seven");
v91 = Buf1;
v92 = (void **)Buf1[0];
if ( v167 > 0xF )
v91 = (void **)Buf1[0];
v93 = v166;
v94 = v166;
if ( v166 > 5 )
v94 = 5;
LODWORD(v95) = memcmp(v91, Buf2, v94);
if ( !(_DWORD)v95 )
{
if ( v93 >= 5 )
v95 = v93 > 5;
else
LODWORD(v95) = -1;
}
if ( !(_DWORD)v95 )
{
v96 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
Size = 0;
v161 = 15;
Block[0] = sub_14003AA10(0x20u);
Size = 24;
v161 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret06");
v97 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v96->m_reportedAchievements, Block);
v98 = cocos2d::CCString::intValue(v97);
if ( v161 > 0xF )
{
v100 = Block[0];
if ( v161 + 1 >= 0x1000 )
{
v100 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v100 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v100);
}
Size = 0;
v161 = 15;
LOBYTE(Block[0]) = 0;
if ( v98 >= 100 )
goto LABEL_241;
v101 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v157 = (SecretLayer2 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v157);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v101 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v101, "geometry.ach.v2.secret06", 100, v99);
*(_OWORD *)Buf2 = 0;
v163 = 0;
v164 = 15;
Buf2[0] = sub_14003AA10(0x20u);
v163 = 30;
v164 = 31;
strcpy((char *)Buf2[0], "I should have been a doctor...");
v102 = (__int64)Buf2;
goto LABEL_212;
}
Size = 14;
v161 = 15;
strcpy((char *)Block, "gimmiethecolor");
HIBYTE(Block[1]) = 0;
v103 = Buf1;
if ( v167 > 0xF )
v103 = v92;
v104 = v93;
if ( v93 > 0xE )
v104 = 14;
LODWORD(v105) = memcmp(v103, Block, v104);
if ( !(_DWORD)v105 )
{
if ( v93 >= 0xE )
v105 = v93 > 0xE;
else
LODWORD(v105) = -1;
}
if ( !(_DWORD)v105 )
{
v106 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
Size = 0;
v161 = 15;
Block[0] = sub_14003AA10(0x20u);
Size = 24;
v161 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret07");
v107 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v106->m_reportedAchievements, Block);
v108 = cocos2d::CCString::intValue(v107);
if ( v161 > 0xF )
{
v110 = Block[0];
if ( v161 + 1 >= 0x1000 )
{
v110 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v110 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v110);
}
Size = 0;
v161 = 15;
LOBYTE(Block[0]) = 0;
if ( v108 >= 100 )
goto LABEL_241;
v111 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v157 = (SecretLayer2 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v157);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v111 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v111, "geometry.ach.v2.secret07", 100, v109);
*(_OWORD *)Buf2 = 0;
v163 = 0;
v164 = 15;
Buf2[0] = sub_14003AA10(0x20u);
v163 = 28;
v164 = 31;
strcpy((char *)Buf2[0], "How many colors do you need?");
v102 = (__int64)Buf2;
goto LABEL_212;
}
*((_QWORD *)&v168 + 1) = 0;
v112 = (char *)sub_14003AA10(0x20u);
*(_QWORD *)&v168 = v112;
v169 = 18;
v170 = 31;
strcpy(v112, "thechickenisonfire");
v113 = Buf1;
if ( v167 > 0xF )
v113 = (void **)Buf1[0];
v114 = v166;
v115 = v166;
if ( v166 > 0x12 )
v115 = 18;
if ( !memcmp(v113, v112, v115) && v114 == 18 )
{
j_j_free(v112);
v116 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
Size = 0;
v161 = 15;
Block[0] = sub_14003AA10(0x20u);
Size = 24;
v161 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret08");
v117 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v116->m_reportedAchievements, Block);
v118 = cocos2d::CCString::intValue(v117);
if ( v161 > 0xF )
{
v120 = Block[0];
if ( v161 + 1 >= 0x1000 )
{
v120 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v120 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v120);
}
Size = 0;
v161 = 15;
LOBYTE(Block[0]) = 0;
if ( v118 >= 100 )
goto LABEL_241;
v121 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v157 = (SecretLayer2 *)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v157);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v121 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v121, "geometry.ach.v2.secret08", 100, v119);
Size = 15;
v161 = 15;
strcpy((char *)Block, "Indeed it is...");
v102 = (__int64)Block;
goto LABEL_212;
}
j_j_free(v112);
v163 = 12;
v164 = 15;
strcpy((char *)Buf2, "d4shg30me7ry");
BYTE5(Buf2[1]) = 0;
HIWORD(Buf2[1]) = 0;
v122 = Buf1;
if ( v167 > 0xF )
v122 = (void **)Buf1[0];
v123 = v166;
v124 = v166;
if ( v166 > 0xC )
v124 = 12;
LODWORD(v125) = memcmp(v122, Buf2, v124);
if ( !(_DWORD)v125 )
{
if ( v123 >= 0xC )
v125 = v123 > 0xC;
else
LODWORD(v125) = -1;
}
if ( !(_DWORD)v125 )
{
v126 = AchievementManager::sharedState();
*(_OWORD *)Block = 0;
Size = 0;
v161 = 15;
Block[0] = sub_14003AA10(0x20u);
Size = 24;
v161 = 31;
strcpy((char *)Block[0], "geometry.ach.v2.secret09");
v127 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v126->m_reportedAchievements, Block);
v128 = cocos2d::CCString::intValue(v127);
if ( v161 > 0xF )
{
v129 = Block[0];
if ( v161 + 1 >= 0x1000 )
{
v129 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v129 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v129);
}
if ( v128 >= 100 )
goto LABEL_237;
v130 = GameManager::sharedState();
GameManager::reportAchievementWithID(v130, "geometry.ach.v2.secret09", 100, v131);
v132 = "Good times";
LABEL_211:
v102 = sub_14003A7F0((__int64)&v168, (__int64)v132);
LABEL_212:
SecretLayer2::updateMessageLabel(v23, v102);
LOWORD(v155) = -256;
BYTE2(v155) = -1;
v23->m_messageLabel->setColor(&v23->m_messageLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v155);
v71 = 300.0;
goto LABEL_213;
}
sub_14003A7F0((__int64)&v168, (__int64)"thechickenisready");
v133 = Current_set(Buf1, &v168);
sub_14003A830((__int64)&v168);
if ( v133 )
{
v134 = AchievementManager::sharedState();
if ( AchievementManager::isAchievementEarned(v134, "geometry.ach.v2.secret10") )
goto LABEL_237;
v135 = GameManager::sharedState();
GameManager::reportAchievementWithID(v135, "geometry.ach.v2.secret10", 100, v136);
v132 = "You overcooked it again!";
goto LABEL_211;
}
sub_14003A7F0((__int64)&v168, (__int64)"thechallenge");
v137 = Current_set(Buf1, &v168);
sub_14003A830((__int64)&v168);
if ( v137 )
{
v138 = GameManager::sharedState();
if ( !GameManager::getUGV(v138, (const char *)&word_140531EA4) )
{
v139 = sub_14003A7F0((__int64)&v168, (__int64)"My level? You want to try it!?");
SecretLayer2::updateMessageLabel(v23, v139);
LOWORD(v155) = -256;
BYTE2(v155) = -1;
v23->m_messageLabel->setColor(&v23->m_messageLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v155);
v23->m_selectedThread = 0;
SecretLayer2::showSecretLevel(v23);
goto LABEL_241;
}
goto LABEL_237;
}
sub_14003A7F0((__int64)&v168, (__int64)"cod3breaker");
v140 = Current_set(Buf1, &v168);
sub_14003A830((__int64)&v168);
if ( !v140 )
{
if ( v172 )
{
sub_14003A7F0((__int64)&v168, (__int64)"unicorn");
v146 = Current_set(Buf1, &v168);
sub_14003A830((__int64)&v168);
if ( v146 )
{
ErrorMessage = sub_14003A7F0((__int64)&v168, (__int64)"Why do they have a horn?");
}
else
{
sub_14003A7F0((__int64)&v168, (__int64)"rubrubpowah123");
v148 = Current_set(Buf1, &v168);
sub_14003A830((__int64)&v168);
if ( v148 )
{
ErrorMessage = sub_14003A7F0((__int64)&v168, (__int64)"Ultimate Haxxor mode enabled. Not...");
}
else
{
sub_14003A7F0((__int64)&v168, (__int64)"battop");
v149 = Current_set(Buf1, &v168);
sub_14003A830((__int64)&v168);
if ( v149 )
{
ErrorMessage = sub_14003A7F0((__int64)&v168, (__int64)"He could be watching us right now...");
}
else
{
sub_14003A7F0((__int64)&v168, (__int64)"kappa");
v150 = Current_set(Buf1, &v168);
sub_14003A830((__int64)&v168);
if ( v150 )
{
ErrorMessage = sub_14003A7F0((__int64)&v168, (__int64)"There is no Kappa icon...");
}
else
{
sub_14003A7F0((__int64)&v168, (__int64)"robtop");
v151 = Current_set(Buf1, &v168);
sub_14003A830((__int64)&v168);
if ( v151 )
ErrorMessage = sub_14003A7F0((__int64)&v168, (__int64)"RUBRUBRUBRUBRUBRUB");
else
ErrorMessage = SecretLayer2::getErrorMessage(v23, &v168);
}
}
}
}
SecretLayer2::updateMessageLabel(v23, ErrorMessage);
v23->m_selectedThread = 0;
LOWORD(v155) = -26881;
BYTE2(v155) = 0;
v152 = (__int16 *)&v155;
LABEL_240:
v23->m_messageLabel->setColor(&v23->m_messageLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)v152);
goto LABEL_241;
}
goto LABEL_237;
}
v141 = sub_14003A7F0((__int64)&v168, (__int64)" ");
SecretLayer2::updateMessageLabel(v23, v141);
v23->m_selectedThread = 0;
v142 = GameManager::sharedState();
if ( v142->m_secretNumber.seed - v142->m_secretNumber.random <= 0 )
{
GameManager::sharedState();
GameManager::generateSecretNumber(v143);
}
v144 = SecretNumberLayer::create();
v23->addChild_0(v23, v144, 100);
v145 = GameManager::sharedState();
SecretNumberLayer::playNumberEffect(v144, v145->m_secretNumber.seed - v145->m_secretNumber.random);
LABEL_241:
sub_14003A830((__int64)Buf1);
sub_14003A830((__int64)Src);
}