//
// SecretLayer4::onSubmit from 0x6224d0 to 0x622b88 (1720 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:55:07 +0000
//
int __fastcall SecretLayer4::onSubmit(SecretLayer4 *this, cocos2d::CCObject *a2)
{
unsigned int v3; // r5
char *v4; // r3
char *v5; // r6
char *v6; // r3
int v7; // r0
size_t i; // r8
unsigned __int8 *v9; // r12
unsigned int v10; // r1
unsigned __int8 *v11; // lr
int v12; // r0
char *v13; // r1
char *v14; // r0
int v15; // r9
unsigned __int8 *v16; // r8
char *v17; // r9
int v18; // t1
unsigned int v19; // r2
char *v20; // r3
size_t v21; // r1
int v22; // r3
int v23; // r6
_BOOL4 v24; // r7
AchievementManager *v25; // r0
AchievementManager *v26; // r0
GameManager *v27; // r0
int *v28; // r7
int v29; // r0
void (__fastcall *v30)(int, char *); // r2
_BOOL4 v31; // r7
AchievementManager *v32; // r0
AchievementManager *v33; // r0
GameManager *v34; // r0
_BOOL4 v35; // r7
AchievementManager *v36; // r0
AchievementManager *v37; // r0
GameManager *v38; // r0
_BOOL4 v39; // r7
AchievementManager *v40; // r0
AchievementManager *v41; // r0
GameManager *v42; // r0
_BOOL4 v43; // r7
AchievementManager *v44; // r0
AchievementManager *v45; // r0
GameManager *v46; // r0
_BOOL4 v47; // r7
AchievementManager *v48; // r0
AchievementManager *v49; // r0
GameManager *v50; // r0
_BOOL4 v51; // r8
AchievementManager *v52; // r0
AchievementManager *v53; // r0
GameManager *v54; // r0
int v55; // r3
int v56; // r0
void (__fastcall *v57)(int, char *); // r2
int v58; // r8
int v59; // r0
void (*v60)(void); // r3
unsigned __int8 *v62; // [sp+Ch] [bp-140h]
unsigned __int8 *v63; // [sp+14h] [bp-138h]
unsigned __int8 *v64; // [sp+20h] [bp-12Ch]
char v65; // [sp+2Ch] [bp-120h] BYREF
__int16 v66; // [sp+2Dh] [bp-11Fh]
char v67[4]; // [sp+30h] [bp-11Ch] BYREF
int v68; // [sp+34h] [bp-118h]
int v69; // [sp+3Ch] [bp-110h] BYREF
unsigned int v70; // [sp+40h] [bp-10Ch]
char *v71; // [sp+44h] [bp-108h]
int v72; // [sp+48h] [bp-104h] BYREF
unsigned int v73; // [sp+4Ch] [bp-100h]
unsigned __int8 *v74; // [sp+50h] [bp-FCh]
int v75; // [sp+54h] [bp-F8h] BYREF
size_t v76; // [sp+58h] [bp-F4h]
char *v77; // [sp+5Ch] [bp-F0h]
int v78[3]; // [sp+60h] [bp-ECh] BYREF
int v79[3]; // [sp+6Ch] [bp-E0h] BYREF
int v80[3]; // [sp+78h] [bp-D4h] BYREF
int v81[3]; // [sp+84h] [bp-C8h] BYREF
int v82[3]; // [sp+90h] [bp-BCh] BYREF
int v83[3]; // [sp+9Ch] [bp-B0h] BYREF
int v84[3]; // [sp+A8h] [bp-A4h] BYREF
int v85[3]; // [sp+B4h] [bp-98h] BYREF
int v86[3]; // [sp+C0h] [bp-8Ch] BYREF
int v87[3]; // [sp+CCh] [bp-80h] BYREF
int v88[3]; // [sp+D8h] [bp-74h] BYREF
int v89[3]; // [sp+E4h] [bp-68h] BYREF
int v90[3]; // [sp+F0h] [bp-5Ch] BYREF
int v91[3]; // [sp+FCh] [bp-50h] BYREF
int v92[3]; // [sp+108h] [bp-44h] BYREF
int v93[3]; // [sp+114h] [bp-38h] BYREF
int v94[3]; // [sp+120h] [bp-2Ch] BYREF
_BYTE v95[12]; // [sp+12Ch] [bp-20h] BYREF
_BYTE v96[12]; // [sp+138h] [bp-14h] BYREF
CCTextInputNode::getString((CCTextInputNode *)v67, *((_DWORD *)this + 88));
std::string::basic_string(&v69, (int)v67);
v3 = 0;
while ( (v69 & 1) != 0 )
{
if ( v3 >= v70 )
goto LABEL_11;
v4 = v71;
LABEL_7:
v5 = &v4[v3];
if ( (v69 & 1) != 0 )
v6 = v71;
else
v6 = (char *)&v69 + 1;
v7 = (unsigned __int8)v6[v3++];
*v5 = tolower(v7);
}
if ( v3 < (unsigned __int8)v69 >> 1 )
{
v4 = (char *)&v69 + 1;
goto LABEL_7;
}
LABEL_11:
v72 = 0;
v73 = 0;
v74 = nullptr;
std::string::__init(&v72, " ", 1u);
v75 = 0;
v76 = 0;
v77 = nullptr;
std::string::__init(&v75, &unk_B6B226, 0);
for ( i = 0; ; i += v22 )
{
if ( (v69 & 1) != 0 )
{
v9 = (unsigned __int8 *)v71;
v10 = v70;
}
else
{
v10 = (int)(unsigned __int8)v69 >> 1;
v9 = (unsigned __int8 *)&v69 + 1;
}
if ( (v72 & 1) != 0 )
{
v11 = v74;
v12 = v73;
}
else
{
v11 = (unsigned __int8 *)&v72 + 1;
v12 = (int)(unsigned __int8)v72 >> 1;
}
if ( i > v10 || v10 - i < v12 )
break;
if ( v12 )
{
v13 = (char *)&v9[v10];
if ( v13 - (char *)&v9[i] >= v12 )
{
v62 = &v9[i];
v63 = (unsigned __int8 *)&v13[1 - v12];
v64 = &v11[v12];
LABEL_21:
while ( 1 )
{
v14 = (char *)v62;
if ( v62 == v63 )
break;
v15 = *v62++;
if ( v15 == *v11 )
{
v16 = v11;
v17 = v14;
while ( ++v16 != v64 )
{
v18 = (unsigned __int8)*++v17;
if ( v18 != *v16 )
goto LABEL_21;
}
goto LABEL_28;
}
}
}
v14 = v13;
LABEL_28:
if ( v14 == v13 )
break;
i = v14 - (char *)v9;
}
if ( i == -1 )
break;
if ( (v72 & 1) != 0 )
v19 = v73;
else
v19 = (int)(unsigned __int8)v72 >> 1;
if ( (v75 & 1) != 0 )
{
v20 = v77;
v21 = v76;
}
else
{
v21 = (int)(unsigned __int8)v75 >> 1;
v20 = (char *)&v75 + 1;
}
std::string::replace(&v69, i, v19, v20, v21);
if ( (v75 & 1) != 0 )
v22 = v76;
else
v22 = (int)(unsigned __int8)v75 >> 1;
}
std::string::~string((int)&v75);
std::string::~string((int)&v72);
v23 = *((_DWORD *)this + 88);
memset(v78, 0, sizeof(v78));
std::string::__init(v78, &unk_B6B226, 0);
CCTextInputNode::setString(v23, (int)v78);
std::string::~string((int)v78);
memset(v79, 0, sizeof(v79));
std::string::__init(v79, "darkness", 8u);
v24 = sub_620C1A((unsigned __int8 *)&v69, (unsigned __int8 *)v79);
v25 = (AchievementManager *)std::string::~string((int)v79);
if ( !v24 )
{
memset(v81, 0, sizeof(v81));
std::string::__init(v81, "silence", 7u);
v31 = sub_620C1A((unsigned __int8 *)&v69, (unsigned __int8 *)v81);
v32 = (AchievementManager *)std::string::~string((int)v81);
if ( v31 )
{
v33 = (AchievementManager *)AchievementManager::sharedState(v32);
if ( AchievementManager::isAchievementEarned(v33, "geometry.ach.v3.secret02") )
goto LABEL_71;
v34 = (GameManager *)GameManager::sharedState(nullptr);
GameManager::reportAchievementWithID(v34, "geometry.ach.v3.secret02", (const char *)&dword_64, 0);
v28 = v82;
memset(v82, 0, sizeof(v82));
std::string::__init(v82, "Something you always ruin...", 0x1Cu);
SecretLayer4::updateMessageLabel((int)this, (int)v82);
}
else
{
memset(v83, 0, sizeof(v83));
std::string::__init(v83, "river", 5u);
v35 = sub_620C1A((unsigned __int8 *)&v69, (unsigned __int8 *)v83);
if ( !v35 )
{
memset(v84, 0, sizeof(v84));
std::string::__init(v84, "ariver", 6u);
v35 = sub_620C1A((unsigned __int8 *)&v69, (unsigned __int8 *)v84);
std::string::~string((int)v84);
}
v36 = (AchievementManager *)std::string::~string((int)v83);
if ( v35 )
{
v37 = (AchievementManager *)AchievementManager::sharedState(v36);
if ( AchievementManager::isAchievementEarned(v37, "geometry.ach.v3.secret03") )
goto LABEL_71;
v38 = (GameManager *)GameManager::sharedState(nullptr);
GameManager::reportAchievementWithID(v38, "geometry.ach.v3.secret03", (const char *)&dword_64, 0);
v28 = v85;
memset(v85, 0, sizeof(v85));
std::string::__init(v85, "Be like water my friend", 0x17u);
SecretLayer4::updateMessageLabel((int)this, (int)v85);
}
else
{
memset(v86, 0, sizeof(v86));
std::string::__init(v86, "hunger", 6u);
v39 = sub_620C1A((unsigned __int8 *)&v69, (unsigned __int8 *)v86);
v40 = (AchievementManager *)std::string::~string((int)v86);
if ( v39 )
{
v41 = (AchievementManager *)AchievementManager::sharedState(v40);
if ( AchievementManager::isAchievementEarned(v41, "geometry.ach.v3.secret04") )
goto LABEL_71;
v42 = (GameManager *)GameManager::sharedState(nullptr);
GameManager::reportAchievementWithID(v42, "geometry.ach.v3.secret04", (const char *)&dword_64, 0);
v28 = v87;
memset(v87, 0, sizeof(v87));
std::string::__init(v87, "A pizza would be nice", 0x15u);
SecretLayer4::updateMessageLabel((int)this, (int)v87);
}
else
{
memset(v88, 0, sizeof(v88));
std::string::__init(v88, "volcano", 7u);
v43 = sub_620C1A((unsigned __int8 *)&v69, (unsigned __int8 *)v88);
if ( !v43 )
{
memset(v89, 0, sizeof(v89));
std::string::__init(v89, "avolcano", 8u);
v43 = sub_620C1A((unsigned __int8 *)&v69, (unsigned __int8 *)v89);
std::string::~string((int)v89);
}
v44 = (AchievementManager *)std::string::~string((int)v88);
if ( v43 )
{
v45 = (AchievementManager *)AchievementManager::sharedState(v44);
if ( AchievementManager::isAchievementEarned(v45, "geometry.ach.v3.secret05") )
goto LABEL_71;
v46 = (GameManager *)GameManager::sharedState(nullptr);
GameManager::reportAchievementWithID(v46, "geometry.ach.v3.secret05", (const char *)&dword_64, 0);
v28 = v90;
memset(v90, 0, sizeof(v90));
std::string::__init(v90, "Hot answer, well done", 0x15u);
SecretLayer4::updateMessageLabel((int)this, (int)v90);
}
else
{
memset(v91, 0, sizeof(v91));
std::string::__init(v91, "backontrack", 0xBu);
v47 = sub_620C1A((unsigned __int8 *)&v69, (unsigned __int8 *)v91);
v48 = (AchievementManager *)std::string::~string((int)v91);
if ( v47 )
{
v49 = (AchievementManager *)AchievementManager::sharedState(v48);
if ( AchievementManager::isAchievementEarned(v49, "geometry.ach.v3.secret06") )
goto LABEL_71;
v50 = (GameManager *)GameManager::sharedState(nullptr);
GameManager::reportAchievementWithID(v50, "geometry.ach.v3.secret06", (const char *)&dword_64, 0);
v28 = v92;
memset(v92, 0, sizeof(v92));
std::string::__init(v92, "That's some skill", 0x11u);
SecretLayer4::updateMessageLabel((int)this, (int)v92);
}
else
{
memset(v93, 0, sizeof(v93));
std::string::__init(v93, "givemehelper", 0xCu);
v51 = sub_620C1A((unsigned __int8 *)&v69, (unsigned __int8 *)v93);
v52 = (AchievementManager *)std::string::~string((int)v93);
if ( !v51 )
{
if ( (v67[0] & 1) != 0 )
v55 = v68;
else
v55 = (int)(unsigned __int8)v67[0] >> 1;
if ( !v55 )
goto LABEL_71;
SecretLayer4::getErrorMessage((SecretLayer4 *)v95, (int)this);
SecretLayer4::updateMessageLabel((int)this, (int)v95);
std::string::~string((int)v95);
v56 = *((_DWORD *)this + 89);
*((_DWORD *)this + 84) = 0;
v57 = *(void (__fastcall **)(int, char *))(*(_DWORD *)v56 + 536);
v65 = -1;
v66 = 150;
v57(v56, &v65);
goto LABEL_76;
}
v53 = (AchievementManager *)AchievementManager::sharedState(v52);
if ( AchievementManager::isAchievementEarned(v53, "geometry.ach.v3.secret07") )
goto LABEL_71;
v54 = (GameManager *)GameManager::sharedState(nullptr);
GameManager::reportAchievementWithID(v54, "geometry.ach.v3.secret07", (const char *)&dword_64, 0);
v28 = v94;
memset(v94, 0, sizeof(v94));
std::string::__init(v94, "Is that even a real thing...", 0x1Cu);
SecretLayer4::updateMessageLabel((int)this, (int)v94);
}
}
}
}
}
LABEL_43:
std::string::~string((int)v28);
v29 = *((_DWORD *)this + 89);
v30 = *(void (__fastcall **)(int, char *))(*(_DWORD *)v29 + 536);
v65 = 0;
v66 = -1;
v30(v29, &v65);
cocos2d::CCLabelBMFont::limitLabelWidth(*((cocos2d::CCLabelBMFont **)this + 89), 400.0, 0.8, 0.0);
*((_DWORD *)this + 84) = 0;
goto LABEL_76;
}
v26 = (AchievementManager *)AchievementManager::sharedState(v25);
if ( !AchievementManager::isAchievementEarned(v26, "geometry.ach.v3.secret01") )
{
v27 = (GameManager *)GameManager::sharedState(nullptr);
GameManager::reportAchievementWithID(v27, "geometry.ach.v3.secret01", (const char *)&dword_64, 0);
v28 = v80;
memset(v80, 0, sizeof(v80));
std::string::__init(v80, "Impressive", 0xAu);
SecretLayer4::updateMessageLabel((int)this, (int)v80);
goto LABEL_43;
}
LABEL_71:
v58 = *((_DWORD *)this + 84);
SecretLayer4::getMessage((SecretLayer4 *)v96, this);
SecretLayer4::updateMessageLabel((int)this, (int)v96);
std::string::~string((int)v96);
v59 = *((_DWORD *)this + 89);
if ( v58 <= 0 && *((int *)this + 84) <= 0 )
v60 = *(void (**)(void))(*(_DWORD *)v59 + 536);
else
v60 = *(void (**)(void))(*(_DWORD *)v59 + 536);
v60();
LABEL_76:
std::string::~string((int)&v69);
return std::string::~string((int)v67);
}