//
// MenuGameLayer::ccTouchBegan from 0x140471920 to 0x140471d57 (1079 bytes)
//
// 3 xrefs:
// > ??> @ 0x1407b3ca8
// > ??> @ 0x1409281b4
// > ??> @ 0x1409281c0
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:32:39 +0000
//
// Hidden C++ exception states: #wind=3
char __fastcall MenuGameLayer::ccTouchBegan(__int64 a1, __int64 a2)
{
__int64 v3; // r14
__int64 v4; // rax
cocos2d *v5; // rax
const struct cocos2d::CCPoint *v6; // r8
__int64 v7; // rdx
__int64 v8; // r8
__int64 v9; // rax
__int64 v10; // rcx
__int64 v11; // rsi
__int64 v12; // rbx
cocos2d::CCString *v13; // rax
int v14; // ebx
void *v15; // r8
__int64 v16; // rdx
__int64 v17; // rcx
__int64 v18; // r8
__int64 v19; // rax
const char *v20; // rdx
__int64 v21; // rsi
__int64 v22; // rbx
cocos2d::CCString *v23; // rax
int v24; // ebx
void *v25; // r8
__int64 v26; // rdx
__int64 v27; // rcx
__int64 v28; // r8
float v30; // [rsp+30h] [rbp-40h] BYREF
void *v31; // [rsp+38h] [rbp-38h] BYREF
void *Block[2]; // [rsp+40h] [rbp-30h] BYREF
__int64 v33; // [rsp+50h] [rbp-20h]
unsigned __int64 v34; // [rsp+58h] [rbp-18h]
cocos2d::CCTouch::getLocation(a2, &v30);
v3 = a1 - 320;
cocos2d::CCNode::convertToNodeSpace(a1 - 320, &v31, &v30);
cocos2d::CCPoint::operator=(&v30, v4);
if ( v30 > 50.0 )
{
v5 = (cocos2d *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 112) + 200LL))(*(_QWORD *)(a1 + 112));
if ( cocos2d::ccpDistance(v5, (const struct cocos2d::CCPoint *)&v30, v6) <= 30.0 )
{
v9 = *(_QWORD *)(a1 + 112);
if ( !*(_BYTE *)(v9 + 2497)
&& !*(_BYTE *)(v9 + 2498)
&& !*(_BYTE *)(v9 + 2500)
&& !*(_BYTE *)(v9 + 2508)
&& !*(_BYTE *)(v9 + 2499)
&& !*(_BYTE *)(v9 + 2501)
&& *(float *)(v9 + 2552) == 1.0 )
{
v10 = *(unsigned int *)(v9 + 1568);
if ( (_DWORD)v10 == 55 )
{
v11 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v31 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v31);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v11 = qword_14090BFD0;
}
v12 = AchievementManager::sharedState(v10, v7, v8);
*(_OWORD *)Block = 0;
v33 = 0;
v34 = 0;
Block[0] = sub_14003D460(0x20u);
v33 = 21;
v34 = 31;
strcpy((char *)Block[0], "geometry.ach.secret11");
v13 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v12 + 352), Block);
v14 = cocos2d::CCString::intValue(v13);
if ( v34 > 0xF )
{
v15 = Block[0];
if ( v34 + 1 >= 0x1000 )
{
v15 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v15 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v15);
}
if ( v14 >= 100 )
goto LABEL_31;
*(_OWORD *)Block = 0;
v33 = 0;
v34 = 0;
Block[0] = sub_14003D460(0x20u);
v33 = 21;
v34 = 31;
strcpy((char *)Block[0], "geometry.ach.secret11");
GameManager::completedAchievement(v11, (__int64)Block);
v19 = AchievementManager::sharedState(v17, v16, v18);
v20 = "geometry.ach.secret11";
}
else
{
if ( (_DWORD)v10 != 50 )
goto LABEL_31;
v21 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v31 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v31);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v21 = qword_14090BFD0;
}
v22 = AchievementManager::sharedState(v10, v7, v8);
*(_OWORD *)Block = 0;
v33 = 0;
v34 = 0;
Block[0] = sub_14003D460(0x20u);
v33 = 21;
v34 = 31;
strcpy((char *)Block[0], "geometry.ach.secret12");
v23 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v22 + 352), Block);
v24 = cocos2d::CCString::intValue(v23);
if ( v34 > 0xF )
{
v25 = Block[0];
if ( v34 + 1 >= 0x1000 )
{
v25 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v25 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v25);
}
if ( v24 >= 100 )
goto LABEL_31;
*(_OWORD *)Block = 0;
v33 = 0;
v34 = 0;
Block[0] = sub_14003D460(0x20u);
v33 = 21;
v34 = 31;
strcpy((char *)Block[0], "geometry.ach.secret12");
GameManager::completedAchievement(v21, (__int64)Block);
v19 = AchievementManager::sharedState(v27, v26, v28);
v20 = "geometry.ach.secret12";
}
AchievementManager::reportAchievementWithID(v19, (__int64)v20, 100);
}
LABEL_31:
MenuGameLayer::destroyPlayer(v3);
}
}
return 1;
}