{"type": "func", "start": 4296100640, "end": 4296100786, "name": "GJBaseGameLayer::createMiddleground", "pseudocode": "// \n// GJBaseGameLayer::createMiddleground from 0x100114b20 to 0x100114bb2 (146 bytes)\n// \n// 3 xrefs:\n// > PlayLayer::setupHasCompleted @ 0x1000adf35\n// > LevelEditorLayer::init @ 0x1000dbf45\n// > LevelSettingsLayer::selectArtClosed @ 0x10026f5b6\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 GJBaseGameLayer::createMiddleground(GJBaseGameLayer *a1, int a2)\n{\n  GJMGLayer *m_middleground; // rdi\n  unsigned int v4; // r15d\n  GJMGLayer *v5; // rax\n\n  m_middleground = a1->m_middleground;\n  if ( m_middleground )\n  {\n    ((void (__fastcall *)(GJMGLayer *))m_middleground->removeFromParent)(m_middleground);\n    a1->m_middleground = nullptr;\n  }\n  if ( a2 > 0 )\n  {\n    v4 = 3;\n    if ( (unsigned int)a2 < 3 )\n      v4 = a2;\n    v5 = GJMGLayer::create(v4);\n    a1->m_middleground = v5;\n    ((void (__fastcall *)(GJMGLayer *, _QWORD))v5->setTag)(v5, v4);\n    ((void (__fastcall *)(cocos2d::CCNode *, GJMGLayer *, __int64))a1->m_objectParent->addChild_0)(\n      a1->m_objectParent,\n      a1->m_middleground,\n      4294967257LL);\n  }\n}", "assembly": "; \n; GJBaseGameLayer::createMiddleground from 0x100114b20 to 0x100114bb2 (146 bytes)\n; \n; 3 xrefs:\n; > PlayLayer::setupHasCompleted @ 0x1000adf35\n; > LevelEditorLayer::init @ 0x1000dbf45\n; > LevelSettingsLayer::selectArtClosed @ 0x10026f5b6\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\npush    rbp                                                            ; +0x0, 0x100114b20\nmov     rbp, rsp                                                       ; +0x1, 0x100114b21\npush    r15                                                            ; +0x4, 0x100114b24\npush    r14                                                            ; +0x6, 0x100114b26\npush    rbx                                                            ; +0x8, 0x100114b28\npush    rax                                                            ; +0x9, 0x100114b29\nmov     r14d, esi                                                      ; +0xa, 0x100114b2a\nmov     rbx, rdi                                                       ; +0xd, 0x100114b2d\nmov     rdi, [rdi+0EF0h]                                               ; +0x10, 0x100114b30\ntest    rdi, rdi                                                       ; +0x17, 0x100114b37\njz      short loc_100114B50                                            ; +0x1a, 0x100114b3a\nmov     rax, [rdi]                                                     ; +0x1c, 0x100114b3c\ncall    qword ptr [rax+1F8h]                                           ; +0x1f, 0x100114b3f\nmov     qword ptr [rbx+0EF0h], 0                                       ; +0x25, 0x100114b45\ntest    r14d, r14d                                                     ; +0x30, 0x100114b50\njle     short loc_100114BA7                                            ; +0x33, 0x100114b53\ncmp     r14d, 3                                                        ; +0x35, 0x100114b55\nmov     r15d, 3                                                        ; +0x39, 0x100114b59\ncmovb   r15d, r14d                                                     ; +0x3f, 0x100114b5f\nmov     edi, r15d                                                      ; +0x43, 0x100114b63\ncall    GJMGLayer__create                                              ; +0x46, 0x100114b66\nmov     [rbx+0EF0h], rax                                               ; +0x4b, 0x100114b6b\nmov     rcx, [rax]                                                     ; +0x52, 0x100114b72\nmov     rdi, rax                                                       ; +0x55, 0x100114b75\nmov     esi, r15d                                                      ; +0x58, 0x100114b78\ncall    qword ptr [rcx+48h]                                            ; +0x5b, 0x100114b7b\nmov     rdi, [rbx+0EA0h]                                               ; +0x5e, 0x100114b7e\nmov     rsi, [rbx+0EF0h]                                               ; +0x65, 0x100114b85\nmov     rax, [rdi]                                                     ; +0x6c, 0x100114b8c\nmov     rax, [rax+1C0h]                                                ; +0x6f, 0x100114b8f\nmov     edx, 0FFFFFFD9h                                                ; +0x76, 0x100114b96\nadd     rsp, 8                                                         ; +0x7b, 0x100114b9b\npop     rbx                                                            ; +0x7f, 0x100114b9f\npop     r14                                                            ; +0x80, 0x100114ba0\npop     r15                                                            ; +0x82, 0x100114ba2\npop     rbp                                                            ; +0x84, 0x100114ba4\njmp     rax                                                            ; +0x85, 0x100114ba5\nadd     rsp, 8                                                         ; +0x87, 0x100114ba7\npop     rbx                                                            ; +0x8b, 0x100114bab\npop     r14                                                            ; +0x8c, 0x100114bac\npop     r15                                                            ; +0x8e, 0x100114bae\npop     rbp                                                            ; +0x90, 0x100114bb0\nretn                                                                   ; +0x91, 0x100114bb1", "xrefs": ["PlayLayer::setupHasCompleted @ 0x1000adf35", "LevelEditorLayer::init @ 0x1000dbf45", "LevelSettingsLayer::selectArtClosed @ 0x10026f5b6"], "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"}