{"type": "func", "start": 4297557784, "end": 4297557964, "name": "GJBaseGameLayer::swapMiddleground", "pseudocode": "// \n// GJBaseGameLayer::swapMiddleground from 0x100278718 to 0x1002787cc (180 bytes)\n// \n// 1 xrefs:\n// > ArtTriggerGameObject::triggerObject @ 0x10043e208\n// \n// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:01:51 +0000\n// \n\n__int64 __fastcall GJBaseGameLayer::swapMiddleground(__int64 result, __int64 a2)\n{\n  __int64 v3; // x19\n  __int64 v4; // x0\n  __int64 v5; // x0\n\n  *(_DWORD *)(result + 1908) = a2;\n  if ( (*(_BYTE *)(result + 12605) & 1) != 0 )\n    return result;\n  v3 = result;\n  result = GameManager::sharedState(result);\n  if ( *(_DWORD *)(result + 988) == (_DWORD)a2 )\n  {\n    if ( (int)a2 < 1 || *(_QWORD *)(v3 + 3976) )\n      return result;\nLABEL_8:\n    v4 = GameManager::sharedState(result);\n    if ( *(_DWORD *)(v4 + 988) == (_DWORD)a2 )\n    {\n      GJBaseGameLayer::createMiddleground(v3);\n      return GJBaseGameLayer::updateLevelColors(v3);\n    }\n    else\n    {\n      v5 = GameManager::sharedState(v4);\n      return sub_1003B5494(v5, a2);\n    }\n  }\n  if ( (_DWORD)a2 )\n    goto LABEL_8;\n  result = *(_QWORD *)(v3 + 3976);\n  if ( result )\n  {\n    result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)result + 520LL))(result);\n    *(_QWORD *)(v3 + 3976) = 0;\n  }\n  return result;\n}", "assembly": "; \n; GJBaseGameLayer::swapMiddleground from 0x100278718 to 0x1002787cc (180 bytes)\n; \n; 1 xrefs:\n; > ArtTriggerGameObject::triggerObject @ 0x10043e208\n; \n; This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:01:51 +0000\n; \nSTP             X20, X19, [SP,#-0x10+var_10]!                          ; +0x0, 0x100278718\nSTP             X29, X30, [SP,#0x10+var_s0]                            ; +0x4, 0x10027871c\nADD             X29, SP, #0x10                                         ; +0x8, 0x100278720\nSTR             W1, [X0,#0x774]                                        ; +0xc, 0x100278724\nMOV             W8, #0x313D                                            ; +0x10, 0x100278728\nLDRB            W8, [X0,X8]                                            ; +0x14, 0x10027872c\nTBZ             W8, #0, loc_100278740                                  ; +0x18, 0x100278730\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x1c, 0x100278734\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x20, 0x100278738\nRET                                                                    ; +0x24, 0x10027873c\nMOV             X20, X1                                                ; +0x28, 0x100278740\nMOV             X19, X0                                                ; +0x2c, 0x100278744\nBL              GameManager__sharedState                               ; +0x30, 0x100278748\nLDR             W8, [X0,#0x3DC]                                        ; +0x34, 0x10027874c\nCMP             W8, W20                                                ; +0x38, 0x100278750\nB.NE            loc_10027876C                                          ; +0x3c, 0x100278754\nCMP             W20, #1                                                ; +0x40, 0x100278758\nB.LT            loc_100278734                                          ; +0x44, 0x10027875c\nLDR             X8, [X19,#0xF88]                                       ; +0x48, 0x100278760\nCBNZ            X8, loc_100278734                                      ; +0x4c, 0x100278764\nB               loc_100278770                                          ; +0x50, 0x100278768\nCBZ             W20, loc_1002787B0                                     ; +0x54, 0x10027876c\nBL              GameManager__sharedState                               ; +0x58, 0x100278770\nLDR             W8, [X0,#0x3DC]                                        ; +0x5c, 0x100278774\nCMP             W8, W20                                                ; +0x60, 0x100278778\nB.NE            loc_10027879C                                          ; +0x64, 0x10027877c\nMOV             X0, X19                                                ; +0x68, 0x100278780\nMOV             X1, X20                                                ; +0x6c, 0x100278784\nBL              GJBaseGameLayer__createMiddleground                    ; +0x70, 0x100278788\nMOV             X0, X19                                                ; +0x74, 0x10027878c\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x78, 0x100278790\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x7c, 0x100278794\nB               GJBaseGameLayer__updateLevelColors                     ; +0x80, 0x100278798\nBL              GameManager__sharedState                               ; +0x84, 0x10027879c\nMOV             X1, X20                                                ; +0x88, 0x1002787a0\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x8c, 0x1002787a4\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x90, 0x1002787a8\nB               sub_1003B5494                                          ; +0x94, 0x1002787ac\nLDR             X0, [X19,#0xF88]                                       ; +0x98, 0x1002787b0\nCBZ             X0, loc_100278734                                      ; +0x9c, 0x1002787b4\nLDR             X8, [X0]                                               ; +0xa0, 0x1002787b8\nLDR             X8, [X8,#0x208]                                        ; +0xa4, 0x1002787bc\nBLR             X8                                                     ; +0xa8, 0x1002787c0\nSTR             XZR, [X19,#0xF88]                                      ; +0xac, 0x1002787c4\nB               loc_100278734                                          ; +0xb0, 0x1002787c8", "xrefs": ["ArtTriggerGameObject::triggerObject @ 0x10043e208"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}