{"type": "func", "start": 8948116, "end": 8948780, "name": "GJBaseGameLayer::updateParticles", "pseudocode": "// \n// GJBaseGameLayer::updateParticles from 0x888994 to 0x888c2c (664 bytes)\n// \n// 3 xrefs:\n// > PlayLayer::updateVisibility @ 0x5cea38\n// > LevelEditorLayer::updateVisibility @ 0x66310c\n// > <???> @ 0x6d3f8\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 GJBaseGameLayer::updateParticles(GJBaseGameLayer *a1, float a2)\n{\n  unsigned int v3; // w21\n  __int64 *p_m_customParticlesUIDs; // x22\n  stl::StringData<char>::Internal *v6; // x0\n  __int64 v7; // x0\n  __int64 v8; // x20\n  unsigned int v9; // w20\n  cocos2d::CCObject *v10; // x21\n  unsigned __int64 m_uUnknown; // x26\n  std::_Hashtable<int, std::pair<const int, std::string>, std::allocator<std::pair<const int, std::string>>, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true>>::size_type v12; // x27\n  _QWORD *v13; // x0\n  cocos2d::CCArray *v14; // x0\n  char *v15; // x27\n  unsigned int *v16; // x21\n  int v17; // w0\n  int v18; // w0\n  void (__fastcall *v19)(__int64, float); // x2\n  __int64 v20; // x0\n  int v21; // w5\n  std::string v22[2]; // [xsp+90h] [xbp+90h] BYREF\n\n  v3 = 0;\n  p_m_customParticlesUIDs = (__int64 *)&a1->m_customParticlesUIDs;\n  v6 = (stl::StringData<char>::Internal *)_stack_chk_guard;\n  a1->m_particleCount = 0;\n  v22[1].m_data.m_data = v6;\n  while ( v3 < (unsigned int)cocos2d::CCArray::count(a1->m_temporaryParticles) )\n  {\n    while ( 1 )\n    {\n      v7 = cocos2d::CCArray::objectAtIndex(a1->m_temporaryParticles, v3);\n      v8 = v7;\n      if ( !*(_BYTE *)(v7 + 535) )\n        break;\n      LODWORD(v22[0].m_data.m_data) = *(_DWORD *)(v7 + 8);\n      sub_888850(p_m_customParticlesUIDs, (int *)v22);\n      cocos2d::CCArray::fastRemoveObjectAtIndex(a1->m_temporaryParticles, v3);\n      if ( v3 >= (unsigned int)cocos2d::CCArray::count(a1->m_temporaryParticles) )\n        goto LABEL_5;\n    }\n    ++v3;\n    v18 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 1480LL))(v7);\n    v19 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)v8 + 40LL);\n    a1->m_particleCount += v18;\n    v19(v8, a2);\n  }\nLABEL_5:\n  v9 = 0;\n  while ( v9 < (unsigned int)cocos2d::CCArray::count(a1->m_unclaimedParticles) )\n  {\n    while ( 1 )\n    {\n      v10 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(a1->m_unclaimedParticles, v9);\n      if ( !((unsigned int (__fastcall *)(cocos2d::CCObject *))v10->__vftable[11].~CCObject_0)(v10) )\n        break;\n      if ( ++v9 >= (unsigned int)cocos2d::CCArray::count(a1->m_unclaimedParticles) )\n        return;\n    }\n    m_uUnknown = v10[13].m_uUnknown;\n    v12 = m_uUnknown % a1->m_particleCountToParticleString._M_h._M_bucket_count;\n    v13 = sub_8562F8(&a1->m_particleCountToParticleString._M_h._M_buckets, v12, &v10[13].m_uUnknown);\n    if ( !v13 || !*v13 )\n    {\n      v20 = operator new(0x18u);\n      v21 = v10[13].m_uUnknown;\n      *(_QWORD *)v20 = 0;\n      *(_DWORD *)(v20 + 8) = v21;\n      *(_QWORD *)(v20 + 16) = &byte_124B6C8;\n      std::_Hashtable<int,std::pair<int const,std::string>,std::allocator<std::pair<int const,std::string>>,std::__detail::_Select1st,std::equal_to<int>,std::hash<int>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<false,false,true>>::_M_insert_unique_node(\n        (char **)&a1->m_particleCountToParticleString,\n        v12,\n        m_uUnknown,\n        (char *)v20);\n    }\n    sub_D18D28(v22);\n    v14 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(a1->m_customParticles, v22);\n    if ( v14 )\n      cocos2d::CCArray::addObject(v14, v10);\n    cocos2d::CCArray::fastRemoveObjectAtIndex(a1->m_unclaimedParticles, v9);\n    v15 = (char *)v22[0].m_data.m_data - 24;\n    if ( (__int64 *)v22[0].m_data.m_data - 3 != &qword_124B6B0 )\n    {\n      if ( &pthread_create )\n      {\n        v16 = (unsigned int *)((char *)v22[0].m_data.m_data - 8);\n        do\n          v17 = __ldaxr(v16);\n        while ( __stlxr(v17 - 1, v16) );\n      }\n      else\n      {\n        v17 = *((_DWORD *)v22[0].m_data.m_data - 2);\n        *((_DWORD *)v22[0].m_data.m_data - 2) = v17 - 1;\n      }\n      if ( v17 <= 0 )\n        operator delete(v15);\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::updateParticles from 0x888994 to 0x888c2c (664 bytes)\n; \n; 3 xrefs:\n; > PlayLayer::updateVisibility @ 0x5cea38\n; > LevelEditorLayer::updateVisibility @ 0x66310c\n; > <???> @ 0x6d3f8\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_A0]!                                ; +0x0, 0x888994\nMOV             X29, SP                                                ; +0x4, 0x888998\nSTP             X23, X24, [SP,#0xA0+var_70]                            ; +0x8, 0x88899c\nADRP            X24, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x8889a0\nADD             X23, X29, #0xA0+var_10                                 ; +0x10, 0x8889a4\nSTP             X21, X22, [SP,#0xA0+var_80]                            ; +0x14, 0x8889a8\nSTP             X19, X20, [SP,#0xA0+var_90]                            ; +0x18, 0x8889ac\nADD             X22, X0, #3,LSL#12                                     ; +0x1c, 0x8889b0\nMOV             X19, X0                                                ; +0x20, 0x8889b4\nLDR             X0, [X24,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x24, 0x8889b8\nMOV             W21, #0                                                ; +0x28, 0x8889bc\nSTR             D8, [SP,#0xA0+var_40]                                  ; +0x2c, 0x8889c0\nADD             X22, X22, #0x190                                       ; +0x30, 0x8889c4\nFMOV            S8, S0                                                 ; +0x34, 0x8889c8\nSTP             X25, X26, [SP,#0xA0+var_60]                            ; +0x38, 0x8889cc\nSTP             X27, X28, [SP,#0xA0+var_50]                            ; +0x3c, 0x8889d0\nLDR             X0, [X0]                                               ; +0x40, 0x8889d4\nSTR             WZR, [X19,#0x3120]                                     ; +0x44, 0x8889d8\nSTR             X0, [X29,#0xA0+var_8]                                  ; +0x48, 0x8889dc\nLDR             X0, [X19,#0x3188]; this                                ; +0x4c, 0x8889e0\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x50, 0x8889e4\nCMP             W21, W0                                                ; +0x54, 0x8889e8\nB.CS            loc_888A38                                             ; +0x58, 0x8889ec\nLDR             X0, [X19,#0x3188]; this                                ; +0x5c, 0x8889f0\nMOV             W1, W21; unsigned int                                  ; +0x60, 0x8889f4\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x64, 0x8889f8\nLDRB            W1, [X0,#0x217]                                        ; +0x68, 0x8889fc\nMOV             X20, X0                                                ; +0x6c, 0x888a00\nCBZ             W1, loc_888B78                                         ; +0x70, 0x888a04\nLDR             W2, [X20,#8]                                           ; +0x74, 0x888a08\nMOV             X1, X23                                                ; +0x78, 0x888a0c\nMOV             X0, X22                                                ; +0x7c, 0x888a10\nSTR             W2, [X29,#0xA0+var_10]                                 ; +0x80, 0x888a14\nBL              sub_888850                                             ; +0x84, 0x888a18\nLDR             X0, [X19,#0x3188]; this                                ; +0x88, 0x888a1c\nMOV             W1, W21; unsigned int                                  ; +0x8c, 0x888a20\nBL              _ZN7cocos2d7CCArray23fastRemoveObjectAtIndexEj; cocos2d::CCArray::fastRemoveObjectAtIndex(uint) ; +0x90, 0x888a24\nLDR             X0, [X19,#0x3188]; this                                ; +0x94, 0x888a28\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x98, 0x888a2c\nCMP             W21, W0                                                ; +0x9c, 0x888a30\nB.CC            loc_8889F0                                             ; +0xa0, 0x888a34\nADD             X23, X19, #3,LSL#12                                    ; +0xa4, 0x888a38\nADD             X0, X29, #0xA0+var_18                                  ; +0xa8, 0x888a3c\nMOV             W20, #0                                                ; +0xac, 0x888a40\nADD             X23, X23, #0x148                                       ; +0xb0, 0x888a44\nADRP            X25, #off_122EFE8@PAGE                                 ; +0xb4, 0x888a48\nADD             X22, X29, #0xA0+var_10                                 ; +0xb8, 0x888a4c\nSTR             X0, [X29,#0xA0+var_28]                                 ; +0xbc, 0x888a50\nLDR             X0, [X19,#0x3140]; this                                ; +0xc0, 0x888a54\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xc4, 0x888a58\nCMP             W20, W0                                                ; +0xc8, 0x888a5c\nB.CS            loc_888A98                                             ; +0xcc, 0x888a60\nLDR             X0, [X19,#0x3140]; this                                ; +0xd0, 0x888a64\nMOV             W1, W20; unsigned int                                  ; +0xd4, 0x888a68\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0xd8, 0x888a6c\nLDR             X1, [X0]                                               ; +0xdc, 0x888a70\nMOV             X21, X0                                                ; +0xe0, 0x888a74\nLDR             X1, [X1,#0x380]                                        ; +0xe4, 0x888a78\nBLR             X1                                                     ; +0xe8, 0x888a7c\nCBZ             W0, loc_888ACC                                         ; +0xec, 0x888a80\nLDR             X0, [X19,#0x3140]; this                                ; +0xf0, 0x888a84\nADD             W20, W20, #1                                           ; +0xf4, 0x888a88\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xf8, 0x888a8c\nCMP             W20, W0                                                ; +0xfc, 0x888a90\nB.CC            loc_888A64                                             ; +0x100, 0x888a94\nLDR             X24, [X24,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x104, 0x888a98\nLDR             X1, [X29,#0xA0+var_8]                                  ; +0x108, 0x888a9c\nLDR             X0, [X24]                                              ; +0x10c, 0x888aa0\nCMP             X1, X0                                                 ; +0x110, 0x888aa4\nB.NE            loc_888C28                                             ; +0x114, 0x888aa8\nLDP             X19, X20, [SP,#0xA0+var_90]                            ; +0x118, 0x888aac\nLDP             X21, X22, [SP,#0xA0+var_80]                            ; +0x11c, 0x888ab0\nLDP             X23, X24, [SP,#0xA0+var_70]                            ; +0x120, 0x888ab4\nLDP             X25, X26, [SP,#0xA0+var_60]                            ; +0x124, 0x888ab8\nLDP             X27, X28, [SP,#0xA0+var_50]                            ; +0x128, 0x888abc\nLDR             D8, [SP,#0xA0+var_40]                                  ; +0x12c, 0x888ac0\nLDP             X29, X30, [SP+0xA0+var_A0],#0xA0                       ; +0x130, 0x888ac4\nRET                                                                    ; +0x134, 0x888ac8\nLDR             X1, [X19,#0x3150]                                      ; +0x138, 0x888acc\nMOV             X0, X23                                                ; +0x13c, 0x888ad0\nLDRSW           X26, [X21,#0x2FC]                                      ; +0x140, 0x888ad4\nADD             X2, X21, #0x2FC                                        ; +0x144, 0x888ad8\nUDIV            X27, X26, X1                                           ; +0x148, 0x888adc\nMSUB            X27, X27, X1, X26                                      ; +0x14c, 0x888ae0\nMOV             X1, X27                                                ; +0x150, 0x888ae4\nBL              sub_8562F8                                             ; +0x154, 0x888ae8\nCBZ             X0, loc_888BAC                                         ; +0x158, 0x888aec\nLDR             X1, [X0]                                               ; +0x15c, 0x888af0\nCBZ             X1, loc_888BAC                                         ; +0x160, 0x888af4\nADD             X1, X1, #0x10                                          ; +0x164, 0x888af8\nADRP            X28, #off_122EFE8@PAGE                                 ; +0x168, 0x888afc\nMOV             X0, X22                                                ; +0x16c, 0x888b00\nBL              sub_D18D28                                             ; +0x170, 0x888b04\nLDR             X0, [X19,#0x3138]                                      ; +0x174, 0x888b08\nMOV             X1, X22                                                ; +0x178, 0x888b0c\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x17c, 0x888b10\nCBZ             X0, loc_888B20                                         ; +0x180, 0x888b14\nMOV             X1, X21; cocos2d::CCObject *                           ; +0x184, 0x888b18\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x188, 0x888b1c\nLDR             X0, [X19,#0x3140]; this                                ; +0x18c, 0x888b20\nMOV             W1, W20; unsigned int                                  ; +0x190, 0x888b24\nBL              _ZN7cocos2d7CCArray23fastRemoveObjectAtIndexEj; cocos2d::CCArray::fastRemoveObjectAtIndex(uint) ; +0x194, 0x888b28\nLDR             X21, [X22]                                             ; +0x198, 0x888b2c\nLDR             X28, [X28,#off_122EFE8@PAGEOFF]; qword_124B6B0         ; +0x19c, 0x888b30\nSUB             X27, X21, #0x18                                        ; +0x1a0, 0x888b34\nCMP             X27, X28                                               ; +0x1a4, 0x888b38\nB.EQ            loc_888A54                                             ; +0x1a8, 0x888b3c\nADRP            X0, #pthread_create_ptr_0@PAGE                         ; +0x1ac, 0x888b40\nLDR             X0, [X0,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x1b0, 0x888b44\nCBZ             X0, loc_888BF0                                         ; +0x1b4, 0x888b48\nSUB             X21, X21, #8                                           ; +0x1b8, 0x888b4c\nLDAXR           W0, [X21]                                              ; +0x1bc, 0x888b50\nSUB             W1, W0, #1                                             ; +0x1c0, 0x888b54\nSTLXR           W2, W1, [X21]                                          ; +0x1c4, 0x888b58\nCBNZ            W2, loc_888B50                                         ; +0x1c8, 0x888b5c\nCMP             W0, WZR                                                ; +0x1cc, 0x888b60\nB.GT            loc_888A54                                             ; +0x1d0, 0x888b64\nLDR             X1, [X29,#0xA0+var_28]                                 ; +0x1d4, 0x888b68\nMOV             X0, X27; p                                             ; +0x1d8, 0x888b6c\nBL              j__ZdlPv; operator delete(void *)                      ; +0x1dc, 0x888b70\nB               loc_888A54                                             ; +0x1e0, 0x888b74\nLDR             X1, [X0]                                               ; +0x1e4, 0x888b78\nADD             W21, W21, #1                                           ; +0x1e8, 0x888b7c\nLDR             X1, [X1,#0x5C8]                                        ; +0x1ec, 0x888b80\nBLR             X1                                                     ; +0x1f0, 0x888b84\nLDR             X2, [X20]                                              ; +0x1f4, 0x888b88\nLDR             W1, [X19,#0x3120]                                      ; +0x1f8, 0x888b8c\nFMOV            S0, S8                                                 ; +0x1fc, 0x888b90\nLDR             X2, [X2,#0x28]                                         ; +0x200, 0x888b94\nADD             W1, W1, W0                                             ; +0x204, 0x888b98\nMOV             X0, X20                                                ; +0x208, 0x888b9c\nSTR             W1, [X19,#0x3120]                                      ; +0x20c, 0x888ba0\nBLR             X2                                                     ; +0x210, 0x888ba4\nB               loc_8889E0                                             ; +0x214, 0x888ba8\nMOV             X0, #0x18; unsigned __int64                            ; +0x218, 0x888bac\nADRP            X28, #off_122EFE8@PAGE                                 ; +0x21c, 0x888bb0\nBL              _Znwm; operator new(ulong)                             ; +0x220, 0x888bb4\nMOV             X4, X0                                                 ; +0x224, 0x888bb8\nLDR             W5, [X21,#0x2FC]                                       ; +0x228, 0x888bbc\nMOV             X1, X27                                                ; +0x22c, 0x888bc0\nMOV             X0, X23                                                ; +0x230, 0x888bc4\nMOV             X2, X26                                                ; +0x234, 0x888bc8\nSTR             XZR, [X4]                                              ; +0x238, 0x888bcc\nMOV             X3, X4                                                 ; +0x23c, 0x888bd0\nSTR             W5, [X4,#8]                                            ; +0x240, 0x888bd4\nLDR             X5, [X25,#off_122EFE8@PAGEOFF]; qword_124B6B0          ; +0x244, 0x888bd8\nADD             X5, X5, #0x18                                          ; +0x248, 0x888bdc\nSTR             X5, [X4,#0x10]                                         ; +0x24c, 0x888be0\nBL              _ZNSt10_HashtableIiSt4pairIKiSsESaIS2_ENSt8__detail10_Select1stESt8equal_toIiESt4hashIiENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE21_M_insert_unique_nodeEmmPNS4_10_Hash_nodeIS2_Lb0EEE; std::_Hashtable<int,std::pair<int const,std::string>,std::allocator<std::pair<int const,std::string>>,std::__detail::_Select1st,std::equal_to<int>,std::hash<int>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<false,false,true>>::_M_insert_unique_node(ulong,ulong,std::__detail::_Hash_node<std::pair<int const,std::string>,false> *) ; +0x250, 0x888be4\nADD             X1, X0, #0x10                                          ; +0x254, 0x888be8\nB               loc_888B00                                             ; +0x258, 0x888bec\nLDUR            W0, [X21,#-8]                                          ; +0x25c, 0x888bf0\nSUB             W1, W0, #1                                             ; +0x260, 0x888bf4\nSTUR            W1, [X21,#-8]                                          ; +0x264, 0x888bf8\nB               loc_888B60                                             ; +0x268, 0x888bfc\nMOV             X19, X0                                                ; +0x26c, 0x888c00\nLDR             X0, [X29,#0xA0+var_10]                                 ; +0x270, 0x888c04\nLDR             X28, [X28,#0xFE8]                                      ; +0x274, 0x888c08\nSUB             X0, X0, #0x18                                          ; +0x278, 0x888c0c\nCMP             X0, X28                                                ; +0x27c, 0x888c10\nB.EQ            loc_888C20                                             ; +0x280, 0x888c14\nADD             X1, X29, #0xA0+var_18                                  ; +0x284, 0x888c18\nBL              sub_4DC320                                             ; +0x288, 0x888c1c\nMOV             X0, X19                                                ; +0x28c, 0x888c20\nBL              _Unwind_Resume                                         ; +0x290, 0x888c24\nBL              .__stack_chk_fail                                      ; +0x294, 0x888c28", "xrefs": ["PlayLayer::updateVisibility @ 0x5cea38", "LevelEditorLayer::updateVisibility @ 0x66310c", "<???> @ 0x6d3f8"], "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"}