{"type": "func", "start": 5370399184, "end": 5370399433, "name": "GameObject::addToColorGroup", "pseudocode": "// \n// GameObject::addToColorGroup from 0x14019c9d0 to 0x14019cac9 (249 bytes)\n// \n// 5 xrefs:\n// > GJBaseGameLayer::calculateColorGroups @ 0x14020e2f0\n// > PlayLayer::optimizeColorGroups @ 0x1403aedc0\n// > <???> @ 0x1406792b0\n// > <???> @ 0x1406792c0\n// > <???> @ 0x1406cbe14\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 GameObject::addToColorGroup(GameObject *a1, int a2)\n{\n  int v4; // ebx\n  std::array<short, 10> *v5; // rax\n  __int64 m_colorGroupCount; // r8\n  std::array<short, 10> *m_colorGroups; // rcx\n\n  if ( a1->m_colorGroupCount < 10 && (unsigned int)(a2 - 1) <= 0x270E )\n  {\n    v4 = 0;\n    if ( !a1->m_colorGroups )\n    {\n      v5 = (std::array<short, 10> *)operator new(0x14u);\n      a1->m_colorGroups = v5;\n      v5->_Elems[0] = 0;\n      a1->m_colorGroups->_Elems[1] = 0;\n      a1->m_colorGroups->_Elems[2] = 0;\n      a1->m_colorGroups->_Elems[3] = 0;\n      a1->m_colorGroups->_Elems[4] = 0;\n      a1->m_colorGroups->_Elems[5] = 0;\n      a1->m_colorGroups->_Elems[6] = 0;\n      a1->m_colorGroups->_Elems[7] = 0;\n      a1->m_colorGroups->_Elems[8] = 0;\n      a1->m_colorGroups->_Elems[9] = 0;\n    }\n    m_colorGroupCount = a1->m_colorGroupCount;\n    if ( (int)m_colorGroupCount <= 0 )\n    {\nLABEL_9:\n      a1->m_colorGroups->_Elems[m_colorGroupCount] = a2;\n      ++a1->m_colorGroupCount;\n    }\n    else\n    {\n      m_colorGroups = a1->m_colorGroups;\n      while ( m_colorGroups->_Elems[0] != a2 )\n      {\n        ++v4;\n        m_colorGroups = (std::array<short, 10> *)((char *)m_colorGroups + 2);\n        if ( v4 >= (int)m_colorGroupCount )\n          goto LABEL_9;\n      }\n    }\n  }\n}", "assembly": "; \n; GameObject::addToColorGroup from 0x14019c9d0 to 0x14019cac9 (249 bytes)\n; \n; 5 xrefs:\n; > GJBaseGameLayer::calculateColorGroups @ 0x14020e2f0\n; > PlayLayer::optimizeColorGroups @ 0x1403aedc0\n; > <???> @ 0x1406792b0\n; > <???> @ 0x1406792c0\n; > <???> @ 0x1406cbe14\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     [rsp+arg_8], rsi                                               ; +0x0, 0x14019c9d0\npush    rdi                                                            ; +0x5, 0x14019c9d5\nsub     rsp, 20h                                                       ; +0x6, 0x14019c9d6\ncmp     word ptr [rcx+4A8h], 0Ah                                       ; +0xa, 0x14019c9da\nmov     esi, edx                                                       ; +0x12, 0x14019c9e2\nmov     rdi, rcx                                                       ; +0x14, 0x14019c9e4\njge     loc_14019CABE                                                  ; +0x17, 0x14019c9e7\nlea     eax, [rdx-1]                                                   ; +0x1d, 0x14019c9ed\ncmp     eax, 270Eh                                                     ; +0x20, 0x14019c9f0\nja      loc_14019CABE                                                  ; +0x25, 0x14019c9f5\nmov     [rsp+28h+arg_0], rbx                                           ; +0x2b, 0x14019c9fb\nxor     ebx, ebx                                                       ; +0x30, 0x14019ca00\ncmp     [rcx+4A0h], rbx                                                ; +0x32, 0x14019ca02\njnz     short loc_14019CA80                                            ; +0x39, 0x14019ca09\nlea     ecx, [rbx+14h]; Size                                           ; +0x3b, 0x14019ca0b\ncall    j_??2@YAPEAX_K@Z; operator new(unsigned __int64)               ; +0x3e, 0x14019ca0e\nmov     [rdi+4A0h], rax                                                ; +0x43, 0x14019ca13\nmov     [rax], bx                                                      ; +0x4a, 0x14019ca1a\nmov     rax, [rdi+4A0h]                                                ; +0x4d, 0x14019ca1d\nmov     [rax+2], bx                                                    ; +0x54, 0x14019ca24\nmov     rax, [rdi+4A0h]                                                ; +0x58, 0x14019ca28\nmov     [rax+4], bx                                                    ; +0x5f, 0x14019ca2f\nmov     rax, [rdi+4A0h]                                                ; +0x63, 0x14019ca33\nmov     [rax+6], bx                                                    ; +0x6a, 0x14019ca3a\nmov     rax, [rdi+4A0h]                                                ; +0x6e, 0x14019ca3e\nmov     [rax+8], bx                                                    ; +0x75, 0x14019ca45\nmov     rax, [rdi+4A0h]                                                ; +0x79, 0x14019ca49\nmov     [rax+0Ah], bx                                                  ; +0x80, 0x14019ca50\nmov     rax, [rdi+4A0h]                                                ; +0x84, 0x14019ca54\nmov     [rax+0Ch], bx                                                  ; +0x8b, 0x14019ca5b\nmov     rax, [rdi+4A0h]                                                ; +0x8f, 0x14019ca5f\nmov     [rax+0Eh], bx                                                  ; +0x96, 0x14019ca66\nmov     rax, [rdi+4A0h]                                                ; +0x9a, 0x14019ca6a\nmov     [rax+10h], bx                                                  ; +0xa1, 0x14019ca71\nmov     rax, [rdi+4A0h]                                                ; +0xa5, 0x14019ca75\nmov     [rax+12h], bx                                                  ; +0xac, 0x14019ca7c\nmovsx   r8, word ptr [rdi+4A8h]                                        ; +0xb0, 0x14019ca80\ntest    r8d, r8d                                                       ; +0xb8, 0x14019ca88\njle     short loc_14019CAA6                                            ; +0xbb, 0x14019ca8b\nmov     rcx, [rdi+4A0h]                                                ; +0xbd, 0x14019ca8d\nmovsx   eax, word ptr [rcx]                                            ; +0xc4, 0x14019ca94\ncmp     eax, esi                                                       ; +0xc7, 0x14019ca97\njz      short loc_14019CAB9                                            ; +0xc9, 0x14019ca99\ninc     ebx                                                            ; +0xcb, 0x14019ca9b\nadd     rcx, 2                                                         ; +0xcd, 0x14019ca9d\ncmp     ebx, r8d                                                       ; +0xd1, 0x14019caa1\njl      short loc_14019CA94                                            ; +0xd4, 0x14019caa4\nmov     rax, [rdi+4A0h]                                                ; +0xd6, 0x14019caa6\nmov     [rax+r8*2], si                                                 ; +0xdd, 0x14019caad\ninc     word ptr [rdi+4A8h]                                            ; +0xe2, 0x14019cab2\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xe9, 0x14019cab9\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xee, 0x14019cabe\nadd     rsp, 20h                                                       ; +0xf3, 0x14019cac3\npop     rdi                                                            ; +0xf7, 0x14019cac7\nretn                                                                   ; +0xf8, 0x14019cac8", "xrefs": ["GJBaseGameLayer::calculateColorGroups @ 0x14020e2f0", "PlayLayer::optimizeColorGroups @ 0x1403aedc0", "<???> @ 0x1406792b0", "<???> @ 0x1406792c0", "<???> @ 0x1406cbe14"], "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"}