{"type": "func", "start": 4297557964, "end": 4297558100, "name": "GJBaseGameLayer::createMiddleground", "pseudocode": "// \n// GJBaseGameLayer::createMiddleground from 0x1002787cc to 0x100278854 (136 bytes)\n// \n// 6 xrefs:\n// > PlayLayer::setupHasCompleted @ 0x10013f72c\n// > LevelSettingsLayer::selectArtClosed @ 0x10020d9d4\n// > GJBaseGameLayer::swapMiddleground @ 0x100278788\n// > GJBaseGameLayer::asyncMGLoaded @ 0x100278864\n// > GJBaseGameLayer::syncBGTextures @ 0x10029ef60\n// > LevelEditorLayer::init @ 0x1003f7118\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::createMiddleground(__int64 a1, int a2)\n{\n  __int64 v2; // x20\n  __int64 result; // x0\n  char *v5; // x0\n\n  LODWORD(v2) = a2;\n  result = *(_QWORD *)(a1 + 3976);\n  if ( result )\n  {\n    result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)result + 520LL))(result);\n    *(_QWORD *)(a1 + 3976) = 0;\n  }\n  if ( (int)v2 >= 1 )\n  {\n    if ( (unsigned int)v2 >= 3 )\n      v2 = 3;\n    else\n      v2 = (unsigned int)v2;\n    v5 = sub_1000300E0(v2);\n    *(_QWORD *)(a1 + 3976) = v5;\n    (*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v5 + 72LL))(v5, v2);\n    return (*(__int64 (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 3896) + 464LL))(\n             *(_QWORD *)(a1 + 3896),\n             *(_QWORD *)(a1 + 3976),\n             4294967257LL);\n  }\n  return result;\n}", "assembly": "; \n; GJBaseGameLayer::createMiddleground from 0x1002787cc to 0x100278854 (136 bytes)\n; \n; 6 xrefs:\n; > PlayLayer::setupHasCompleted @ 0x10013f72c\n; > LevelSettingsLayer::selectArtClosed @ 0x10020d9d4\n; > GJBaseGameLayer::swapMiddleground @ 0x100278788\n; > GJBaseGameLayer::asyncMGLoaded @ 0x100278864\n; > GJBaseGameLayer::syncBGTextures @ 0x10029ef60\n; > LevelEditorLayer::init @ 0x1003f7118\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, 0x1002787cc\nSTP             X29, X30, [SP,#0x10+var_s0]                            ; +0x4, 0x1002787d0\nADD             X29, SP, #0x10                                         ; +0x8, 0x1002787d4\nMOV             X20, X1                                                ; +0xc, 0x1002787d8\nMOV             X19, X0                                                ; +0x10, 0x1002787dc\nLDR             X0, [X0,#0xF88]                                        ; +0x14, 0x1002787e0\nCBZ             X0, loc_1002787F8                                      ; +0x18, 0x1002787e4\nLDR             X8, [X0]                                               ; +0x1c, 0x1002787e8\nLDR             X8, [X8,#0x208]                                        ; +0x20, 0x1002787ec\nBLR             X8                                                     ; +0x24, 0x1002787f0\nSTR             XZR, [X19,#0xF88]                                      ; +0x28, 0x1002787f4\nCMP             W20, #1                                                ; +0x2c, 0x1002787f8\nB.LT            loc_100278848                                          ; +0x30, 0x1002787fc\nCMP             W20, #3                                                ; +0x34, 0x100278800\nMOV             W8, #3                                                 ; +0x38, 0x100278804\nCSEL            W20, W20, W8, CC                                       ; +0x3c, 0x100278808\nMOV             X0, X20                                                ; +0x40, 0x10027880c\nBL              sub_1000300E0                                          ; +0x44, 0x100278810\nSTR             X0, [X19,#0xF88]                                       ; +0x48, 0x100278814\nLDR             X8, [X0]                                               ; +0x4c, 0x100278818\nLDR             X8, [X8,#0x48]                                         ; +0x50, 0x10027881c\nMOV             X1, X20                                                ; +0x54, 0x100278820\nBLR             X8                                                     ; +0x58, 0x100278824\nLDR             X0, [X19,#0xF38]                                       ; +0x5c, 0x100278828\nLDR             X1, [X19,#0xF88]                                       ; +0x60, 0x10027882c\nLDR             X8, [X0]                                               ; +0x64, 0x100278830\nLDR             X3, [X8,#0x1D0]                                        ; +0x68, 0x100278834\nMOV             W2, #0xFFFFFFD9                                        ; +0x6c, 0x100278838\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x70, 0x10027883c\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x74, 0x100278840\nBR              X3                                                     ; +0x78, 0x100278844\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x7c, 0x100278848\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x80, 0x10027884c\nRET                                                                    ; +0x84, 0x100278850", "xrefs": ["PlayLayer::setupHasCompleted @ 0x10013f72c", "LevelSettingsLayer::selectArtClosed @ 0x10020d9d4", "GJBaseGameLayer::swapMiddleground @ 0x100278788", "GJBaseGameLayer::asyncMGLoaded @ 0x100278864", "GJBaseGameLayer::syncBGTextures @ 0x10029ef60", "LevelEditorLayer::init @ 0x1003f7118"], "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"}