{"type": "func", "start": 4649800, "end": 4649864, "name": "GJBaseGameLayer::countCollectedUserCoins", "pseudocode": "// \n// GJBaseGameLayer::countCollectedUserCoins from 0x46f348 to 0x46f388 (64 bytes)\n// \n// 1 xrefs:\n// > PlayLayer::levelComplete @ 0x313620\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\nint GJBaseGameLayer::countCollectedUserCoins(GJBaseGameLayer *a1)\n{\n  cocos2d::CCDictionary *m_collectedItems; // r4\n  cocos2d::CCDictElement *m_pElements; // r3\n  cocos2d::CCDictElement *next; // r5\n  cocos2d::CCDictElement *v4; // r2\n\n  m_collectedItems = a1->m_collectedItems;\n  if ( m_collectedItems )\n  {\n    m_pElements = m_collectedItems->m_pElements;\n    if ( m_pElements )\n      next = (cocos2d::CCDictElement *)m_pElements->hh.next;\n    else\n      next = nullptr;\n    m_collectedItems = nullptr;\n    while ( m_pElements )\n    {\n      if ( ((int (__fastcall *)(cocos2d::CCObject *))m_pElements->m_pObject->__vftable[22].isEqual)(m_pElements->m_pObject) == 31 )\n        m_collectedItems = (cocos2d::CCDictionary *)((char *)m_collectedItems + 1);\n      if ( next )\n        v4 = (cocos2d::CCDictElement *)next->hh.next;\n      else\n        v4 = nullptr;\n      m_pElements = next;\n      next = v4;\n    }\n  }\n  return (int)m_collectedItems;\n}", "assembly": "; \n; GJBaseGameLayer::countCollectedUserCoins from 0x46f348 to 0x46f388 (64 bytes)\n; \n; 1 xrefs:\n; > PlayLayer::levelComplete @ 0x313620\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            {R3-R5,LR}                                             ; +0x0, 0x46f348\nMOVW            R3, #0x2AE0                                            ; +0x2, 0x46f34a\nLDR             R4, [R0,R3]                                            ; +0x6, 0x46f34e\nCBZ             R4, loc_46F384                                         ; +0x8, 0x46f350\nLDR             R3, [R4,#0x34]                                         ; +0xa, 0x46f352\nCBZ             R3, loc_46F35C                                         ; +0xc, 0x46f354\nLDR.W           R5, [R3,#0x110]                                        ; +0xe, 0x46f356\nB               loc_46F35E                                             ; +0x12, 0x46f35a\nMOV             R5, R3                                                 ; +0x14, 0x46f35c\nMOVS            R4, #0                                                 ; +0x16, 0x46f35e\nCBZ             R3, loc_46F384                                         ; +0x18, 0x46f360\nLDR.W           R0, [R3,#0x104]                                        ; +0x1a, 0x46f362\nLDR             R3, [R0]                                               ; +0x1e, 0x46f366\nLDR.W           R3, [R3,#0x37C]                                        ; +0x20, 0x46f368\nBLX             R3                                                     ; +0x24, 0x46f36c\nCMP             R0, #0x1F                                              ; +0x26, 0x46f36e\nIT EQ                                                                  ; +0x28, 0x46f370\nADDEQ           R4, #1                                                 ; +0x2a, 0x46f372\nCBZ             R5, loc_46F37C                                         ; +0x2c, 0x46f374\nLDR.W           R2, [R5,#0x110]                                        ; +0x2e, 0x46f376\nB               loc_46F37E                                             ; +0x32, 0x46f37a\nMOV             R2, R5                                                 ; +0x34, 0x46f37c\nMOV             R3, R5                                                 ; +0x36, 0x46f37e\nMOV             R5, R2                                                 ; +0x38, 0x46f380\nB               loc_46F360                                             ; +0x3a, 0x46f382\nMOV             R0, R4                                                 ; +0x3c, 0x46f384\nPOP             {R3-R5,PC}                                             ; +0x3e, 0x46f386", "xrefs": ["PlayLayer::levelComplete @ 0x313620"], "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"}