{"type": "func", "start": 6866860, "end": 6867148, "name": "CCAnimatedSprite::switchToMode", "pseudocode": "// \n// CCAnimatedSprite::switchToMode from 0x68c7ac to 0x68c8cc (288 bytes)\n// \n// 4 xrefs:\n// > SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x6afdb8\n// > SpriteAnimationManager::executeAnimation @ 0x6b0014\n// > SpriteAnimationManager::executeAnimation @ 0x6b0120\n// > <???> @ 0xfbb00\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 12:50:33 +0000\n// \n\n__int64 __fastcall CCAnimatedSprite::switchToMode(__int64 result, int a2)\n{\n  __int64 v2; // x19\n  __int64 v4; // x21\n  _QWORD *v5; // x0\n  CCPartAnimSprite *v6; // x21\n  char v7; // w0\n  cocos2d::CCNode *v8; // x0\n  __int64 v9; // x21\n  void (__fastcall *v10)(__int64, __int64); // x22\n  __int64 v11; // x0\n  cocos2d::CCSprite *v12; // x21\n  char isFlipX; // w0\n\n  if ( *(_DWORD *)(result + 680) != a2 )\n  {\n    v2 = result;\n    cocos2d::CCNode::stopAllActions(*(cocos2d::CCNode **)(result + 656));\n    (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v2 + 656) + 344LL))(*(_QWORD *)(v2 + 656), 0);\n    if ( a2 == 1 )\n    {\n      v9 = *(_QWORD *)(v2 + 664);\n      if ( v9 )\n      {\n        v10 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v9 + 960LL);\n        v11 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v2 + 656) + 944LL))(*(_QWORD *)(v2 + 656));\n        v10(v9, v11);\n        v12 = *(cocos2d::CCSprite **)(v2 + 664);\n        isFlipX = cocos2d::CCSprite::isFlipX(*(cocos2d::CCSprite **)(v2 + 656));\n        cocos2d::CCSprite::setFlipX(v12, isFlipX);\n        v8 = *(cocos2d::CCNode **)(v2 + 664);\n        *(_QWORD *)(v2 + 656) = v8;\n      }\n      else\n      {\n        v8 = *(cocos2d::CCNode **)(v2 + 656);\n      }\n    }\n    else\n    {\n      v4 = *(_QWORD *)(v2 + 672);\n      v5 = (_QWORD *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v2 + 656) + 944LL))(*(_QWORD *)(v2 + 656));\n      CCPartAnimSprite::setColor(v4, *v5);\n      v6 = *(CCPartAnimSprite **)(v2 + 672);\n      v7 = cocos2d::CCSprite::isFlipX(*(cocos2d::CCSprite **)(v2 + 656));\n      CCPartAnimSprite::setFlipX(v6, v7);\n      v8 = *(cocos2d::CCNode **)(v2 + 672);\n      *(_QWORD *)(v2 + 656) = v8;\n    }\n    cocos2d::CCNode::stopAllActions(v8);\n    result = (*(__int64 (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(v2 + 656) + 344LL))(*(_QWORD *)(v2 + 656), 1);\n    *(_DWORD *)(v2 + 680) = a2;\n  }\n  return result;\n}", "assembly": "; \n; CCAnimatedSprite::switchToMode from 0x68c7ac to 0x68c8cc (288 bytes)\n; \n; 4 xrefs:\n; > SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x6afdb8\n; > SpriteAnimationManager::executeAnimation @ 0x6b0014\n; > SpriteAnimationManager::executeAnimation @ 0x6b0120\n; > <???> @ 0xfbb00\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 12:50:33 +0000\n; \nSTP             X29, X30, [SP,#-0x30+var_s0]!                          ; +0x0, 0x68c7ac\nMOV             X29, SP                                                ; +0x4, 0x68c7b0\nSTP             X19, X20, [SP,#var_s10]                                ; +0x8, 0x68c7b4\nSTP             X21, X22, [SP,#var_s20]                                ; +0xc, 0x68c7b8\nLDR             W2, [X0,#0x2A8]                                        ; +0x10, 0x68c7bc\nCMP             W2, W1                                                 ; +0x14, 0x68c7c0\nB.EQ            loc_68C860                                             ; +0x18, 0x68c7c4\nMOV             X19, X0                                                ; +0x1c, 0x68c7c8\nLDR             X0, [X0,#0x290]; this                                  ; +0x20, 0x68c7cc\nMOV             W20, W1                                                ; +0x24, 0x68c7d0\nBL              _ZN7cocos2d6CCNode14stopAllActionsEv; cocos2d::CCNode::stopAllActions(void) ; +0x28, 0x68c7d4\nLDR             X2, [X19,#0x290]                                       ; +0x2c, 0x68c7d8\nMOV             W1, #0                                                 ; +0x30, 0x68c7dc\nMOV             X0, X2                                                 ; +0x34, 0x68c7e0\nLDR             X2, [X2]                                               ; +0x38, 0x68c7e4\nLDR             X2, [X2,#0x158]                                        ; +0x3c, 0x68c7e8\nBLR             X2                                                     ; +0x40, 0x68c7ec\nCMP             W20, #1                                                ; +0x44, 0x68c7f0\nB.EQ            loc_68C870                                             ; +0x48, 0x68c7f4\nLDR             X1, [X19,#0x290]                                       ; +0x4c, 0x68c7f8\nLDR             X21, [X19,#0x2A0]                                      ; +0x50, 0x68c7fc\nMOV             X0, X1                                                 ; +0x54, 0x68c800\nLDR             X1, [X1]                                               ; +0x58, 0x68c804\nLDR             X1, [X1,#0x3B0]                                        ; +0x5c, 0x68c808\nBLR             X1                                                     ; +0x60, 0x68c80c\nMOV             X1, X0                                                 ; +0x64, 0x68c810\nMOV             X0, X21                                                ; +0x68, 0x68c814\nLDR             X1, [X1]                                               ; +0x6c, 0x68c818\nBL              _ZN16CCPartAnimSprite8setColorEN7cocos2d10_ccColor3BE; CCPartAnimSprite::setColor(cocos2d::_ccColor3B) ; +0x70, 0x68c81c\nLDR             X21, [X19,#0x2A0]                                      ; +0x74, 0x68c820\nLDR             X0, [X19,#0x290]; this                                 ; +0x78, 0x68c824\nBL              _ZN7cocos2d8CCSprite7isFlipXEv; cocos2d::CCSprite::isFlipX(void) ; +0x7c, 0x68c828\nMOV             W1, W0; bool                                           ; +0x80, 0x68c82c\nMOV             X0, X21; this                                          ; +0x84, 0x68c830\nBL              _ZN16CCPartAnimSprite8setFlipXEb; CCPartAnimSprite::setFlipX(bool) ; +0x88, 0x68c834\nLDR             X0, [X19,#0x2A0]; this                                 ; +0x8c, 0x68c838\nSTR             X0, [X19,#0x290]                                       ; +0x90, 0x68c83c\nBL              _ZN7cocos2d6CCNode14stopAllActionsEv; cocos2d::CCNode::stopAllActions(void) ; +0x94, 0x68c840\nLDR             X2, [X19,#0x290]                                       ; +0x98, 0x68c844\nMOV             W1, #1                                                 ; +0x9c, 0x68c848\nMOV             X0, X2                                                 ; +0xa0, 0x68c84c\nLDR             X2, [X2]                                               ; +0xa4, 0x68c850\nLDR             X2, [X2,#0x158]                                        ; +0xa8, 0x68c854\nBLR             X2                                                     ; +0xac, 0x68c858\nSTR             W20, [X19,#0x2A8]                                      ; +0xb0, 0x68c85c\nLDP             X19, X20, [SP,#var_s10]                                ; +0xb4, 0x68c860\nLDP             X21, X22, [SP,#var_s20]                                ; +0xb8, 0x68c864\nLDP             X29, X30, [SP+var_s0],#0x30                            ; +0xbc, 0x68c868\nRET                                                                    ; +0xc0, 0x68c86c\nLDR             X21, [X19,#0x298]                                      ; +0xc4, 0x68c870\nCBZ             X21, loc_68C8C4                                        ; +0xc8, 0x68c874\nLDR             X1, [X19,#0x290]                                       ; +0xcc, 0x68c878\nLDR             X2, [X21]                                              ; +0xd0, 0x68c87c\nMOV             X0, X1                                                 ; +0xd4, 0x68c880\nLDR             X1, [X1]                                               ; +0xd8, 0x68c884\nLDR             X22, [X2,#0x3C0]                                       ; +0xdc, 0x68c888\nLDR             X1, [X1,#0x3B0]                                        ; +0xe0, 0x68c88c\nBLR             X1                                                     ; +0xe4, 0x68c890\nMOV             X1, X0                                                 ; +0xe8, 0x68c894\nMOV             X0, X21                                                ; +0xec, 0x68c898\nBLR             X22                                                    ; +0xf0, 0x68c89c\nLDR             X21, [X19,#0x298]                                      ; +0xf4, 0x68c8a0\nLDR             X0, [X19,#0x290]; this                                 ; +0xf8, 0x68c8a4\nBL              _ZN7cocos2d8CCSprite7isFlipXEv; cocos2d::CCSprite::isFlipX(void) ; +0xfc, 0x68c8a8\nMOV             W1, W0; bool                                           ; +0x100, 0x68c8ac\nMOV             X0, X21; this                                          ; +0x104, 0x68c8b0\nBL              _ZN7cocos2d8CCSprite8setFlipXEb; cocos2d::CCSprite::setFlipX(bool) ; +0x108, 0x68c8b4\nLDR             X0, [X19,#0x298]                                       ; +0x10c, 0x68c8b8\nSTR             X0, [X19,#0x290]                                       ; +0x110, 0x68c8bc\nB               loc_68C840                                             ; +0x114, 0x68c8c0\nLDR             X0, [X19,#0x290]                                       ; +0x118, 0x68c8c4\nB               loc_68C840                                             ; +0x11c, 0x68c8c8", "xrefs": ["SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x6afdb8", "SpriteAnimationManager::executeAnimation @ 0x6b0014", "SpriteAnimationManager::executeAnimation @ 0x6b0120", "<???> @ 0xfbb00"], "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"}