{"type": "func", "start": 4300990304, "end": 4300990455, "name": "GameObject::addToColorGroup", "pseudocode": "// \n// GameObject::addToColorGroup from 0x1005be760 to 0x1005be7f7 (151 bytes)\n// \n// 2 xrefs:\n// > PlayLayer::optimizeColorGroups @ 0x1000aebfe\n// > GJBaseGameLayer::calculateColorGroups @ 0x10011df0e\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 GameObject::addToColorGroup(GameObject *a1, int a2)\n{\n  __int64 m_colorGroupCount; // r14\n  std::array<short, 10> *m_colorGroups; // rax\n  __int64 v4; // rcx\n\n  m_colorGroupCount = a1->m_colorGroupCount;\n  if ( m_colorGroupCount < 10 && (unsigned int)(a2 - 10000) >= 0xFFFFD8F1 )\n  {\n    m_colorGroups = a1->m_colorGroups;\n    if ( m_colorGroups )\n    {\n      if ( (__int16)m_colorGroupCount <= 0 )\n        goto LABEL_9;\n    }\n    else\n    {\n      m_colorGroups = (std::array<short, 10> *)operator new[](0x14u);\n      a1->m_colorGroups = m_colorGroups;\n      *(_OWORD *)m_colorGroups->__elems_ = 0;\n      *(_DWORD *)&m_colorGroups->__elems_[8] = 0;\n      if ( (__int16)m_colorGroupCount <= 0 )\n      {\nLABEL_9:\n        m_colorGroups->__elems_[m_colorGroupCount] = a2;\n        ++a1->m_colorGroupCount;\n        return;\n      }\n    }\n    v4 = 0;\n    while ( m_colorGroups->__elems_[v4] != a2 )\n    {\n      if ( m_colorGroupCount == ++v4 )\n        goto LABEL_9;\n    }\n  }\n}", "assembly": "; \n; GameObject::addToColorGroup from 0x1005be760 to 0x1005be7f7 (151 bytes)\n; \n; 2 xrefs:\n; > PlayLayer::optimizeColorGroups @ 0x1000aebfe\n; > GJBaseGameLayer::calculateColorGroups @ 0x10011df0e\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, 0x1005be760\nmov     rbp, rsp                                                       ; +0x1, 0x1005be761\npush    r15                                                            ; +0x4, 0x1005be764\npush    r14                                                            ; +0x6, 0x1005be766\npush    rbx                                                            ; +0x8, 0x1005be768\npush    rax                                                            ; +0x9, 0x1005be769\nmov     ebx, esi                                                       ; +0xa, 0x1005be76a\nmovsx   r14, word ptr [rdi+4A0h]                                       ; +0xc, 0x1005be76c\ncmp     r14, 0Ah                                                       ; +0x14, 0x1005be774\nsetnl   al                                                             ; +0x18, 0x1005be778\nlea     ecx, [rbx-2710h]                                               ; +0x1b, 0x1005be77b\ncmp     ecx, 0FFFFD8F1h                                                ; +0x21, 0x1005be781\nsetb    cl                                                             ; +0x27, 0x1005be787\nor      cl, al                                                         ; +0x2a, 0x1005be78a\njnz     short loc_1005BE7EC                                            ; +0x2c, 0x1005be78c\nmov     rax, [rdi+498h]                                                ; +0x2e, 0x1005be78e\ntest    rax, rax                                                       ; +0x35, 0x1005be795\njz      short loc_1005BE7A2                                            ; +0x38, 0x1005be798\ntest    r14w, r14w                                                     ; +0x3a, 0x1005be79a\njg      short loc_1005BE7CC                                            ; +0x3e, 0x1005be79e\njmp     short loc_1005BE7E0                                            ; +0x40, 0x1005be7a0\nmov     r15, rdi                                                       ; +0x42, 0x1005be7a2\nmov     edi, 14h; __sz                                                 ; +0x45, 0x1005be7a5\ncall    __Znam; operator new[](ulong)                                  ; +0x4a, 0x1005be7aa\nmov     rdi, r15                                                       ; +0x4f, 0x1005be7af\nmov     [r15+498h], rax                                                ; +0x52, 0x1005be7b2\nxorps   xmm0, xmm0                                                     ; +0x59, 0x1005be7b9\nmovups  xmmword ptr [rax], xmm0                                        ; +0x5c, 0x1005be7bc\nmov     dword ptr [rax+10h], 0                                         ; +0x5f, 0x1005be7bf\ntest    r14w, r14w                                                     ; +0x66, 0x1005be7c6\njle     short loc_1005BE7E0                                            ; +0x6a, 0x1005be7ca\nxor     ecx, ecx                                                       ; +0x6c, 0x1005be7cc\nxchg    ax, ax                                                         ; +0x6e, 0x1005be7ce\nmovsx   edx, word ptr [rax+rcx*2]                                      ; +0x70, 0x1005be7d0\ncmp     edx, ebx                                                       ; +0x74, 0x1005be7d4\njz      short loc_1005BE7EC                                            ; +0x76, 0x1005be7d6\ninc     rcx                                                            ; +0x78, 0x1005be7d8\ncmp     r14, rcx                                                       ; +0x7b, 0x1005be7db\njnz     short loc_1005BE7D0                                            ; +0x7e, 0x1005be7de\nmov     [rax+r14*2], bx                                                ; +0x80, 0x1005be7e0\ninc     word ptr [rdi+4A0h]                                            ; +0x85, 0x1005be7e5\nadd     rsp, 8                                                         ; +0x8c, 0x1005be7ec\npop     rbx                                                            ; +0x90, 0x1005be7f0\npop     r14                                                            ; +0x91, 0x1005be7f1\npop     r15                                                            ; +0x93, 0x1005be7f3\npop     rbp                                                            ; +0x95, 0x1005be7f5\nretn                                                                   ; +0x96, 0x1005be7f6", "xrefs": ["PlayLayer::optimizeColorGroups @ 0x1000aebfe", "GJBaseGameLayer::calculateColorGroups @ 0x10011df0e"], "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"}