//
// MenuGameLayer::ccTouchBegan from 0x140333600 to 0x1403337a9 (425 bytes)
//
// 2 xrefs:
// > ??> @ 0x1405aa6e8
// > ??> @ 0x1406d50cc
//
// 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=2
bool MenuGameLayer::ccTouchBegan(MenuGameLayer *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)
{
struct cocos2d::CCPoint v4; // rax
cocos2d *v5; // rax
const struct cocos2d::CCPoint *v6; // r8
bool v7; // r9
__int64 v8; // rax
int v9; // ecx
GameManager *v10; // rcx
const char *v11; // rdx
struct cocos2d::CCPoint v13; // [rsp+30h] [rbp+8h] BYREF
struct cocos2d::CCPoint v14; // [rsp+48h] [rbp+20h] BYREF
cocos2d::CCTouch::getLocation(a2);
v4 = cocos2d::CCNode::convertToNodeSpace((MenuGameLayer *)((char *)a1 - 320), &v14);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v13, v4);
if ( v13.x > 50.0 )
{
v5 = (cocos2d *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_obContentSize.height + 200LL))(*(_QWORD *)&a1->m_obContentSize.height);
if ( cocos2d::ccpDistance(v5, &v13, v6) <= 30.0 )
{
v8 = *(_QWORD *)&a1->m_obContentSize.height;
if ( *(_BYTE *)(v8 + 2489)
|| *(_BYTE *)(v8 + 2490)
|| *(_BYTE *)(v8 + 2492)
|| *(_BYTE *)(v8 + 2500)
|| *(_BYTE *)(v8 + 2491)
|| *(_BYTE *)(v8 + 2493)
|| *(float *)(v8 + 2544) != 1.0 )
{
goto LABEL_19;
}
v9 = *(_DWORD *)(v8 + 1568);
if ( v9 == 55 )
{
v10 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v14 = (struct cocos2d::CCPoint)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(*(_QWORD *)&v14);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v10 = (GameManager *)qword_1406C2ED8;
}
v11 = "geometry.ach.secret11";
}
else
{
if ( v9 != 50 )
{
LABEL_19:
MenuGameLayer::destroyPlayer((MenuGameLayer *)((char *)a1 - 320));
return 1;
}
v10 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v14 = (struct cocos2d::CCPoint)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(*(_QWORD *)&v14);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v10 = (GameManager *)qword_1406C2ED8;
}
v11 = "geometry.ach.secret12";
}
GameManager::reportAchievementWithID(v10, v11, 100, v7);
goto LABEL_19;
}
}
return 1;
}