{"type": "func", "start": 4295934752, "end": 4295934968, "name": "EditLevelLayer::onClone", "pseudocode": "// \n// EditLevelLayer::onClone from 0x1000ec320 to 0x1000ec3f8 (216 bytes)\n// \n// 1 xrefs:\n// > EditLevelLayer::FLAlert_Clicked @ 0x1000ec168\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\nvoid __fastcall EditLevelLayer::onClone(EditLevelLayer *a1)\n{\n  GameLevelManager *v2; // x0\n  GJGameLevel *NewLevel; // x20\n  int v4; // w19\n  float v5; // s0\n  cocos2d::CCDirector *v6; // x19\n  cocos2d::CCScene *v7; // x0\n  cocos2d::CCTransitionFade *v8; // x1\n\n  if ( !cocos2d::CCDirector::sharedDirector()->m_bIsTransitioning && !a1->m_exiting )\n  {\n    ((void (__fastcall *)(EditLevelLayer *, _QWORD))a1->setKeypadEnabled)(a1, 0);\n    a1->m_exiting = 1;\n    GameManager::sharedState()->m_sceneEnum = 2;\n    v2 = GameLevelManager::sharedState();\n    NewLevel = GameLevelManager::createNewLevel(v2);\n    GJGameLevel::copyLevelInfo(NewLevel);\n    EditLevelLayer::verifyLevelName(a1);\n    v4 = a1->m_level->m_originalLevel.random - a1->m_level->m_originalLevel.seed;\n    NewLevel->m_originalLevel.value = v4;\n    v5 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;\n    NewLevel->m_originalLevel.seed = (int)v5;\n    NewLevel->m_originalLevel.random = v4 + (int)v5;\n    v6 = cocos2d::CCDirector::sharedDirector();\n    v7 = EditLevelLayer::scene(NewLevel);\n    v8 = cocos2d::CCTransitionFade::create_1(0.5, v7);\n    cocos2d::CCDirector::replaceScene(v6, v8);\n  }\n}", "assembly": "; \n; EditLevelLayer::onClone from 0x1000ec320 to 0x1000ec3f8 (216 bytes)\n; \n; 1 xrefs:\n; > EditLevelLayer::FLAlert_Clicked @ 0x1000ec168\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, 0x1000ec320\nSTP             X29, X30, [SP,#0x10+var_s0]                            ; +0x4, 0x1000ec324\nADD             X29, SP, #0x10                                         ; +0x8, 0x1000ec328\nMOV             X19, X0                                                ; +0xc, 0x1000ec32c\nBL              cocos2d__CCDirector__sharedDirector                    ; +0x10, 0x1000ec330\nLDRB            W8, [X0,#0xA8]                                         ; +0x14, 0x1000ec334\nTBNZ            W8, #0, loc_1000EC344                                  ; +0x18, 0x1000ec338\nLDRB            W8, [X19,#0x1E0]                                       ; +0x1c, 0x1000ec33c\nTBZ             W8, #0, loc_1000EC350                                  ; +0x20, 0x1000ec340\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x24, 0x1000ec344\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x28, 0x1000ec348\nRET                                                                    ; +0x2c, 0x1000ec34c\nLDR             X8, [X19]                                              ; +0x30, 0x1000ec350\nLDR             X8, [X8,#0x420]                                        ; +0x34, 0x1000ec354\nMOV             X0, X19                                                ; +0x38, 0x1000ec358\nMOV             W1, #0                                                 ; +0x3c, 0x1000ec35c\nBLR             X8                                                     ; +0x40, 0x1000ec360\nMOV             W8, #1                                                 ; +0x44, 0x1000ec364\nSTRB            W8, [X19,#0x1E0]                                       ; +0x48, 0x1000ec368\nBL              GameManager__sharedState                               ; +0x4c, 0x1000ec36c\nMOV             W8, #2                                                 ; +0x50, 0x1000ec370\nSTR             W8, [X0,#0x29C]                                        ; +0x54, 0x1000ec374\nBL              GameLevelManager__sharedState                          ; +0x58, 0x1000ec378\nBL              GameLevelManager__createNewLevel                       ; +0x5c, 0x1000ec37c\nMOV             X20, X0                                                ; +0x60, 0x1000ec380\nLDR             X1, [X19,#0x1C8]                                       ; +0x64, 0x1000ec384\nBL              GJGameLevel__copyLevelInfo                             ; +0x68, 0x1000ec388\nMOV             X0, X19                                                ; +0x6c, 0x1000ec38c\nBL              EditLevelLayer__verifyLevelName                        ; +0x70, 0x1000ec390\nLDR             X8, [X19,#0x1C8]                                       ; +0x74, 0x1000ec394\nLDR             W9, [X8,#0x368]                                        ; +0x78, 0x1000ec398\nLDR             W8, [X8,#0x36C]                                        ; +0x7c, 0x1000ec39c\nSUB             W19, W9, W8                                            ; +0x80, 0x1000ec3a0\nSTR             W19, [X20,#0x370]                                      ; +0x84, 0x1000ec3a4\nBL              _rand                                                  ; +0x88, 0x1000ec3a8\nSCVTF           S0, W0, #0x1F                                          ; +0x8c, 0x1000ec3ac\nMOV             W8, #0x447A0000                                        ; +0x90, 0x1000ec3b0\nFMOV            S1, W8                                                 ; +0x94, 0x1000ec3b4\nFMUL            S0, S0, S1                                             ; +0x98, 0x1000ec3b8\nFCVTZS          W8, S0                                                 ; +0x9c, 0x1000ec3bc\nSTR             W8, [X20,#0x36C]                                       ; +0xa0, 0x1000ec3c0\nADD             W8, W19, W8                                            ; +0xa4, 0x1000ec3c4\nSTR             W8, [X20,#0x368]                                       ; +0xa8, 0x1000ec3c8\nBL              cocos2d__CCDirector__sharedDirector                    ; +0xac, 0x1000ec3cc\nMOV             X19, X0                                                ; +0xb0, 0x1000ec3d0\nMOV             X0, X20                                                ; +0xb4, 0x1000ec3d4\nBL              EditLevelLayer__scene                                  ; +0xb8, 0x1000ec3d8\nFMOV            S0, #0.5                                               ; +0xbc, 0x1000ec3dc\nBL              cocos2d__CCTransitionFade__create_1                    ; +0xc0, 0x1000ec3e0\nMOV             X1, X0; lpsrc                                          ; +0xc4, 0x1000ec3e4\nMOV             X0, X19; int                                           ; +0xc8, 0x1000ec3e8\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0xcc, 0x1000ec3ec\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0xd0, 0x1000ec3f0\nB               cocos2d__CCDirector__replaceScene                      ; +0xd4, 0x1000ec3f4", "xrefs": ["EditLevelLayer::FLAlert_Clicked @ 0x1000ec168"], "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"}