{"type": "func", "start": 9208324, "end": 9208436, "name": "GJOptionsLayer::getToggleButton", "pseudocode": "// \n// GJOptionsLayer::getToggleButton from 0x8c8204 to 0x8c8274 (112 bytes)\n// \n// 3 xrefs:\n// > GameLevelOptionsLayer::didToggle @ 0x8c8300\n// > GameLevelOptionsLayer::didToggle @ 0x8c831c\n// > <???> @ 0x8f580\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\nCCMenuItemToggler *GJOptionsLayer::getToggleButton(GJOptionsLayer *a1, int a2)\n{\n  std::_Hashtable<int, std::pair<const int, CCMenuItemToggler *>, std::allocator<std::pair<const int, CCMenuItemToggler *>>, 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 v3; // x7\n  std::_Hashtable<int, std::pair<const int, CCMenuItemToggler *>, std::allocator<std::pair<const int, CCMenuItemToggler *>>, 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 v4; // x6\n  std::__detail::_Hashtable_alloc<_NodeAlloc>::__node_base *M_nxt; // x3\n  int v6; // w5\n  std::__detail::_Hashtable_alloc<_NodeAlloc>::__node_base v7; // x0\n  CCMenuItemToggler *result; // x0\n\n  M_bucket_count = a1->m_toggleButtons._M_h._M_bucket_count;\n  v3 = a2 % M_bucket_count;\n  v4 = a1->m_toggleButtons._M_h._M_buckets[v3];\n  if ( !v4 )\n    return nullptr;\n  M_nxt = v4->_M_nxt;\n  v6 = (int)v4->_M_nxt[1]._M_nxt;\n  while ( a2 != v6 )\n  {\n    v7._M_nxt = M_nxt->_M_nxt;\n    v4 = M_nxt;\n    M_nxt = v7._M_nxt;\n    if ( v7._M_nxt )\n    {\n      v6 = (int)v7._M_nxt[1]._M_nxt;\n      if ( v3 == v6 % M_bucket_count )\n        continue;\n    }\n    return nullptr;\n  }\n  result = (CCMenuItemToggler *)v4->_M_nxt;\n  if ( v4->_M_nxt )\n    return *(CCMenuItemToggler **)&result->m_nTag;\n  return result;\n}", "assembly": "; \n; GJOptionsLayer::getToggleButton from 0x8c8204 to 0x8c8274 (112 bytes)\n; \n; 3 xrefs:\n; > GameLevelOptionsLayer::didToggle @ 0x8c8300\n; > GameLevelOptionsLayer::didToggle @ 0x8c831c\n; > <???> @ 0x8f580\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\nLDR             X4, [X0,#0x410]                                        ; +0x0, 0x8c8204\nSXTW            X7, W1                                                 ; +0x4, 0x8c8208\nLDR             X2, [X0,#0x408]                                        ; +0x8, 0x8c820c\nUDIV            X0, X7, X4                                             ; +0xc, 0x8c8210\nMSUB            X7, X0, X4, X7                                         ; +0x10, 0x8c8214\nLDR             X6, [X2,X7,LSL#3]                                      ; +0x14, 0x8c8218\nCBZ             X6, loc_8C825C                                         ; +0x18, 0x8c821c\nLDR             X3, [X6]                                               ; +0x1c, 0x8c8220\nLDR             W5, [X3,#8]                                            ; +0x20, 0x8c8224\nCMP             W1, W5                                                 ; +0x24, 0x8c8228\nB.EQ            loc_8C8264                                             ; +0x28, 0x8c822c\nLDR             X0, [X3]                                               ; +0x2c, 0x8c8230\nMOV             X6, X3                                                 ; +0x30, 0x8c8234\nMOV             X3, X0                                                 ; +0x34, 0x8c8238\nCBZ             X0, loc_8C825C                                         ; +0x38, 0x8c823c\nLDR             W0, [X0,#8]                                            ; +0x3c, 0x8c8240\nMOV             W5, W0                                                 ; +0x40, 0x8c8244\nSXTW            X0, W0                                                 ; +0x44, 0x8c8248\nUDIV            X2, X0, X4                                             ; +0x48, 0x8c824c\nMSUB            X0, X2, X4, X0                                         ; +0x4c, 0x8c8250\nCMP             X7, X0                                                 ; +0x50, 0x8c8254\nB.EQ            loc_8C8228                                             ; +0x54, 0x8c8258\nMOV             X0, #0                                                 ; +0x58, 0x8c825c\nRET                                                                    ; +0x5c, 0x8c8260\nLDR             X0, [X6]                                               ; +0x60, 0x8c8264\nCBZ             X0, locret_8C8260                                      ; +0x64, 0x8c8268\nLDR             X0, [X0,#0x10]                                         ; +0x68, 0x8c826c\nRET                                                                    ; +0x6c, 0x8c8270", "xrefs": ["GameLevelOptionsLayer::didToggle @ 0x8c8300", "GameLevelOptionsLayer::didToggle @ 0x8c831c", "<???> @ 0x8f580"], "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"}