#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int pixel;
  int red;
  int green;
  int blue;
};
typedef TYPE_1__ XColor;
typedef scalar_t__ Bool;

/* Variables and functions */
void merge_colors(int argc, XColor **argv, XColor *into_color, int mask,
                  Bool additive_p) {
  int j;
  *into_color = *argv[0];
  into_color->pixel |= mask;
  for (j = 1; j < argc; j++) {
    if (additive_p) {
      (into_color->red = ((((into_color->red) + (argv[j]->red)) > 0xFFFF)
                              ? 0xFFFF
                              : ((into_color->red) + (argv[j]->red))));
      (into_color->green = ((((into_color->green) + (argv[j]->green)) > 0xFFFF)
                                ? 0xFFFF
                                : ((into_color->green) + (argv[j]->green))));
      (into_color->blue = ((((into_color->blue) + (argv[j]->blue)) > 0xFFFF)
                               ? 0xFFFF
                               : ((into_color->blue) + (argv[j]->blue))));
    } else {
      (into_color->red = ((((into_color->red) - (argv[j]->red)) < 0)
                              ? 0
                              : ((into_color->red) - (argv[j]->red))));
      (into_color->green = ((((into_color->green) - (argv[j]->green)) < 0)
                                ? 0
                                : ((into_color->green) - (argv[j]->green))));
      (into_color->blue = ((((into_color->blue) - (argv[j]->blue)) < 0)
                               ? 0
                               : ((into_color->blue) - (argv[j]->blue))));
    }
  }
}


