{"type": "func", "start": 9473548, "end": 9473912, "name": "ChallengeNode::onClaimReward", "pseudocode": "// \n// ChallengeNode::onClaimReward from 0x908e0c to 0x908f78 (364 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0xc31e0\n// > ChallengeNode::init @ 0x9077b0\n// > <???> @ 0x122ec48\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 ChallengeNode::onClaimReward(ChallengeNode *a1, cocos2d::CCObject *a2)\n{\n  ChallengesPage *m_challengesPage; // x23\n  __int64 v5; // x0\n  FMODAudioEngine *v6; // x20\n  void *v7; // x0\n  unsigned int *v8; // x2\n  int v9; // w1\n  GJChallengeItem *m_challengeItem; // [xsp+48h] [xbp+48h]\n  __int64 v11; // [xsp+60h] [xbp+60h] BYREF\n  cocos2d::CCPoint v12; // 0:s0.4,4:s1.4\n\n  m_challengeItem = a1->m_challengeItem;\n  m_challengesPage = a1->m_challengesPage;\n  v5 = ((__int64 (*)(void))a1->getPosition)();\n  cocos2d::CCPoint::operator+(&v11, v5, &a1->m_unkPoint);\n  ChallengesPage::claimItem(m_challengesPage, a1, m_challengeItem, v12);\n  v6 = FMODAudioEngine::sharedEngine();\n  sub_D153B8((int)&v11, \"gold02.ogg\");\n  FMODAudioEngine::playEffect((__int64)v6, (__int64)&v11);\n  v7 = (void *)(v11 - 24);\n  if ( (__int64 *)(v11 - 24) != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v8 = (unsigned int *)(v11 - 8);\n      do\n        v9 = __ldaxr(v8);\n      while ( __stlxr(v9 - 1, v8) );\n    }\n    else\n    {\n      v9 = *(_DWORD *)(v11 - 8);\n      *(_DWORD *)(v11 - 8) = v9 - 1;\n    }\n    if ( v9 <= 0 )\n      operator delete(v7);\n  }\n  ((void (__fastcall *)(cocos2d::CCObject *, _QWORD))a2->__vftable[4].~CCObject)(a2, 0);\n  a2->__vftable[13].copyWithZone(a2, nullptr);\n}", "assembly": "; \n; ChallengeNode::onClaimReward from 0x908e0c to 0x908f78 (364 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0xc31e0\n; > ChallengeNode::init @ 0x9077b0\n; > <???> @ 0x122ec48\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_70]!                                ; +0x0, 0x908e0c\nMOV             X29, SP                                                ; +0x4, 0x908e10\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x8, 0x908e14\nADRP            X21, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x908e18\nMOV             X22, X1                                                ; +0x10, 0x908e1c\nLDR             X1, [X0]                                               ; +0x14, 0x908e20\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x18, 0x908e24\nLDR             X2, [X21,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x908e28\nMOV             X20, X0                                                ; +0x20, 0x908e2c\nLDR             X1, [X1,#0xC0]                                         ; +0x24, 0x908e30\nADD             X19, X29, #0x70+var_10                                 ; +0x28, 0x908e34\nSTR             X23, [SP,#0x70+var_40]                                 ; +0x2c, 0x908e38\nLDR             X2, [X2]                                               ; +0x30, 0x908e3c\nSTR             X2, [X29,#0x70+var_8]                                  ; +0x34, 0x908e40\nLDR             X2, [X0,#0x148]                                        ; +0x38, 0x908e44\nSTR             X2, [X29,#0x70+var_28]                                 ; +0x3c, 0x908e48\nLDR             X23, [X0,#0x140]                                       ; +0x40, 0x908e4c\nBLR             X1                                                     ; +0x44, 0x908e50\nMOV             X8, X19                                                ; +0x48, 0x908e54\nADD             X1, X20, #0x150                                        ; +0x4c, 0x908e58\nBL              _ZNK7cocos2d7CCPointplERKS0_; cocos2d::CCPoint::operator+(cocos2d::CCPoint const&) ; +0x50, 0x908e5c\nLDR             X2, [X29,#0x70+var_28]                                 ; +0x54, 0x908e60\nMOV             X1, X20                                                ; +0x58, 0x908e64\nMOV             X3, X19                                                ; +0x5c, 0x908e68\nMOV             X0, X23                                                ; +0x60, 0x908e6c\nBL              _ZN14ChallengesPage9claimItemEP13ChallengeNodeP15GJChallengeItemN7cocos2d7CCPointE; ChallengesPage::claimItem(ChallengeNode *,GJChallengeItem *,cocos2d::CCPoint) ; +0x64, 0x908e70\nBL              _ZN15FMODAudioEngine12sharedEngineEv; FMODAudioEngine::sharedEngine(void) ; +0x68, 0x908e74\nMOV             X20, X0                                                ; +0x6c, 0x908e78\nADRP            X1, #aGold02Ogg@PAGE; \"gold02.ogg\"                     ; +0x70, 0x908e7c\nMOV             X0, X19; int                                           ; +0x74, 0x908e80\nADD             X1, X1, #aGold02Ogg@PAGEOFF; \"gold02.ogg\"              ; +0x78, 0x908e84\nADD             X2, X29, #0x70+var_20                                  ; +0x7c, 0x908e88\nBL              sub_D153B8                                             ; +0x80, 0x908e8c\nMOV             X0, X20                                                ; +0x84, 0x908e90\nMOV             X1, X19                                                ; +0x88, 0x908e94\nBL              _ZN15FMODAudioEngine10playEffectESs; FMODAudioEngine::playEffect(std::string) ; +0x8c, 0x908e98\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x90, 0x908e9c\nLDR             X2, [X29,#0x70+var_10]                                 ; +0x94, 0x908ea0\nSUB             X0, X2, #0x18; p                                       ; +0x98, 0x908ea4\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x9c, 0x908ea8\nCMP             X0, X1                                                 ; +0xa0, 0x908eac\nB.NE            loc_908F04                                             ; +0xa4, 0x908eb0\nLDR             X2, [X22]                                              ; +0xa8, 0x908eb4\nMOV             X0, X22                                                ; +0xac, 0x908eb8\nMOV             W1, #0                                                 ; +0xb0, 0x908ebc\nLDR             X2, [X2,#0x148]                                        ; +0xb4, 0x908ec0\nBLR             X2                                                     ; +0xb8, 0x908ec4\nLDR             X2, [X22]                                              ; +0xbc, 0x908ec8\nMOV             X0, X22                                                ; +0xc0, 0x908ecc\nMOV             W1, #0                                                 ; +0xc4, 0x908ed0\nLDR             X2, [X2,#0x410]                                        ; +0xc8, 0x908ed4\nBLR             X2                                                     ; +0xcc, 0x908ed8\nLDR             X21, [X21,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0xd0, 0x908edc\nLDR             X1, [X29,#0x70+var_8]                                  ; +0xd4, 0x908ee0\nLDR             X0, [X21]                                              ; +0xd8, 0x908ee4\nCMP             X1, X0                                                 ; +0xdc, 0x908ee8\nB.NE            loc_908F48                                             ; +0xe0, 0x908eec\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0xe4, 0x908ef0\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0xe8, 0x908ef4\nLDR             X23, [SP,#0x70+var_40]                                 ; +0xec, 0x908ef8\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0xf0, 0x908efc\nRET                                                                    ; +0xf4, 0x908f00\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0xf8, 0x908f04\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xfc, 0x908f08\nCBZ             X1, loc_908F38                                         ; +0x100, 0x908f0c\nSUB             X2, X2, #8                                             ; +0x104, 0x908f10\nLDAXR           W1, [X2]                                               ; +0x108, 0x908f14\nSUB             W3, W1, #1                                             ; +0x10c, 0x908f18\nSTLXR           W4, W3, [X2]                                           ; +0x110, 0x908f1c\nCBNZ            W4, loc_908F14                                         ; +0x114, 0x908f20\nCMP             W1, WZR                                                ; +0x118, 0x908f24\nB.GT            loc_908EB4                                             ; +0x11c, 0x908f28\nADD             X1, X29, #0x70+var_18                                  ; +0x120, 0x908f2c\nBL              j__ZdlPv; operator delete(void *)                      ; +0x124, 0x908f30\nB               loc_908EB4                                             ; +0x128, 0x908f34\nLDUR            W1, [X2,#-8]                                           ; +0x12c, 0x908f38\nSUB             W3, W1, #1                                             ; +0x130, 0x908f3c\nSTUR            W3, [X2,#-8]                                           ; +0x134, 0x908f40\nB               loc_908F24                                             ; +0x138, 0x908f44\nBL              .__stack_chk_fail                                      ; +0x13c, 0x908f48\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x140, 0x908f4c\nMOV             X19, X0                                                ; +0x144, 0x908f50\nLDR             X0, [X29,#0x70+var_10]                                 ; +0x148, 0x908f54\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x14c, 0x908f58\nSUB             X0, X0, #0x18                                          ; +0x150, 0x908f5c\nCMP             X0, X1                                                 ; +0x154, 0x908f60\nB.EQ            loc_908F70                                             ; +0x158, 0x908f64\nADD             X1, X29, #0x70+var_18                                  ; +0x15c, 0x908f68\nBL              sub_4DCA20                                             ; +0x160, 0x908f6c\nMOV             X0, X19                                                ; +0x164, 0x908f70\nBL              _Unwind_Resume                                         ; +0x168, 0x908f74", "xrefs": ["<???> @ 0xc31e0", "ChallengeNode::init @ 0x9077b0", "<???> @ 0x122ec48"], "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"}