{"type": "func", "start": 4296270336, "end": 4296270881, "name": "GJBaseGameLayer::reAddToStickyGroup", "pseudocode": "// \n// GJBaseGameLayer::reAddToStickyGroup from 0x10013e200 to 0x10013e421 (545 bytes)\n// \n// 1 xrefs:\n// > LevelEditorLayer::addSpecial @ 0x1000e02b7\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 __fastcall GJBaseGameLayer::reAddToStickyGroup(GJBaseGameLayer *a1, GameObject *a2)\n{\n  __m128 v2; // xmm0\n  unsigned __int64 value; // r10\n  std::unordered_map<int, int> *p_m_stickyGroups; // rbx\n  int m_uniqueID; // ecx\n  unsigned __int64 v6; // r14\n  unsigned __int64 v7; // r9\n  std::__hash_node_base<std::__hash_node<std::__hash_value_type<int, int>, void *> *> *v8; // rax\n  std::__hash_node_base<std::__hash_node<std::__hash_value_type<int, int>, void *> *>::__next_pointer next; // r11\n  unsigned __int64 v10; // r10\n  std::__hash_node_base<std::__hash_node<std::__hash_value_type<int, int>, void *> *>::__next_pointer v11; // rax\n  unsigned __int64 v12; // rax\n  int v13; // r15d\n  cocos2d::CCObject *v14; // rax\n  int v15; // [rsp-3Ch] [rbp-3Ch] BYREF\n  _DWORD *v16[7]; // [rsp-38h] [rbp-38h] BYREF\n\n  value = a1->m_stickyGroups.__table_.__bucket_list_.__ptr_.__value_.__data_.__value_;\n  if ( !value )\n    return;\n  p_m_stickyGroups = &a1->m_stickyGroups;\n  m_uniqueID = a2->m_uniqueID;\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 = m_uniqueID & (value - 1);\n    v8 = p_m_stickyGroups->__table_.__bucket_list_.__ptr_.__value_[v7];\n    if ( !v8 )\n      return;\n    goto LABEL_9;\n  }\n  v7 = m_uniqueID;\n  if ( value <= m_uniqueID )\n  {\n    if ( !((value | m_uniqueID) >> 32) )\n    {\n      v7 = m_uniqueID % (unsigned int)value;\n      v8 = p_m_stickyGroups->__table_.__bucket_list_.__ptr_.__value_[v7];\n      if ( !v8 )\n        return;\n      goto LABEL_9;\n    }\n    v7 = m_uniqueID % value;\n  }\n  v8 = p_m_stickyGroups->__table_.__bucket_list_.__ptr_.__value_[v7];\n  if ( !v8 )\n    return;\nLABEL_9:\n  next = v8->__next_;\n  if ( !v8->__next_ )\n    return;\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, int>, void *> *>::__next_pointer)m_uniqueID )\n      {\n        if ( LODWORD(next[2].__next_) == m_uniqueID )\n          goto LABEL_27;\n      }\n      else if ( (v10 & (unsigned __int64)v11) != v7 )\n      {\n        return;\n      }\n      next = next->__next_;\n      if ( !next )\n        return;\n    }\n  }\n  while ( 1 )\n  {\n    v12 = (unsigned __int64)next[1].__next_;\n    if ( v12 == m_uniqueID )\n      break;\n    if ( v12 < value )\n      goto LABEL_23;\n    if ( (value | v12) >> 32 )\n    {\n      v12 %= value;\nLABEL_23:\n      if ( v12 != v7 )\n        return;\n      goto LABEL_18;\n    }\n    if ( (unsigned int)v12 % (unsigned int)value != v7 )\n      return;\nLABEL_18:\n    next = next->__next_;\n    if ( !next )\n      return;\n  }\n  if ( LODWORD(next[2].__next_) != m_uniqueID )\n    goto LABEL_18;\nLABEL_27:\n  if ( !a2->m_linkedGroup )\n  {\n    v15 = a2->m_uniqueID;\n    v16[0] = &v15;\n    v13 = *((_DWORD *)sub_100105AF0((float *)&a1->m_stickyGroups, &v15, v2, (__int64)&unk_100816AE0, v16) + 5);\n    v14 = cocos2d::CCDictionary::objectForKey(a1->m_linkedGroupDict, v13);\n    if ( v14 )\n    {\n      sub_10071FCD0(v14, a2);\n      a2->m_linkedGroup = v13;\n      LODWORD(v16[0]) = a2->m_uniqueID;\n      sub_1000569A0(p_m_stickyGroups, (int *)v16);\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::reAddToStickyGroup from 0x10013e200 to 0x10013e421 (545 bytes)\n; \n; 1 xrefs:\n; > LevelEditorLayer::addSpecial @ 0x1000e02b7\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     r10, [rdi+34A0h]                                               ; +0x0, 0x10013e200\ntest    r10, r10                                                       ; +0x7, 0x10013e207\njz      locret_10013E420                                               ; +0xa, 0x10013e20a\npush    rbp                                                            ; +0x10, 0x10013e210\nmov     rbp, rsp                                                       ; +0x11, 0x10013e211\npush    r15                                                            ; +0x14, 0x10013e214\npush    r14                                                            ; +0x16, 0x10013e216\npush    r12                                                            ; +0x18, 0x10013e218\npush    rbx                                                            ; +0x1a, 0x10013e21a\nsub     rsp, 20h                                                       ; +0x1b, 0x10013e21b\nlea     rbx, [rdi+3498h]                                               ; +0x1f, 0x10013e21f\nmov     ecx, [rsi+394h]                                                ; +0x26, 0x10013e226\nmovsxd  r8, ecx                                                        ; +0x2c, 0x10013e22c\nmov     rax, r10                                                       ; +0x2f, 0x10013e22f\nshr     rax, 1                                                         ; +0x32, 0x10013e232\nmov     rdx, 5555555555555555h                                         ; +0x35, 0x10013e235\nand     rdx, rax                                                       ; +0x3f, 0x10013e23f\nmov     rax, r10                                                       ; +0x42, 0x10013e242\nsub     rax, rdx                                                       ; +0x45, 0x10013e245\nmov     rdx, 3333333333333333h                                         ; +0x48, 0x10013e248\nmov     r9, rax                                                        ; +0x52, 0x10013e252\nand     r9, rdx                                                        ; +0x55, 0x10013e255\nshr     rax, 2                                                         ; +0x58, 0x10013e258\nand     rax, rdx                                                       ; +0x5c, 0x10013e25c\nadd     rax, r9                                                        ; +0x5f, 0x10013e25f\nmov     rdx, rax                                                       ; +0x62, 0x10013e262\nshr     rdx, 4                                                         ; +0x65, 0x10013e265\nadd     rdx, rax                                                       ; +0x69, 0x10013e269\nmov     rax, 0F0F0F0F0F0F0F0Fh                                         ; +0x6c, 0x10013e26c\nand     rax, rdx                                                       ; +0x76, 0x10013e276\nmov     r14, 101010101010101h                                          ; +0x79, 0x10013e279\nimul    r14, rax                                                       ; +0x83, 0x10013e283\nshr     r14, 38h                                                       ; +0x87, 0x10013e287\ncmp     r14, 1                                                         ; +0x8b, 0x10013e28b\nja      short loc_10013E2A9                                            ; +0x8f, 0x10013e28f\nlea     r9, [r10-1]                                                    ; +0x91, 0x10013e291\nand     r9, r8                                                         ; +0x95, 0x10013e295\nmov     rax, [rbx]                                                     ; +0x98, 0x10013e298\nmov     rax, [rax+r9*8]                                                ; +0x9b, 0x10013e29b\ntest    rax, rax                                                       ; +0x9f, 0x10013e29f\njnz     short loc_10013E2DC                                            ; +0xa2, 0x10013e2a2\njmp     loc_10013E414                                                  ; +0xa4, 0x10013e2a4\nmov     r9, r8                                                         ; +0xa9, 0x10013e2a9\ncmp     r10, r8                                                        ; +0xac, 0x10013e2ac\nja      short loc_10013E2CC                                            ; +0xaf, 0x10013e2af\nmov     rax, r8                                                        ; +0xb1, 0x10013e2b1\nor      rax, r10                                                       ; +0xb4, 0x10013e2b4\nshr     rax, 20h                                                       ; +0xb7, 0x10013e2b7\njz      loc_10013E3FA                                                  ; +0xbb, 0x10013e2bb\nmov     rax, r8                                                        ; +0xc1, 0x10013e2c1\nxor     edx, edx                                                       ; +0xc4, 0x10013e2c4\ndiv     r10                                                            ; +0xc6, 0x10013e2c6\nmov     r9, rdx                                                        ; +0xc9, 0x10013e2c9\nmov     rax, [rbx]                                                     ; +0xcc, 0x10013e2cc\nmov     rax, [rax+r9*8]                                                ; +0xcf, 0x10013e2cf\ntest    rax, rax                                                       ; +0xd3, 0x10013e2d3\njz      loc_10013E414                                                  ; +0xd6, 0x10013e2d6\nmov     r11, [rax]                                                     ; +0xdc, 0x10013e2dc\ntest    r11, r11                                                       ; +0xdf, 0x10013e2df\njz      loc_10013E414                                                  ; +0xe2, 0x10013e2e2\ncmp     r14d, 2                                                        ; +0xe8, 0x10013e2e8\njnb     short loc_10013E342                                            ; +0xec, 0x10013e2ec\ndec     r10                                                            ; +0xee, 0x10013e2ee\njmp     short loc_10013E312                                            ; +0xf1, 0x10013e2f1\nalign 20h                                                              ; +0xf3, 0x10013e2f3\ncmp     [r11+10h], ecx                                                 ; +0x100, 0x10013e300\njz      short loc_10013E37F                                            ; +0x104, 0x10013e304\nmov     r11, [r11]                                                     ; +0x106, 0x10013e306\ntest    r11, r11                                                       ; +0x109, 0x10013e309\njz      loc_10013E414                                                  ; +0x10c, 0x10013e30c\nmov     rax, [r11+8]                                                   ; +0x112, 0x10013e312\ncmp     rax, r8                                                        ; +0x116, 0x10013e316\njz      short loc_10013E300                                            ; +0x119, 0x10013e319\nand     rax, r10                                                       ; +0x11b, 0x10013e31b\ncmp     rax, r9                                                        ; +0x11e, 0x10013e31e\njz      short loc_10013E306                                            ; +0x121, 0x10013e321\njmp     loc_10013E414                                                  ; +0x123, 0x10013e323\nalign 10h                                                              ; +0x128, 0x10013e328\ncmp     [r11+10h], ecx                                                 ; +0x130, 0x10013e330\njz      short loc_10013E37F                                            ; +0x134, 0x10013e334\nmov     r11, [r11]                                                     ; +0x136, 0x10013e336\ntest    r11, r11                                                       ; +0x139, 0x10013e339\njz      loc_10013E414                                                  ; +0x13c, 0x10013e33c\nmov     rax, [r11+8]                                                   ; +0x142, 0x10013e342\ncmp     rax, r8                                                        ; +0x146, 0x10013e346\njz      short loc_10013E330                                            ; +0x149, 0x10013e349\ncmp     rax, r10                                                       ; +0x14b, 0x10013e34b\njb      short loc_10013E364                                            ; +0x14e, 0x10013e34e\nmov     rdx, rax                                                       ; +0x150, 0x10013e350\nor      rdx, r10                                                       ; +0x153, 0x10013e353\nshr     rdx, 20h                                                       ; +0x156, 0x10013e356\njz      short loc_10013E36E                                            ; +0x15a, 0x10013e35a\nxor     edx, edx                                                       ; +0x15c, 0x10013e35c\ndiv     r10                                                            ; +0x15e, 0x10013e35e\nmov     rax, rdx                                                       ; +0x161, 0x10013e361\ncmp     rax, r9                                                        ; +0x164, 0x10013e364\njz      short loc_10013E336                                            ; +0x167, 0x10013e367\njmp     loc_10013E414                                                  ; +0x169, 0x10013e369\nxor     edx, edx                                                       ; +0x16e, 0x10013e36e\ndiv     r10d                                                           ; +0x170, 0x10013e370\nmov     eax, edx                                                       ; +0x173, 0x10013e373\ncmp     rax, r9                                                        ; +0x175, 0x10013e375\njz      short loc_10013E336                                            ; +0x178, 0x10013e378\njmp     loc_10013E414                                                  ; +0x17a, 0x10013e37a\ncmp     dword ptr [rsi+368h], 0                                        ; +0x17f, 0x10013e37f\njnz     loc_10013E414                                                  ; +0x186, 0x10013e386\nmov     [rbp-34h], ecx                                                 ; +0x18c, 0x10013e38c\nlea     rax, [rbp-34h]                                                 ; +0x18f, 0x10013e38f\nmov     [rbp-30h], rax                                                 ; +0x193, 0x10013e393\nlea     rdx, unk_100816AE0                                             ; +0x197, 0x10013e397\nlea     rcx, [rbp-30h]                                                 ; +0x19e, 0x10013e39e\nlea     r8, [rbp-21h]                                                  ; +0x1a2, 0x10013e3a2\nmov     r12, rdi                                                       ; +0x1a6, 0x10013e3a6\nmov     rdi, rbx                                                       ; +0x1a9, 0x10013e3a9\nmov     r14, rsi                                                       ; +0x1ac, 0x10013e3ac\nmov     rsi, rax                                                       ; +0x1af, 0x10013e3af\ncall    sub_100105AF0                                                  ; +0x1b2, 0x10013e3b2\nmov     r15d, [rax+14h]                                                ; +0x1b7, 0x10013e3b7\nmov     rdi, [r12+0E90h]                                               ; +0x1bb, 0x10013e3bb\nmovsxd  rsi, r15d                                                      ; +0x1c3, 0x10013e3c3\ncall    cocos2d__CCDictionary__objectForKey                            ; +0x1c6, 0x10013e3c6\ntest    rax, rax                                                       ; +0x1cb, 0x10013e3cb\njz      short loc_10013E414                                            ; +0x1ce, 0x10013e3ce\nmov     rdi, rax                                                       ; +0x1d0, 0x10013e3d0\nmov     rsi, r14                                                       ; +0x1d3, 0x10013e3d3\ncall    sub_10071FCD0                                                  ; +0x1d6, 0x10013e3d6\nmov     [r14+368h], r15d                                               ; +0x1db, 0x10013e3db\nmov     eax, [r14+394h]                                                ; +0x1e2, 0x10013e3e2\nmov     [rbp-30h], eax                                                 ; +0x1e9, 0x10013e3e9\nlea     rsi, [rbp-30h]                                                 ; +0x1ec, 0x10013e3ec\nmov     rdi, rbx                                                       ; +0x1f0, 0x10013e3f0\ncall    sub_1000569A0                                                  ; +0x1f3, 0x10013e3f3\njmp     short loc_10013E414                                            ; +0x1f8, 0x10013e3f8\nmov     eax, ecx                                                       ; +0x1fa, 0x10013e3fa\nxor     edx, edx                                                       ; +0x1fc, 0x10013e3fc\ndiv     r10d                                                           ; +0x1fe, 0x10013e3fe\nmov     r9d, edx                                                       ; +0x201, 0x10013e401\nmov     rax, [rbx]                                                     ; +0x204, 0x10013e404\nmov     rax, [rax+r9*8]                                                ; +0x207, 0x10013e407\ntest    rax, rax                                                       ; +0x20b, 0x10013e40b\njnz     loc_10013E2DC                                                  ; +0x20e, 0x10013e40e\nadd     rsp, 20h                                                       ; +0x214, 0x10013e414\npop     rbx                                                            ; +0x218, 0x10013e418\npop     r12                                                            ; +0x219, 0x10013e419\npop     r14                                                            ; +0x21b, 0x10013e41b\npop     r15                                                            ; +0x21d, 0x10013e41d\npop     rbp                                                            ; +0x21f, 0x10013e41f\nretn                                                                   ; +0x220, 0x10013e420", "xrefs": ["LevelEditorLayer::addSpecial @ 0x1000e02b7"], "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"}