x86 assembly (clang, -O0):
<merge_colors>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
mov    (%rcx),%rdx
mov    %rdx,(%rax)
mov    0x8(%rcx),%rcx
mov    %rcx,0x8(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1347 <merge_colors+0x247>
cmpq   $0x0,-0x28(%rbp)
je     1250 <merge_colors+0x150>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
add    0x4(%rcx),%eax
cmp    $0xffff,%eax
jle    1186 <merge_colors+0x86>
mov    $0xffff,%eax
mov    %eax,-0x30(%rbp)
jmp    119f <merge_colors+0x9f>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
add    0x4(%rcx),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
add    0x8(%rcx),%eax
cmp    $0xffff,%eax
jle    11d7 <merge_colors+0xd7>
mov    $0xffff,%eax
mov    %eax,-0x34(%rbp)
jmp    11f0 <merge_colors+0xf0>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
add    0x8(%rcx),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
add    0xc(%rcx),%eax
cmp    $0xffff,%eax
jle    1228 <merge_colors+0x128>
mov    $0xffff,%eax
mov    %eax,-0x38(%rbp)
jmp    1241 <merge_colors+0x141>
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
add    0xc(%rcx),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
jmp    1334 <merge_colors+0x234>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
sub    0x4(%rcx),%eax
cmp    $0x0,%eax
jge    1279 <merge_colors+0x179>
xor    %eax,%eax
mov    %eax,-0x3c(%rbp)
jmp    1292 <merge_colors+0x192>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
sub    0x4(%rcx),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
sub    0x8(%rcx),%eax
cmp    $0x0,%eax
jge    12c5 <merge_colors+0x1c5>
xor    %eax,%eax
mov    %eax,-0x40(%rbp)
jmp    12de <merge_colors+0x1de>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
sub    0x8(%rcx),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
sub    0xc(%rcx),%eax
cmp    $0x0,%eax
jge    1311 <merge_colors+0x211>
xor    %eax,%eax
mov    %eax,-0x44(%rbp)
jmp    132a <merge_colors+0x22a>
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
sub    0xc(%rcx),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
jmp    1339 <merge_colors+0x239>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1141 <merge_colors+0x41>
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_colors>:
push   %rbx
mov    (%rsi),%rax
movups (%rax),%xmm0
movups %xmm0,(%rdx)
or     %ecx,(%rdx)
cmp    $0x2,%edi
jl     119d <merge_colors+0x9d>
mov    %edi,%r11d
mov    $0x1,%ecx
xor    %r9d,%r9d
mov    $0xffff,%r10d
jmp    115c <merge_colors+0x5c>
nopl   0x0(%rax,%rax,1)
sub    %ebx,%eax
cmovs  %r9d,%eax
mov    %eax,0x4(%rdx)
mov    0x8(%rdx),%ebx
sub    0x8(%rdi),%ebx
mov    0xc(%rdx),%eax
cmovs  %r9d,%ebx
mov    %ebx,0x8(%rdx)
sub    0xc(%rdi),%eax
cmovs  %r9d,%eax
mov    %eax,0xc(%rdx)
add    $0x1,%rcx
cmp    %rcx,%r11
je     119d <merge_colors+0x9d>
mov    0x4(%rdx),%eax
mov    (%rsi,%rcx,8),%rdi
mov    0x4(%rdi),%ebx
test   %r8,%r8
je     1130 <merge_colors+0x30>
add    %eax,%ebx
cmp    $0xffff,%ebx
cmovge %r10d,%ebx
mov    %ebx,0x4(%rdx)
mov    0x8(%rdi),%eax
add    0x8(%rdx),%eax
cmp    $0xffff,%eax
cmovge %r10d,%eax
mov    %eax,0x8(%rdx)
mov    0xc(%rdi),%eax
add    0xc(%rdx),%eax
cmp    $0xffff,%eax
cmovge %r10d,%eax
jmp    1150 <merge_colors+0x50>
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32, i32, i32, i32 }
define void @merge_colors(i32 %0, %struct.TYPE_4__** %1, %struct.TYPE_4__* %2, i32 %3, i64 %4) {
%6 = alloca i32
%7 = alloca %struct.TYPE_4__**
%8 = alloca %struct.TYPE_4__*
%9 = alloca i32
%10 = alloca i64
%11 = alloca i32
store i32 %0, i32* %6
store %struct.TYPE_4__** %1, %struct.TYPE_4__*** %7
store %struct.TYPE_4__* %2, %struct.TYPE_4__** %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%12 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%13 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %7
%14 = getelementptr inbounds %struct.TYPE_4__*, %struct.TYPE_4__** %13, i64 0
%15 = load %struct.TYPE_4__*, %struct.TYPE_4__** %14
%16 = bitcast %struct.TYPE_4__* %12 to i8*
%17 = bitcast %struct.TYPE_4__* %15 to i8*
%18 = load i32, i32* %9
%19 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%20 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %19, i32 0, i32 0
%21 = load i32, i32* %20
%22 = or i32 %21, %18
store i32 %22, i32* %20
store i32 1, i32* %11
br label %23
23: ; preds = %207, %5
%24 = load i32, i32* %11
%25 = load i32, i32* %6
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %210
27: ; preds = %23
%28 = load i64, i64* %10
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %118
30: ; preds = %27
%31 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%32 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %31, i32 0, i32 1
%33 = load i32, i32* %32
%34 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %7
%35 = load i32, i32* %11
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds %struct.TYPE_4__*, %struct.TYPE_4__** %34, i64 %36
%38 = load %struct.TYPE_4__*, %struct.TYPE_4__** %37
%39 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %38, i32 0, i32 1
%40 = load i32, i32* %39
%41 = add nsw i32 %33, %40
%42 = icmp sgt i32 %41, 65535
br i1 %42, label %43, label %44
43: ; preds = %30
br label %56
44: ; preds = %30
%45 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%46 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %45, i32 0, i32 1
%47 = load i32, i32* %46
%48 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %7
%49 = load i32, i32* %11
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds %struct.TYPE_4__*, %struct.TYPE_4__** %48, i64 %50
%52 = load %struct.TYPE_4__*, %struct.TYPE_4__** %51
%53 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %52, i32 0, i32 1
%54 = load i32, i32* %53
%55 = add nsw i32 %47, %54
br label %56
56: ; preds = %44, %43
%57 = phi i32 [ 65535, %43 ], [ %55, %44 ]
%58 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%59 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %58, i32 0, i32 1
store i32 %57, i32* %59
%60 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%61 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %60, i32 0, i32 2
%62 = load i32, i32* %61
%63 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %7
%64 = load i32, i32* %11
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds %struct.TYPE_4__*, %struct.TYPE_4__** %63, i64 %65
%67 = load %struct.TYPE_4__*, %struct.TYPE_4__** %66
%68 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %67, i32 0, i32 2
%69 = load i32, i32* %68
%70 = add nsw i32 %62, %69
%71 = icmp sgt i32 %70, 65535
br i1 %71, label %72, label %73
72: ; preds = %56
br label %85
73: ; preds = %56
%74 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%75 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %74, i32 0, i32 2
%76 = load i32, i32* %75
%77 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %7
%78 = load i32, i32* %11
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds %struct.TYPE_4__*, %struct.TYPE_4__** %77, i64 %79
%81 = load %struct.TYPE_4__*, %struct.TYPE_4__** %80
%82 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %81, i32 0, i32 2
%83 = load i32, i32* %82
%84 = add nsw i32 %76, %83
br label %85
85: ; preds = %73, %72
%86 = phi i32 [ 65535, %72 ], [ %84, %73 ]
%87 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%88 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %87, i32 0, i32 2
store i32 %86, i32* %88
%89 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%90 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %89, i32 0, i32 3
%91 = load i32, i32* %90
%92 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %7
%93 = load i32, i32* %11
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds %struct.TYPE_4__*, %struct.TYPE_4__** %92, i64 %94
%96 = load %struct.TYPE_4__*, %struct.TYPE_4__** %95
%97 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %96, i32 0, i32 3
%98 = load i32, i32* %97
%99 = add nsw i32 %91, %98
%100 = icmp sgt i32 %99, 65535
br i1 %100, label %101, label %102
101: ; preds = %85
br label %114
102: ; preds = %85
%103 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%104 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %103, i32 0, i32 3
%105 = load i32, i32* %104
%106 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %7
%107 = load i32, i32* %11
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds %struct.TYPE_4__*, %struct.TYPE_4__** %106, i64 %108
%110 = load %struct.TYPE_4__*, %struct.TYPE_4__** %109
%111 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %110, i32 0, i32 3
%112 = load i32, i32* %111
%113 = add nsw i32 %105, %112
br label %114
114: ; preds = %102, %101
%115 = phi i32 [ 65535, %101 ], [ %113, %102 ]
%116 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%117 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %116, i32 0, i32 3
store i32 %115, i32* %117
br label %206
118: ; preds = %27
%119 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%120 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %119, i32 0, i32 1
%121 = load i32, i32* %120
%122 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %7
%123 = load i32, i32* %11
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds %struct.TYPE_4__*, %struct.TYPE_4__** %122, i64 %124
%126 = load %struct.TYPE_4__*, %struct.TYPE_4__** %125
%127 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %126, i32 0, i32 1
%128 = load i32, i32* %127
%129 = sub nsw i32 %121, %128
%130 = icmp slt i32 %129, 0
br i1 %130, label %131, label %132
131: ; preds = %118
br label %144
132: ; preds = %118
%133 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%134 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %133, i32 0, i32 1
%135 = load i32, i32* %134
%136 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %7
%137 = load i32, i32* %11
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds %struct.TYPE_4__*, %struct.TYPE_4__** %136, i64 %138
%140 = load %struct.TYPE_4__*, %struct.TYPE_4__** %139
%141 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %140, i32 0, i32 1
%142 = load i32, i32* %141
%143 = sub nsw i32 %135, %142
br label %144
144: ; preds = %132, %131
%145 = phi i32 [ 0, %131 ], [ %143, %132 ]
%146 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%147 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %146, i32 0, i32 1
store i32 %145, i32* %147
%148 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%149 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %148, i32 0, i32 2
%150 = load i32, i32* %149
%151 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %7
%152 = load i32, i32* %11
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds %struct.TYPE_4__*, %struct.TYPE_4__** %151, i64 %153
%155 = load %struct.TYPE_4__*, %struct.TYPE_4__** %154
%156 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %155, i32 0, i32 2
%157 = load i32, i32* %156
%158 = sub nsw i32 %150, %157
%159 = icmp slt i32 %158, 0
br i1 %159, label %160, label %161
160: ; preds = %144
br label %173
161: ; preds = %144
%162 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%163 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %162, i32 0, i32 2
%164 = load i32, i32* %163
%165 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %7
%166 = load i32, i32* %11
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds %struct.TYPE_4__*, %struct.TYPE_4__** %165, i64 %167
%169 = load %struct.TYPE_4__*, %struct.TYPE_4__** %168
%170 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %169, i32 0, i32 2
%171 = load i32, i32* %170
%172 = sub nsw i32 %164, %171
br label %173
173: ; preds = %161, %160
%174 = phi i32 [ 0, %160 ], [ %172, %161 ]
%175 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%176 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %175, i32 0, i32 2
store i32 %174, i32* %176
%177 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%178 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %177, i32 0, i32 3
%179 = load i32, i32* %178
%180 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %7
%181 = load i32, i32* %11
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds %struct.TYPE_4__*, %struct.TYPE_4__** %180, i64 %182
%184 = load %struct.TYPE_4__*, %struct.TYPE_4__** %183
%185 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %184, i32 0, i32 3
%186 = load i32, i32* %185
%187 = sub nsw i32 %179, %186
%188 = icmp slt i32 %187, 0
br i1 %188, label %189, label %190
189: ; preds = %173
br label %202
190: ; preds = %173
%191 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%192 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %191, i32 0, i32 3
%193 = load i32, i32* %192
%194 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %7
%195 = load i32, i32* %11
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds %struct.TYPE_4__*, %struct.TYPE_4__** %194, i64 %196
%198 = load %struct.TYPE_4__*, %struct.TYPE_4__** %197
%199 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %198, i32 0, i32 3
%200 = load i32, i32* %199
%201 = sub nsw i32 %193, %200
br label %202
202: ; preds = %190, %189
%203 = phi i32 [ 0, %189 ], [ %201, %190 ]
%204 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%205 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %204, i32 0, i32 3
store i32 %203, i32* %205
br label %206
206: ; preds = %202, %114
br label %207
207: ; preds = %206
%208 = load i32, i32* %11
%209 = add nsw i32 %208, 1
store i32 %209, i32* %11
br label %23
210: ; preds = %23
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32, i32, i32, i32 }
define void @merge_colors(i32 %0, %struct.TYPE_4__** nocapture %1, %struct.TYPE_4__* nocapture %2, i32 %3, i64 %4) {
%6 = bitcast %struct.TYPE_4__** %1 to i8**
%7 = load i8*, i8** %6
%8 = bitcast %struct.TYPE_4__* %2 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 dereferenceable(16) %8, i8* align 4 dereferenceable(16) %7, i64 16, i1 false)
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %2, i64 0, i32 0
%10 = load i32, i32* %9
%11 = or i32 %10, %3
store i32 %11, i32* %9
%12 = icmp sgt i32 %0, 1
br i1 %12, label %13, label %62
13: ; preds = %5
%14 = icmp eq i64 %4, 0
%15 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %2, i64 0, i32 1
%16 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %2, i64 0, i32 2
%17 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %2, i64 0, i32 3
%18 = zext i32 %0 to i64
br label %19
19: ; preds = %13, %58
%20 = phi i64 [ 1, %13 ], [ %60, %58 ]
%21 = load i32, i32* %15
%22 = getelementptr inbounds %struct.TYPE_4__*, %struct.TYPE_4__** %1, i64 %20
%23 = load %struct.TYPE_4__*, %struct.TYPE_4__** %22
%24 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %23, i64 0, i32 1
%25 = load i32, i32* %24
br i1 %14, label %42, label %26
26: ; preds = %19
%27 = add nsw i32 %25, %21
%28 = icmp slt i32 %27, 65535
%29 = select i1 %28, i32 %27, i32 65535
store i32 %29, i32* %15
%30 = load i32, i32* %16
%31 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %23, i64 0, i32 2
%32 = load i32, i32* %31
%33 = add nsw i32 %32, %30
%34 = icmp slt i32 %33, 65535
%35 = select i1 %34, i32 %33, i32 65535
store i32 %35, i32* %16
%36 = load i32, i32* %17
%37 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %23, i64 0, i32 3
%38 = load i32, i32* %37
%39 = add nsw i32 %38, %36
%40 = icmp slt i32 %39, 65535
%41 = select i1 %40, i32 %39, i32 65535
br label %58
42: ; preds = %19
%43 = sub nsw i32 %21, %25
%44 = icmp sgt i32 %43, 0
%45 = select i1 %44, i32 %43, i32 0
store i32 %45, i32* %15
%46 = load i32, i32* %16
%47 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %23, i64 0, i32 2
%48 = load i32, i32* %47
%49 = sub nsw i32 %46, %48
%50 = icmp sgt i32 %49, 0
%51 = select i1 %50, i32 %49, i32 0
store i32 %51, i32* %16
%52 = load i32, i32* %17
%53 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %23, i64 0, i32 3
%54 = load i32, i32* %53
%55 = sub nsw i32 %52, %54
%56 = icmp sgt i32 %55, 0
%57 = select i1 %56, i32 %55, i32 0
br label %58
58: ; preds = %26, %42
%59 = phi i32 [ %41, %26 ], [ %57, %42 ]
store i32 %59, i32* %17
%60 = add nuw nsw i64 %20, 1
%61 = icmp eq i64 %60, %18
br i1 %61, label %62, label %19
62: ; preds = %58, %5
ret void
}