{"type": "func", "start": 8757716, "end": 8757988, "name": "GJBaseGameLayer::pickupItem", "pseudocode": "// \n// GJBaseGameLayer::pickupItem from 0x85a1d4 to 0x85a2e4 (272 bytes)\n// \n// 4 xrefs:\n// > PlayLayer::loadFromCheckpoint @ 0x5e4f98\n// > GJBaseGameLayer::collisionCheckObjects @ 0x88bee4\n// > GJBaseGameLayer::collisionCheckObjects @ 0x88c198\n// > <???> @ 0x2c898\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::pickupItem(GJBaseGameLayer *a1, EffectGameObject *a2)\n{\n  cocos2d::CCDictionary *m_collectedItems; // x22\n  cocos2d::CCString *v4; // x0\n  char *CString; // x0\n  void *v6; // x0\n  unsigned int *v7; // x2\n  int v8; // w1\n  __int64 v9; // [xsp+40h] [xbp+40h] BYREF\n\n  m_collectedItems = a1->m_collectedItems;\n  v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(\n                              (cocos2d::CCString *)\"%i\",\n                              (const char *)(unsigned int)a2->m_secretCoinID);\n  CString = (char *)cocos2d::CCString::getCString(v4);\n  sub_D153B8((int)&v9, CString);\n  cocos2d::CCDictionary::setObject((int)m_collectedItems, a2);\n  v6 = (void *)(v9 - 24);\n  if ( (__int64 *)(v9 - 24) != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v7 = (unsigned int *)(v9 - 8);\n      do\n        v8 = __ldaxr(v7);\n      while ( __stlxr(v8 - 1, v7) );\n    }\n    else\n    {\n      v8 = *(_DWORD *)(v9 - 8);\n      *(_DWORD *)(v9 - 8) = v8 - 1;\n    }\n    if ( v8 <= 0 )\n      operator delete(v6);\n  }\n}", "assembly": "; \n; GJBaseGameLayer::pickupItem from 0x85a1d4 to 0x85a2e4 (272 bytes)\n; \n; 4 xrefs:\n; > PlayLayer::loadFromCheckpoint @ 0x5e4f98\n; > GJBaseGameLayer::collisionCheckObjects @ 0x88bee4\n; > GJBaseGameLayer::collisionCheckObjects @ 0x88c198\n; > <???> @ 0x2c898\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, 0x85a1d4\nMOV             X29, SP                                                ; +0x4, 0x85a1d8\nSTP             X19, X20, [SP,#0x50+var_40]                            ; +0x8, 0x85a1dc\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x85a1e0\nADD             X20, X29, #0x50+var_10                                 ; +0x10, 0x85a1e4\nSTP             X21, X22, [SP,#0x50+var_30]                            ; +0x14, 0x85a1e8\nLDR             X22, [X0,#0x3278]                                      ; +0x18, 0x85a1ec\nMOV             X21, X1                                                ; +0x1c, 0x85a1f0\nLDR             X2, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x85a1f4\nADRP            X0, #(aSongidI+8)@PAGE; \"%i\"                           ; +0x24, 0x85a1f8\nLDR             W1, [X1,#0x6F0]; char *                                ; +0x28, 0x85a1fc\nADD             X0, X0, #(aSongidI+8)@PAGEOFF; this                    ; +0x2c, 0x85a200\nLDR             X2, [X2]                                               ; +0x30, 0x85a204\nSTR             X2, [X29,#0x50+var_8]                                  ; +0x34, 0x85a208\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x38, 0x85a20c\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x3c, 0x85a210\nMOV             X1, X0; char *                                         ; +0x40, 0x85a214\nADD             X2, X29, #0x50+var_20                                  ; +0x44, 0x85a218\nMOV             X0, X20; int                                           ; +0x48, 0x85a21c\nBL              sub_D153B8                                             ; +0x4c, 0x85a220\nMOV             X0, X22; int                                           ; +0x50, 0x85a224\nMOV             X1, X21; this                                          ; +0x54, 0x85a228\nMOV             X2, X20                                                ; +0x58, 0x85a22c\nBL              _ZN7cocos2d12CCDictionary9setObjectEPNS_8CCObjectERKSs; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const&) ; +0x5c, 0x85a230\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x60, 0x85a234\nLDR             X2, [X29,#0x50+var_10]                                 ; +0x64, 0x85a238\nSUB             X0, X2, #0x18; p                                       ; +0x68, 0x85a23c\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x6c, 0x85a240\nCMP             X0, X1                                                 ; +0x70, 0x85a244\nB.NE            loc_85A270                                             ; +0x74, 0x85a248\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x78, 0x85a24c\nLDR             X1, [X29,#0x50+var_8]                                  ; +0x7c, 0x85a250\nLDR             X0, [X19]                                              ; +0x80, 0x85a254\nCMP             X1, X0                                                 ; +0x84, 0x85a258\nB.NE            loc_85A2B4                                             ; +0x88, 0x85a25c\nLDP             X19, X20, [SP,#0x50+var_40]                            ; +0x8c, 0x85a260\nLDP             X21, X22, [SP,#0x50+var_30]                            ; +0x90, 0x85a264\nLDP             X29, X30, [SP+0x50+var_50],#0x50                       ; +0x94, 0x85a268\nRET                                                                    ; +0x98, 0x85a26c\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x9c, 0x85a270\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xa0, 0x85a274\nCBZ             X1, loc_85A2A4                                         ; +0xa4, 0x85a278\nSUB             X2, X2, #8                                             ; +0xa8, 0x85a27c\nLDAXR           W1, [X2]                                               ; +0xac, 0x85a280\nSUB             W3, W1, #1                                             ; +0xb0, 0x85a284\nSTLXR           W4, W3, [X2]                                           ; +0xb4, 0x85a288\nCBNZ            W4, loc_85A280                                         ; +0xb8, 0x85a28c\nCMP             W1, WZR                                                ; +0xbc, 0x85a290\nB.GT            loc_85A24C                                             ; +0xc0, 0x85a294\nADD             X1, X29, #0x50+var_18                                  ; +0xc4, 0x85a298\nBL              j__ZdlPv; operator delete(void *)                      ; +0xc8, 0x85a29c\nB               loc_85A24C                                             ; +0xcc, 0x85a2a0\nLDUR            W1, [X2,#-8]                                           ; +0xd0, 0x85a2a4\nSUB             W3, W1, #1                                             ; +0xd4, 0x85a2a8\nSTUR            W3, [X2,#-8]                                           ; +0xd8, 0x85a2ac\nB               loc_85A290                                             ; +0xdc, 0x85a2b0\nBL              .__stack_chk_fail                                      ; +0xe0, 0x85a2b4\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xe4, 0x85a2b8\nMOV             X19, X0                                                ; +0xe8, 0x85a2bc\nLDR             X0, [X29,#0x50+var_10]                                 ; +0xec, 0x85a2c0\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xf0, 0x85a2c4\nSUB             X0, X0, #0x18                                          ; +0xf4, 0x85a2c8\nCMP             X0, X1                                                 ; +0xf8, 0x85a2cc\nB.EQ            loc_85A2DC                                             ; +0xfc, 0x85a2d0\nADD             X1, X29, #0x50+var_18                                  ; +0x100, 0x85a2d4\nBL              sub_4DC320                                             ; +0x104, 0x85a2d8\nMOV             X0, X19                                                ; +0x108, 0x85a2dc\nBL              _Unwind_Resume                                         ; +0x10c, 0x85a2e0", "xrefs": ["PlayLayer::loadFromCheckpoint @ 0x5e4f98", "GJBaseGameLayer::collisionCheckObjects @ 0x88bee4", "GJBaseGameLayer::collisionCheckObjects @ 0x88c198", "<???> @ 0x2c898"], "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"}