{"type": "func", "start": 4297072980, "end": 4297073164, "name": "GJBaseGameLayer::syncBGTextures", "pseudocode": "// \n// GJBaseGameLayer::syncBGTextures from 0x100202154 to 0x10020220c (184 bytes)\n// \n// 3 xrefs:\n// > PlayLayer::resetLevel @ 0x10012237c\n// > LevelEditorLayer::onPlaytest @ 0x100362ea0\n// > LevelEditorLayer::onStopPlaytest @ 0x100363270\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::syncBGTextures(GJBaseGameLayer *a1)\n{\n  int v2; // w0\n  int m_background; // w1\n  int v4; // w0\n  int m_ground; // w1\n  GJMGLayer *m_middleground; // x0\n  int v7; // w0\n  int v8; // w1\n\n  v2 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_background->getTag)(a1->m_background);\n  m_background = a1->m_gameState.m_background;\n  if ( v2 != m_background )\n    GJBaseGameLayer::createBackground(a1, m_background);\n  v4 = ((__int64 (__fastcall *)(GJGroundLayer *))a1->m_groundLayer->getTag)(a1->m_groundLayer);\n  m_ground = a1->m_gameState.m_ground;\n  if ( v4 != m_ground )\n    GJBaseGameLayer::createGroundLayer(a1, m_ground, a1->m_levelSettings->m_groundLineIndex);\n  m_middleground = a1->m_middleground;\n  if ( !m_middleground )\n  {\n    v8 = a1->m_gameState.m_middleground;\n    goto LABEL_10;\n  }\n  v7 = ((__int64 (__fastcall *)(GJMGLayer *))m_middleground->getTag)(m_middleground);\n  v8 = a1->m_gameState.m_middleground;\n  if ( v7 == v8 )\n  {\n    if ( a1->m_middleground )\n      return;\n    v8 = v7;\nLABEL_10:\n    if ( v8 < 1 )\n      return;\n  }\n  GJBaseGameLayer::createMiddleground(a1, v8);\n}", "assembly": "; \n; GJBaseGameLayer::syncBGTextures from 0x100202154 to 0x10020220c (184 bytes)\n; \n; 3 xrefs:\n; > PlayLayer::resetLevel @ 0x10012237c\n; > LevelEditorLayer::onPlaytest @ 0x100362ea0\n; > LevelEditorLayer::onStopPlaytest @ 0x100363270\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, 0x100202154\nSTP             X29, X30, [SP,#0x10+var_s0]                            ; +0x4, 0x100202158\nADD             X29, SP, #0x10                                         ; +0x8, 0x10020215c\nMOV             X19, X0                                                ; +0xc, 0x100202160\nLDR             X0, [X0,#0xEF8]                                        ; +0x10, 0x100202164\nLDR             X8, [X0]                                               ; +0x14, 0x100202168\nLDR             X8, [X8,#0x40]                                         ; +0x18, 0x10020216c\nBLR             X8                                                     ; +0x1c, 0x100202170\nLDR             W1, [X19,#0x76C]                                       ; +0x20, 0x100202174\nCMP             W0, W1                                                 ; +0x24, 0x100202178\nB.EQ            loc_100202188                                          ; +0x28, 0x10020217c\nMOV             X0, X19                                                ; +0x2c, 0x100202180\nBL              GJBaseGameLayer__createBackground                      ; +0x30, 0x100202184\nLDR             X0, [X19,#0xF08]                                       ; +0x34, 0x100202188\nLDR             X8, [X0]                                               ; +0x38, 0x10020218c\nLDR             X8, [X8,#0x40]                                         ; +0x3c, 0x100202190\nBLR             X8                                                     ; +0x40, 0x100202194\nLDR             W1, [X19,#0x770]                                       ; +0x44, 0x100202198\nCMP             W0, W1                                                 ; +0x48, 0x10020219c\nB.EQ            loc_1002021B4                                          ; +0x4c, 0x1002021a0\nLDR             X8, [X19,#0xCD8]                                       ; +0x50, 0x1002021a4\nLDR             W2, [X8,#0x1A8]                                        ; +0x54, 0x1002021a8\nMOV             X0, X19                                                ; +0x58, 0x1002021ac\nBL              GJBaseGameLayer__createGroundLayer                     ; +0x5c, 0x1002021b0\nLDR             X0, [X19,#0xF18]                                       ; +0x60, 0x1002021b4\nCBZ             X0, loc_1002021E4                                      ; +0x64, 0x1002021b8\nLDR             X8, [X0]                                               ; +0x68, 0x1002021bc\nLDR             X8, [X8,#0x40]                                         ; +0x6c, 0x1002021c0\nBLR             X8                                                     ; +0x70, 0x1002021c4\nLDR             W1, [X19,#0x774]                                       ; +0x74, 0x1002021c8\nCMP             W0, W1                                                 ; +0x78, 0x1002021cc\nB.NE            loc_1002021F0                                          ; +0x7c, 0x1002021d0\nLDR             X8, [X19,#0xF18]                                       ; +0x80, 0x1002021d4\nCBNZ            X8, loc_100202200                                      ; +0x84, 0x1002021d8\nMOV             X1, X0                                                 ; +0x88, 0x1002021dc\nB               loc_1002021E8                                          ; +0x8c, 0x1002021e0\nLDR             W1, [X19,#0x774]                                       ; +0x90, 0x1002021e4\nCMP             W1, #1                                                 ; +0x94, 0x1002021e8\nB.LT            loc_100202200                                          ; +0x98, 0x1002021ec\nMOV             X0, X19                                                ; +0x9c, 0x1002021f0\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0xa0, 0x1002021f4\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0xa4, 0x1002021f8\nB               GJBaseGameLayer__createMiddleground                    ; +0xa8, 0x1002021fc\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0xac, 0x100202200\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0xb0, 0x100202204\nRET                                                                    ; +0xb4, 0x100202208", "xrefs": ["PlayLayer::resetLevel @ 0x10012237c", "LevelEditorLayer::onPlaytest @ 0x100362ea0", "LevelEditorLayer::onStopPlaytest @ 0x100363270"], "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"}