{"type": "func", "start": 4298015152, "end": 4298015482, "name": "GJEffectManager::opacityModForGroup", "pseudocode": "// \n// GJEffectManager::opacityModForGroup from 0x1002e81b0 to 0x1002e82fa (330 bytes)\n// \n// 11 xrefs:\n// > LevelEditorLayer::updateVisibility @ 0x1000eb3cc\n// > LevelEditorLayer::updateVisibility @ 0x1000eb61c\n// > LevelEditorLayer::updateObjectColors @ 0x1000eba7c\n// > LevelEditorLayer::updateObjectColors @ 0x1000ebc8c\n// > GJBaseGameLayer::opacityForObject @ 0x10015110c\n// > GameObject::groupOpacityMod @ 0x1005befc8\n// > GameObject::updateMainColor @ 0x1005ca7d8\n// > GameObject::updateMainOpacity @ 0x1005caaa8\n// > GameObject::opacityModForMode @ 0x1005cabc8\n// > GameObject::updateSecondaryColor @ 0x1005cace8\n// > GameObject::updateSecondaryOpacity @ 0x1005cadb8\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\nfloat __fastcall GJEffectManager::opacityModForGroup(GJEffectManager *a1, int a2)\n{\n  int v2; // eax\n  unsigned __int64 v3; // rcx\n  unsigned __int64 value; // rsi\n  float result; // xmm0_4\n  unsigned __int64 v6; // r9\n  unsigned __int64 v7; // r8\n  std::__hash_node_base<std::__hash_node<std::__hash_value_type<int, OpacityEffectAction>, void *> *> *v8; // rax\n  std::__hash_node_base<std::__hash_node<std::__hash_value_type<int, OpacityEffectAction>, void *> *>::__next_pointer next; // rdi\n  unsigned __int64 v10; // rsi\n  std::__hash_node_base<std::__hash_node<std::__hash_value_type<int, OpacityEffectAction>, void *> *>::__next_pointer v11; // rax\n  unsigned __int64 v12; // rax\n\n  v2 = 0;\n  if ( a2 > 0 )\n    v2 = a2;\n  v3 = 9999;\n  if ( v2 < 9999 )\n    v3 = (unsigned int)v2;\n  value = a1->m_opacityEffectMap.__table_.__bucket_list_.__ptr_.__value_.__data_.__value_;\n  result = 1.0;\n  if ( value )\n  {\n    v6 = (0x101010101010101LL\n        * ((((value - ((value >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)\n          + (((value - ((value >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)\n          + ((((value - ((value >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)\n            + (((value - ((value >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))\n         & 0xF0F0F0F0F0F0F0FLL)) >> 56;\n    if ( v6 > 1 )\n    {\n      v7 = v3;\n      if ( value <= v3 )\n        v7 = (unsigned __int16)((unsigned __int16)v3 % (unsigned __int16)value);\n    }\n    else\n    {\n      v7 = ((_DWORD)value + 0x3FFF) & (unsigned int)v3;\n    }\n    v8 = a1->m_opacityEffectMap.__table_.__bucket_list_.__ptr_.__value_[v7];\n    if ( v8 )\n    {\n      next = v8->__next_;\n      if ( v8->__next_ )\n      {\n        if ( (unsigned int)v6 < 2 )\n        {\n          v10 = value - 1;\n          while ( 1 )\n          {\n            v11 = next[1].__next_;\n            if ( v11 == (std::__hash_node_base<std::__hash_node<std::__hash_value_type<int, OpacityEffectAction>, void *> *>::__next_pointer)v3 )\n            {\n              if ( LODWORD(next[2].__next_) == (_DWORD)v3 )\n                return *((float *)&next[5].__next_ + 1);\n            }\n            else if ( (v10 & (unsigned __int64)v11) != v7 )\n            {\n              return result;\n            }\n            next = next->__next_;\n            if ( !next )\n              return result;\n          }\n        }\n        do\n        {\n          v12 = (unsigned __int64)next[1].__next_;\n          if ( v12 == v3 )\n          {\n            if ( LODWORD(next[2].__next_) == (_DWORD)v3 )\n              return *((float *)&next[5].__next_ + 1);\n          }\n          else\n          {\n            if ( v12 < value )\n              goto LABEL_25;\n            if ( (value | v12) >> 32 )\n            {\n              v12 %= value;\nLABEL_25:\n              if ( v12 != v7 )\n                return result;\n              goto LABEL_20;\n            }\n            if ( (unsigned int)v12 % (unsigned int)value != v7 )\n              return result;\n          }\nLABEL_20:\n          next = next->__next_;\n        }\n        while ( next );\n      }\n    }\n  }\n  return result;\n}", "assembly": "; \n; GJEffectManager::opacityModForGroup from 0x1002e81b0 to 0x1002e82fa (330 bytes)\n; \n; 11 xrefs:\n; > LevelEditorLayer::updateVisibility @ 0x1000eb3cc\n; > LevelEditorLayer::updateVisibility @ 0x1000eb61c\n; > LevelEditorLayer::updateObjectColors @ 0x1000eba7c\n; > LevelEditorLayer::updateObjectColors @ 0x1000ebc8c\n; > GJBaseGameLayer::opacityForObject @ 0x10015110c\n; > GameObject::groupOpacityMod @ 0x1005befc8\n; > GameObject::updateMainColor @ 0x1005ca7d8\n; > GameObject::updateMainOpacity @ 0x1005caaa8\n; > GameObject::opacityModForMode @ 0x1005cabc8\n; > GameObject::updateSecondaryColor @ 0x1005cace8\n; > GameObject::updateSecondaryOpacity @ 0x1005cadb8\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    rbp                                                            ; +0x0, 0x1002e81b0\nmov     rbp, rsp                                                       ; +0x1, 0x1002e81b1\nxor     eax, eax                                                       ; +0x4, 0x1002e81b4\ntest    esi, esi                                                       ; +0x6, 0x1002e81b6\ncmovg   eax, esi                                                       ; +0x8, 0x1002e81b8\ncmp     eax, 270Fh                                                     ; +0xb, 0x1002e81bb\nmov     ecx, 270Fh                                                     ; +0x10, 0x1002e81c0\ncmovl   ecx, eax                                                       ; +0x15, 0x1002e81c5\nmov     rsi, [rdi+1A0h]                                                ; +0x18, 0x1002e81c8\nmovss   xmm0, cs:alpha                                                 ; +0x1f, 0x1002e81cf\ntest    rsi, rsi                                                       ; +0x27, 0x1002e81d7\njz      loc_1002E82AE                                                  ; +0x2a, 0x1002e81da\nmov     rax, rsi                                                       ; +0x30, 0x1002e81e0\nshr     rax, 1                                                         ; +0x33, 0x1002e81e3\nmov     rdx, 5555555555555555h                                         ; +0x36, 0x1002e81e6\nand     rdx, rax                                                       ; +0x40, 0x1002e81f0\nmov     rax, rsi                                                       ; +0x43, 0x1002e81f3\nsub     rax, rdx                                                       ; +0x46, 0x1002e81f6\nmov     rdx, 3333333333333333h                                         ; +0x49, 0x1002e81f9\nmov     r8, rax                                                        ; +0x53, 0x1002e8203\nand     r8, rdx                                                        ; +0x56, 0x1002e8206\nshr     rax, 2                                                         ; +0x59, 0x1002e8209\nand     rax, rdx                                                       ; +0x5d, 0x1002e820d\nadd     rax, r8                                                        ; +0x60, 0x1002e8210\nmov     rdx, rax                                                       ; +0x63, 0x1002e8213\nshr     rdx, 4                                                         ; +0x66, 0x1002e8216\nadd     rdx, rax                                                       ; +0x6a, 0x1002e821a\nmov     rax, 0F0F0F0F0F0F0F0Fh                                         ; +0x6d, 0x1002e821d\nand     rax, rdx                                                       ; +0x77, 0x1002e8227\nmov     r9, 101010101010101h                                           ; +0x7a, 0x1002e822a\nimul    r9, rax                                                        ; +0x84, 0x1002e8234\nshr     r9, 38h                                                        ; +0x88, 0x1002e8238\ncmp     r9, 1                                                          ; +0x8c, 0x1002e823c\nja      short loc_1002E8250                                            ; +0x90, 0x1002e8240\nlea     eax, [rsi+3FFFh]                                               ; +0x92, 0x1002e8242\nmov     r8d, ecx                                                       ; +0x98, 0x1002e8248\nand     r8d, eax                                                       ; +0x9b, 0x1002e824b\njmp     short loc_1002E8263                                            ; +0x9e, 0x1002e824e\nmov     r8, rcx                                                        ; +0xa0, 0x1002e8250\ncmp     rsi, rcx                                                       ; +0xa3, 0x1002e8253\nja      short loc_1002E8263                                            ; +0xa6, 0x1002e8256\nmov     eax, ecx                                                       ; +0xa8, 0x1002e8258\nxor     edx, edx                                                       ; +0xaa, 0x1002e825a\ndiv     si                                                             ; +0xac, 0x1002e825c\nmovzx   r8d, dx                                                        ; +0xaf, 0x1002e825f\nmov     rax, [rdi+198h]                                                ; +0xb3, 0x1002e8263\nmov     rax, [rax+r8*8]                                                ; +0xba, 0x1002e826a\ntest    rax, rax                                                       ; +0xbe, 0x1002e826e\njz      short loc_1002E82AE                                            ; +0xc1, 0x1002e8271\nmov     rdi, [rax]                                                     ; +0xc3, 0x1002e8273\ntest    rdi, rdi                                                       ; +0xc6, 0x1002e8276\njz      short loc_1002E82AE                                            ; +0xc9, 0x1002e8279\ncmp     r9d, 2                                                         ; +0xcb, 0x1002e827b\njnb     short loc_1002E82BD                                            ; +0xcf, 0x1002e827f\ndec     rsi                                                            ; +0xd1, 0x1002e8281\njmp     short loc_1002E829D                                            ; +0xd4, 0x1002e8284\nalign 10h                                                              ; +0xd6, 0x1002e8286\ncmp     [rdi+10h], ecx                                                 ; +0xe0, 0x1002e8290\njz      short loc_1002E82F3                                            ; +0xe3, 0x1002e8293\nmov     rdi, [rdi]                                                     ; +0xe5, 0x1002e8295\ntest    rdi, rdi                                                       ; +0xe8, 0x1002e8298\njz      short loc_1002E82AE                                            ; +0xeb, 0x1002e829b\nmov     rax, [rdi+8]                                                   ; +0xed, 0x1002e829d\ncmp     rax, rcx                                                       ; +0xf1, 0x1002e82a1\njz      short loc_1002E8290                                            ; +0xf4, 0x1002e82a4\nand     rax, rsi                                                       ; +0xf6, 0x1002e82a6\ncmp     rax, r8                                                        ; +0xf9, 0x1002e82a9\njz      short loc_1002E8295                                            ; +0xfc, 0x1002e82ac\npop     rbp                                                            ; +0xfe, 0x1002e82ae\nretn                                                                   ; +0xff, 0x1002e82af\ncmp     [rdi+10h], ecx                                                 ; +0x100, 0x1002e82b0\njz      short loc_1002E82F3                                            ; +0x103, 0x1002e82b3\nmov     rdi, [rdi]                                                     ; +0x105, 0x1002e82b5\ntest    rdi, rdi                                                       ; +0x108, 0x1002e82b8\njz      short loc_1002E82AE                                            ; +0x10b, 0x1002e82bb\nmov     rax, [rdi+8]                                                   ; +0x10d, 0x1002e82bd\ncmp     rax, rcx                                                       ; +0x111, 0x1002e82c1\njz      short loc_1002E82B0                                            ; +0x114, 0x1002e82c4\ncmp     rax, rsi                                                       ; +0x116, 0x1002e82c6\njb      short loc_1002E82DF                                            ; +0x119, 0x1002e82c9\nmov     rdx, rax                                                       ; +0x11b, 0x1002e82cb\nor      rdx, rsi                                                       ; +0x11e, 0x1002e82ce\nshr     rdx, 20h                                                       ; +0x121, 0x1002e82d1\njz      short loc_1002E82E6                                            ; +0x125, 0x1002e82d5\nxor     edx, edx                                                       ; +0x127, 0x1002e82d7\ndiv     rsi                                                            ; +0x129, 0x1002e82d9\nmov     rax, rdx                                                       ; +0x12c, 0x1002e82dc\ncmp     rax, r8                                                        ; +0x12f, 0x1002e82df\njz      short loc_1002E82B5                                            ; +0x132, 0x1002e82e2\njmp     short loc_1002E82AE                                            ; +0x134, 0x1002e82e4\nxor     edx, edx                                                       ; +0x136, 0x1002e82e6\ndiv     esi                                                            ; +0x138, 0x1002e82e8\nmov     eax, edx                                                       ; +0x13a, 0x1002e82ea\ncmp     rax, r8                                                        ; +0x13c, 0x1002e82ec\njz      short loc_1002E82B5                                            ; +0x13f, 0x1002e82ef\njmp     short loc_1002E82AE                                            ; +0x141, 0x1002e82f1\nmovss   xmm0, dword ptr [rdi+2Ch]                                      ; +0x143, 0x1002e82f3\npop     rbp                                                            ; +0x148, 0x1002e82f8\nretn                                                                   ; +0x149, 0x1002e82f9", "xrefs": ["LevelEditorLayer::updateVisibility @ 0x1000eb3cc", "LevelEditorLayer::updateVisibility @ 0x1000eb61c", "LevelEditorLayer::updateObjectColors @ 0x1000eba7c", "LevelEditorLayer::updateObjectColors @ 0x1000ebc8c", "GJBaseGameLayer::opacityForObject @ 0x10015110c", "GameObject::groupOpacityMod @ 0x1005befc8", "GameObject::updateMainColor @ 0x1005ca7d8", "GameObject::updateMainOpacity @ 0x1005caaa8", "GameObject::opacityModForMode @ 0x1005cabc8", "GameObject::updateSecondaryColor @ 0x1005cace8", "GameObject::updateSecondaryOpacity @ 0x1005cadb8"], "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"}