{"type": "func", "start": 5706700, "end": 5706964, "name": "CCAnimatedSprite::tweenToAnimationFinished", "pseudocode": "// \n// CCAnimatedSprite::tweenToAnimationFinished from 0x5713cc to 0x5714d4 (264 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x49fe0\n// > CCAnimatedSprite::tweenToAnimation @ 0x5717b8\n// > <???> @ 0x122a5c8\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 CCAnimatedSprite::tweenToAnimationFinished(CCAnimatedSprite *a1)\n{\n  std::string *p_m_activeTween; // x21\n  void *v3; // x0\n  unsigned int *v4; // x2\n  int v5; // w1\n  __int64 v6; // [xsp+40h] [xbp+40h] BYREF\n\n  p_m_activeTween = &a1->m_activeTween;\n  sub_D18D28(&v6, &a1->m_activeTween);\n  CCAnimatedSprite::runAnimation((__int64)a1, (__int64)&v6);\n  v3 = (void *)(v6 - 24);\n  if ( (__int64 *)(v6 - 24) != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v4 = (unsigned int *)(v6 - 8);\n      do\n        v5 = __ldaxr(v4);\n      while ( __stlxr(v5 - 1, v4) );\n    }\n    else\n    {\n      v5 = *(_DWORD *)(v6 - 8);\n      *(_DWORD *)(v6 - 8) = v5 - 1;\n    }\n    if ( v5 <= 0 )\n      operator delete(v3);\n  }\n  sub_D1798C(p_m_activeTween, &byte_F288A0, 0);\n}", "assembly": "; \n; CCAnimatedSprite::tweenToAnimationFinished from 0x5713cc to 0x5714d4 (264 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x49fe0\n; > CCAnimatedSprite::tweenToAnimation @ 0x5717b8\n; > <???> @ 0x122a5c8\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             X29, X30, [SP,#var_50]!                                ; +0x0, 0x5713cc\nMOV             X29, SP                                                ; +0x4, 0x5713d0\nSTP             X19, X20, [SP,#0x50+var_40]                            ; +0x8, 0x5713d4\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x5713d8\nADD             X20, X29, #0x50+var_10                                 ; +0x10, 0x5713dc\nSTP             X21, X22, [SP,#0x50+var_30]                            ; +0x14, 0x5713e0\nADD             X21, X0, #0x260                                        ; +0x18, 0x5713e4\nMOV             X22, X0                                                ; +0x1c, 0x5713e8\nLDR             X2, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x5713ec\nMOV             X0, X20                                                ; +0x24, 0x5713f0\nMOV             X1, X21                                                ; +0x28, 0x5713f4\nLDR             X2, [X2]                                               ; +0x2c, 0x5713f8\nSTR             X2, [X29,#0x50+var_8]                                  ; +0x30, 0x5713fc\nBL              sub_D18D28                                             ; +0x34, 0x571400\nMOV             X0, X22                                                ; +0x38, 0x571404\nMOV             X1, X20                                                ; +0x3c, 0x571408\nBL              _ZN16CCAnimatedSprite12runAnimationESs; CCAnimatedSprite::runAnimation(std::string) ; +0x40, 0x57140c\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x44, 0x571410\nLDR             X2, [X29,#0x50+var_10]                                 ; +0x48, 0x571414\nSUB             X0, X2, #0x18; p                                       ; +0x4c, 0x571418\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x50, 0x57141c\nCMP             X0, X1                                                 ; +0x54, 0x571420\nB.NE            loc_571460                                             ; +0x58, 0x571424\nADRP            X1, #byte_F288A0@PAGE                                  ; +0x5c, 0x571428\nMOV             X0, X21                                                ; +0x60, 0x57142c\nADD             X1, X1, #byte_F288A0@PAGEOFF                           ; +0x64, 0x571430\nMOV             X2, #0                                                 ; +0x68, 0x571434\nBL              sub_D1798C                                             ; +0x6c, 0x571438\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x70, 0x57143c\nLDR             X1, [X29,#0x50+var_8]                                  ; +0x74, 0x571440\nLDR             X0, [X19]                                              ; +0x78, 0x571444\nCMP             X1, X0                                                 ; +0x7c, 0x571448\nB.NE            loc_5714A4                                             ; +0x80, 0x57144c\nLDP             X19, X20, [SP,#0x50+var_40]                            ; +0x84, 0x571450\nLDP             X21, X22, [SP,#0x50+var_30]                            ; +0x88, 0x571454\nLDP             X29, X30, [SP+0x50+var_50],#0x50                       ; +0x8c, 0x571458\nRET                                                                    ; +0x90, 0x57145c\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x94, 0x571460\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x98, 0x571464\nCBZ             X1, loc_571494                                         ; +0x9c, 0x571468\nSUB             X2, X2, #8                                             ; +0xa0, 0x57146c\nLDAXR           W1, [X2]                                               ; +0xa4, 0x571470\nSUB             W3, W1, #1                                             ; +0xa8, 0x571474\nSTLXR           W4, W3, [X2]                                           ; +0xac, 0x571478\nCBNZ            W4, loc_571470                                         ; +0xb0, 0x57147c\nCMP             W1, WZR                                                ; +0xb4, 0x571480\nB.GT            loc_571428                                             ; +0xb8, 0x571484\nADD             X1, X29, #0x50+var_18                                  ; +0xbc, 0x571488\nBL              j__ZdlPv; operator delete(void *)                      ; +0xc0, 0x57148c\nB               loc_571428                                             ; +0xc4, 0x571490\nLDUR            W1, [X2,#-8]                                           ; +0xc8, 0x571494\nSUB             W3, W1, #1                                             ; +0xcc, 0x571498\nSTUR            W3, [X2,#-8]                                           ; +0xd0, 0x57149c\nB               loc_571480                                             ; +0xd4, 0x5714a0\nBL              .__stack_chk_fail                                      ; +0xd8, 0x5714a4\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xdc, 0x5714a8\nMOV             X19, X0                                                ; +0xe0, 0x5714ac\nLDR             X0, [X29,#0x50+var_10]                                 ; +0xe4, 0x5714b0\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xe8, 0x5714b4\nSUB             X0, X0, #0x18                                          ; +0xec, 0x5714b8\nCMP             X0, X1                                                 ; +0xf0, 0x5714bc\nB.EQ            loc_5714CC                                             ; +0xf4, 0x5714c0\nADD             X1, X29, #0x50+var_18                                  ; +0xf8, 0x5714c4\nBL              sub_5703FC                                             ; +0xfc, 0x5714c8\nMOV             X0, X19                                                ; +0x100, 0x5714cc\nBL              _Unwind_Resume                                         ; +0x104, 0x5714d0", "xrefs": ["<???> @ 0x49fe0", "CCAnimatedSprite::tweenToAnimation @ 0x5717b8", "<???> @ 0x122a5c8"], "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"}