{"type": "func", "start": 9066416, "end": 9066560, "name": "GJEffectManager::countForItem", "pseudocode": "// \n// GJEffectManager::countForItem from 0x8a57b0 to 0x8a5840 (144 bytes)\n// \n// 10 xrefs:\n// > GJBaseGameLayer::testInstantCountTrigger @ 0x8653b4\n// > GJBaseGameLayer::getItemValue @ 0x86549c\n// > GJBaseGameLayer::refreshCounterLabels @ 0x890294\n// > GJBaseGameLayer::collectedObject @ 0x890eb0\n// > GJBaseGameLayer::addPickupTrigger @ 0x890f30\n// > GJBaseGameLayer::addPickupTrigger @ 0x890f58\n// > GJBaseGameLayer::addPickupTrigger @ 0x890f8c\n// > GJEffectManager::runCountTrigger @ 0x8aff14\n// > GJEffectManager::updateCountForItem @ 0x8bcd38\n// > <???> @ 0x9f570\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 GJEffectManager::countForItem(GJEffectManager *a1, int a2)\n{\n  unsigned __int64 v2; // x7\n  std::_Hashtable<int, std::pair<const int, int>, std::allocator<std::pair<const int, int>>, 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 M_bucket_count; // x4\n  unsigned __int64 v4; // x7\n  std::_Hashtable<int, std::pair<const int, int>, std::allocator<std::pair<const int, int>>, 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>>::__bucket_type v5; // x6\n  std::__detail::_Hashtable_alloc<_NodeAlloc>::__node_base *M_nxt; // x3\n  int v7; // w5\n  std::__detail::_Hashtable_alloc<_NodeAlloc>::__node_base v8; // x0\n  std::__detail::_Hash_node_base *v9; // x0\n\n  if ( a2 > 9998 )\n  {\n    v2 = 9999;\n    a2 = 9999;\n  }\n  else\n  {\n    if ( a2 < 0 )\n      a2 = 0;\n    v2 = a2;\n  }\n  M_bucket_count = a1->m_itemCountMap._M_h._M_bucket_count;\n  v4 = v2 % M_bucket_count;\n  v5 = a1->m_itemCountMap._M_h._M_buckets[v4];\n  if ( v5 )\n  {\n    M_nxt = v5->_M_nxt;\n    v7 = (int)v5->_M_nxt[1]._M_nxt;\n    while ( a2 != v7 )\n    {\n      v8._M_nxt = M_nxt->_M_nxt;\n      v5 = M_nxt;\n      M_nxt = v8._M_nxt;\n      if ( v8._M_nxt )\n      {\n        v7 = (int)v8._M_nxt[1]._M_nxt;\n        if ( v4 == v7 % M_bucket_count )\n          continue;\n      }\n      goto LABEL_10;\n    }\n    v9 = v5->_M_nxt;\n    if ( v5->_M_nxt )\n      LODWORD(v9) = HIDWORD(v9[1]._M_nxt);\n  }\n  else\n  {\nLABEL_10:\n    LODWORD(v9) = 0;\n  }\n  return (int)v9;\n}", "assembly": "; \n; GJEffectManager::countForItem from 0x8a57b0 to 0x8a5840 (144 bytes)\n; \n; 10 xrefs:\n; > GJBaseGameLayer::testInstantCountTrigger @ 0x8653b4\n; > GJBaseGameLayer::getItemValue @ 0x86549c\n; > GJBaseGameLayer::refreshCounterLabels @ 0x890294\n; > GJBaseGameLayer::collectedObject @ 0x890eb0\n; > GJBaseGameLayer::addPickupTrigger @ 0x890f30\n; > GJBaseGameLayer::addPickupTrigger @ 0x890f58\n; > GJBaseGameLayer::addPickupTrigger @ 0x890f8c\n; > GJEffectManager::runCountTrigger @ 0x8aff14\n; > GJEffectManager::updateCountForItem @ 0x8bcd38\n; > <???> @ 0x9f570\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\nMOV             W2, #0x270E                                            ; +0x0, 0x8a57b0\nCMP             W1, W2                                                 ; +0x4, 0x8a57b4\nB.GT            loc_8A5834                                             ; +0x8, 0x8a57b8\nCMP             W1, WZR                                                ; +0xc, 0x8a57bc\nCSEL            W1, W1, WZR, GE                                        ; +0x10, 0x8a57c0\nSXTW            X7, W1                                                 ; +0x14, 0x8a57c4\nLDR             X4, [X0,#0x320]                                        ; +0x18, 0x8a57c8\nLDR             X2, [X0,#0x318]                                        ; +0x1c, 0x8a57cc\nUDIV            X0, X7, X4                                             ; +0x20, 0x8a57d0\nMSUB            X7, X0, X4, X7                                         ; +0x24, 0x8a57d4\nLDR             X6, [X2,X7,LSL#3]                                      ; +0x28, 0x8a57d8\nCBZ             X6, loc_8A581C                                         ; +0x2c, 0x8a57dc\nLDR             X3, [X6]                                               ; +0x30, 0x8a57e0\nLDR             W5, [X3,#8]                                            ; +0x34, 0x8a57e4\nCMP             W1, W5                                                 ; +0x38, 0x8a57e8\nB.EQ            loc_8A5824                                             ; +0x3c, 0x8a57ec\nLDR             X0, [X3]                                               ; +0x40, 0x8a57f0\nMOV             X6, X3                                                 ; +0x44, 0x8a57f4\nMOV             X3, X0                                                 ; +0x48, 0x8a57f8\nCBZ             X0, loc_8A581C                                         ; +0x4c, 0x8a57fc\nLDR             W0, [X0,#8]                                            ; +0x50, 0x8a5800\nMOV             W5, W0                                                 ; +0x54, 0x8a5804\nSXTW            X0, W0                                                 ; +0x58, 0x8a5808\nUDIV            X2, X0, X4                                             ; +0x5c, 0x8a580c\nMSUB            X0, X2, X4, X0                                         ; +0x60, 0x8a5810\nCMP             X7, X0                                                 ; +0x64, 0x8a5814\nB.EQ            loc_8A57E8                                             ; +0x68, 0x8a5818\nMOV             W0, #0                                                 ; +0x6c, 0x8a581c\nRET                                                                    ; +0x70, 0x8a5820\nLDR             X0, [X6]                                               ; +0x74, 0x8a5824\nCBZ             X0, locret_8A5820                                      ; +0x78, 0x8a5828\nLDR             W0, [X0,#0xC]                                          ; +0x7c, 0x8a582c\nRET                                                                    ; +0x80, 0x8a5830\nMOV             X7, #0x270F                                            ; +0x84, 0x8a5834\nMOV             W1, W7                                                 ; +0x88, 0x8a5838\nB               loc_8A57C8                                             ; +0x8c, 0x8a583c", "xrefs": ["GJBaseGameLayer::testInstantCountTrigger @ 0x8653b4", "GJBaseGameLayer::getItemValue @ 0x86549c", "GJBaseGameLayer::refreshCounterLabels @ 0x890294", "GJBaseGameLayer::collectedObject @ 0x890eb0", "GJBaseGameLayer::addPickupTrigger @ 0x890f30", "GJBaseGameLayer::addPickupTrigger @ 0x890f58", "GJBaseGameLayer::addPickupTrigger @ 0x890f8c", "GJEffectManager::runCountTrigger @ 0x8aff14", "GJEffectManager::updateCountForItem @ 0x8bcd38", "<???> @ 0x9f570"], "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"}