{"type": "func", "start": 4299301884, "end": 4299302048, "name": "AchievementsLayer::keyDown", "pseudocode": "// \n// AchievementsLayer::keyDown from 0x1004223fc to 0x1004224a0 (164 bytes)\n// \n// 2 xrefs:\n// > sub_1004224A0 @ 0x1004224a4\n// > <???> @ 0x100825a88\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\n// local variable allocation has failed, the output may be wrong!\nvoid __fastcall AchievementsLayer::keyDown(AchievementsLayer *a1, cocos2d::enumKeyCodes a2, double a3)\n{\n  int v4; // w1\n\n  if ( a2 > 1024 )\n  {\n    if ( a2 == CONTROLLER_Right )\n      goto LABEL_9;\n    if ( a2 != CONTROLLER_Left )\n    {\nLABEL_13:\n      cocos2d::CCLayer::keyDown(a1, a2, a3);\n      return;\n    }\n  }\n  else if ( a2 != KEY_Left )\n  {\n    if ( a2 != KEY_Right )\n      goto LABEL_13;\nLABEL_9:\n    if ( ((unsigned int (__fastcall *)(CCMenuItemSpriteExtra *, __n128))a1->m_nextPageButton->isVisible)(\n           a1->m_nextPageButton,\n           *(__n128 *)&a3) )\n    {\n      v4 = a1->m_currentPage + 1;\n      goto LABEL_11;\n    }\n    return;\n  }\n  if ( ((unsigned int (__fastcall *)(CCMenuItemSpriteExtra *, __n128))a1->m_prevPageButton->isVisible)(\n         a1->m_prevPageButton,\n         *(__n128 *)&a3) )\n  {\n    v4 = a1->m_currentPage - 1;\nLABEL_11:\n    AchievementsLayer::loadPage(a1, v4);\n  }\n}", "assembly": "; \n; AchievementsLayer::keyDown from 0x1004223fc to 0x1004224a0 (164 bytes)\n; \n; 2 xrefs:\n; > sub_1004224A0 @ 0x1004224a4\n; > <???> @ 0x100825a88\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSTP             X20, X19, [SP,#-0x10+var_10]!                          ; +0x0, 0x1004223fc\nSTP             X29, X30, [SP,#0x10+var_s0]                            ; +0x4, 0x100422400\nADD             X29, SP, #0x10                                         ; +0x8, 0x100422404\nMOV             X19, X0                                                ; +0xc, 0x100422408\nCMP             W1, #0x400                                             ; +0x10, 0x10042240c\nB.GT            loc_100422428                                          ; +0x14, 0x100422410\nCMP             W1, #0x25 ; '%'                                        ; +0x18, 0x100422414\nB.EQ            loc_100422438                                          ; +0x1c, 0x100422418\nCMP             W1, #0x27 ; '''                                        ; +0x20, 0x10042241c\nB.EQ            loc_100422458                                          ; +0x24, 0x100422420\nB               loc_100422490                                          ; +0x28, 0x100422424\nCMP             W1, #0x403                                             ; +0x2c, 0x100422428\nB.EQ            loc_100422458                                          ; +0x30, 0x10042242c\nCMP             W1, #0x401                                             ; +0x34, 0x100422430\nB.NE            loc_100422490                                          ; +0x38, 0x100422434\nLDR             X0, [X19,#0x268]                                       ; +0x3c, 0x100422438\nLDR             X8, [X0]                                               ; +0x40, 0x10042243c\nLDR             X8, [X8,#0x150]                                        ; +0x44, 0x100422440\nBLR             X8                                                     ; +0x48, 0x100422444\nCBZ             W0, loc_100422484                                      ; +0x4c, 0x100422448\nLDR             W8, [X19,#0x25C]                                       ; +0x50, 0x10042244c\nSUB             W1, W8, #1                                             ; +0x54, 0x100422450\nB               loc_100422474                                          ; +0x58, 0x100422454\nLDR             X0, [X19,#0x260]                                       ; +0x5c, 0x100422458\nLDR             X8, [X0]                                               ; +0x60, 0x10042245c\nLDR             X8, [X8,#0x150]                                        ; +0x64, 0x100422460\nBLR             X8                                                     ; +0x68, 0x100422464\nCBZ             W0, loc_100422484                                      ; +0x6c, 0x100422468\nLDR             W8, [X19,#0x25C]                                       ; +0x70, 0x10042246c\nADD             W1, W8, #1                                             ; +0x74, 0x100422470\nMOV             X0, X19                                                ; +0x78, 0x100422474\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x7c, 0x100422478\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x80, 0x10042247c\nB               AchievementsLayer__loadPage                            ; +0x84, 0x100422480\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x88, 0x100422484\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x8c, 0x100422488\nRET                                                                    ; +0x90, 0x10042248c\nMOV             X0, X19                                                ; +0x94, 0x100422490\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x98, 0x100422494\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x9c, 0x100422498\nB               cocos2d__CCLayer__keyDown                              ; +0xa0, 0x10042249c", "xrefs": ["sub_1004224A0 @ 0x1004224a4", "<???> @ 0x100825a88"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}