#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 */

/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int floor(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char, unsigned char);
int /*<<< orphan*/ rainbow(int, double, int, double *, double *, double *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int32_t *texture_gen(char *mapstr, int saturation_lvls, int texture_size,
                     int black_border) {
  unsigned char r, g, b, *obuf;
  r = g = b = 0;
  int invert = 0, map, ncolors = texture_size, tx, x, y, ihue;
  int32_t *texture;
  double hue, oldhue, sat, oldsat, red, green, blue, h;
  if (!strncmp("inverse ", mapstr, 8)) {
    invert = 1;
    mapstr += 8;
  }
  if (!strcmp("rainbow", mapstr))
    map = 1;
  else if (!strcmp("gray", mapstr) || !strcmp("grey", mapstr))
    map = 2;
  else if (!strcmp("terrain", mapstr) || !strcmp("topo", mapstr))
    map = 3;
  else if (!strcmp("iron", mapstr) || !strcmp("heated", mapstr) ||
           !strncmp("hot", mapstr, 3))
    map = 4;
  else if (!strcmp("astro", mapstr))
    map = 5;
  else if (!strncmp("alt", mapstr, 3) || !strcmp("zebra", mapstr))
    map = 6;
  else if (!strcmp("mgreen", mapstr))
    map = 11;
  else if (!strcmp("red", mapstr))
    map = 12;
  else if (!strcmp("green", mapstr))
    map = 13;
  else if (!strcmp("blue", mapstr))
    map = 14;
  else if (!strcmp("yellow", mapstr))
    map = 15;
  else if (!strcmp("cyan", mapstr))
    map = 16;
  else if (!strcmp("magenta", mapstr))
    map = 17;
  else {
    fprintf(stderr, "Unknown colormap - installing grey map\n");
    map = 2;
  }
  texture = (int32_t *)malloc(texture_size * saturation_lvls * sizeof(int32_t));
  oldhue = -1;
  oldsat = -1;
  for (y = 0; y < saturation_lvls; y++) {
    obuf = (unsigned char *)(texture + y * texture_size);
    sat = y / (saturation_lvls - 1.);
    if (sat > 0.99)
      sat = 0.99;
    if (oldsat != sat) {
      for (x = 0, tx = 0; x < texture_size; x++, tx += 4) {
        hue = (x - black_border) / (texture_size - 2 * black_border - 1.);
        ihue = floor(ncolors * hue);
        hue = ((double)ihue) / (ncolors - 1);
        if (hue > 1.)
          hue = 1.;
        if (invert)
          hue = 1. - hue;
        if (x < black_border || x >= texture_size - black_border) {
          r = 0;
          g = 0;
          b = 0;
        } else if (oldhue != hue) {
          switch (map) {
          case 1:
            rainbow(1. - hue, sat, 1., &red, &green, &blue);
            break;
          case 2:
            red = hue;
            green = hue;
            blue = hue;
            break;
          case 3:
            h = 3 * hue;
            if (h < .25) {
              red = 0;
              green = 0;
              blue = 0.25 + 2 * h;
            } else if (h < 2) {
              red = 0;
              green = 0.25 + (2 - h);
              blue = 0;
            } else if (h < 2.7) {
              red = .75;
              green = .15;
              blue = .0;
            } else {
              red = .9;
              green = .9;
              blue = .9;
            }
            break;
          case 4:
            red = 3 * (hue + .03);
            green = 3 * (hue - .333333);
            blue = 3 * (hue - .666667);
            break;
          case 5:
            red = hue;
            green = hue;
            blue = (hue + .2) / 1.2;
            break;
          case 6:
            red = (ihue + invert) % 2;
            green = red;
            blue = red;
            break;
          case 11:
            red = 3 * (hue - .333333);
            green = 3 * (hue + 0.03);
            blue = 3 * (hue - .66667);
            break;
          case 12:
            red = hue;
            green = 0.;
            blue = 0.;
            break;
          case 13:
            red = 0.;
            green = hue;
            blue = 0.;
            break;
          case 14:
            red = 0.;
            green = 0.;
            blue = hue;
            break;
          case 15:
            red = hue;
            green = hue;
            blue = 0.;
            break;
          case 16:
            red = 0.;
            green = hue;
            blue = hue;
            break;
          case 17:
            red = hue;
            green = 0.;
            blue = hue;
            break;
          }
          if (red > 1.)
            red = 1.;
          if (green > 1.)
            green = 1.;
          if (blue > 1.)
            blue = 1.;
          if (red < 0.)
            red = 0.;
          if (green < 0.)
            green = 0.;
          if (blue < 0.)
            blue = 0.;
          r = 255 * red;
          g = 255 * green;
          b = 255 * blue;
          oldhue = hue;
          if (sat == 1.)
            printf("# %.2g %.2g %.2g\n", r / 255., g / 255., b / 255.);
        }
        obuf[tx + 0] = r;
        obuf[tx + 1] = g;
        obuf[tx + 2] = b;
        obuf[tx + 3] = 0;
      }
    }
    oldsat = sat;
  }
  return texture;
}


x86 assembly (clang, -O0):
<texture_gen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movb   $0x0,-0x17(%rbp)
movb   $0x0,-0x16(%rbp)
movb   $0x0,-0x15(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xf20(%rip),%rdi
mov    $0x8,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11d2 <texture_gen+0x62>
movl   $0x1,-0x24(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xef8(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    11f7 <texture_gen+0x87>
movl   $0x1,-0x28(%rbp)
jmp    1492 <texture_gen+0x322>
mov    -0x8(%rbp),%rsi
lea    0xedb(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     1229 <texture_gen+0xb9>
mov    -0x8(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1235 <texture_gen+0xc5>
movl   $0x2,-0x28(%rbp)
jmp    148d <texture_gen+0x31d>
mov    -0x8(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     1267 <texture_gen+0xf7>
mov    -0x8(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1273 <texture_gen+0x103>
movl   $0x3,-0x28(%rbp)
jmp    1488 <texture_gen+0x318>
mov    -0x8(%rbp),%rsi
lea    0xe76(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     12c3 <texture_gen+0x153>
mov    -0x8(%rbp),%rsi
lea    0xe62(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     12c3 <texture_gen+0x153>
mov    -0x8(%rbp),%rsi
lea    0xe50(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    12cf <texture_gen+0x15f>
movl   $0x4,-0x28(%rbp)
jmp    1483 <texture_gen+0x313>
mov    -0x8(%rbp),%rsi
lea    0xe2a(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12f4 <texture_gen+0x184>
movl   $0x5,-0x28(%rbp)
jmp    147e <texture_gen+0x30e>
mov    -0x8(%rbp),%rsi
lea    0xe0b(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     132b <texture_gen+0x1bb>
mov    -0x8(%rbp),%rsi
lea    0xdf1(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1337 <texture_gen+0x1c7>
movl   $0x6,-0x28(%rbp)
jmp    1479 <texture_gen+0x309>
mov    -0x8(%rbp),%rsi
lea    0xdd2(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    135c <texture_gen+0x1ec>
movl   $0xb,-0x28(%rbp)
jmp    1474 <texture_gen+0x304>
mov    -0x8(%rbp),%rsi
lea    0xdb4(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1381 <texture_gen+0x211>
movl   $0xc,-0x28(%rbp)
jmp    146f <texture_gen+0x2ff>
mov    -0x8(%rbp),%rsi
lea    0xd89(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    13a6 <texture_gen+0x236>
movl   $0xd,-0x28(%rbp)
jmp    146a <texture_gen+0x2fa>
mov    -0x8(%rbp),%rsi
lea    0xd6e(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    13cb <texture_gen+0x25b>
movl   $0xe,-0x28(%rbp)
jmp    1465 <texture_gen+0x2f5>
mov    -0x8(%rbp),%rsi
lea    0xd4e(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    13f0 <texture_gen+0x280>
movl   $0xf,-0x28(%rbp)
jmp    1460 <texture_gen+0x2f0>
mov    -0x8(%rbp),%rsi
lea    0xd30(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1415 <texture_gen+0x2a5>
movl   $0x10,-0x28(%rbp)
jmp    145b <texture_gen+0x2eb>
mov    -0x8(%rbp),%rsi
lea    0xd10(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    143a <texture_gen+0x2ca>
movl   $0x11,-0x28(%rbp)
jmp    1456 <texture_gen+0x2e6>
mov    0x2b9f(%rip),%rax
mov    (%rax),%edi
lea    0xcee(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x2,-0x28(%rbp)
jmp    145b <texture_gen+0x2eb>
jmp    1460 <texture_gen+0x2f0>
jmp    1465 <texture_gen+0x2f5>
jmp    146a <texture_gen+0x2fa>
jmp    146f <texture_gen+0x2ff>
jmp    1474 <texture_gen+0x304>
jmp    1479 <texture_gen+0x309>
jmp    147e <texture_gen+0x30e>
jmp    1483 <texture_gen+0x313>
jmp    1488 <texture_gen+0x318>
jmp    148d <texture_gen+0x31d>
jmp    1492 <texture_gen+0x322>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x48(%rbp)
movsd  0xb4e(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xb41(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1bc2 <texture_gen+0xa52>
mov    -0x48(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   -0x10(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
cvtsi2sdl -0x38(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xb0e(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xaec(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1533 <texture_gen+0x3c3>
movsd  0xada(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x68(%rbp),%xmm0
ucomisd -0x60(%rbp),%xmm0
jne    154e <texture_gen+0x3de>
jp     154e <texture_gen+0x3de>
jmp    1baa <texture_gen+0xa3a>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1ba5 <texture_gen+0xa35>
mov    -0x34(%rbp),%eax
sub    -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xa87(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
cvtsi2sdl -0x2c(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1090 <floor@plt>
mov    %eax,-0x3c(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm0
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0xa3f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    15e8 <texture_gen+0x478>
movsd  0xa2d(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1604 <texture_gen+0x494>
movsd  0xa16(%rip),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1621 <texture_gen+0x4b1>
mov    -0x34(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jl     1632 <texture_gen+0x4c2>
movb   $0x0,-0x15(%rbp)
movb   $0x0,-0x16(%rbp)
movb   $0x0,-0x17(%rbp)
jmp    1b44 <texture_gen+0x9d4>
movsd  -0x58(%rbp),%xmm0
ucomisd -0x50(%rbp),%xmm0
jne    164d <texture_gen+0x4dd>
jp     164d <texture_gen+0x4dd>
jmp    1b3f <texture_gen+0x9cf>
mov    -0x28(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x90(%rbp)
sub    $0x10,%eax
ja     19dc <texture_gen+0x86c>
mov    -0x90(%rbp),%rax
lea    0xa15(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  0x98c(%rip),%xmm0
subsd  -0x50(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x60(%rbp),%xmm0
mov    $0x1,%esi
lea    -0x70(%rbp),%rdx
lea    -0x78(%rbp),%rcx
lea    -0x80(%rbp),%r8
call   1050 <rainbow@plt>
jmp    19dc <texture_gen+0x86c>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    19dc <texture_gen+0x86c>
movsd  0x940(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0x963(%rip),%xmm0
ucomisd -0x88(%rbp),%xmm0
ff
jbe    172d <texture_gen+0x5bd>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
addsd  %xmm0,%xmm0
movsd  0x931(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    17e7 <texture_gen+0x677>
movsd  0x923(%rip),%xmm0
ucomisd -0x88(%rbp),%xmm0
ff
jbe    1779 <texture_gen+0x609>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0x905(%rip),%xmm1
subsd  -0x88(%rbp),%xmm1
ff
movsd  0x8ed(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    17e2 <texture_gen+0x672>
movsd  0x8df(%rip),%xmm0
ucomisd -0x88(%rbp),%xmm0
ff
jbe    17b6 <texture_gen+0x646>
movsd  0x8e1(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0x8cc(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    17dd <texture_gen+0x66d>
movsd  0x8aa(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0x89d(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0x890(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    17e2 <texture_gen+0x672>
jmp    17e7 <texture_gen+0x677>
jmp    19dc <texture_gen+0x86c>
movsd  0x834(%rip),%xmm1
addsd  -0x50(%rbp),%xmm1
movsd  0x817(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  0x819(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0x7f5(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  0x80f(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0x7d3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    19dc <texture_gen+0x86c>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0x7d1(%rip),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  0x7bc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    19dc <texture_gen+0x86c>
mov    -0x3c(%rbp),%eax
add    -0x24(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    19dc <texture_gen+0x86c>
movsd  -0x50(%rbp),%xmm1
movsd  0x769(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0x745(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0x744(%rip),%xmm1
addsd  -0x50(%rbp),%xmm1
movsd  0x727(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  0x719(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0x705(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    19dc <texture_gen+0x86c>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    19dc <texture_gen+0x86c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    19dc <texture_gen+0x86c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    19dc <texture_gen+0x86c>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    19dc <texture_gen+0x86c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    19dc <texture_gen+0x86c>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  0x627(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1a00 <texture_gen+0x890>
movsd  0x615(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  0x603(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1a24 <texture_gen+0x8b4>
movsd  0x5f1(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  0x5df(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1a48 <texture_gen+0x8d8>
movsd  0x5cd(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    1a5e <texture_gen+0x8ee>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x78(%rbp),%xmm0
jbe    1a74 <texture_gen+0x904>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x80(%rbp),%xmm0
jbe    1a8a <texture_gen+0x91a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  0x5e9(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %al,-0x15(%rbp)
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %al,-0x16(%rbp)
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %al,-0x17(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0x537(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1b3a <texture_gen+0x9ca>
jp     1b3a <texture_gen+0x9ca>
movzbl -0x15(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0x587(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %al,%dl
movzbl -0x16(%rbp),%eax
cvtsi2sd %eax,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %al,%cl
movzbl -0x17(%rbp),%eax
cvtsi2sd %eax,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
lea    0x634(%rip),%rdi
movzbl %dl,%esi
movzbl %cl,%edx
movzbl %al,%ecx
call   1040 <printf@plt>
jmp    1b3f <texture_gen+0x9cf>
jmp    1b44 <texture_gen+0x9d4>
mov    -0x15(%rbp),%dl
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x16(%rbp),%dl
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x17(%rbp),%dl
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x30(%rbp)
jmp    155c <texture_gen+0x3ec>
jmp    1baa <texture_gen+0xa3a>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    14cb <texture_gen+0x35b>
mov    -0x48(%rbp),%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<texture_gen>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rcx,0x48(%rsp)
mov    %rdx,0x28(%rsp)
mov    %esi,%ebp
mov    %rdi,%r12
lea    0xf3d(%rip),%rdi
mov    %r12,%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
mov    %eax,0x3c(%rsp)
test   %eax,%eax
sete   %cl
mov    %rcx,0x50(%rsp)
lea    (%r12,%rcx,8),%r12
lea    0xf1e(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1390 <texture_gen+0x220>
lea    0xf0f(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
mov    $0x2,%ebx
test   %eax,%eax
je     1395 <texture_gen+0x225>
lea    0xef8(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1395 <texture_gen+0x225>
lea    0xee6(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
mov    $0x3,%ebx
test   %eax,%eax
je     1395 <texture_gen+0x225>
lea    0xed2(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1395 <texture_gen+0x225>
lea    0xec0(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
mov    $0x4,%ebx
test   %eax,%eax
je     1395 <texture_gen+0x225>
lea    0xea9(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1395 <texture_gen+0x225>
lea    0xe99(%rip),%rdi
mov    %r12,%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1395 <texture_gen+0x225>
lea    0xe81(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     19f2 <texture_gen+0x882>
lea    0xe70(%rip),%rdi
mov    %r12,%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
mov    $0x6,%ebx
test   %eax,%eax
je     1395 <texture_gen+0x225>
lea    0xe53(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1395 <texture_gen+0x225>
lea    0xe42(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     19fc <texture_gen+0x88c>
lea    0xe32(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1a06 <texture_gen+0x896>
lea    0xe15(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1a10 <texture_gen+0x8a0>
lea    0xe08(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1a1a <texture_gen+0x8aa>
lea    0xdf6(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1a24 <texture_gen+0x8b4>
lea    0xde6(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1a2e <texture_gen+0x8be>
lea    0xdd4(%rip),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1a38 <texture_gen+0x8c8>
mov    0x2c65(%rip),%rax
mov    (%rax),%edi
lea    0xdbc(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x2,%ebx
jmp    1395 <texture_gen+0x225>
mov    $0x1,%ebx
mov    %rbx,0x30(%rsp)
mov    %ebp,%edi
imul   0x28(%rsp),%edi
shl    $0x2,%edi
call   1080 <malloc@plt>
mov    %rax,0x40(%rsp)
test   %ebp,%ebp
jle    19db <texture_gen+0x86b>
cvtsi2sd %ebp,%xmm0
movsd  0xc3e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x68(%rsp)
mov    0x48(%rsp),%rbx
mov    0x28(%rsp),%rdx
mov    %edx,%ecx
sub    %ebx,%ecx
sub    %ebx,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x90(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
movsd  %xmm0,0x88(%rsp)
lea    -0x1(%rdx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x80(%rsp)
mov    %edx,%eax
sub    %ebx,%eax
mov    %eax,0x38(%rsp)
movslq %edx,%rax
mov    %ebp,%ecx
mov    %rcx,0x60(%rsp)
mov    0x40(%rsp),%r14
add    $0x3,%r14
lea    0x0(,%rax,4),%rcx
mov    %rcx,0x58(%rsp)
mov    %eax,%eax
mov    %rax,0x78(%rsp)
neg    %ebx
xor    %ecx,%ecx
mov    0x30(%rsp),%rax
add    $0xffffffff,%eax
mov    %rax,0x30(%rsp)
xor    %ebp,%ebp
xor    %r15d,%r15d
xor    %r12d,%r12d
movsd  %xmm1,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
jmp    1489 <texture_gen+0x319>
nopl   0x0(%rax)
mov    0x70(%rsp),%rcx
add    $0x1,%rcx
add    0x58(%rsp),%r14
cmp    0x60(%rsp),%rcx
je     19db <texture_gen+0x86b>
movsd  0x20(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
divsd  0x68(%rsp),%xmm1
movsd  0xb64(%rip),%xmm2
minsd  %xmm1,%xmm2
movsd  %xmm2,0x20(%rsp)
ucomisd %xmm2,%xmm0
mov    %rcx,0x70(%rsp)
jne    14bb <texture_gen+0x34b>
jnp    1470 <texture_gen+0x300>
cmpl   $0x0,0x28(%rsp)
jle    1470 <texture_gen+0x300>
xor    %r13d,%r13d
jmp    14fb <texture_gen+0x38b>
nopw   0x0(%rax,%rax,1)
xor    %r12d,%r12d
xor    %r15d,%r15d
xor    %ebp,%ebp
mov    %bpl,-0x3(%r14,%r13,4)
mov    %r15b,-0x2(%r14,%r13,4)
mov    %r12b,-0x1(%r14,%r13,4)
movb   $0x0,(%r14,%r13,4)
add    $0x1,%r13
cmp    %r13d,0x78(%rsp)
je     1470 <texture_gen+0x300>
lea    (%rbx,%r13,1),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0x90(%rsp),%xmm0
mulsd  0x88(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1090 <floor@plt>
movsd  0xae7(%rip),%xmm4
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0x80(%rsp),%xmm0
movapd %xmm4,%xmm5
minsd  %xmm0,%xmm5
cmpl   $0x0,0x3c(%rsp)
jne    1554 <texture_gen+0x3e4>
movapd %xmm4,%xmm0
subsd  %xmm5,%xmm0
movapd %xmm0,%xmm5
cmp    0x48(%rsp),%r13d
jl     14d0 <texture_gen+0x360>
cmp    0x38(%rsp),%r13d
jge    14d0 <texture_gen+0x360>
movsd  0x18(%rsp),%xmm0
ucomisd %xmm5,%xmm0
jne    157c <texture_gen+0x40c>
jnp    14d8 <texture_gen+0x368>
mov    0x30(%rsp),%rcx
cmp    $0x10,%ecx
ja     1730 <texture_gen+0x5c0>
lea    0xaff(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
movapd %xmm4,%xmm0
subsd  %xmm5,%xmm0
cvttsd2si %xmm0,%edi
movsd  0x20(%rsp),%xmm0
mov    $0x1,%esi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rsp,%r8
movsd  %xmm5,0x18(%rsp)
call   1050 <rainbow@plt>
movsd  0x18(%rsp),%xmm5
movsd  0xa39(%rip),%xmm4
jmp    1730 <texture_gen+0x5c0>
movsd  %xmm5,0x10(%rsp)
movsd  %xmm5,0x8(%rsp)
jmp    17ea <texture_gen+0x67a>
movapd %xmm5,%xmm2
mulsd  0xa27(%rip),%xmm2
movsd  0xa4f(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    1921 <texture_gen+0x7b1>
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
addsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
xorpd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm4,%xmm2
ja     1836 <texture_gen+0x6c6>
jmp    1848 <texture_gen+0x6d8>
movapd %xmm5,%xmm0
addsd  0x9db(%rip),%xmm0
movsd  0x9cb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movapd %xmm5,%xmm0
addsd  0x9ad(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm5,%xmm0
addsd  0x9c7(%rip),%xmm0
jmp    1727 <texture_gen+0x5b7>
movsd  %xmm5,0x10(%rsp)
movsd  %xmm5,0x8(%rsp)
movapd %xmm5,%xmm0
addsd  0x99a(%rip),%xmm0
divsd  0x99a(%rip),%xmm0
movsd  %xmm0,(%rsp)
jmp    17ef <texture_gen+0x67f>
add    0x50(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  %xmm0,(%rsp)
ucomisd %xmm4,%xmm0
ja     17f9 <texture_gen+0x689>
jmp    180c <texture_gen+0x69c>
movapd %xmm5,%xmm0
addsd  0x925(%rip),%xmm0
movsd  0x925(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movapd %xmm5,%xmm0
addsd  0x917(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm5,%xmm0
addsd  0x909(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
ucomisd %xmm4,%xmm0
ja     17f9 <texture_gen+0x689>
jmp    180c <texture_gen+0x69c>
movsd  %xmm5,0x10(%rsp)
movq   $0x0,0x8(%rsp)
jmp    17ad <texture_gen+0x63d>
movq   $0x0,0x10(%rsp)
movsd  %xmm5,0x8(%rsp)
movq   $0x0,(%rsp)
jmp    17cb <texture_gen+0x65b>
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
movsd  %xmm5,(%rsp)
xorpd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
movapd %xmm5,%xmm2
ucomisd %xmm4,%xmm2
ja     1836 <texture_gen+0x6c6>
jmp    1848 <texture_gen+0x6d8>
movsd  %xmm5,0x10(%rsp)
movsd  %xmm5,0x8(%rsp)
movq   $0x0,(%rsp)
jmp    17ef <texture_gen+0x67f>
movq   $0x0,0x10(%rsp)
movsd  %xmm5,0x8(%rsp)
movsd  %xmm5,(%rsp)
xorpd  %xmm0,%xmm0
movapd %xmm5,%xmm1
ucomisd %xmm4,%xmm1
ja     1818 <texture_gen+0x6a8>
jmp    182b <texture_gen+0x6bb>
movsd  %xmm5,0x10(%rsp)
movq   $0x0,0x8(%rsp)
movsd  %xmm5,(%rsp)
movapd %xmm5,%xmm0
ucomisd %xmm4,%xmm0
jbe    180c <texture_gen+0x69c>
movabs $0x3ff0000000000000,%rax
mov    %rax,0x10(%rsp)
movapd %xmm4,%xmm0
movsd  0x8(%rsp),%xmm1
ucomisd %xmm4,%xmm1
jbe    182b <texture_gen+0x6bb>
movabs $0x3ff0000000000000,%rax
mov    %rax,0x8(%rsp)
movapd %xmm4,%xmm1
movsd  (%rsp),%xmm2
ucomisd %xmm4,%xmm2
jbe    1848 <texture_gen+0x6d8>
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rsp)
movapd %xmm4,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm0,%xmm3
jbe    185f <texture_gen+0x6ef>
movq   $0x0,0x10(%rsp)
xorpd  %xmm0,%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm1,%xmm3
jbe    1876 <texture_gen+0x706>
movq   $0x0,0x8(%rsp)
xorpd  %xmm1,%xmm1
xorpd  %xmm3,%xmm3
ucomisd %xmm2,%xmm3
jbe    188c <texture_gen+0x71c>
movq   $0x0,(%rsp)
xorpd  %xmm2,%xmm2
movsd  0x20(%rsp),%xmm3
ucomisd %xmm4,%xmm3
movsd  0x7e2(%rip),%xmm3
mulsd  %xmm3,%xmm0
cvttsd2si %xmm0,%ebp
mulsd  %xmm3,%xmm1
cvttsd2si %xmm1,%r15d
mulsd  %xmm3,%xmm2
cvttsd2si %xmm2,%r12d
jne    1916 <texture_gen+0x7a6>
jp     1916 <texture_gen+0x7a6>
movzbl %bpl,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  %xmm3,%xmm0
cvttsd2si %xmm0,%eax
movzbl %r15b,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
divsd  %xmm3,%xmm0
cvttsd2si %xmm0,%ecx
movzbl %r12b,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
divsd  %xmm3,%xmm0
cvttsd2si %xmm0,%edi
movzbl %al,%esi
movzbl %cl,%edx
movzbl %dil,%ecx
lea    0x862(%rip),%rdi
movsd  %xmm5,0x18(%rsp)
call   1040 <printf@plt>
jmp    14d8 <texture_gen+0x368>
movsd  %xmm5,0x18(%rsp)
jmp    14d8 <texture_gen+0x368>
movsd  0x72f(%rip),%xmm1
ucomisd %xmm2,%xmm1
jbe    1961 <texture_gen+0x7f1>
movq   $0x0,0x10(%rsp)
subsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movq   $0x0,(%rsp)
xorpd  %xmm0,%xmm0
ucomisd %xmm4,%xmm1
ja     1818 <texture_gen+0x6a8>
jmp    182b <texture_gen+0x6bb>
movsd  0x6f7(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    19ae <texture_gen+0x83e>
movabs $0x3fe8000000000000,%rax
mov    %rax,0x10(%rsp)
movabs $0x3fc3333333333333,%rax
33 c3 3f
mov    %rax,0x8(%rsp)
movq   $0x0,(%rsp)
xorpd  %xmm2,%xmm2
movsd  0x6d7(%rip),%xmm1
movsd  0x6c7(%rip),%xmm0
jmp    188c <texture_gen+0x71c>
movabs $0x3feccccccccccccd,%rax
cc ec 3f
mov    %rax,0x10(%rsp)
mov    %rax,0x8(%rsp)
mov    %rax,(%rsp)
movsd  0x69a(%rip),%xmm0
movapd %xmm0,%xmm2
movapd %xmm0,%xmm1
jmp    188c <texture_gen+0x71c>
mov    0x40(%rsp),%rax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x5,%ebx
jmp    1395 <texture_gen+0x225>
mov    $0xb,%ebx
jmp    1395 <texture_gen+0x225>
mov    $0xc,%ebx
jmp    1395 <texture_gen+0x225>
mov    $0xd,%ebx
jmp    1395 <texture_gen+0x225>
mov    $0xe,%ebx
jmp    1395 <texture_gen+0x225>
mov    $0xf,%ebx
jmp    1395 <texture_gen+0x225>
mov    $0x10,%ebx
jmp    1395 <texture_gen+0x225>
mov    $0x11,%ebx
jmp    1395 <texture_gen+0x225>

LLVM IR (-O0):
@.str = [9 x i8] c"inverse \00"
@.str.1 = [8 x i8] c"rainbow\00"
@.str.2 = [5 x i8] c"gray\00"
@.str.3 = [5 x i8] c"grey\00"
@.str.4 = [8 x i8] c"terrain\00"
@.str.5 = [5 x i8] c"topo\00"
@.str.6 = [5 x i8] c"iron\00"
@.str.7 = [7 x i8] c"heated\00"
@.str.8 = [4 x i8] c"hot\00"
@.str.9 = [6 x i8] c"astro\00"
@.str.10 = [4 x i8] c"alt\00"
@.str.11 = [6 x i8] c"zebra\00"
@.str.12 = [7 x i8] c"mgreen\00"
@.str.13 = [4 x i8] c"red\00"
@.str.14 = [6 x i8] c"green\00"
@.str.15 = [5 x i8] c"blue\00"
@.str.16 = [7 x i8] c"yellow\00"
@.str.17 = [5 x i8] c"cyan\00"
@.str.18 = [8 x i8] c"magenta\00"
@stderr = global i32 0
@.str.19 = [40 x i8] c"Unknown colormap - installing grey map\0A\00"
@.str.20 = [18 x i8] c"# %.2g %.2g %.2g\0A\00"
define i32* @texture_gen(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32*
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i8 0, i8* %11
store i8 0, i8* %10
store i8 0, i8* %9
store i32 0, i32* %13
%29 = load i32, i32* %7
store i32 %29, i32* %15
%30 = load i8*, i8** %5
%31 = call i32 @strncmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %30, i32 8)
%32 = icmp ne i32 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %4
store i32 1, i32* %13
%34 = load i8*, i8** %5
%35 = getelementptr inbounds i8, i8* %34, i64 8
store i8* %35, i8** %5
br label %36
36: ; preds = %33, %4
%37 = load i8*, i8** %5
%38 = call i32 @strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %37)
%39 = icmp ne i32 %38, 0
br i1 %39, label %41, label %40
40: ; preds = %36
store i32 1, i32* %14
br label %136
41: ; preds = %36
%42 = load i8*, i8** %5
%43 = call i32 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %42)
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %41
%46 = load i8*, i8** %5
%47 = call i32 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %46)
%48 = icmp ne i32 %47, 0
br i1 %48, label %50, label %49
49: ; preds = %45, %41
store i32 2, i32* %14
br label %135
50: ; preds = %45
%51 = load i8*, i8** %5
%52 = call i32 @strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %51)
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %58
54: ; preds = %50
%55 = load i8*, i8** %5
%56 = call i32 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %55)
%57 = icmp ne i32 %56, 0
br i1 %57, label %59, label %58
58: ; preds = %54, %50
store i32 3, i32* %14
br label %134
59: ; preds = %54
%60 = load i8*, i8** %5
%61 = call i32 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %60)
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %71
63: ; preds = %59
%64 = load i8*, i8** %5
%65 = call i32 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %64)
%66 = icmp ne i32 %65, 0
br i1 %66, label %67, label %71
67: ; preds = %63
%68 = load i8*, i8** %5
%69 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %68, i32 3)
%70 = icmp ne i32 %69, 0
br i1 %70, label %72, label %71
71: ; preds = %67, %63, %59
store i32 4, i32* %14
br label %133
72: ; preds = %67
%73 = load i8*, i8** %5
%74 = call i32 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %73)
%75 = icmp ne i32 %74, 0
br i1 %75, label %77, label %76
76: ; preds = %72
store i32 5, i32* %14
br label %132
77: ; preds = %72
%78 = load i8*, i8** %5
%79 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %78, i32 3)
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %85
81: ; preds = %77
%82 = load i8*, i8** %5
%83 = call i32 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* %82)
%84 = icmp ne i32 %83, 0
br i1 %84, label %86, label %85
85: ; preds = %81, %77
store i32 6, i32* %14
br label %131
86: ; preds = %81
%87 = load i8*, i8** %5
%88 = call i32 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* %87)
%89 = icmp ne i32 %88, 0
br i1 %89, label %91, label %90
90: ; preds = %86
store i32 11, i32* %14
br label %130
91: ; preds = %86
%92 = load i8*, i8** %5
%93 = call i32 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %92)
%94 = icmp ne i32 %93, 0
br i1 %94, label %96, label %95
95: ; preds = %91
store i32 12, i32* %14
br label %129
96: ; preds = %91
%97 = load i8*, i8** %5
%98 = call i32 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %97)
%99 = icmp ne i32 %98, 0
br i1 %99, label %101, label %100
100: ; preds = %96
store i32 13, i32* %14
br label %128
101: ; preds = %96
%102 = load i8*, i8** %5
%103 = call i32 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* %102)
%104 = icmp ne i32 %103, 0
br i1 %104, label %106, label %105
105: ; preds = %101
store i32 14, i32* %14
br label %127
106: ; preds = %101
%107 = load i8*, i8** %5
%108 = call i32 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i8* %107)
%109 = icmp ne i32 %108, 0
br i1 %109, label %111, label %110
110: ; preds = %106
store i32 15, i32* %14
br label %126
111: ; preds = %106
%112 = load i8*, i8** %5
%113 = call i32 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* %112)
%114 = icmp ne i32 %113, 0
br i1 %114, label %116, label %115
115: ; preds = %111
store i32 16, i32* %14
br label %125
116: ; preds = %111
%117 = load i8*, i8** %5
%118 = call i32 @strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0), i8* %117)
%119 = icmp ne i32 %118, 0
br i1 %119, label %121, label %120
120: ; preds = %116
store i32 17, i32* %14
br label %124
121: ; preds = %116
%122 = load i32, i32* @stderr
%123 = call i32 @fprintf(i32 %122, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.19, i64 0, i64 0))
store i32 2, i32* %14
br label %124
124: ; preds = %121, %120
br label %125
125: ; preds = %124, %115
br label %126
126: ; preds = %125, %110
br label %127
127: ; preds = %126, %105
br label %128
128: ; preds = %127, %100
br label %129
129: ; preds = %128, %95
br label %130
130: ; preds = %129, %90
br label %131
131: ; preds = %130, %85
br label %132
132: ; preds = %131, %76
br label %133
133: ; preds = %132, %71
br label %134
134: ; preds = %133, %58
br label %135
135: ; preds = %134, %49
br label %136
136: ; preds = %135, %40
%137 = load i32, i32* %7
%138 = load i32, i32* %6
%139 = mul nsw i32 %137, %138
%140 = sext i32 %139 to i64
%141 = mul i64 %140, 4
%142 = trunc i64 %141 to i32
%143 = call i64 @malloc(i32 %142)
%144 = inttoptr i64 %143 to i32*
store i32* %144, i32** %20
store double -1.000000e+00, double* %22
store double -1.000000e+00, double* %24
store i32 0, i32* %18
br label %145
145: ; preds = %395, %136
%146 = load i32, i32* %18
%147 = load i32, i32* %6
%148 = icmp slt i32 %146, %147
br i1 %148, label %149, label %398
149: ; preds = %145
%150 = load i32*, i32** %20
%151 = load i32, i32* %18
%152 = load i32, i32* %7
%153 = mul nsw i32 %151, %152
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds i32, i32* %150, i64 %154
%156 = bitcast i32* %155 to i8*
store i8* %156, i8** %12
%157 = load i32, i32* %18
%158 = sitofp i32 %157 to double
%159 = load i32, i32* %6
%160 = sitofp i32 %159 to double
%161 = fsub double %160, 1.000000e+00
%162 = fdiv double %158, %161
store double %162, double* %23
%163 = load double, double* %23
%164 = fcmp ogt double %163, 0x3FEFAE147AE147AE
br i1 %164, label %165, label %166
165: ; preds = %149
store double 0x3FEFAE147AE147AE, double* %23
br label %166
166: ; preds = %165, %149
%167 = load double, double* %24
%168 = load double, double* %23
%169 = fcmp une double %167, %168
br i1 %169, label %170, label %393
170: ; preds = %166
store i32 0, i32* %17
store i32 0, i32* %16
br label %171
171: ; preds = %387, %170
%172 = load i32, i32* %17
%173 = load i32, i32* %7
%174 = icmp slt i32 %172, %173
br i1 %174, label %175, label %392
175: ; preds = %171
%176 = load i32, i32* %17
%177 = load i32, i32* %8
%178 = sub nsw i32 %176, %177
%179 = sitofp i32 %178 to double
%180 = load i32, i32* %7
%181 = load i32, i32* %8
%182 = mul nsw i32 2, %181
%183 = sub nsw i32 %180, %182
%184 = sitofp i32 %183 to double
%185 = fsub double %184, 1.000000e+00
%186 = fdiv double %179, %185
store double %186, double* %21
%187 = load i32, i32* %15
%188 = sitofp i32 %187 to double
%189 = load double, double* %21
%190 = fmul double %188, %189
%191 = fptosi double %190 to i32
%192 = call i32 @floor(i32 %191)
store i32 %192, i32* %19
%193 = load i32, i32* %19
%194 = sitofp i32 %193 to double
%195 = load i32, i32* %15
%196 = sub nsw i32 %195, 1
%197 = sitofp i32 %196 to double
%198 = fdiv double %194, %197
store double %198, double* %21
%199 = load double, double* %21
%200 = fcmp ogt double %199, 1.000000e+00
br i1 %200, label %201, label %202
201: ; preds = %175
store double 1.000000e+00, double* %21
br label %202
202: ; preds = %201, %175
%203 = load i32, i32* %13
%204 = icmp ne i32 %203, 0
br i1 %204, label %205, label %208
205: ; preds = %202
%206 = load double, double* %21
%207 = fsub double 1.000000e+00, %206
store double %207, double* %21
br label %208
208: ; preds = %205, %202
%209 = load i32, i32* %17
%210 = load i32, i32* %8
%211 = icmp slt i32 %209, %210
br i1 %211, label %218, label %212
212: ; preds = %208
%213 = load i32, i32* %17
%214 = load i32, i32* %7
%215 = load i32, i32* %8
%216 = sub nsw i32 %214, %215
%217 = icmp sge i32 %213, %216
br i1 %217, label %218, label %219
218: ; preds = %212, %208
store i8 0, i8* %9
store i8 0, i8* %10
store i8 0, i8* %11
br label %363
219: ; preds = %212
%220 = load double, double* %22
%221 = load double, double* %21
%222 = fcmp une double %220, %221
br i1 %222, label %223, label %362
223: ; preds = %219
%224 = load i32, i32* %14
switch i32 %224, label %307 [
i32 1, label %225
i32 2, label %231
i32 3, label %235
i32 4, label %258
i32 5, label %268
i32 6, label %274
i32 11, label %282
i32 12, label %292
i32 13, label %294
i32 14, label %296
i32 15, label %298
i32 16, label %301
i32 17, label %304
]
225: ; preds = %223
%226 = load double, double* %21
%227 = fsub double 1.000000e+00, %226
%228 = fptosi double %227 to i32
%229 = load double, double* %23
%230 = call i32 @rainbow(i32 %228, double %229, i32 1, double* %25, double* %26, double* %27)
br label %307
231: ; preds = %223
%232 = load double, double* %21
store double %232, double* %25
%233 = load double, double* %21
store double %233, double* %26
%234 = load double, double* %21
store double %234, double* %27
br label %307
235: ; preds = %223
%236 = load double, double* %21
%237 = fmul double 3.000000e+00, %236
store double %237, double* %28
%238 = load double, double* %28
%239 = fcmp olt double %238, 2.500000e-01
br i1 %239, label %240, label %243
240: ; preds = %235
store double 0.000000e+00, double* %25
store double 0.000000e+00, double* %26
%241 = load double, double* %28
%242 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %241, double 2.500000e-01)
store double %242, double* %27
br label %257
243: ; preds = %235
%244 = load double, double* %28
%245 = fcmp olt double %244, 2.000000e+00
br i1 %245, label %246, label %250
246: ; preds = %243
store double 0.000000e+00, double* %25
%247 = load double, double* %28
%248 = fsub double 2.000000e+00, %247
%249 = fadd double 2.500000e-01, %248
store double %249, double* %26
store double 0.000000e+00, double* %27
br label %256
250: ; preds = %243
%251 = load double, double* %28
%252 = fcmp olt double %251, 2.700000e+00
br i1 %252, label %253, label %254
253: ; preds = %250
store double 7.500000e-01, double* %25
store double 1.500000e-01, double* %26
store double 0.000000e+00, double* %27
br label %255
254: ; preds = %250
store double 9.000000e-01, double* %25
store double 9.000000e-01, double* %26
store double 9.000000e-01, double* %27
br label %255
255: ; preds = %254, %253
br label %256
256: ; preds = %255, %246
br label %257
257: ; preds = %256, %240
br label %307
258: ; preds = %223
%259 = load double, double* %21
%260 = fadd double %259, 3.000000e-02
%261 = fmul double 3.000000e+00, %260
store double %261, double* %25
%262 = load double, double* %21
%263 = fsub double %262, 3.333330e-01
%264 = fmul double 3.000000e+00, %263
store double %264, double* %26
%265 = load double, double* %21
%266 = fsub double %265, 6.666670e-01
%267 = fmul double 3.000000e+00, %266
store double %267, double* %27
br label %307
268: ; preds = %223
%269 = load double, double* %21
store double %269, double* %25
%270 = load double, double* %21
store double %270, double* %26
%271 = load double, double* %21
%272 = fadd double %271, 2.000000e-01
%273 = fdiv double %272, 1.200000e+00
store double %273, double* %27
br label %307
274: ; preds = %223
%275 = load i32, i32* %19
%276 = load i32, i32* %13
%277 = add nsw i32 %275, %276
%278 = srem i32 %277, 2
%279 = sitofp i32 %278 to double
store double %279, double* %25
%280 = load double, double* %25
store double %280, double* %26
%281 = load double, double* %25
store double %281, double* %27
br label %307
282: ; preds = %223
%283 = load double, double* %21
%284 = fsub double %283, 3.333330e-01
%285 = fmul double 3.000000e+00, %284
store double %285, double* %25
%286 = load double, double* %21
%287 = fadd double %286, 3.000000e-02
%288 = fmul double 3.000000e+00, %287
store double %288, double* %26
%289 = load double, double* %21
%290 = fsub double %289, 6.666700e-01
%291 = fmul double 3.000000e+00, %290
store double %291, double* %27
br label %307
292: ; preds = %223
%293 = load double, double* %21
store double %293, double* %25
store double 0.000000e+00, double* %26
store double 0.000000e+00, double* %27
br label %307
294: ; preds = %223
store double 0.000000e+00, double* %25
%295 = load double, double* %21
store double %295, double* %26
store double 0.000000e+00, double* %27
br label %307
296: ; preds = %223
store double 0.000000e+00, double* %25
store double 0.000000e+00, double* %26
%297 = load double, double* %21
store double %297, double* %27
br label %307
298: ; preds = %223
%299 = load double, double* %21
store double %299, double* %25
%300 = load double, double* %21
store double %300, double* %26
store double 0.000000e+00, double* %27
br label %307
301: ; preds = %223
store double 0.000000e+00, double* %25
%302 = load double, double* %21
store double %302, double* %26
%303 = load double, double* %21
store double %303, double* %27
br label %307
304: ; preds = %223
%305 = load double, double* %21
store double %305, double* %25
store double 0.000000e+00, double* %26
%306 = load double, double* %21
store double %306, double* %27
br label %307
307: ; preds = %223, %304, %301, %298, %296, %294, %292, %282, %274, %268, %258, %257, %231, %225
%308 = load double, double* %25
%309 = fcmp ogt double %308, 1.000000e+00
br i1 %309, label %310, label %311
310: ; preds = %307
store double 1.000000e+00, double* %25
br label %311
311: ; preds = %310, %307
%312 = load double, double* %26
%313 = fcmp ogt double %312, 1.000000e+00
br i1 %313, label %314, label %315
314: ; preds = %311
store double 1.000000e+00, double* %26
br label %315
315: ; preds = %314, %311
%316 = load double, double* %27
%317 = fcmp ogt double %316, 1.000000e+00
br i1 %317, label %318, label %319
318: ; preds = %315
store double 1.000000e+00, double* %27
br label %319
319: ; preds = %318, %315
%320 = load double, double* %25
%321 = fcmp olt double %320, 0.000000e+00
br i1 %321, label %322, label %323
322: ; preds = %319
store double 0.000000e+00, double* %25
br label %323
323: ; preds = %322, %319
%324 = load double, double* %26
%325 = fcmp olt double %324, 0.000000e+00
br i1 %325, label %326, label %327
326: ; preds = %323
store double 0.000000e+00, double* %26
br label %327
327: ; preds = %326, %323
%328 = load double, double* %27
%329 = fcmp olt double %328, 0.000000e+00
br i1 %329, label %330, label %331
330: ; preds = %327
store double 0.000000e+00, double* %27
br label %331
331: ; preds = %330, %327
%332 = load double, double* %25
%333 = fmul double 2.550000e+02, %332
%334 = fptoui double %333 to i8
store i8 %334, i8* %9
%335 = load double, double* %26
%336 = fmul double 2.550000e+02, %335
%337 = fptoui double %336 to i8
store i8 %337, i8* %10
%338 = load double, double* %27
%339 = fmul double 2.550000e+02, %338
%340 = fptoui double %339 to i8
store i8 %340, i8* %11
%341 = load double, double* %21
store double %341, double* %22
%342 = load double, double* %23
%343 = fcmp oeq double %342, 1.000000e+00
br i1 %343, label %344, label %361
344: ; preds = %331
%345 = load i8, i8* %9
%346 = zext i8 %345 to i32
%347 = sitofp i32 %346 to double
%348 = fdiv double %347, 2.550000e+02
%349 = fptoui double %348 to i8
%350 = load i8, i8* %10
%351 = zext i8 %350 to i32
%352 = sitofp i32 %351 to double
%353 = fdiv double %352, 2.550000e+02
%354 = fptoui double %353 to i8
%355 = load i8, i8* %11
%356 = zext i8 %355 to i32
%357 = sitofp i32 %356 to double
%358 = fdiv double %357, 2.550000e+02
%359 = fptoui double %358 to i8
%360 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0), i8 zeroext %349, i8 zeroext %354, i8 zeroext %359)
br label %361
361: ; preds = %344, %331
br label %362
362: ; preds = %361, %219
br label %363
363: ; preds = %362, %218
%364 = load i8, i8* %9
%365 = load i8*, i8** %12
%366 = load i32, i32* %16
%367 = add nsw i32 %366, 0
%368 = sext i32 %367 to i64
%369 = getelementptr inbounds i8, i8* %365, i64 %368
store i8 %364, i8* %369
%370 = load i8, i8* %10
%371 = load i8*, i8** %12
%372 = load i32, i32* %16
%373 = add nsw i32 %372, 1
%374 = sext i32 %373 to i64
%375 = getelementptr inbounds i8, i8* %371, i64 %374
store i8 %370, i8* %375
%376 = load i8, i8* %11
%377 = load i8*, i8** %12
%378 = load i32, i32* %16
%379 = add nsw i32 %378, 2
%380 = sext i32 %379 to i64
%381 = getelementptr inbounds i8, i8* %377, i64 %380
store i8 %376, i8* %381
%382 = load i8*, i8** %12
%383 = load i32, i32* %16
%384 = add nsw i32 %383, 3
%385 = sext i32 %384 to i64
%386 = getelementptr inbounds i8, i8* %382, i64 %385
store i8 0, i8* %386
br label %387
387: ; preds = %363
%388 = load i32, i32* %17
%389 = add nsw i32 %388, 1
store i32 %389, i32* %17
%390 = load i32, i32* %16
%391 = add nsw i32 %390, 4
store i32 %391, i32* %16
br label %171
392: ; preds = %171
br label %393
393: ; preds = %392, %166
%394 = load double, double* %23
store double %394, double* %24
br label %395
395: ; preds = %393
%396 = load i32, i32* %18
%397 = add nsw i32 %396, 1
store i32 %397, i32* %18
br label %145
398: ; preds = %145
%399 = load i32*, i32** %20
ret i32* %399
}

LLVM IR (-O2):
@.str = [9 x i8] c"inverse \00"
@.str.1 = [8 x i8] c"rainbow\00"
@.str.2 = [5 x i8] c"gray\00"
@.str.3 = [5 x i8] c"grey\00"
@.str.4 = [8 x i8] c"terrain\00"
@.str.5 = [5 x i8] c"topo\00"
@.str.6 = [5 x i8] c"iron\00"
@.str.7 = [7 x i8] c"heated\00"
@.str.8 = [4 x i8] c"hot\00"
@.str.9 = [6 x i8] c"astro\00"
@.str.10 = [4 x i8] c"alt\00"
@.str.11 = [6 x i8] c"zebra\00"
@.str.12 = [7 x i8] c"mgreen\00"
@.str.13 = [4 x i8] c"red\00"
@.str.14 = [6 x i8] c"green\00"
@.str.15 = [5 x i8] c"blue\00"
@.str.16 = [7 x i8] c"yellow\00"
@.str.17 = [5 x i8] c"cyan\00"
@.str.18 = [8 x i8] c"magenta\00"
@stderr = global i32 0
@.str.19 = [40 x i8] c"Unknown colormap - installing grey map\0A\00"
@.str.20 = [18 x i8] c"# %.2g %.2g %.2g\0A\00"
define i32* @texture_gen(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = bitcast double* %5 to i8*
%9 = bitcast double* %6 to i8*
%10 = bitcast double* %7 to i8*
%11 = tail call i32 @strncmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i32 8)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = select i1 %12, i64 8, i64 0
%15 = getelementptr i8, i8* %0, i64 %14
%16 = tail call i32 @strcmp(i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* dereferenceable(1) %15)
%17 = icmp eq i32 %16, 0
br i1 %17, label %72, label %18
18: ; preds = %4
%19 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* dereferenceable(1) %15)
%20 = icmp eq i32 %19, 0
br i1 %20, label %72, label %21
21: ; preds = %18
%22 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* dereferenceable(1) %15)
%23 = icmp eq i32 %22, 0
br i1 %23, label %72, label %24
24: ; preds = %21
%25 = tail call i32 @strcmp(i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* dereferenceable(1) %15)
%26 = icmp eq i32 %25, 0
br i1 %26, label %72, label %27
27: ; preds = %24
%28 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* dereferenceable(1) %15)
%29 = icmp eq i32 %28, 0
br i1 %29, label %72, label %30
30: ; preds = %27
%31 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* dereferenceable(1) %15)
%32 = icmp eq i32 %31, 0
br i1 %32, label %72, label %33
33: ; preds = %30
%34 = tail call i32 @strcmp(i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* dereferenceable(1) %15)
%35 = icmp eq i32 %34, 0
br i1 %35, label %72, label %36
36: ; preds = %33
%37 = tail call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %15, i32 3)
%38 = icmp eq i32 %37, 0
br i1 %38, label %72, label %39
39: ; preds = %36
%40 = tail call i32 @strcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* dereferenceable(1) %15)
%41 = icmp eq i32 %40, 0
br i1 %41, label %72, label %42
42: ; preds = %39
%43 = tail call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %15, i32 3)
%44 = icmp eq i32 %43, 0
br i1 %44, label %72, label %45
45: ; preds = %42
%46 = tail call i32 @strcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* dereferenceable(1) %15)
%47 = icmp eq i32 %46, 0
br i1 %47, label %72, label %48
48: ; preds = %45
%49 = tail call i32 @strcmp(i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* dereferenceable(1) %15)
%50 = icmp eq i32 %49, 0
br i1 %50, label %72, label %51
51: ; preds = %48
%52 = tail call i32 @strcmp(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* dereferenceable(1) %15)
%53 = icmp eq i32 %52, 0
br i1 %53, label %72, label %54
54: ; preds = %51
%55 = tail call i32 @strcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* dereferenceable(1) %15)
%56 = icmp eq i32 %55, 0
br i1 %56, label %72, label %57
57: ; preds = %54
%58 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* dereferenceable(1) %15)
%59 = icmp eq i32 %58, 0
br i1 %59, label %72, label %60
60: ; preds = %57
%61 = tail call i32 @strcmp(i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i8* dereferenceable(1) %15)
%62 = icmp eq i32 %61, 0
br i1 %62, label %72, label %63
63: ; preds = %60
%64 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i8* dereferenceable(1) %15)
%65 = icmp eq i32 %64, 0
br i1 %65, label %72, label %66
66: ; preds = %63
%67 = tail call i32 @strcmp(i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0), i8* dereferenceable(1) %15)
%68 = icmp eq i32 %67, 0
br i1 %68, label %72, label %69
69: ; preds = %66
%70 = load i32, i32* @stderr
%71 = tail call i32 @fprintf(i32 %70, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.19, i64 0, i64 0))
br label %72
72: ; preds = %66, %63, %60, %57, %54, %51, %48, %42, %45, %39, %30, %33, %36, %24, %27, %18, %21, %4, %69
%73 = phi i32 [ 2, %69 ], [ 1, %4 ], [ 2, %21 ], [ 2, %18 ], [ 3, %27 ], [ 3, %24 ], [ 4, %36 ], [ 4, %33 ], [ 4, %30 ], [ 5, %39 ], [ 6, %45 ], [ 6, %42 ], [ 11, %48 ], [ 12, %51 ], [ 13, %54 ], [ 14, %57 ], [ 15, %60 ], [ 16, %63 ], [ 17, %66 ]
%74 = shl i32 %1, 2
%75 = mul i32 %74, %2
%76 = tail call i64 @malloc(i32 %75)
%77 = inttoptr i64 %76 to i32*
%78 = icmp sgt i32 %1, 0
br i1 %78, label %79, label %261
79: ; preds = %72
%80 = sitofp i32 %1 to double
%81 = fadd double %80, -1.000000e+00
%82 = icmp sgt i32 %2, 0
%83 = mul i32 %3, -2
%84 = add i32 %83, %2
%85 = sitofp i32 %84 to double
%86 = fadd double %85, -1.000000e+00
%87 = sitofp i32 %2 to double
%88 = add nsw i32 %2, -1
%89 = sitofp i32 %88 to double
%90 = sub nsw i32 %2, %3
%91 = sext i32 %2 to i64
%92 = zext i32 %1 to i64
br label %93
93: ; preds = %79, %254
%94 = phi i64 [ 0, %79 ], [ %259, %254 ]
%95 = phi double [ -1.000000e+00, %79 ], [ %107, %254 ]
%96 = phi double [ -1.000000e+00, %79 ], [ %258, %254 ]
%97 = phi i8 [ 0, %79 ], [ %257, %254 ]
%98 = phi i8 [ 0, %79 ], [ %256, %254 ]
%99 = phi i8 [ 0, %79 ], [ %255, %254 ]
%100 = mul nsw i64 %94, %91
%101 = getelementptr inbounds i32, i32* %77, i64 %100
%102 = bitcast i32* %101 to i8*
%103 = trunc i64 %94 to i32
%104 = sitofp i32 %103 to double
%105 = fdiv double %104, %81
%106 = fcmp ogt double %105, 0x3FEFAE147AE147AE
%107 = select i1 %106, double 0x3FEFAE147AE147AE, double %105
%108 = fcmp une double %95, %107
br i1 %108, label %109, label %254
109: ; preds = %93
br i1 %82, label %110, label %254
110: ; preds = %109
%111 = fcmp oeq double %107, 1.000000e+00
br label %112
112: ; preds = %110, %239
%113 = phi i64 [ 0, %110 ], [ %252, %239 ]
%114 = phi double [ %96, %110 ], [ %243, %239 ]
%115 = phi i8 [ %97, %110 ], [ %242, %239 ]
%116 = phi i8 [ %98, %110 ], [ %241, %239 ]
%117 = phi i32 [ 0, %110 ], [ %251, %239 ]
%118 = phi i8 [ %99, %110 ], [ %240, %239 ]
%119 = sub nsw i32 %117, %3
%120 = sitofp i32 %119 to double
%121 = fdiv double %120, %86
%122 = fmul double %121, %87
%123 = fptosi double %122 to i32
%124 = call i32 @floor(i32 %123)
%125 = sitofp i32 %124 to double
%126 = fdiv double %125, %89
%127 = fcmp ogt double %126, 1.000000e+00
%128 = select i1 %127, double 1.000000e+00, double %126
%129 = fsub double 1.000000e+00, %128
%130 = select i1 %12, double %129, double %128
%131 = icmp sge i32 %117, %3
%132 = icmp slt i32 %117, %90
%133 = select i1 %131, i1 %132, i1 false
br i1 %133, label %134, label %239
134: ; preds = %112
%135 = fcmp une double %114, %130
br i1 %135, label %136, label %239
136: ; preds = %134
switch i32 %73, label %183 [
i32 1, label %137
i32 2, label %141
i32 3, label %142
i32 4, label %156
i32 5, label %163
i32 6, label %166
i32 11, label %170
i32 12, label %177
i32 13, label %178
i32 14, label %179
i32 15, label %180
i32 16, label %181
i32 17, label %182
]
137: ; preds = %136
%138 = fsub double 1.000000e+00, %130
%139 = fptosi double %138 to i32
%140 = call i32 @rainbow(i32 %139, double %107, i32 1, double* %5, double* %6, double* %7)
br label %183
141: ; preds = %136
store double %130, double* %5
store double %130, double* %6
store double %130, double* %7
br label %185
142: ; preds = %136
%143 = fmul double %130, 3.000000e+00
%144 = fcmp olt double %143, 2.500000e-01
br i1 %144, label %145, label %147
145: ; preds = %142
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %6
%146 = call double @llvm.fmuladd.f64(double %143, double 2.000000e+00, double 2.500000e-01)
store double %146, double* %7
br label %200
147: ; preds = %142
%148 = fcmp olt double %143, 2.000000e+00
br i1 %148, label %149, label %152
149: ; preds = %147
store double 0.000000e+00, double* %5
%150 = fsub double 2.000000e+00, %143
%151 = fadd double %150, 2.500000e-01
store double %151, double* %6
store double 0.000000e+00, double* %7
br label %192
152: ; preds = %147
%153 = fcmp olt double %143, 2.700000e+00
br i1 %153, label %154, label %155
154: ; preds = %152
store double 7.500000e-01, double* %5
store double 1.500000e-01, double* %6
store double 0.000000e+00, double* %7
br label %218
155: ; preds = %152
store double 9.000000e-01, double* %5
store double 9.000000e-01, double* %6
store double 9.000000e-01, double* %7
br label %218
156: ; preds = %136
%157 = fadd double %130, 3.000000e-02
%158 = fmul double %157, 3.000000e+00
store double %158, double* %5
%159 = fadd double %130, -3.333330e-01
%160 = fmul double %159, 3.000000e+00
store double %160, double* %6
%161 = fadd double %130, -6.666670e-01
%162 = fmul double %161, 3.000000e+00
store double %162, double* %7
br label %183
163: ; preds = %136
store double %130, double* %5
store double %130, double* %6
%164 = fadd double %130, 2.000000e-01
%165 = fdiv double %164, 1.200000e+00
store double %165, double* %7
br label %185
166: ; preds = %136
%167 = add nsw i32 %124, %13
%168 = srem i32 %167, 2
%169 = sitofp i32 %168 to double
store double %169, double* %5
store double %169, double* %6
store double %169, double* %7
br label %185
170: ; preds = %136
%171 = fadd double %130, -3.333330e-01
%172 = fmul double %171, 3.000000e+00
store double %172, double* %5
%173 = fadd double %130, 3.000000e-02
%174 = fmul double %173, 3.000000e+00
store double %174, double* %6
%175 = fadd double %130, -6.666700e-01
%176 = fmul double %175, 3.000000e+00
store double %176, double* %7
br label %183
177: ; preds = %136
store double %130, double* %5
store double 0.000000e+00, double* %6
store double 0.000000e+00, double* %7
br label %185
178: ; preds = %136
store double 0.000000e+00, double* %5
store double %130, double* %6
store double 0.000000e+00, double* %7
br label %192
179: ; preds = %136
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %6
store double %130, double* %7
br label %200
180: ; preds = %136
store double %130, double* %5
store double %130, double* %6
store double 0.000000e+00, double* %7
br label %185
181: ; preds = %136
store double 0.000000e+00, double* %5
store double %130, double* %6
store double %130, double* %7
br label %192
182: ; preds = %136
store double %130, double* %5
store double 0.000000e+00, double* %6
store double %130, double* %7
br label %185
183: ; preds = %137, %156, %170, %136
%184 = load double, double* %5
br label %185
185: ; preds = %183, %182, %180, %177, %166, %163, %141
%186 = phi double [ %184, %183 ], [ %130, %182 ], [ %130, %180 ], [ %130, %177 ], [ %169, %166 ], [ %130, %163 ], [ %130, %141 ]
%187 = fcmp ogt double %186, 1.000000e+00
br i1 %187, label %188, label %189
188: ; preds = %185
store double 1.000000e+00, double* %5
br label %189
189: ; preds = %185, %188
%190 = phi double [ %186, %185 ], [ 1.000000e+00, %188 ]
%191 = load double, double* %6
br label %192
192: ; preds = %189, %178, %181, %149
%193 = phi double [ %190, %189 ], [ 0.000000e+00, %178 ], [ 0.000000e+00, %181 ], [ 0.000000e+00, %149 ]
%194 = phi double [ %191, %189 ], [ %130, %178 ], [ %130, %181 ], [ %151, %149 ]
%195 = fcmp ogt double %194, 1.000000e+00
br i1 %195, label %196, label %197
196: ; preds = %192
store double 1.000000e+00, double* %6
br label %197
197: ; preds = %192, %196
%198 = phi double [ %194, %192 ], [ 1.000000e+00, %196 ]
%199 = load double, double* %7
br label %200
200: ; preds = %197, %145, %179
%201 = phi double [ %198, %197 ], [ 0.000000e+00, %145 ], [ 0.000000e+00, %179 ]
%202 = phi double [ %193, %197 ], [ 0.000000e+00, %145 ], [ 0.000000e+00, %179 ]
%203 = phi double [ %199, %197 ], [ %146, %145 ], [ %130, %179 ]
%204 = fcmp ogt double %203, 1.000000e+00
br i1 %204, label %205, label %206
205: ; preds = %200
store double 1.000000e+00, double* %7
br label %206
206: ; preds = %205, %200
%207 = phi double [ 1.000000e+00, %205 ], [ %203, %200 ]
%208 = fcmp olt double %202, 0.000000e+00
br i1 %208, label %209, label %210
209: ; preds = %206
store double 0.000000e+00, double* %5
br label %210
210: ; preds = %209, %206
%211 = phi double [ 0.000000e+00, %209 ], [ %202, %206 ]
%212 = fcmp olt double %201, 0.000000e+00
br i1 %212, label %213, label %214
213: ; preds = %210
store double 0.000000e+00, double* %6
br label %214
214: ; preds = %213, %210
%215 = phi double [ 0.000000e+00, %213 ], [ %201, %210 ]
%216 = fcmp olt double %207, 0.000000e+00
br i1 %216, label %217, label %218
217: ; preds = %214
store double 0.000000e+00, double* %7
br label %218
218: ; preds = %154, %155, %217, %214
%219 = phi double [ 0.000000e+00, %154 ], [ 9.000000e-01, %155 ], [ 0.000000e+00, %217 ], [ %207, %214 ]
%220 = phi double [ 1.500000e-01, %154 ], [ 9.000000e-01, %155 ], [ %215, %217 ], [ %215, %214 ]
%221 = phi double [ 7.500000e-01, %154 ], [ 9.000000e-01, %155 ], [ %211, %217 ], [ %211, %214 ]
%222 = fmul double %221, 2.550000e+02
%223 = fptoui double %222 to i8
%224 = fmul double %220, 2.550000e+02
%225 = fptoui double %224 to i8
%226 = fmul double %219, 2.550000e+02
%227 = fptoui double %226 to i8
br i1 %111, label %228, label %239
228: ; preds = %218
%229 = uitofp i8 %223 to double
%230 = fdiv double %229, 2.550000e+02
%231 = fptoui double %230 to i8
%232 = uitofp i8 %225 to double
%233 = fdiv double %232, 2.550000e+02
%234 = fptoui double %233 to i8
%235 = uitofp i8 %227 to double
%236 = fdiv double %235, 2.550000e+02
%237 = fptoui double %236 to i8
%238 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0), i8 zeroext %231, i8 zeroext %234, i8 zeroext %237)
br label %239
239: ; preds = %112, %134, %228, %218
%240 = phi i8 [ %227, %228 ], [ %227, %218 ], [ %118, %134 ], [ 0, %112 ]
%241 = phi i8 [ %225, %228 ], [ %225, %218 ], [ %116, %134 ], [ 0, %112 ]
%242 = phi i8 [ %223, %228 ], [ %223, %218 ], [ %115, %134 ], [ 0, %112 ]
%243 = phi double [ %130, %228 ], [ %130, %218 ], [ %114, %134 ], [ %114, %112 ]
%244 = getelementptr inbounds i8, i8* %102, i64 %113
store i8 %242, i8* %244
%245 = or i64 %113, 1
%246 = getelementptr inbounds i8, i8* %102, i64 %245
store i8 %241, i8* %246
%247 = or i64 %113, 2
%248 = getelementptr inbounds i8, i8* %102, i64 %247
store i8 %240, i8* %248
%249 = or i64 %113, 3
%250 = getelementptr inbounds i8, i8* %102, i64 %249
store i8 0, i8* %250
%251 = add nuw nsw i32 %117, 1
%252 = add nuw nsw i64 %113, 4
%253 = icmp eq i32 %251, %2
br i1 %253, label %254, label %112
254: ; preds = %239, %109, %93
%255 = phi i8 [ %99, %93 ], [ %99, %109 ], [ %240, %239 ]
%256 = phi i8 [ %98, %93 ], [ %98, %109 ], [ %241, %239 ]
%257 = phi i8 [ %97, %93 ], [ %97, %109 ], [ %242, %239 ]
%258 = phi double [ %96, %93 ], [ %96, %109 ], [ %243, %239 ]
%259 = add nuw nsw i64 %94, 1
%260 = icmp eq i64 %259, %92
br i1 %260, label %261, label %93
261: ; preds = %254, %72
ret i32* %77
}