{"type": "func", "start": 9958896, "end": 9959348, "name": "GJBigSprite::finishedLoadingSpriteAsync", "pseudocode": "// \n// GJBigSprite::finishedLoadingSpriteAsync from 0x97f5f0 to 0x97f7b4 (452 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x6ac80\n// > GJBigSprite::loadSpriteAsync @ 0x97f414\n// > <???> @ 0x122b7d0\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 GJBigSprite::finishedLoadingSpriteAsync(GJBigSprite *a1, cocos2d::CCObject *a2)\n{\n  int v3; // w22\n  const char *v4; // x1\n  __int64 v5; // x20\n  __int64 v6; // x0\n  char *v7; // x0\n  unsigned int *v8; // x2\n  int v9; // w1\n  cocos2d::CCNode *v10; // x22\n  void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23\n  __int64 v12; // x0\n  cocos2d::CCNode_vtbl *v13; // x1\n  const char *v14; // [xsp+50h] [xbp+50h] BYREF\n\n  v3 = a2->getTag(a2);\n  v5 = cocos2d::CCArray::objectAtIndex(a1->m_spriteNodes, v3);\n  if ( *(_BYTE *)(v5 + 352) )\n  {\n    v6 = *(_QWORD *)(v5 + 328);\n    if ( v6 )\n    {\n      if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v6 + 64LL))(v6) == -1 )\n      {\n        (*(void (__fastcall **)(_QWORD))(**(_QWORD **)(v5 + 328) + 520LL))(*(_QWORD *)(v5 + 328));\n        *(_QWORD *)(v5 + 328) = 0;\n      }\n      else if ( *(_QWORD *)(v5 + 328) )\n      {\n        return;\n      }\n    }\n    v10 = (cocos2d::CCNode *)cocos2d::CCSprite::create(*(cocos2d::CCSprite **)(v5 + 320), v4);\n    setPosition = v10->setPosition;\n    v12 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 192LL))(v5);\n    setPosition(v10, (const cocos2d::CCPoint *)v12);\n    a1->addChild(a1, v10);\n    v13 = v10->__vftable;\n    *(_QWORD *)(v5 + 328) = v10;\n    v13->setScale(v10, 1.002);\n    return;\n  }\n  sub_D18D28(&v14);\n  GJBigSprite::unloadSprite((__int64)a1, &v14, v3);\n  v7 = (char *)(v14 - 24);\n  if ( v14 - 24 != (const char *)&qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v8 = (unsigned int *)(v14 - 8);\n      do\n        v9 = __ldaxr(v8);\n      while ( __stlxr(v9 - 1, v8) );\n    }\n    else\n    {\n      v9 = *((_DWORD *)v14 - 2);\n      *((_DWORD *)v14 - 2) = v9 - 1;\n    }\n    if ( v9 <= 0 )\n      operator delete(v7);\n  }\n}", "assembly": "; \n; GJBigSprite::finishedLoadingSpriteAsync from 0x97f5f0 to 0x97f7b4 (452 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x6ac80\n; > GJBigSprite::loadSpriteAsync @ 0x97f414\n; > <???> @ 0x122b7d0\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_60]!                                ; +0x0, 0x97f5f0\nMOV             X29, SP                                                ; +0x4, 0x97f5f4\nSTP             X19, X20, [SP,#0x60+var_50]                            ; +0x8, 0x97f5f8\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x97f5fc\nSTR             X23, [SP,#0x60+var_30]                                 ; +0x10, 0x97f600\nSTP             X21, X22, [SP,#0x60+var_40]                            ; +0x14, 0x97f604\nMOV             X21, X0                                                ; +0x18, 0x97f608\nMOV             X0, X1                                                 ; +0x1c, 0x97f60c\nLDR             X2, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x97f610\nLDR             X1, [X1]                                               ; +0x24, 0x97f614\nLDR             X2, [X2]                                               ; +0x28, 0x97f618\nLDR             X1, [X1,#0x40]                                         ; +0x2c, 0x97f61c\nSTR             X2, [X29,#0x60+var_8]                                  ; +0x30, 0x97f620\nBLR             X1                                                     ; +0x34, 0x97f624\nMOV             W22, W0                                                ; +0x38, 0x97f628\nLDR             X0, [X21,#0x168]; this                                 ; +0x3c, 0x97f62c\nMOV             W1, W22; unsigned int                                  ; +0x40, 0x97f630\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x44, 0x97f634\nMOV             X20, X0                                                ; +0x48, 0x97f638\nLDRB            W0, [X0,#0x160]                                        ; +0x4c, 0x97f63c\nCBZ             W0, loc_97F690                                         ; +0x50, 0x97f640\nLDR             X0, [X20,#0x148]                                       ; +0x54, 0x97f644\nCBZ             X0, loc_97F714                                         ; +0x58, 0x97f648\nLDR             X1, [X0]                                               ; +0x5c, 0x97f64c\nLDR             X1, [X1,#0x40]                                         ; +0x60, 0x97f650\nBLR             X1                                                     ; +0x64, 0x97f654\nCMN             W0, #1                                                 ; +0x68, 0x97f658\nB.EQ            loc_97F6FC                                             ; +0x6c, 0x97f65c\nLDR             X0, [X20,#0x148]                                       ; +0x70, 0x97f660\nCBZ             X0, loc_97F714                                         ; +0x74, 0x97f664\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x78, 0x97f668\nLDR             X1, [X29,#0x60+var_8]                                  ; +0x7c, 0x97f66c\nLDR             X0, [X19]                                              ; +0x80, 0x97f670\nCMP             X1, X0                                                 ; +0x84, 0x97f674\nB.NE            loc_97F784                                             ; +0x88, 0x97f678\nLDP             X19, X20, [SP,#0x60+var_50]                            ; +0x8c, 0x97f67c\nLDP             X21, X22, [SP,#0x60+var_40]                            ; +0x90, 0x97f680\nLDR             X23, [SP,#0x60+var_30]                                 ; +0x94, 0x97f684\nLDP             X29, X30, [SP+0x60+var_60],#0x60                       ; +0x98, 0x97f688\nRET                                                                    ; +0x9c, 0x97f68c\nADD             X23, X29, #0x60+var_10                                 ; +0xa0, 0x97f690\nADD             X1, X20, #0x140                                        ; +0xa4, 0x97f694\nMOV             X0, X23                                                ; +0xa8, 0x97f698\nBL              sub_D18D28                                             ; +0xac, 0x97f69c\nMOV             X0, X21                                                ; +0xb0, 0x97f6a0\nMOV             X1, X23                                                ; +0xb4, 0x97f6a4\nMOV             W2, W22                                                ; +0xb8, 0x97f6a8\nBL              _ZN11GJBigSprite12unloadSpriteESsi; GJBigSprite::unloadSprite(std::string,int) ; +0xbc, 0x97f6ac\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xc0, 0x97f6b0\nLDR             X2, [X29,#0x60+var_10]                                 ; +0xc4, 0x97f6b4\nSUB             X0, X2, #0x18; p                                       ; +0xc8, 0x97f6b8\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xcc, 0x97f6bc\nCMP             X0, X1                                                 ; +0xd0, 0x97f6c0\nB.EQ            loc_97F668                                             ; +0xd4, 0x97f6c4\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0xd8, 0x97f6c8\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xdc, 0x97f6cc\nCBZ             X1, loc_97F774                                         ; +0xe0, 0x97f6d0\nSUB             X2, X2, #8                                             ; +0xe4, 0x97f6d4\nLDAXR           W1, [X2]                                               ; +0xe8, 0x97f6d8\nSUB             W3, W1, #1                                             ; +0xec, 0x97f6dc\nSTLXR           W4, W3, [X2]                                           ; +0xf0, 0x97f6e0\nCBNZ            W4, loc_97F6D8                                         ; +0xf4, 0x97f6e4\nCMP             W1, WZR                                                ; +0xf8, 0x97f6e8\nB.GT            loc_97F668                                             ; +0xfc, 0x97f6ec\nADD             X1, X29, #0x60+var_18                                  ; +0x100, 0x97f6f0\nBL              j__ZdlPv; operator delete(void *)                      ; +0x104, 0x97f6f4\nB               loc_97F668                                             ; +0x108, 0x97f6f8\nLDR             X1, [X20,#0x148]                                       ; +0x10c, 0x97f6fc\nMOV             X0, X1                                                 ; +0x110, 0x97f700\nLDR             X1, [X1]                                               ; +0x114, 0x97f704\nLDR             X1, [X1,#0x208]                                        ; +0x118, 0x97f708\nBLR             X1                                                     ; +0x11c, 0x97f70c\nSTR             XZR, [X20,#0x148]                                      ; +0x120, 0x97f710\nLDR             X0, [X20,#0x140]; this                                 ; +0x124, 0x97f714\nBL              _ZN7cocos2d8CCSprite6createEPKc; cocos2d::CCSprite::create(char const*) ; +0x128, 0x97f718\nMOV             X22, X0                                                ; +0x12c, 0x97f71c\nLDR             X1, [X20]                                              ; +0x130, 0x97f720\nMOV             X0, X20                                                ; +0x134, 0x97f724\nLDR             X2, [X22]                                              ; +0x138, 0x97f728\nLDR             X1, [X1,#0xC0]                                         ; +0x13c, 0x97f72c\nLDR             X23, [X2,#0xB8]                                        ; +0x140, 0x97f730\nBLR             X1                                                     ; +0x144, 0x97f734\nMOV             X1, X0                                                 ; +0x148, 0x97f738\nMOV             X0, X22                                                ; +0x14c, 0x97f73c\nBLR             X23                                                    ; +0x150, 0x97f740\nLDR             X2, [X21]                                              ; +0x154, 0x97f744\nMOV             X0, X21                                                ; +0x158, 0x97f748\nMOV             X1, X22                                                ; +0x15c, 0x97f74c\nLDR             X2, [X2,#0x1B8]                                        ; +0x160, 0x97f750\nBLR             X2                                                     ; +0x164, 0x97f754\nLDR             X1, [X22]                                              ; +0x168, 0x97f758\nMOV             X0, X22                                                ; +0x16c, 0x97f75c\nSTR             X22, [X20,#0x148]                                      ; +0x170, 0x97f760\nLDR             S0, =0x3F804189                                        ; +0x174, 0x97f764\nLDR             X1, [X1,#0xA0]                                         ; +0x178, 0x97f768\nBLR             X1                                                     ; +0x17c, 0x97f76c\nB               loc_97F668                                             ; +0x180, 0x97f770\nLDUR            W1, [X2,#-8]                                           ; +0x184, 0x97f774\nSUB             W3, W1, #1                                             ; +0x188, 0x97f778\nSTUR            W3, [X2,#-8]                                           ; +0x18c, 0x97f77c\nB               loc_97F6E8                                             ; +0x190, 0x97f780\nBL              .__stack_chk_fail                                      ; +0x194, 0x97f784\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x198, 0x97f788\nMOV             X19, X0                                                ; +0x19c, 0x97f78c\nLDR             X0, [X29,#0x60+var_10]                                 ; +0x1a0, 0x97f790\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x1a4, 0x97f794\nSUB             X0, X0, #0x18                                          ; +0x1a8, 0x97f798\nCMP             X0, X1                                                 ; +0x1ac, 0x97f79c\nB.EQ            loc_97F7AC                                             ; +0x1b0, 0x97f7a0\nADD             X1, X29, #0x60+var_18                                  ; +0x1b4, 0x97f7a4\nBL              sub_4DD320                                             ; +0x1b8, 0x97f7a8\nMOV             X0, X19                                                ; +0x1bc, 0x97f7ac\nBL              _Unwind_Resume                                         ; +0x1c0, 0x97f7b0", "xrefs": ["<???> @ 0x6ac80", "GJBigSprite::loadSpriteAsync @ 0x97f414", "<???> @ 0x122b7d0"], "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"}