{"type": "func", "start": 5034160, "end": 5034380, "name": "ChallengesPage::claimItem", "pseudocode": "// \n// ChallengesPage::claimItem from 0x4cd0b0 to 0x4cd18c (220 bytes)\n// \n// 1 xrefs:\n// > ChallengeNode::onClaimReward @ 0x4cd1c8\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 ChallengesPage::claimItem(ChallengesPage *a1, ChallengeNode *a2, GJChallengeItem *a3, cocos2d::CCPoint a4)\n{\n  float x; // r10\n  int m_position; // r9\n  GameStatsManager *v8; // r0\n  CurrencyRewardLayer *m_currencyRewardLayer; // r5\n  int v10; // r7\n  CurrencyRewardLayer *v11; // r0\n  GameStatsManager *v12; // r0\n  int v13; // [sp+4h] [bp-30h]\n  float v14; // [sp+20h] [bp-14h]\n  cocos2d::CCPoint v15; // [sp+24h] [bp-10h] BYREF\n  cocos2d::CCPoint v16; // 0:r3.4,4:^0.4\n\n  x = a4.x;\n  m_position = a3->m_position;\n  v8 = GameStatsManager::sharedState();\n  GameStatsManager::completedChallenge(v8, a3);\n  m_currencyRewardLayer = a1->m_currencyRewardLayer;\n  v10 = a3->m_reward.random - a3->m_reward.seed;\n  cocos2d::CCPoint::CCPoint(&v15, (const cocos2d::CCPoint *)LODWORD(x));\n  if ( m_currencyRewardLayer )\n  {\n    v16.y = 0.0;\n    LODWORD(v16.x) = &v15;\n    CurrencyRewardLayer::createObjects(m_currencyRewardLayer, Star|Orb, v10, v16, *(float *)&v13);\n  }\n  else\n  {\n    v11 = CurrencyRewardLayer::create(\n            0,\n            0,\n            0,\n            v10,\n            Icon,\n            0,\n            Icon,\n            0,\n            (cocos2d::CCPoint)(unsigned int)&v15,\n            (CurrencyRewardType)0,\n            1.0,\n            v14);\n    a1->m_currencyRewardLayer = v11;\n    v11->m_delegate = &a1->CurrencyRewardDelegate;\n    a1->addChild_0(a1, a1->m_currencyRewardLayer, 14);\n  }\n  ChallengesPage::exitNodeAtSlot(a1, m_position, 0.0);\n  v12 = GameStatsManager::sharedState();\n  GameStatsManager::processChallengeQueue(v12, m_position);\n  ChallengesPage::createChallengeNode(a1, m_position, 0, 0.5, 1);\n  ChallengesPage::updateTimers(a1, 0.0);\n  ChallengesPage::updateDots(a1);\n}", "assembly": "; \n; ChallengesPage::claimItem from 0x4cd0b0 to 0x4cd18c (220 bytes)\n; \n; 1 xrefs:\n; > ChallengeNode::onClaimReward @ 0x4cd1c8\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\nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x4cd0b0\nMOV             R10, R3                                                ; +0x4, 0x4cd0b4\nLDR             R6, =(__stack_chk_guard_ptr - 0x4CD0C2)                ; +0x6, 0x4cd0b6\nSUB             SP, SP, #0x34                                          ; +0x8, 0x4cd0b8\nMOV             R7, R2                                                 ; +0xa, 0x4cd0ba\nMOV             R4, R0                                                 ; +0xc, 0x4cd0bc\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0xe, 0x4cd0be\nLDR             R6, [R6]; __stack_chk_guard                            ; +0x10, 0x4cd0c0\nLDR.W           R9, [R2,#0x64]                                         ; +0x12, 0x4cd0c2\nADD.W           R8, SP, #0x34+var_10                                   ; +0x16, 0x4cd0c6\nMOV.W           R11, #0                                                ; +0x1a, 0x4cd0ca\nLDR             R3, [R6]                                               ; +0x1e, 0x4cd0ce\nSTR             R3, [SP,#0x34+var_8]                                   ; +0x20, 0x4cd0d0\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x22, 0x4cd0d2\nMOV             R1, R7; GJChallengeItem *                              ; +0x26, 0x4cd0d6\nBL              _ZN16GameStatsManager18completedChallengeEP15GJChallengeItem; GameStatsManager::completedChallenge(GJChallengeItem *) ; +0x28, 0x4cd0d8\nLDR.W           R5, [R4,#0x20C]                                        ; +0x2c, 0x4cd0dc\nLDR             R1, [R7,#0x44]                                         ; +0x30, 0x4cd0e0\nMOV             R0, R8; this                                           ; +0x32, 0x4cd0e2\nLDR             R7, [R7,#0x48]                                         ; +0x34, 0x4cd0e4\nSUBS            R7, R1, R7                                             ; +0x36, 0x4cd0e6\nMOV             R1, R10; cocos2d::CCPoint *                            ; +0x38, 0x4cd0e8\nCBZ             R5, loc_4CD102                                         ; +0x3a, 0x4cd0ea\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x3c, 0x4cd0ec\nSTR.W           R11, [SP,#0x34+var_34]; float                          ; +0x40, 0x4cd0f0\nMOV             R0, R5; int                                            ; +0x44, 0x4cd0f4\nMOVS            R1, #3; int                                            ; +0x46, 0x4cd0f6\nMOV             R2, R7; int                                            ; +0x48, 0x4cd0f8\nMOV             R3, R8; cocos2d::CCPoint *                             ; +0x4a, 0x4cd0fa\nBL              _ZN19CurrencyRewardLayer13createObjectsE18CurrencySpriteTypeiN7cocos2d7CCPointEf; CurrencyRewardLayer::createObjects(CurrencySpriteType,int,cocos2d::CCPoint,float) ; +0x4c, 0x4cd0fc\nB               loc_4CD146                                             ; +0x50, 0x4cd100\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x52, 0x4cd102\nMOV.W           R3, #0x3F800000                                        ; +0x56, 0x4cd106\nMOV             R1, R5; int                                            ; +0x5a, 0x4cd10a\nSTR             R3, [SP,#0x34+var_18]; float                           ; +0x5c, 0x4cd10c\nMOV             R2, R5; int                                            ; +0x5e, 0x4cd10e\nMOV             R3, R7; int                                            ; +0x60, 0x4cd110\nSTR             R5, [SP,#0x34+var_34]; int                             ; +0x62, 0x4cd112\nMOV             R0, R5; int                                            ; +0x64, 0x4cd114\nSTR             R5, [SP,#0x34+var_30]; int                             ; +0x66, 0x4cd116\nSTR             R5, [SP,#0x34+var_2C]; int                             ; +0x68, 0x4cd118\nSTR             R5, [SP,#0x34+var_28]; int                             ; +0x6a, 0x4cd11a\nSTR.W           R8, [SP,#0x34+var_24]; int                             ; +0x6c, 0x4cd11c\nSTR             R5, [SP,#0x34+var_20]; int                             ; +0x70, 0x4cd120\nSTR.W           R11, [SP,#0x34+var_1C]; float                          ; +0x72, 0x4cd122\nBL              _ZN19CurrencyRewardLayer6createEiiii18CurrencySpriteTypeiS0_iN7cocos2d7CCPointE18CurrencyRewardTypeff; CurrencyRewardLayer::create(int,int,int,int,CurrencySpriteType,int,CurrencySpriteType,int,cocos2d::CCPoint,CurrencyRewardType,float,float) ; +0x76, 0x4cd126\nADD.W           R3, R4, #0x1F8                                         ; +0x7a, 0x4cd12a\nMOVS            R2, #0xE                                               ; +0x7e, 0x4cd12e\nSTR.W           R0, [R4,#0x20C]                                        ; +0x80, 0x4cd130\nSTR.W           R3, [R0,#0x13C]                                        ; +0x84, 0x4cd134\nMOV             R0, R4                                                 ; +0x88, 0x4cd138\nLDR             R3, [R4]                                               ; +0x8a, 0x4cd13a\nLDR.W           R1, [R4,#0x20C]                                        ; +0x8c, 0x4cd13c\nLDR.W           R3, [R3,#0xE0]                                         ; +0x90, 0x4cd140\nBLX             R3                                                     ; +0x94, 0x4cd144\nMOVS            R2, #0; float                                          ; +0x96, 0x4cd146\nMOV             R1, R9; int                                            ; +0x98, 0x4cd148\nMOV             R0, R4; this                                           ; +0x9a, 0x4cd14a\nBL              _ZN14ChallengesPage14exitNodeAtSlotEif; ChallengesPage::exitNodeAtSlot(int,float) ; +0x9c, 0x4cd14c\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0xa0, 0x4cd150\nMOV             R1, R9; int                                            ; +0xa4, 0x4cd154\nBL              _ZN16GameStatsManager21processChallengeQueueEi; GameStatsManager::processChallengeQueue(int) ; +0xa6, 0x4cd156\nMOVS            R2, #0; bool                                           ; +0xaa, 0x4cd15a\nMOVS            R3, #1                                                 ; +0xac, 0x4cd15c\nMOV             R1, R9; int                                            ; +0xae, 0x4cd15e\nSTR             R3, [SP,#0x34+var_34]; bool                            ; +0xb0, 0x4cd160\nMOV             R0, R4; this                                           ; +0xb2, 0x4cd162\nMOV.W           R3, #0x3F000000; float                                 ; +0xb4, 0x4cd164\nBL              _ZN14ChallengesPage19createChallengeNodeEibfb; ChallengesPage::createChallengeNode(int,bool,float,bool) ; +0xb8, 0x4cd168\nMOV             R0, R4; this                                           ; +0xbc, 0x4cd16c\nMOVS            R1, #0; float                                          ; +0xbe, 0x4cd16e\nBL              _ZN14ChallengesPage12updateTimersEf; ChallengesPage::updateTimers(float) ; +0xc0, 0x4cd170\nMOV             R0, R4; this                                           ; +0xc4, 0x4cd174\nBL              _ZN14ChallengesPage10updateDotsEv; ChallengesPage::updateDots(void) ; +0xc6, 0x4cd176\nLDR             R2, [SP,#0x34+var_8]                                   ; +0xca, 0x4cd17a\nLDR             R3, [R6]                                               ; +0xcc, 0x4cd17c\nCMP             R2, R3                                                 ; +0xce, 0x4cd17e\nBEQ             loc_4CD186                                             ; +0xd0, 0x4cd180\nBLX             __stack_chk_fail                                       ; +0xd2, 0x4cd182\nADD             SP, SP, #0x34 ; '4'                                    ; +0xd6, 0x4cd186\nPOP.W           {R4-R11,PC}                                            ; +0xd8, 0x4cd188", "xrefs": ["ChallengeNode::onClaimReward @ 0x4cd1c8"], "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"}