{"type": "func", "start": 4295953568, "end": 4295953855, "name": "GJBaseGameLayer::swapMiddleground", "pseudocode": "// \n// GJBaseGameLayer::swapMiddleground from 0x1000f0ca0 to 0x1000f0dbf (287 bytes)\n// \n// 1 xrefs:\n// > ArtTriggerGameObject::triggerObject @ 0x1001ce9ad\n// \n// This function is hookable on this platform (idp: pc, 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 12:21:11 +0000\n// \n\nvoid __fastcall GJBaseGameLayer::swapMiddleground(__int64 a1, __int64 a2, __int64 a3)\n{\n  __int64 v4; // rdx\n  double v5; // xmm0_8\n  __int64 v6; // rax\n  __int64 v7; // rdx\n  double v8; // xmm0_8\n  __int64 v9; // rax\n  __int64 v10; // rdi\n  unsigned int v11; // r15d\n  __int64 v12; // rax\n  double v13; // xmm0_8\n  __int64 v14; // rax\n  __int64 v15; // rdi\n\n  *(_DWORD *)(a1 + 1908) = a2;\n  if ( *(_BYTE *)(a1 + 12605) )\n    return;\n  *(_QWORD *)&v5 = GameManager::sharedState(a1, a2, a3).u64[0];\n  if ( *(_DWORD *)(v6 + 988) == (_DWORD)a2 )\n  {\n    if ( (int)a2 <= 0 || *(_QWORD *)(a1 + 3976) )\n      return;\n    goto LABEL_8;\n  }\n  if ( (_DWORD)a2 )\n  {\nLABEL_8:\n    *(_QWORD *)&v8 = GameManager::sharedState(a1, a2, v4).u64[0];\n    if ( *(_DWORD *)(v9 + 988) == (_DWORD)a2 )\n    {\n      v10 = *(_QWORD *)(a1 + 3976);\n      if ( v10 )\n      {\n        (*(void (__fastcall **)(__int64, double))(*(_QWORD *)v10 + 520LL))(v10, v8);\n        *(_QWORD *)(a1 + 3976) = 0;\n      }\n      if ( (int)a2 > 0 )\n      {\n        v11 = 3;\n        if ( (unsigned int)a2 < 3 )\n          v11 = a2;\n        v12 = GJMGLayer::create(v11, v8);\n        *(_QWORD *)(a1 + 3976) = v12;\n        (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v12 + 72LL))(v12, v11);\n        v8 = (*(double (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 3896) + 464LL))(\n               *(_QWORD *)(a1 + 3896),\n               *(_QWORD *)(a1 + 3976),\n               4294967257LL);\n      }\n      GJBaseGameLayer::updateLevelColors(a1, v8);\n    }\n    else\n    {\n      *(_QWORD *)&v13 = GameManager::sharedState(a1, a2, v7).u64[0];\n      GameManager::loadMiddlegroundAsync(v14, (unsigned int)a2, v13);\n    }\n    return;\n  }\n  v15 = *(_QWORD *)(a1 + 3976);\n  if ( v15 )\n  {\n    (*(void (__fastcall **)(__int64, double))(*(_QWORD *)v15 + 520LL))(v15, v5);\n    *(_QWORD *)(a1 + 3976) = 0;\n  }\n}", "assembly": "; \n; GJBaseGameLayer::swapMiddleground from 0x1000f0ca0 to 0x1000f0dbf (287 bytes)\n; \n; 1 xrefs:\n; > ArtTriggerGameObject::triggerObject @ 0x1001ce9ad\n; \n; This function is hookable on this platform (idp: pc, 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 12:21:11 +0000\n; \npush    rbp                                                            ; +0x0, 0x1000f0ca0\nmov     rbp, rsp                                                       ; +0x1, 0x1000f0ca1\npush    r15                                                            ; +0x4, 0x1000f0ca4\npush    r14                                                            ; +0x6, 0x1000f0ca6\npush    rbx                                                            ; +0x8, 0x1000f0ca8\npush    rax                                                            ; +0x9, 0x1000f0ca9\nmov     [rdi+774h], esi                                                ; +0xa, 0x1000f0caa\ncmp     byte ptr [rdi+313Dh], 0                                        ; +0x10, 0x1000f0cb0\njz      short loc_1000F0CC4                                            ; +0x17, 0x1000f0cb7\nadd     rsp, 8                                                         ; +0x19, 0x1000f0cb9\npop     rbx                                                            ; +0x1d, 0x1000f0cbd\npop     r14                                                            ; +0x1e, 0x1000f0cbe\npop     r15                                                            ; +0x20, 0x1000f0cc0\npop     rbp                                                            ; +0x22, 0x1000f0cc2\nretn                                                                   ; +0x23, 0x1000f0cc3\nmov     r14d, esi                                                      ; +0x24, 0x1000f0cc4\nmov     rbx, rdi                                                       ; +0x27, 0x1000f0cc7\ncall    GameManager__sharedState                                       ; +0x2a, 0x1000f0cca\ncmp     [rax+3DCh], r14d                                               ; +0x2f, 0x1000f0ccf\njnz     short loc_1000F0CE9                                            ; +0x36, 0x1000f0cd6\ntest    r14d, r14d                                                     ; +0x38, 0x1000f0cd8\njle     short loc_1000F0CB9                                            ; +0x3b, 0x1000f0cdb\ncmp     qword ptr [rbx+0F88h], 0                                       ; +0x3d, 0x1000f0cdd\njnz     short loc_1000F0CB9                                            ; +0x45, 0x1000f0ce5\njmp     short loc_1000F0CF2                                            ; +0x47, 0x1000f0ce7\ntest    r14d, r14d                                                     ; +0x49, 0x1000f0ce9\njz      loc_1000F0D96                                                  ; +0x4c, 0x1000f0cec\ncall    GameManager__sharedState                                       ; +0x52, 0x1000f0cf2\ncmp     [rax+3DCh], r14d                                               ; +0x57, 0x1000f0cf7\njnz     short loc_1000F0D7C                                            ; +0x5e, 0x1000f0cfe\nmov     rdi, [rbx+0F88h]                                               ; +0x60, 0x1000f0d00\ntest    rdi, rdi                                                       ; +0x67, 0x1000f0d07\njz      short loc_1000F0D20                                            ; +0x6a, 0x1000f0d0a\nmov     rax, [rdi]                                                     ; +0x6c, 0x1000f0d0c\ncall    qword ptr [rax+208h]                                           ; +0x6f, 0x1000f0d0f\nmov     qword ptr [rbx+0F88h], 0                                       ; +0x75, 0x1000f0d15\ntest    r14d, r14d                                                     ; +0x80, 0x1000f0d20\njle     short loc_1000F0D6A                                            ; +0x83, 0x1000f0d23\ncmp     r14d, 3                                                        ; +0x85, 0x1000f0d25\nmov     r15d, 3                                                        ; +0x89, 0x1000f0d29\ncmovb   r15d, r14d                                                     ; +0x8f, 0x1000f0d2f\nmov     edi, r15d                                                      ; +0x93, 0x1000f0d33\ncall    GJMGLayer__create                                              ; +0x96, 0x1000f0d36\nmov     [rbx+0F88h], rax                                               ; +0x9b, 0x1000f0d3b\nmov     rcx, [rax]                                                     ; +0xa2, 0x1000f0d42\nmov     rdi, rax                                                       ; +0xa5, 0x1000f0d45\nmov     esi, r15d                                                      ; +0xa8, 0x1000f0d48\ncall    qword ptr [rcx+48h]                                            ; +0xab, 0x1000f0d4b\nmov     rdi, [rbx+0F38h]                                               ; +0xae, 0x1000f0d4e\nmov     rsi, [rbx+0F88h]                                               ; +0xb5, 0x1000f0d55\nmov     rax, [rdi]                                                     ; +0xbc, 0x1000f0d5c\nmov     edx, 0FFFFFFD9h                                                ; +0xbf, 0x1000f0d5f\ncall    qword ptr [rax+1D0h]                                           ; +0xc4, 0x1000f0d64\nmov     rdi, rbx                                                       ; +0xca, 0x1000f0d6a\nadd     rsp, 8                                                         ; +0xcd, 0x1000f0d6d\npop     rbx                                                            ; +0xd1, 0x1000f0d71\npop     r14                                                            ; +0xd2, 0x1000f0d72\npop     r15                                                            ; +0xd4, 0x1000f0d74\npop     rbp                                                            ; +0xd6, 0x1000f0d76\njmp     GJBaseGameLayer__updateLevelColors                             ; +0xd7, 0x1000f0d77\ncall    GameManager__sharedState                                       ; +0xdc, 0x1000f0d7c\nmov     rdi, rax                                                       ; +0xe1, 0x1000f0d81\nmov     esi, r14d                                                      ; +0xe4, 0x1000f0d84\nadd     rsp, 8                                                         ; +0xe7, 0x1000f0d87\npop     rbx                                                            ; +0xeb, 0x1000f0d8b\npop     r14                                                            ; +0xec, 0x1000f0d8c\npop     r15                                                            ; +0xee, 0x1000f0d8e\npop     rbp                                                            ; +0xf0, 0x1000f0d90\njmp     GameManager__loadMiddlegroundAsync                             ; +0xf1, 0x1000f0d91\nmov     rdi, [rbx+0F88h]                                               ; +0xf6, 0x1000f0d96\ntest    rdi, rdi                                                       ; +0xfd, 0x1000f0d9d\njz      loc_1000F0CB9                                                  ; +0x100, 0x1000f0da0\nmov     rax, [rdi]                                                     ; +0x106, 0x1000f0da6\ncall    qword ptr [rax+208h]                                           ; +0x109, 0x1000f0da9\nmov     qword ptr [rbx+0F88h], 0                                       ; +0x10f, 0x1000f0daf\njmp     loc_1000F0CB9                                                  ; +0x11a, 0x1000f0dba", "xrefs": ["ArtTriggerGameObject::triggerObject @ 0x1001ce9ad"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "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"}