//
// AchievementsLayer::keyDown from 0x1004a48d0 to 0x1004a4974 (164 bytes)
//
// 2 xrefs:
// > sub_1004A4974 @ 0x1004a4978
// > ??> @ 0x10097e628
//
// This function is hookable on this platform (idp: arm, 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:06:04 +0000
//
__int64 __fastcall AchievementsLayer::keyDown(__int64 a1, int a2)
{
__int64 result; // x0
int v4; // w1
if ( a2 > 1024 )
{
if ( a2 == 1027 )
goto LABEL_9;
if ( a2 != 1025 )
return cocos2d::CCLayer::keyDown(a1, a2);
}
else if ( a2 != 37 )
{
if ( a2 != 39 )
return cocos2d::CCLayer::keyDown(a1, a2);
LABEL_9:
result = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 608) + 352LL))(*(_QWORD *)(a1 + 608));
if ( (_DWORD)result )
{
v4 = *(_DWORD *)(a1 + 604) + 1;
return sub_1004A4588(a1, v4);
}
return result;
}
result = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 616) + 352LL))(*(_QWORD *)(a1 + 616));
if ( (_DWORD)result )
{
v4 = *(_DWORD *)(a1 + 604) - 1;
return sub_1004A4588(a1, v4);
}
return result;
}