{"type": "func", "start": 5371435552, "end": 5371435803, "name": "GameObject::addToColorGroup", "pseudocode": "// \n// GameObject::addToColorGroup from 0x140299a20 to 0x140299b1b (251 bytes)\n// \n// 5 xrefs:\n// > GJBaseGameLayer::calculateColorGroups @ 0x140314380\n// > PlayLayer::optimizeColorGroups @ 0x14050d7b0\n// > <???> @ 0x1408af638\n// > <???> @ 0x1408af648\n// > <???> @ 0x14091d798\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:29:12 +0000\n// \n\nvoid __fastcall GameObject::addToColorGroup(__int64 a1, int a2)\n{\n  int v4; // ebx\n  _WORD *v5; // rax\n  __int64 v6; // r8\n  __int16 *v7; // rcx\n\n  if ( *(__int16 *)(a1 + 1192) < 10 && (unsigned int)(a2 - 1) <= 0x270E )\n  {\n    v4 = 0;\n    if ( !*(_QWORD *)(a1 + 1184) )\n    {\n      v5 = operator new(0x14u);\n      *(_QWORD *)(a1 + 1184) = v5;\n      *v5 = 0;\n      *(_WORD *)(*(_QWORD *)(a1 + 1184) + 2LL) = 0;\n      *(_WORD *)(*(_QWORD *)(a1 + 1184) + 4LL) = 0;\n      *(_WORD *)(*(_QWORD *)(a1 + 1184) + 6LL) = 0;\n      *(_WORD *)(*(_QWORD *)(a1 + 1184) + 8LL) = 0;\n      *(_WORD *)(*(_QWORD *)(a1 + 1184) + 10LL) = 0;\n      *(_WORD *)(*(_QWORD *)(a1 + 1184) + 12LL) = 0;\n      *(_WORD *)(*(_QWORD *)(a1 + 1184) + 14LL) = 0;\n      *(_WORD *)(*(_QWORD *)(a1 + 1184) + 16LL) = 0;\n      *(_WORD *)(*(_QWORD *)(a1 + 1184) + 18LL) = 0;\n    }\n    v6 = *(__int16 *)(a1 + 1192);\n    if ( (int)v6 <= 0 )\n    {\nLABEL_9:\n      *(_WORD *)(*(_QWORD *)(a1 + 1184) + 2 * v6) = a2;\n      ++*(_WORD *)(a1 + 1192);\n    }\n    else\n    {\n      v7 = *(__int16 **)(a1 + 1184);\n      while ( *v7 != a2 )\n      {\n        ++v4;\n        ++v7;\n        if ( v4 >= (int)v6 )\n          goto LABEL_9;\n      }\n    }\n  }\n}", "assembly": "; \n; GameObject::addToColorGroup from 0x140299a20 to 0x140299b1b (251 bytes)\n; \n; 5 xrefs:\n; > GJBaseGameLayer::calculateColorGroups @ 0x140314380\n; > PlayLayer::optimizeColorGroups @ 0x14050d7b0\n; > <???> @ 0x1408af638\n; > <???> @ 0x1408af648\n; > <???> @ 0x14091d798\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:29:12 +0000\n; \nmov     [rsp+arg_8], rsi                                               ; +0x0, 0x140299a20\npush    rdi                                                            ; +0x5, 0x140299a25\nsub     rsp, 20h                                                       ; +0x6, 0x140299a26\ncmp     word ptr [rcx+4A8h], 0Ah                                       ; +0xa, 0x140299a2a\nmov     esi, edx                                                       ; +0x12, 0x140299a32\nmov     rdi, rcx                                                       ; +0x14, 0x140299a34\njge     loc_140299B10                                                  ; +0x17, 0x140299a37\nlea     eax, [rdx-1]                                                   ; +0x1d, 0x140299a3d\ncmp     eax, 270Eh                                                     ; +0x20, 0x140299a40\nja      loc_140299B10                                                  ; +0x25, 0x140299a45\nmov     [rsp+28h+arg_0], rbx                                           ; +0x2b, 0x140299a4b\nxor     ebx, ebx                                                       ; +0x30, 0x140299a50\ncmp     [rcx+4A0h], rbx                                                ; +0x32, 0x140299a52\njnz     short loc_140299AD2                                            ; +0x39, 0x140299a59\nmov     ecx, 14h; Size                                                 ; +0x3b, 0x140299a5b\ncall    j_??2@YAPEAX_K@Z; operator new(unsigned __int64)               ; +0x40, 0x140299a60\nmov     [rdi+4A0h], rax                                                ; +0x45, 0x140299a65\nmov     [rax], bx                                                      ; +0x4c, 0x140299a6c\nmov     rax, [rdi+4A0h]                                                ; +0x4f, 0x140299a6f\nmov     [rax+2], bx                                                    ; +0x56, 0x140299a76\nmov     rax, [rdi+4A0h]                                                ; +0x5a, 0x140299a7a\nmov     [rax+4], bx                                                    ; +0x61, 0x140299a81\nmov     rax, [rdi+4A0h]                                                ; +0x65, 0x140299a85\nmov     [rax+6], bx                                                    ; +0x6c, 0x140299a8c\nmov     rax, [rdi+4A0h]                                                ; +0x70, 0x140299a90\nmov     [rax+8], bx                                                    ; +0x77, 0x140299a97\nmov     rax, [rdi+4A0h]                                                ; +0x7b, 0x140299a9b\nmov     [rax+0Ah], bx                                                  ; +0x82, 0x140299aa2\nmov     rax, [rdi+4A0h]                                                ; +0x86, 0x140299aa6\nmov     [rax+0Ch], bx                                                  ; +0x8d, 0x140299aad\nmov     rax, [rdi+4A0h]                                                ; +0x91, 0x140299ab1\nmov     [rax+0Eh], bx                                                  ; +0x98, 0x140299ab8\nmov     rax, [rdi+4A0h]                                                ; +0x9c, 0x140299abc\nmov     [rax+10h], bx                                                  ; +0xa3, 0x140299ac3\nmov     rax, [rdi+4A0h]                                                ; +0xa7, 0x140299ac7\nmov     [rax+12h], bx                                                  ; +0xae, 0x140299ace\nmovsx   r8, word ptr [rdi+4A8h]                                        ; +0xb2, 0x140299ad2\ntest    r8d, r8d                                                       ; +0xba, 0x140299ada\njle     short loc_140299AF8                                            ; +0xbd, 0x140299add\nmov     rcx, [rdi+4A0h]                                                ; +0xbf, 0x140299adf\nmovsx   eax, word ptr [rcx]                                            ; +0xc6, 0x140299ae6\ncmp     eax, esi                                                       ; +0xc9, 0x140299ae9\njz      short loc_140299B0B                                            ; +0xcb, 0x140299aeb\ninc     ebx                                                            ; +0xcd, 0x140299aed\nadd     rcx, 2                                                         ; +0xcf, 0x140299aef\ncmp     ebx, r8d                                                       ; +0xd3, 0x140299af3\njl      short loc_140299AE6                                            ; +0xd6, 0x140299af6\nmov     rax, [rdi+4A0h]                                                ; +0xd8, 0x140299af8\nmov     [rax+r8*2], si                                                 ; +0xdf, 0x140299aff\ninc     word ptr [rdi+4A8h]                                            ; +0xe4, 0x140299b04\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xeb, 0x140299b0b\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xf0, 0x140299b10\nadd     rsp, 20h                                                       ; +0xf5, 0x140299b15\npop     rdi                                                            ; +0xf9, 0x140299b19\nretn                                                                   ; +0xfa, 0x140299b1a", "xrefs": ["GJBaseGameLayer::calculateColorGroups @ 0x140314380", "PlayLayer::optimizeColorGroups @ 0x14050d7b0", "<???> @ 0x1408af638", "<???> @ 0x1408af648", "<???> @ 0x14091d798"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}