#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_7__ TYPE_1__;

/* Type definitions */
struct TYPE_7__ {
  int flags;
  unsigned long pixel;
  int /*<<< orphan*/ blue;
  int /*<<< orphan*/ green;
  int /*<<< orphan*/ red;
};
typedef TYPE_1__ XColor;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Colormap;
typedef scalar_t__ Bool;

/* Variables and functions */
int DoBlue;
int DoGreen;
int DoRed;
int /*<<< orphan*/ False;
scalar_t__ XAllocColor(int /*<<< orphan*/ *, int /*<<< orphan*/, TYPE_1__ *);
int /*<<< orphan*/ XAllocColorCells(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/, unsigned long *, int);
int /*<<< orphan*/ XStoreColors(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                TYPE_1__ *, int);
int /*<<< orphan*/ free(unsigned long *);
int /*<<< orphan*/ free_colors(int /*<<< orphan*/ *, int /*<<< orphan*/,
                               TYPE_1__ *, int);
int /*<<< orphan*/ hsv_to_rgb(int, float, float, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(TYPE_1__ *, int /*<<< orphan*/, int);
void make_color_ramp(Display *dpy, Colormap cmap, int h1, float s1, float v1,
                     int h2, float s2, float v2, XColor *colors, int *ncolorsP,
                     Bool closed_p, Bool allocate_p, Bool writable_p) {
  int i;
  int ncolors = *ncolorsP;
  float dh, ds, dv;
AGAIN:
  memset(colors, 0, (*ncolorsP) * sizeof(*colors));
  if (closed_p)
    ncolors = (ncolors / 2) + 1;
  dh = ((float)h2 - (float)h1) / ncolors;
  ds = (s2 - s1) / ncolors;
  dv = (v2 - v1) / ncolors;
  for (i = 0; i < ncolors; i++) {
    colors[i].flags = DoRed | DoGreen | DoBlue;
    hsv_to_rgb((int)(h1 + (i * dh)), (s1 + (i * ds)), (v1 + (i * dv)),
               &colors[i].red, &colors[i].green, &colors[i].blue);
  }
  if (closed_p)
    for (i = ncolors; i < *ncolorsP; i++)
      colors[i] = colors[(*ncolorsP) - i];
  if (!allocate_p)
    return;
  if (writable_p) {
    unsigned long *pixels =
        (unsigned long *)malloc(sizeof(*pixels) * ((*ncolorsP) + 1));
    if (!XAllocColorCells(dpy, cmap, False, 0, 0, pixels, *ncolorsP)) {
      free(pixels);
      goto FAIL;
    }
    for (i = 0; i < *ncolorsP; i++)
      colors[i].pixel = pixels[i];
    free(pixels);
    XStoreColors(dpy, cmap, colors, *ncolorsP);
  } else {
    for (i = 0; i < *ncolorsP; i++) {
      XColor color;
      color = colors[i];
      if (XAllocColor(dpy, cmap, &color)) {
        colors[i].pixel = color.pixel;
      } else {
        free_colors(dpy, cmap, colors, i);
        goto FAIL;
      }
    }
  }
  return;
FAIL:
  ncolors = (ncolors > 170   ? ncolors - 20
             : ncolors > 100 ? ncolors - 10
             : ncolors > 75  ? ncolors - 5
             : ncolors > 25  ? ncolors - 3
             : ncolors > 10  ? ncolors - 2
             : ncolors > 2   ? ncolors - 1
                             : 0);
  *ncolorsP = ncolors;
  if (ncolors > 0)
    goto AGAIN;
}


x86 assembly (clang, -O0):
<make_color_ramp>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movss  %xmm2,-0x20(%rbp)
movss  %xmm3,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rax
movslq (%rax),%rax
shl    $0x5,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1070 <memset@plt>
cmpq   $0x0,0x10(%rbp)
je     11fd <make_color_ramp+0x7d>
mov    -0x40(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
cvtsi2ssl -0x1c(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
subss  %xmm1,%xmm0
cvtsi2ssl -0x40(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x20(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
cvtsi2ssl -0x40(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0x24(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
cvtsi2ssl -0x40(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    131d <make_color_ramp+0x19d>
mov    0x2d7d(%rip),%rax
mov    (%rax),%ecx
mov    0x2d5c(%rip),%rax
or     (%rax),%ecx
mov    0x2d5b(%rip),%rax
or     (%rax),%ecx
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rdx
shl    $0x5,%rdx
add    %rdx,%rax
mov    %ecx,(%rax)
cvtsi2ssl -0x10(%rbp),%xmm1
cvtsi2ssl -0x3c(%rbp),%xmm0
movss  -0x44(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
movss  -0x14(%rbp),%xmm1
cvtsi2ssl -0x3c(%rbp),%xmm0
movss  -0x48(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm2
cvtsi2ssl -0x3c(%rbp),%xmm1
movss  -0x4c(%rbp),%xmm3
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
mov    -0x30(%rbp),%rsi
movslq -0x3c(%rbp),%rax
shl    $0x5,%rax
add    %rax,%rsi
add    $0x18,%rsi
mov    -0x30(%rbp),%rdx
movslq -0x3c(%rbp),%rax
shl    $0x5,%rax
add    %rax,%rdx
add    $0x14,%rdx
mov    -0x30(%rbp),%rcx
movslq -0x3c(%rbp),%rax
shl    $0x5,%rax
add    %rax,%rcx
add    $0x10,%rcx
call   1040 <hsv_to_rgb@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1250 <make_color_ramp+0xd0>
cmpq   $0x0,0x10(%rbp)
je     1394 <make_color_ramp+0x214>
mov    -0x40(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x38(%rbp),%rcx
cmp    (%rcx),%eax
jge    138f <make_color_ramp+0x20f>
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%rdx
mov    (%rdx),%edx
sub    -0x3c(%rbp),%edx
movslq %edx,%rdx
shl    $0x5,%rdx
add    %rdx,%rcx
mov    (%rcx),%rdx
mov    %rdx,(%rax)
mov    0x8(%rcx),%rdx
mov    %rdx,0x8(%rax)
mov    0x10(%rcx),%rdx
mov    %rdx,0x10(%rax)
mov    0x18(%rcx),%rcx
mov    %rcx,0x18(%rax)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    132e <make_color_ramp+0x1ae>
jmp    1394 <make_color_ramp+0x214>
cmpq   $0x0,0x18(%rbp)
jne    13a4 <make_color_ramp+0x224>
jmp    161b <make_color_ramp+0x49b>
cmpq   $0x0,0x20(%rbp)
je     146f <make_color_ramp+0x2ef>
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2c11(%rip),%rax
mov    (%rax),%edx
mov    -0x58(%rbp),%r9
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
xor    %r8d,%r8d
mov    %r8d,%ecx
mov    %eax,(%rsp)
call   1060 <XAllocColorCells@plt>
cmp    $0x0,%eax
jne    1408 <make_color_ramp+0x288>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
jmp    151e <make_color_ramp+0x39e>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x38(%rbp),%rcx
cmp    (%rcx),%eax
jge    144b <make_color_ramp+0x2cb>
mov    -0x58(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rdx
shl    $0x5,%rdx
add    %rdx,%rax
mov    %rcx,0x8(%rax)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    140f <make_color_ramp+0x28f>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rax
mov    (%rax),%ecx
call   10a0 <XStoreColors@plt>
jmp    1519 <make_color_ramp+0x399>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x38(%rbp),%rcx
cmp    (%rcx),%eax
jge    1514 <make_color_ramp+0x394>
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
mov    (%rax),%rcx
mov    %rcx,-0x78(%rbp)
mov    0x8(%rax),%rcx
mov    %rcx,-0x70(%rbp)
mov    0x10(%rax),%rcx
mov    %rcx,-0x68(%rbp)
mov    0x18(%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x78(%rbp),%rdx
call   1050 <XAllocColor@plt>
cmp    $0x0,%rax
je     14e9 <make_color_ramp+0x369>
mov    -0x70(%rbp),%rcx
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rdx
shl    $0x5,%rdx
add    %rdx,%rax
mov    %rcx,0x8(%rax)
jmp    1501 <make_color_ramp+0x381>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x30(%rbp),%rdx
mov    -0x3c(%rbp),%ecx
call   1090 <free_colors@plt>
jmp    151e <make_color_ramp+0x39e>
jmp    1506 <make_color_ramp+0x386>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1476 <make_color_ramp+0x2f6>
jmp    1519 <make_color_ramp+0x399>
jmp    161b <make_color_ramp+0x49b>
cmpl   $0xaa,-0x40(%rbp)
jle    1539 <make_color_ramp+0x3b9>
mov    -0x40(%rbp),%eax
sub    $0x14,%eax
mov    %eax,-0x7c(%rbp)
jmp    15fd <make_color_ramp+0x47d>
cmpl   $0x64,-0x40(%rbp)
jle    1551 <make_color_ramp+0x3d1>
mov    -0x40(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x80(%rbp)
jmp    15f7 <make_color_ramp+0x477>
cmpl   $0x4b,-0x40(%rbp)
jle    156c <make_color_ramp+0x3ec>
mov    -0x40(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0x84(%rbp)
jmp    15ee <make_color_ramp+0x46e>
cmpl   $0x19,-0x40(%rbp)
jle    1587 <make_color_ramp+0x407>
mov    -0x40(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x88(%rbp)
jmp    15e2 <make_color_ramp+0x462>
cmpl   $0xa,-0x40(%rbp)
jle    15a2 <make_color_ramp+0x422>
mov    -0x40(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x8c(%rbp)
jmp    15d6 <make_color_ramp+0x456>
cmpl   $0x2,-0x40(%rbp)
jle    15bd <make_color_ramp+0x43d>
mov    -0x40(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x90(%rbp)
jmp    15ca <make_color_ramp+0x44a>
xor    %eax,%eax
mov    %eax,-0x90(%rbp)
jmp    15ca <make_color_ramp+0x44a>
mov    -0x90(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x80(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x0,-0x40(%rbp)
jle    161b <make_color_ramp+0x49b>
jmp    11c9 <make_color_ramp+0x49>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_color_ramp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %r9,0x50(%rsp)
mov    %r8,%r12
mov    %esi,0x28(%rsp)
mov    %rdi,0x58(%rsp)
cvtsi2ss %ecx,%xmm4
cvtsi2ss %edx,%xmm5
mov    0xc0(%rsp),%rbx
mov    (%r9),%ebp
movss  %xmm5,0x10(%rsp)
subss  %xmm5,%xmm4
movss  %xmm4,0x1c(%rsp)
movss  %xmm0,0x14(%rsp)
subss  %xmm0,%xmm2
movss  %xmm2,0x20(%rsp)
movss  %xmm1,0x18(%rsp)
subss  %xmm1,%xmm3
movss  %xmm3,0x24(%rsp)
lea    0x10(%r8),%rax
mov    %rax,0x40(%rsp)
lea    0x8(%r8),%rax
mov    %rax,0x38(%rsp)
mov    %r8,0x48(%rsp)
jmp    1206 <make_color_ramp+0x86>
xchg   %ax,%ax
add    $0xffffffec,%ebp
mov    %ebp,(%r14)
mov    %ebp,%edx
shl    $0x5,%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
test   %rbx,%rbx
je     1228 <make_color_ramp+0xa8>
mov    %ebp,%eax
shr    $0x1f,%eax
add    %ebp,%eax
sar    %eax
add    $0x1,%eax
mov    %eax,%ebp
mov    %ebp,0xc(%rsp)
test   %ebp,%ebp
movss  0x18(%rsp),%xmm2
movss  0x14(%rsp),%xmm3
movss  0x10(%rsp),%xmm4
mov    0x2d99(%rip),%rbx
mov    0x2d7a(%rip),%r14
mov    0x2d7b(%rip),%r12
jle    131b <make_color_ramp+0x19b>
mov    0xc(%rsp),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0x1c(%rsp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x34(%rsp)
movss  0x20(%rsp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x30(%rsp)
movss  0x24(%rsp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x2c(%rsp)
mov    %eax,%r15d
mov    0x40(%rsp),%rbp
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14),%eax
or     (%rbx),%eax
or     (%r12),%eax
xorps  %xmm1,%xmm1
cvtsi2ss %r13d,%xmm1
mov    %eax,-0x10(%rbp)
movaps %xmm1,%xmm0
mulss  0x34(%rsp),%xmm0
addss  %xmm4,%xmm0
cvttss2si %xmm0,%edi
movaps %xmm1,%xmm0
mulss  0x30(%rsp),%xmm0
addss  %xmm3,%xmm0
mulss  0x2c(%rsp),%xmm1
addss  %xmm2,%xmm1
lea    0x8(%rbp),%rsi
lea    0x4(%rbp),%rdx
mov    %rbp,%rcx
call   1040 <hsv_to_rgb@plt>
movss  0x10(%rsp),%xmm4
movss  0x14(%rsp),%xmm3
movss  0x18(%rsp),%xmm2
add    $0x1,%r13
add    $0x20,%rbp
cmp    %r13,%r15
jne    12b0 <make_color_ramp+0x130>
cmpq   $0x0,0xc0(%rsp)
mov    0x50(%rsp),%r14
mov    0x48(%rsp),%r12
je     1380 <make_color_ramp+0x200>
mov    (%r14),%esi
cmp    0xc(%rsp),%esi
jle    1380 <make_color_ramp+0x200>
movslq 0xc(%rsp),%rax
mov    %rax,%rcx
neg    %rcx
mov    %rax,%rdx
shl    $0x5,%rdx
add    %r12,%rdx
xchg   %ax,%ax
movslq %esi,%rsi
add    %rcx,%rsi
shl    $0x5,%rsi
movups (%r12,%rsi,1),%xmm0
movups 0x10(%r12,%rsi,1),%xmm1
movups %xmm1,0x10(%rdx)
movups %xmm0,(%rdx)
add    $0x1,%rax
movslq (%r14),%rsi
add    $0xffffffffffffffff,%rcx
add    $0x20,%rdx
cmp    %rsi,%rax
jl     1350 <make_color_ramp+0x1d0>
cmpq   $0x0,0xc8(%rsp)
mov    0x28(%rsp),%r15d
mov    0x58(%rsp),%r13
je     157a <make_color_ramp+0x3fa>
mov    (%r14),%eax
cmpq   $0x0,0xd0(%rsp)
je     13f0 <make_color_ramp+0x270>
lea    0x8(,%rax,8),%edi
call   1080 <malloc@plt>
mov    %rax,%rbp
mov    0x2c2b(%rip),%rax
mov    (%rax),%edx
mov    (%r14),%eax
mov    %eax,(%rsp)
mov    %r13,%rdi
mov    %r15d,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    %rbp,%r9
call   1060 <XAllocColorCells@plt>
test   %eax,%eax
jne    14c8 <make_color_ramp+0x348>
mov    %rbp,%rdi
call   1030 <free@plt>
jmp    145c <make_color_ramp+0x2dc>
nopw   0x0(%rax,%rax,1)
test   %eax,%eax
jle    157a <make_color_ramp+0x3fa>
mov    0x38(%rsp),%rbx
xor    %ebp,%ebp
nop
mov    -0x8(%rbx),%rax
mov    (%rbx),%rcx
movups 0x8(%rbx),%xmm0
movaps %xmm0,0x70(%rsp)
mov    %rax,0x60(%rsp)
mov    %rcx,0x68(%rsp)
mov    %r13,%rdi
mov    %r15d,%esi
lea    0x60(%rsp),%rdx
call   1050 <XAllocColor@plt>
test   %rax,%rax
je     144c <make_color_ramp+0x2cc>
mov    0x68(%rsp),%rax
mov    %rax,(%rbx)
add    $0x1,%rbp
movslq (%r14),%rax
add    $0x20,%rbx
cmp    %rax,%rbp
jl     1400 <make_color_ramp+0x280>
jmp    157a <make_color_ramp+0x3fa>
mov    %r13,%rdi
mov    %r15d,%esi
mov    %r12,%rdx
mov    %ebp,%ecx
call   1090 <free_colors@plt>
mov    0xc0(%rsp),%rbx
mov    0xc(%rsp),%ebp
cmp    $0xab,%ebp
jge    1200 <make_color_ramp+0x80>
cmp    $0x65,%ebp
jl     1484 <make_color_ramp+0x304>
add    $0xfffffff6,%ebp
mov    %ebp,(%r14)
jmp    1206 <make_color_ramp+0x86>
cmp    $0x4c,%ebp
jl     1494 <make_color_ramp+0x314>
add    $0xfffffffb,%ebp
mov    %ebp,(%r14)
jmp    1206 <make_color_ramp+0x86>
cmp    $0x1a,%ebp
jl     14a4 <make_color_ramp+0x324>
add    $0xfffffffd,%ebp
mov    %ebp,(%r14)
jmp    1206 <make_color_ramp+0x86>
cmp    $0xb,%ebp
jl     14b4 <make_color_ramp+0x334>
add    $0xfffffffe,%ebp
mov    %ebp,(%r14)
jmp    1206 <make_color_ramp+0x86>
cmp    $0x2,%ebp
jle    158c <make_color_ramp+0x40c>
add    $0xffffffff,%ebp
mov    %ebp,(%r14)
jmp    1206 <make_color_ramp+0x86>
mov    (%r14),%ecx
test   %ecx,%ecx
jle    1561 <make_color_ramp+0x3e1>
lea    -0x1(%rcx),%rdx
mov    %ecx,%eax
and    $0x3,%eax
cmp    $0x3,%rdx
jae    14e6 <make_color_ramp+0x366>
xor    %edx,%edx
jmp    1520 <make_color_ramp+0x3a0>
and    $0xfffffffc,%ecx
lea    0x68(%r12),%rsi
xor    %edx,%edx
mov    0x0(%rbp,%rdx,8),%rdi
mov    %rdi,-0x60(%rsi)
mov    0x8(%rbp,%rdx,8),%rdi
mov    %rdi,-0x40(%rsi)
mov    0x10(%rbp,%rdx,8),%rdi
mov    %rdi,-0x20(%rsi)
mov    0x18(%rbp,%rdx,8),%rdi
mov    %rdi,(%rsi)
add    $0x4,%rdx
sub    $0xffffffffffffff80,%rsi
cmp    %rdx,%rcx
jne    14f0 <make_color_ramp+0x370>
test   %rax,%rax
je     1561 <make_color_ramp+0x3e1>
lea    0x0(,%rdx,8),%rcx
add    %rbp,%rcx
shl    $0x5,%rdx
add    %r12,%rdx
add    $0x8,%rdx
shl    $0x3,%rax
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rcx,%rsi,1),%rdi
mov    %rdi,(%rdx,%rsi,4)
add    $0x8,%rsi
cmp    %rsi,%rax
jne    1550 <make_color_ramp+0x3d0>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    (%r14),%ecx
mov    %r13,%rdi
mov    %r15d,%esi
mov    %r12,%rdx
call   10a0 <XStoreColors@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movl   $0x0,(%r14)
jmp    157a <make_color_ramp+0x3fa>

LLVM IR (-O0):
%struct.TYPE_7__ = type { i32, i64, i32, i32, i32 }
@DoRed = global i32 0
@DoGreen = global i32 0
@DoBlue = global i32 0
@False = global i32 0
define void @make_color_ramp(i32* %0, i32 %1, i32 %2, float %3, float %4, i32 %5, float %6, float %7, %struct.TYPE_7__* %8, i32* %9, i64 %10, i64 %11, i64 %12) {
%14 = alloca i32*
%15 = alloca i32
%16 = alloca i32
%17 = alloca float
%18 = alloca float
%19 = alloca i32
%20 = alloca float
%21 = alloca float
%22 = alloca %struct.TYPE_7__*
%23 = alloca i32*
%24 = alloca i64
%25 = alloca i64
%26 = alloca i64
%27 = alloca i32
%28 = alloca i32
%29 = alloca float
%30 = alloca float
%31 = alloca float
%32 = alloca i64*
%33 = alloca %struct.TYPE_7__
store i32* %0, i32** %14
store i32 %1, i32* %15
store i32 %2, i32* %16
store float %3, float* %17
store float %4, float* %18
store i32 %5, i32* %19
store float %6, float* %20
store float %7, float* %21
store %struct.TYPE_7__* %8, %struct.TYPE_7__** %22
store i32* %9, i32** %23
store i64 %10, i64* %24
store i64 %11, i64* %25
store i64 %12, i64* %26
%34 = load i32*, i32** %23
%35 = load i32, i32* %34
store i32 %35, i32* %28
br label %36
36: ; preds = %296, %13
%37 = load %struct.TYPE_7__*, %struct.TYPE_7__** %22
%38 = load i32*, i32** %23
%39 = load i32, i32* %38
%40 = sext i32 %39 to i64
%41 = mul i64 %40, 32
%42 = trunc i64 %41 to i32
%43 = call i32 @memset(%struct.TYPE_7__* %37, i32 0, i32 %42)
%44 = load i64, i64* %24
%45 = icmp ne i64 %44, 0
br i1 %45, label %46, label %50
46: ; preds = %36
%47 = load i32, i32* %28
%48 = sdiv i32 %47, 2
%49 = add nsw i32 %48, 1
store i32 %49, i32* %28
br label %50
50: ; preds = %46, %36
%51 = load i32, i32* %19
%52 = sitofp i32 %51 to float
%53 = load i32, i32* %16
%54 = sitofp i32 %53 to float
%55 = fsub float %52, %54
%56 = load i32, i32* %28
%57 = sitofp i32 %56 to float
%58 = fdiv float %55, %57
store float %58, float* %29
%59 = load float, float* %20
%60 = load float, float* %17
%61 = fsub float %59, %60
%62 = load i32, i32* %28
%63 = sitofp i32 %62 to float
%64 = fdiv float %61, %63
store float %64, float* %30
%65 = load float, float* %21
%66 = load float, float* %18
%67 = fsub float %65, %66
%68 = load i32, i32* %28
%69 = sitofp i32 %68 to float
%70 = fdiv float %67, %69
store float %70, float* %31
store i32 0, i32* %27
br label %71
71: ; preds = %119, %50
%72 = load i32, i32* %27
%73 = load i32, i32* %28
%74 = icmp slt i32 %72, %73
br i1 %74, label %75, label %122
75: ; preds = %71
%76 = load i32, i32* @DoRed
%77 = load i32, i32* @DoGreen
%78 = or i32 %76, %77
%79 = load i32, i32* @DoBlue
%80 = or i32 %78, %79
%81 = load %struct.TYPE_7__*, %struct.TYPE_7__** %22
%82 = load i32, i32* %27
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %81, i64 %83
%85 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %84, i32 0, i32 0
store i32 %80, i32* %85
%86 = load i32, i32* %16
%87 = sitofp i32 %86 to float
%88 = load i32, i32* %27
%89 = sitofp i32 %88 to float
%90 = load float, float* %29
%91 = call float @llvm.fmuladd.f32(float %89, float %90, float %87)
%92 = fptosi float %91 to i32
%93 = load float, float* %17
%94 = load i32, i32* %27
%95 = sitofp i32 %94 to float
%96 = load float, float* %30
%97 = call float @llvm.fmuladd.f32(float %95, float %96, float %93)
%98 = load float, float* %18
%99 = load i32, i32* %27
%100 = sitofp i32 %99 to float
%101 = load float, float* %31
%102 = call float @llvm.fmuladd.f32(float %100, float %101, float %98)
%103 = load %struct.TYPE_7__*, %struct.TYPE_7__** %22
%104 = load i32, i32* %27
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %103, i64 %105
%107 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %106, i32 0, i32 4
%108 = load %struct.TYPE_7__*, %struct.TYPE_7__** %22
%109 = load i32, i32* %27
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %108, i64 %110
%112 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %111, i32 0, i32 3
%113 = load %struct.TYPE_7__*, %struct.TYPE_7__** %22
%114 = load i32, i32* %27
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %113, i64 %115
%117 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %116, i32 0, i32 2
%118 = call i32 @hsv_to_rgb(i32 %92, float %97, float %102, i32* %107, i32* %112, i32* %117)
br label %119
119: ; preds = %75
%120 = load i32, i32* %27
%121 = add nsw i32 %120, 1
store i32 %121, i32* %27
br label %71
122: ; preds = %71
%123 = load i64, i64* %24
%124 = icmp ne i64 %123, 0
br i1 %124, label %125, label %150
125: ; preds = %122
%126 = load i32, i32* %28
store i32 %126, i32* %27
br label %127
127: ; preds = %146, %125
%128 = load i32, i32* %27
%129 = load i32*, i32** %23
%130 = load i32, i32* %129
%131 = icmp slt i32 %128, %130
br i1 %131, label %132, label %149
132: ; preds = %127
%133 = load %struct.TYPE_7__*, %struct.TYPE_7__** %22
%134 = load i32, i32* %27
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %133, i64 %135
%137 = load %struct.TYPE_7__*, %struct.TYPE_7__** %22
%138 = load i32*, i32** %23
%139 = load i32, i32* %138
%140 = load i32, i32* %27
%141 = sub nsw i32 %139, %140
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %137, i64 %142
%144 = bitcast %struct.TYPE_7__* %136 to i8*
%145 = bitcast %struct.TYPE_7__* %143 to i8*
br label %146
146: ; preds = %132
%147 = load i32, i32* %27
%148 = add nsw i32 %147, 1
store i32 %148, i32* %27
br label %127
149: ; preds = %127
br label %150
150: ; preds = %149, %122
%151 = load i64, i64* %25
%152 = icmp ne i64 %151, 0
br i1 %152, label %154, label %153
153: ; preds = %150
br label %297
154: ; preds = %150
%155 = load i64, i64* %26
%156 = icmp ne i64 %155, 0
br i1 %156, label %157, label %206
157: ; preds = %154
%158 = load i32*, i32** %23
%159 = load i32, i32* %158
%160 = add nsw i32 %159, 1
%161 = sext i32 %160 to i64
%162 = mul i64 8, %161
%163 = trunc i64 %162 to i32
%164 = call i64 @malloc(i32 %163)
%165 = inttoptr i64 %164 to i64*
store i64* %165, i64** %32
%166 = load i32*, i32** %14
%167 = load i32, i32* %15
%168 = load i32, i32* @False
%169 = load i64*, i64** %32
%170 = load i32*, i32** %23
%171 = load i32, i32* %170
%172 = call i32 @XAllocColorCells(i32* %166, i32 %167, i32 %168, i32 0, i32 0, i64* %169, i32 %171)
%173 = icmp ne i32 %172, 0
br i1 %173, label %177, label %174
174: ; preds = %157
%175 = load i64*, i64** %32
%176 = call i32 @free(i64* %175)
br label %243
177: ; preds = %157
store i32 0, i32* %27
br label %178
178: ; preds = %194, %177
%179 = load i32, i32* %27
%180 = load i32*, i32** %23
%181 = load i32, i32* %180
%182 = icmp slt i32 %179, %181
br i1 %182, label %183, label %197
183: ; preds = %178
%184 = load i64*, i64** %32
%185 = load i32, i32* %27
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds i64, i64* %184, i64 %186
%188 = load i64, i64* %187
%189 = load %struct.TYPE_7__*, %struct.TYPE_7__** %22
%190 = load i32, i32* %27
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %189, i64 %191
%193 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %192, i32 0, i32 1
store i64 %188, i64* %193
br label %194
194: ; preds = %183
%195 = load i32, i32* %27
%196 = add nsw i32 %195, 1
store i32 %196, i32* %27
br label %178
197: ; preds = %178
%198 = load i64*, i64** %32
%199 = call i32 @free(i64* %198)
%200 = load i32*, i32** %14
%201 = load i32, i32* %15
%202 = load %struct.TYPE_7__*, %struct.TYPE_7__** %22
%203 = load i32*, i32** %23
%204 = load i32, i32* %203
%205 = call i32 @XStoreColors(i32* %200, i32 %201, %struct.TYPE_7__* %202, i32 %204)
br label %242
206: ; preds = %154
store i32 0, i32* %27
br label %207
207: ; preds = %238, %206
%208 = load i32, i32* %27
%209 = load i32*, i32** %23
%210 = load i32, i32* %209
%211 = icmp slt i32 %208, %210
br i1 %211, label %212, label %241
212: ; preds = %207
%213 = load %struct.TYPE_7__*, %struct.TYPE_7__** %22
%214 = load i32, i32* %27
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %213, i64 %215
%217 = bitcast %struct.TYPE_7__* %33 to i8*
%218 = bitcast %struct.TYPE_7__* %216 to i8*
%219 = load i32*, i32** %14
%220 = load i32, i32* %15
%221 = call i64 @XAllocColor(i32* %219, i32 %220, %struct.TYPE_7__* %33)
%222 = icmp ne i64 %221, 0
br i1 %222, label %223, label %231
223: ; preds = %212
%224 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %33, i32 0, i32 1
%225 = load i64, i64* %224
%226 = load %struct.TYPE_7__*, %struct.TYPE_7__** %22
%227 = load i32, i32* %27
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %226, i64 %228
%230 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %229, i32 0, i32 1
store i64 %225, i64* %230
br label %237
231: ; preds = %212
%232 = load i32*, i32** %14
%233 = load i32, i32* %15
%234 = load %struct.TYPE_7__*, %struct.TYPE_7__** %22
%235 = load i32, i32* %27
%236 = call i32 @free_colors(i32* %232, i32 %233, %struct.TYPE_7__* %234, i32 %235)
br label %243
237: ; preds = %223
br label %238
238: ; preds = %237
%239 = load i32, i32* %27
%240 = add nsw i32 %239, 1
store i32 %240, i32* %27
br label %207
241: ; preds = %207
br label %242
242: ; preds = %241, %197
br label %297
243: ; preds = %231, %174
%244 = load i32, i32* %28
%245 = icmp sgt i32 %244, 170
br i1 %245, label %246, label %249
246: ; preds = %243
%247 = load i32, i32* %28
%248 = sub nsw i32 %247, 20
br label %290
249: ; preds = %243
%250 = load i32, i32* %28
%251 = icmp sgt i32 %250, 100
br i1 %251, label %252, label %255
252: ; preds = %249
%253 = load i32, i32* %28
%254 = sub nsw i32 %253, 10
br label %288
255: ; preds = %249
%256 = load i32, i32* %28
%257 = icmp sgt i32 %256, 75
br i1 %257, label %258, label %261
258: ; preds = %255
%259 = load i32, i32* %28
%260 = sub nsw i32 %259, 5
br label %286
261: ; preds = %255
%262 = load i32, i32* %28
%263 = icmp sgt i32 %262, 25
br i1 %263, label %264, label %267
264: ; preds = %261
%265 = load i32, i32* %28
%266 = sub nsw i32 %265, 3
br label %284
267: ; preds = %261
%268 = load i32, i32* %28
%269 = icmp sgt i32 %268, 10
br i1 %269, label %270, label %273
270: ; preds = %267
%271 = load i32, i32* %28
%272 = sub nsw i32 %271, 2
br label %282
273: ; preds = %267
%274 = load i32, i32* %28
%275 = icmp sgt i32 %274, 2
br i1 %275, label %276, label %279
276: ; preds = %273
%277 = load i32, i32* %28
%278 = sub nsw i32 %277, 1
br label %280
279: ; preds = %273
br label %280
280: ; preds = %279, %276
%281 = phi i32 [ %278, %276 ], [ 0, %279 ]
br label %282
282: ; preds = %280, %270
%283 = phi i32 [ %272, %270 ], [ %281, %280 ]
br label %284
284: ; preds = %282, %264
%285 = phi i32 [ %266, %264 ], [ %283, %282 ]
br label %286
286: ; preds = %284, %258
%287 = phi i32 [ %260, %258 ], [ %285, %284 ]
br label %288
288: ; preds = %286, %252
%289 = phi i32 [ %254, %252 ], [ %287, %286 ]
br label %290
290: ; preds = %288, %246
%291 = phi i32 [ %248, %246 ], [ %289, %288 ]
store i32 %291, i32* %28
%292 = load i32, i32* %28
%293 = load i32*, i32** %23
store i32 %292, i32* %293
%294 = load i32, i32* %28
%295 = icmp sgt i32 %294, 0
br i1 %295, label %296, label %297
296: ; preds = %290
br label %36
297: ; preds = %153, %242, %290
ret void
}

LLVM IR (-O2):
%struct.TYPE_7__ = type { i32, i64, i32, i32, i32 }
@DoRed = global i32 0
@DoGreen = global i32 0
@DoBlue = global i32 0
@False = global i32 0
define void @make_color_ramp(i32* %0, i32 %1, i32 %2, float %3, float %4, i32 %5, float %6, float %7, %struct.TYPE_7__* %8, i32* nocapture %9, i64 %10, i64 %11, i64 %12) {
%14 = alloca %struct.TYPE_7__
%15 = load i32, i32* %9
%16 = icmp eq i64 %10, 0
%17 = sitofp i32 %5 to float
%18 = sitofp i32 %2 to float
%19 = fsub float %17, %18
%20 = fsub float %6, %3
%21 = fsub float %7, %4
%22 = icmp eq i64 %11, 0
%23 = icmp eq i64 %12, 0
%24 = bitcast %struct.TYPE_7__* %14 to i8*
%25 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %14, i64 0, i32 1
br label %26
26: ; preds = %185, %13
%27 = phi i32 [ %15, %13 ], [ %186, %185 ]
%28 = shl i32 %27, 5
%29 = call i32 @memset(%struct.TYPE_7__* %8, i32 0, i32 %28)
br i1 %16, label %33, label %30
30: ; preds = %26
%31 = sdiv i32 %27, 2
%32 = add nsw i32 %31, 1
br label %33
33: ; preds = %30, %26
%34 = phi i32 [ %32, %30 ], [ %27, %26 ]
%35 = sitofp i32 %34 to float
%36 = fdiv float %19, %35
%37 = fdiv float %20, %35
%38 = fdiv float %21, %35
%39 = icmp sgt i32 %34, 0
br i1 %39, label %40, label %62
40: ; preds = %33
%41 = zext i32 %34 to i64
br label %42
42: ; preds = %40, %42
%43 = phi i64 [ 0, %40 ], [ %60, %42 ]
%44 = load i32, i32* @DoRed
%45 = load i32, i32* @DoGreen
%46 = or i32 %45, %44
%47 = load i32, i32* @DoBlue
%48 = or i32 %46, %47
%49 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %8, i64 %43, i32 0
store i32 %48, i32* %49
%50 = trunc i64 %43 to i32
%51 = sitofp i32 %50 to float
%52 = call float @llvm.fmuladd.f32(float %51, float %36, float %18)
%53 = fptosi float %52 to i32
%54 = call float @llvm.fmuladd.f32(float %51, float %37, float %3)
%55 = call float @llvm.fmuladd.f32(float %51, float %38, float %4)
%56 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %8, i64 %43, i32 4
%57 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %8, i64 %43, i32 3
%58 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %8, i64 %43, i32 2
%59 = call i32 @hsv_to_rgb(i32 %53, float %54, float %55, i32* %56, i32* %57, i32* %58)
%60 = add nuw nsw i64 %43, 1
%61 = icmp eq i64 %60, %41
br i1 %61, label %62, label %42
62: ; preds = %42, %33
br i1 %16, label %81, label %63
63: ; preds = %62
%64 = load i32, i32* %9
%65 = icmp sgt i32 %64, %34
br i1 %65, label %66, label %81
66: ; preds = %63
%67 = sext i32 %34 to i64
br label %68
68: ; preds = %66, %68
%69 = phi i64 [ %67, %66 ], [ %77, %68 ]
%70 = phi i32 [ %64, %66 ], [ %78, %68 ]
%71 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %8, i64 %69
%72 = sext i32 %70 to i64
%73 = sub nsw i64 %72, %69
%74 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %8, i64 %73
%75 = bitcast %struct.TYPE_7__* %71 to i8*
%76 = bitcast %struct.TYPE_7__* %74 to i8*
%77 = add nsw i64 %69, 1
%78 = load i32, i32* %9
%79 = sext i32 %78 to i64
%80 = icmp slt i64 %77, %79
br i1 %80, label %68, label %81
81: ; preds = %68, %63, %62
br i1 %22, label %187, label %82
82: ; preds = %81
%83 = load i32, i32* %9
br i1 %23, label %84, label %86
84: ; preds = %82
%85 = icmp sgt i32 %83, 0
br i1 %85, label %145, label %187
86: ; preds = %82
%87 = shl i32 %83, 3
%88 = add i32 %87, 8
%89 = call i64 @malloc(i32 %88)
%90 = inttoptr i64 %89 to i64*
%91 = load i32, i32* @False
%92 = load i32, i32* %9
%93 = call i32 @XAllocColorCells(i32* %0, i32 %1, i32 %91, i32 0, i32 0, i64* %90, i32 %92)
%94 = icmp eq i32 %93, 0
br i1 %94, label %106, label %95
95: ; preds = %86
%96 = inttoptr i64 %89 to i64*
%97 = load i32, i32* %9
%98 = icmp sgt i32 %97, 0
br i1 %98, label %99, label %141
99: ; preds = %95
%100 = zext i32 %97 to i64
%101 = add nsw i64 %100, -1
%102 = and i64 %100, 3
%103 = icmp ult i64 %101, 3
br i1 %103, label %129, label %104
104: ; preds = %99
%105 = and i64 %100, 4294967292
br label %108
106: ; preds = %86
%107 = call i32 @free(i64* %90)
br label %161
108: ; preds = %108, %104
%109 = phi i64 [ 0, %104 ], [ %126, %108 ]
%110 = phi i64 [ 0, %104 ], [ %127, %108 ]
%111 = getelementptr inbounds i64, i64* %96, i64 %109
%112 = load i64, i64* %111
%113 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %8, i64 %109, i32 1
store i64 %112, i64* %113
%114 = or i64 %109, 1
%115 = getelementptr inbounds i64, i64* %96, i64 %114
%116 = load i64, i64* %115
%117 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %8, i64 %114, i32 1
store i64 %116, i64* %117
%118 = or i64 %109, 2
%119 = getelementptr inbounds i64, i64* %96, i64 %118
%120 = load i64, i64* %119
%121 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %8, i64 %118, i32 1
store i64 %120, i64* %121
%122 = or i64 %109, 3
%123 = getelementptr inbounds i64, i64* %96, i64 %122
%124 = load i64, i64* %123
%125 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %8, i64 %122, i32 1
store i64 %124, i64* %125
%126 = add nuw nsw i64 %109, 4
%127 = add i64 %110, 4
%128 = icmp eq i64 %127, %105
br i1 %128, label %129, label %108
129: ; preds = %108, %99
%130 = phi i64 [ 0, %99 ], [ %126, %108 ]
%131 = icmp eq i64 %102, 0
br i1 %131, label %141, label %132
132: ; preds = %129, %132
%133 = phi i64 [ %138, %132 ], [ %130, %129 ]
%134 = phi i64 [ %139, %132 ], [ 0, %129 ]
%135 = getelementptr inbounds i64, i64* %96, i64 %133
%136 = load i64, i64* %135
%137 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %8, i64 %133, i32 1
store i64 %136, i64* %137
%138 = add nuw nsw i64 %133, 1
%139 = add i64 %134, 1
%140 = icmp eq i64 %139, %102
br i1 %140, label %141, label %132
141: ; preds = %129, %132, %95
%142 = call i32 @free(i64* %96)
%143 = load i32, i32* %9
%144 = call i32 @XStoreColors(i32* %0, i32 %1, %struct.TYPE_7__* %8, i32 %143)
br label %187
145: ; preds = %84, %154
%146 = phi i64 [ %157, %154 ], [ 0, %84 ]
%147 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %8, i64 %146
%148 = bitcast %struct.TYPE_7__* %147 to i8*
%149 = call i64 @XAllocColor(i32* %0, i32 %1, %struct.TYPE_7__* %14)
%150 = icmp eq i64 %149, 0
br i1 %150, label %151, label %154
151: ; preds = %145
%152 = trunc i64 %146 to i32
%153 = call i32 @free_colors(i32* %0, i32 %1, %struct.TYPE_7__* %8, i32 %152)
br label %161
154: ; preds = %145
%155 = load i64, i64* %25
%156 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %8, i64 %146, i32 1
store i64 %155, i64* %156
%157 = add nuw nsw i64 %146, 1
%158 = load i32, i32* %9
%159 = sext i32 %158 to i64
%160 = icmp slt i64 %157, %159
br i1 %160, label %145, label %187
161: ; preds = %151, %106
%162 = icmp sgt i32 %34, 170
br i1 %162, label %163, label %165
163: ; preds = %161
%164 = add nsw i32 %34, -20
br label %185
165: ; preds = %161
%166 = icmp sgt i32 %34, 100
br i1 %166, label %167, label %169
167: ; preds = %165
%168 = add nsw i32 %34, -10
br label %185
169: ; preds = %165
%170 = icmp sgt i32 %34, 75
br i1 %170, label %171, label %173
171: ; preds = %169
%172 = add nsw i32 %34, -5
br label %185
173: ; preds = %169
%174 = icmp sgt i32 %34, 25
br i1 %174, label %175, label %177
175: ; preds = %173
%176 = add nsw i32 %34, -3
br label %185
177: ; preds = %173
%178 = icmp sgt i32 %34, 10
br i1 %178, label %179, label %181
179: ; preds = %177
%180 = add nsw i32 %34, -2
br label %185
181: ; preds = %177
%182 = icmp sgt i32 %34, 2
%183 = add nsw i32 %34, -1
br i1 %182, label %185, label %184
184: ; preds = %181
store i32 0, i32* %9
br label %187
185: ; preds = %181, %167, %175, %179, %171, %163
%186 = phi i32 [ %164, %163 ], [ %168, %167 ], [ %172, %171 ], [ %176, %175 ], [ %180, %179 ], [ %183, %181 ]
store i32 %186, i32* %9
br label %26
187: ; preds = %81, %84, %154, %184, %141
ret void
}