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

/* Variables and functions */
double exp(double);
double pow(double, double);
void get_rgb(double val, float *rp, float *gp, float *bp, int COLORBAR) {
  double rrr, ggg, bbb;
  if (COLORBAR == 0) {
    double nexp = 8.0;
    rrr = exp(-nexp * pow(val - 5. / 6., 2.0)) +
          .25 * exp(-nexp * pow(val + 1. / 6., 2.0));
    ggg = exp(-nexp * pow(val - 3. / 6., 2.0));
    bbb = exp(-nexp * pow(val - 1. / 6., 2.0)) +
          .25 * exp(-nexp * pow(val - 7. / 6., 2.0));
  } else if (COLORBAR == 1) {
    if (val < .1) {
      bbb = 4. * (val + .15);
      ggg = 0.0;
      rrr = 0.0;
    } else if (val < .35) {
      bbb = 1.0;
      ggg = 4. * (val - .1);
      rrr = 0.0;
    } else if (val < .6) {
      bbb = 4. * (.6 - val);
      ggg = 1.;
      rrr = 4. * (val - .35);
    } else if (val < .85) {
      bbb = 0.0;
      ggg = 4. * (.85 - val);
      rrr = 1.;
    } else {
      bbb = 0.0;
      ggg = 0.0;
      rrr = 4. * (1.1 - val);
    }
  } else if (COLORBAR == 2) {
    rrr = 2. * val;
    ggg = 1.2 * val;
    bbb = .8 * val;
  } else if (COLORBAR == 3) {
    double gam = .8;
    double Amp;
    double r0, g0, b0;
    double hi, lo, x1, x2, x3, x4;
    hi = .8;
    lo = .1;
    if (val > hi)
      Amp = .3 + .7 * (1. - val) / (1. - hi);
    else if (val < lo)
      Amp = .3 + .7 * (val) / (lo);
    else
      Amp = 1.0;
    x1 = .5;
    x2 = .325;
    x3 = .15;
    x4 = 0.;
    if (val > x1)
      r0 = 1.;
    else if (val > x2)
      r0 = (val - x2) / (x1 - x2);
    else if (val > x3)
      r0 = 0.;
    else if (val > x4)
      r0 = (val - x3) / (x4 - x3);
    else
      r0 = 1.;
    x1 = .6625;
    x2 = .5;
    x3 = .275;
    x4 = .15;
    if (val > x1)
      g0 = 0.;
    else if (val > x2)
      g0 = (val - x1) / (x2 - x1);
    else if (val > x3)
      g0 = 1.;
    else if (val > x4)
      g0 = (val - x4) / (x3 - x4);
    else
      g0 = 0.;
    x1 = .325;
    x2 = .275;
    if (val > x1)
      b0 = 0.;
    else if (val > x2)
      b0 = (val - x1) / (x2 - x1);
    else
      b0 = 1.;
    rrr = pow(Amp * r0, gam);
    ggg = pow(Amp * g0, gam);
    bbb = pow(Amp * b0, gam);
  } else if (COLORBAR == 4) {
    if (val < .1) {
      bbb = 4. * (val + .125);
      ggg = 0.0;
      rrr = 0.0;
    } else if (val < .375) {
      bbb = 1.0;
      ggg = 4. * (val - .125);
      rrr = 0.0;
    } else if (val < .625) {
      bbb = 4. * (.625 - val);
      rrr = 4. * (val - .375);
      ggg = bbb;
      if (rrr > bbb)
        ggg = rrr;
    } else if (val < .875) {
      bbb = 0.0;
      ggg = 4. * (.875 - val);
      rrr = 1.;
    } else {
      bbb = 0.0;
      ggg = 0.0;
      rrr = 4. * (1.125 - val);
    }
  } else if (COLORBAR == 5) {
    rrr = val;
    ggg = val;
    bbb = val;
  } else if (COLORBAR == 6) {
    rrr = 1. - val;
    ggg = 1. - val;
    bbb = 1. - val;
  } else {
    rrr = 1.0;
    ggg = 1.0;
    bbb = 1.0;
  }
  *rp = rrr;
  *gp = ggg;
  *bp = bbb;
}


x86 assembly (clang, -O0):
<get_rgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    1354 <get_rgb+0x234>
movsd  0xf7f(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  0xf41(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xef5(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  0xee0(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xe9b(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  -0xc8(%rbp),%xmm1
ff
movsd  0xe9a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  0xe14(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe28(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  0xe11(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xdcd(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  0xdab(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xd6f(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  -0xa8(%rbp),%xmm1
ff
movsd  0xd6e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1b68 <get_rgb+0xa48>
cmpl   $0x1,-0x24(%rbp)
jne    14e5 <get_rgb+0x3c5>
movsd  0xca2(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    13a4 <get_rgb+0x284>
movsd  0xcdf(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  0xca2(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    14e0 <get_rgb+0x3c0>
movsd  0xce4(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    13f3 <get_rgb+0x2d3>
movsd  0xc41(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xc37(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xc4b(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    14db <get_rgb+0x3bb>
movsd  0xc9d(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1458 <get_rgb+0x338>
movsd  0xc8a(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xc0d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xbd4(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xc52(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xbde(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    14d6 <get_rgb+0x3b6>
movsd  0xc40(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    14a3 <get_rgb+0x383>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xc25(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xba0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xb67(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    14d1 <get_rgb+0x3b1>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xbed(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xb60(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    14d6 <get_rgb+0x3b6>
jmp    14db <get_rgb+0x3bb>
jmp    14e0 <get_rgb+0x3c0>
jmp    1b63 <get_rgb+0xa43>
cmpl   $0x2,-0x24(%rbp)
jne    152a <get_rgb+0x40a>
movsd  0xb91(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xb77(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xb25(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1b5e <get_rgb+0xa3e>
cmpl   $0x3,-0x24(%rbp)
jne    1909 <get_rgb+0x7e9>
movsd  0xb04(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xaf7(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xab2(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x78(%rbp),%xmm0
jbe    15ab <get_rgb+0x48b>
movsd  0xa8d(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xad0(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xa74(%rip),%xmm0
subsd  -0x78(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xaab(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    15f9 <get_rgb+0x4d9>
movsd  -0x8(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    15e7 <get_rgb+0x4c7>
movsd  0xa89(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  -0x80(%rbp),%xmm1
movsd  0xa6f(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    15f4 <get_rgb+0x4d4>
movsd  0xa11(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    15f9 <get_rgb+0x4d9>
movsd  0xa67(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xa4f(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xa37(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
ucomisd -0x88(%rbp),%xmm0
ff
jbe    1659 <get_rgb+0x539>
movsd  0x9b1(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1711 <get_rgb+0x5f1>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x90(%rbp),%xmm0
ff
jbe    1697 <get_rgb+0x577>
movsd  -0x8(%rbp),%xmm0
subsd  -0x90(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm1
ff
subsd  -0x90(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    170c <get_rgb+0x5ec>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x98(%rbp),%xmm0
ff
jbe    16b7 <get_rgb+0x597>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1707 <get_rgb+0x5e7>
movsd  -0x8(%rbp),%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jbe    16f5 <get_rgb+0x5d5>
movsd  -0x8(%rbp),%xmm0
subsd  -0x98(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm1
ff
subsd  -0x98(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1702 <get_rgb+0x5e2>
movsd  0x903(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1707 <get_rgb+0x5e7>
jmp    170c <get_rgb+0x5ec>
jmp    1711 <get_rgb+0x5f1>
movsd  0x95f(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0x93f(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0x937(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0x90f(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
ucomisd -0x88(%rbp),%xmm0
ff
jbe    1771 <get_rgb+0x651>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1829 <get_rgb+0x709>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x90(%rbp),%xmm0
ff
jbe    17af <get_rgb+0x68f>
movsd  -0x8(%rbp),%xmm0
subsd  -0x88(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
subsd  -0x88(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1824 <get_rgb+0x704>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x98(%rbp),%xmm0
ff
jbe    17d4 <get_rgb+0x6b4>
movsd  0x836(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    181f <get_rgb+0x6ff>
movsd  -0x8(%rbp),%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jbe    1812 <get_rgb+0x6f2>
movsd  -0x8(%rbp),%xmm0
subsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
subsd  -0xa0(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    181a <get_rgb+0x6fa>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    181f <get_rgb+0x6ff>
jmp    1824 <get_rgb+0x704>
jmp    1829 <get_rgb+0x709>
movsd  0x82f(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0x82f(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
ucomisd -0x88(%rbp),%xmm0
ff
jbe    1869 <get_rgb+0x749>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    18b9 <get_rgb+0x799>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x90(%rbp),%xmm0
ff
jbe    18a7 <get_rgb+0x787>
movsd  -0x8(%rbp),%xmm0
subsd  -0x88(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
subsd  -0x88(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    18b4 <get_rgb+0x794>
movsd  0x751(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    18b9 <get_rgb+0x799>
movsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x40(%rbp)
jmp    1b59 <get_rgb+0xa39>
cmpl   $0x4,-0x24(%rbp)
jne    1ab1 <get_rgb+0x991>
movsd  0x6ed(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1959 <get_rgb+0x839>
movsd  0x70a(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  0x6ed(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1aac <get_rgb+0x98c>
movsd  0x6af(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    19a8 <get_rgb+0x888>
movsd  0x68c(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0x6b2(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0x696(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1aa7 <get_rgb+0x987>
movsd  0x668(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1a24 <get_rgb+0x904>
movsd  0x655(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0x658(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0x62a(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0x636(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    1a1f <get_rgb+0x8ff>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1aa2 <get_rgb+0x982>
movsd  0x5f4(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1a6f <get_rgb+0x94f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0x5d9(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0x5d4(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0x59b(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1a9d <get_rgb+0x97d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0x5a9(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0x594(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1aa2 <get_rgb+0x982>
jmp    1aa7 <get_rgb+0x987>
jmp    1aac <get_rgb+0x98c>
jmp    1b54 <get_rgb+0xa34>
cmpl   $0x5,-0x24(%rbp)
jne    1ade <get_rgb+0x9be>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1b4f <get_rgb+0xa2f>
cmpl   $0x6,-0x24(%rbp)
jne    1b23 <get_rgb+0xa03>
movsd  0x510(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0x4fe(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0x4ec(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1b4a <get_rgb+0xa2a>
movsd  0x4d5(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0x4c8(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0x4bb(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1b4f <get_rgb+0xa2f>
jmp    1b54 <get_rgb+0xa34>
jmp    1b59 <get_rgb+0xa39>
jmp    1b5e <get_rgb+0xa3e>
jmp    1b63 <get_rgb+0xa43>
jmp    1b68 <get_rgb+0xa48>
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rgb>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
cmp    $0x6,%ecx
ja     123c <get_rgb+0x11c>
movapd %xmm0,%xmm2
mov    %ecx,%eax
lea    0xff8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
movapd %xmm0,%xmm1
movapd %xmm0,%xmm3
jmp    *%rax
movsd  0xfa7(%rip),%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xf9f(%rip),%xmm0
movsd  %xmm2,(%rsp)
call   1030 <exp@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0xf8f(%rip),%xmm0
addsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xf76(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xf79(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xf6d(%rip),%xmm0
addsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xf44(%rip),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xf51(%rip),%xmm0
addsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xf20(%rip),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,0x18(%rsp)
movsd  (%rsp),%xmm0
addsd  0xf30(%rip),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xefc(%rip),%xmm0
call   1030 <exp@plt>
movsd  0x10(%rsp),%xmm3
movsd  0x8(%rsp),%xmm1
movapd %xmm0,%xmm2
mulsd  0xeef(%rip),%xmm2
addsd  0x18(%rsp),%xmm2
jmp    15f6 <get_rgb+0x4d6>
movsd  0xdbc(%rip),%xmm2
movapd %xmm2,%xmm1
movapd %xmm2,%xmm3
jmp    15f6 <get_rgb+0x4d6>
movsd  0xdaf(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    1305 <get_rgb+0x1e5>
addsd  0xe15(%rip),%xmm2
jmp    12d7 <get_rgb+0x1b7>
movapd %xmm2,%xmm3
addsd  %xmm2,%xmm3
movsd  0xe53(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  0xdc7(%rip),%xmm2
jmp    15f6 <get_rgb+0x4d6>
ucomisd 0xdba(%rip),%xmm2
jbe    1324 <get_rgb+0x204>
movsd  0xd5c(%rip),%xmm3
subsd  %xmm2,%xmm3
mulsd  0xda8(%rip),%xmm3
divsd  0xdb0(%rip),%xmm3
jmp    134a <get_rgb+0x22a>
movsd  0xd43(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    1393 <get_rgb+0x273>
addsd  0xd71(%rip),%xmm2
mulsd  0xd51(%rip),%xmm2
xorpd  %xmm1,%xmm1
xorpd  %xmm3,%xmm3
jmp    15f6 <get_rgb+0x4d6>
movsd  0xd0c(%rip),%xmm1
subsd  %xmm2,%xmm1
movapd %xmm1,%xmm2
movapd %xmm1,%xmm3
jmp    15f6 <get_rgb+0x4d6>
movsd  0xdcb(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    13ca <get_rgb+0x2aa>
addsd  0xde1(%rip),%xmm2
jmp    13ad <get_rgb+0x28d>
movsd  0xcdc(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    1409 <get_rgb+0x2e9>
movsd  0xd1a(%rip),%xmm3
mulsd  %xmm2,%xmm3
divsd  0xcbe(%rip),%xmm3
addsd  0xd0e(%rip),%xmm3
ucomisd 0xd16(%rip),%xmm2
jbe    141f <get_rgb+0x2ff>
xorpd  %xmm1,%xmm1
movsd  0xc94(%rip),%xmm0
ucomisd 0xd2c(%rip),%xmm2
ja     1552 <get_rgb+0x432>
movsd  0xd36(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  0xd32(%rip),%xmm1
jmp    1552 <get_rgb+0x432>
movsd  0xc75(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    147b <get_rgb+0x35b>
addsd  0xc93(%rip),%xmm2
movapd %xmm2,%xmm1
mulsd  0xc77(%rip),%xmm1
xorpd  %xmm3,%xmm3
movsd  0xc3b(%rip),%xmm2
jmp    15f6 <get_rgb+0x4d6>
movsd  0xd0e(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    14c0 <get_rgb+0x3a0>
subsd  %xmm2,%xmm0
movsd  0xc48(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  0xd04(%rip),%xmm2
movapd %xmm2,%xmm3
mulsd  %xmm1,%xmm3
movsd  0xbfc(%rip),%xmm1
jmp    15f2 <get_rgb+0x4d2>
movsd  0xbef(%rip),%xmm3
ucomisd 0xc57(%rip),%xmm2
ja     1360 <get_rgb+0x240>
ucomisd 0xc51(%rip),%xmm2
jbe    1442 <get_rgb+0x322>
movsd  0xc5f(%rip),%xmm0
addsd  %xmm2,%xmm0
divsd  0xc5b(%rip),%xmm0
jmp    1512 <get_rgb+0x3f2>
xorpd  %xmm0,%xmm0
ucomisd 0xc32(%rip),%xmm2
ja     1512 <get_rgb+0x3f2>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jbe    150a <get_rgb+0x3ea>
movsd  0xc1e(%rip),%xmm1
movapd %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
jmp    1512 <get_rgb+0x3f2>
movsd  0xb95(%rip),%xmm1
ucomisd %xmm2,%xmm1
jbe    14db <get_rgb+0x3bb>
subsd  %xmm2,%xmm1
movsd  0xb9b(%rip),%xmm0
addsd  0xb9b(%rip),%xmm2
mulsd  %xmm0,%xmm1
movapd %xmm2,%xmm3
mulsd  %xmm0,%xmm3
ucomisd %xmm1,%xmm3
jbe    1623 <get_rgb+0x503>
movapd %xmm1,%xmm2
movapd %xmm3,%xmm1
jmp    15f6 <get_rgb+0x4d6>
movsd  0xc20(%rip),%xmm1
ucomisd %xmm2,%xmm1
ja     14ed <get_rgb+0x3cd>
movsd  0xc1a(%rip),%xmm3
jmp    1631 <get_rgb+0x511>
movsd  0xb3d(%rip),%xmm1
ucomisd %xmm2,%xmm1
jbe    1629 <get_rgb+0x509>
subsd  %xmm2,%xmm1
mulsd  0xb37(%rip),%xmm1
movsd  0xaff(%rip),%xmm3
xorpd  %xmm2,%xmm2
jmp    15f6 <get_rgb+0x4d6>
movsd  0xaee(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd 0xb82(%rip),%xmm2
ja     1552 <get_rgb+0x432>
ucomisd 0xb80(%rip),%xmm2
jbe    1534 <get_rgb+0x414>
movsd  0xace(%rip),%xmm1
jmp    1552 <get_rgb+0x432>
ucomisd 0xb44(%rip),%xmm2
jbe    1552 <get_rgb+0x432>
movsd  0xb42(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  0xb5e(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
xorpd  %xmm1,%xmm1
ucomisd 0xb14(%rip),%xmm2
ja     158e <get_rgb+0x46e>
ucomisd 0xb3a(%rip),%xmm2
jbe    1586 <get_rgb+0x466>
addsd  0xb18(%rip),%xmm2
divsd  0xb48(%rip),%xmm2
movapd %xmm2,%xmm1
jmp    158e <get_rgb+0x46e>
movsd  0xa72(%rip),%xmm1
movsd  %xmm1,0x18(%rsp)
mulsd  %xmm3,%xmm0
movsd  0xab0(%rip),%xmm1
movsd  %xmm3,(%rsp)
call   1040 <pow@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  (%rsp),%xmm0
movsd  0xa8d(%rip),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  (%rsp),%xmm0
movsd  0xa6f(%rip),%xmm1
call   1040 <pow@plt>
movsd  0x10(%rsp),%xmm3
movsd  0x8(%rsp),%xmm1
movapd %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm3,%xmm0
movss  %xmm0,(%rbx)
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,(%r15)
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
movss  %xmm0,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
movapd %xmm1,%xmm2
jmp    15f6 <get_rgb+0x4d6>
movsd  0x9f7(%rip),%xmm3
subsd  %xmm2,%xmm3
mulsd  0x9f3(%rip),%xmm3
xorpd  %xmm2,%xmm2
xorpd  %xmm1,%xmm1
jmp    15f6 <get_rgb+0x4d6>

LLVM IR (-O0):
define void @get_rgb(double %0, float* %1, float* %2, float* %3, i32 %4) {
%6 = alloca double
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
store double %0, double* %6
store float* %1, float** %7
store float* %2, float** %8
store float* %3, float** %9
store i32 %4, i32* %10
%26 = load i32, i32* %10
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %66
28: ; preds = %5
store double 8.000000e+00, double* %14
%29 = load double, double* %14
%30 = fneg double %29
%31 = load double, double* %6
%32 = fsub double %31, 0x3FEAAAAAAAAAAAAB
%33 = call double @pow(double %32, double 2.000000e+00)
%34 = fmul double %30, %33
%35 = call double @exp(double %34)
%36 = load double, double* %14
%37 = fneg double %36
%38 = load double, double* %6
%39 = fadd double %38, 0x3FC5555555555555
%40 = call double @pow(double %39, double 2.000000e+00)
%41 = fmul double %37, %40
%42 = call double @exp(double %41)
%43 = call double @llvm.fmuladd.f64(double 2.500000e-01, double %42, double %35)
store double %43, double* %11
%44 = load double, double* %14
%45 = fneg double %44
%46 = load double, double* %6
%47 = fsub double %46, 5.000000e-01
%48 = call double @pow(double %47, double 2.000000e+00)
%49 = fmul double %45, %48
%50 = call double @exp(double %49)
store double %50, double* %12
%51 = load double, double* %14
%52 = fneg double %51
%53 = load double, double* %6
%54 = fsub double %53, 0x3FC5555555555555
%55 = call double @pow(double %54, double 2.000000e+00)
%56 = fmul double %52, %55
%57 = call double @exp(double %56)
%58 = load double, double* %14
%59 = fneg double %58
%60 = load double, double* %6
%61 = fsub double %60, 0x3FF2AAAAAAAAAAAB
%62 = call double @pow(double %61, double 2.000000e+00)
%63 = fmul double %59, %62
%64 = call double @exp(double %63)
%65 = call double @llvm.fmuladd.f64(double 2.500000e-01, double %64, double %57)
store double %65, double* %13
br label %329
66: ; preds = %5
%67 = load i32, i32* %10
%68 = icmp eq i32 %67, 1
br i1 %68, label %69, label %108
69: ; preds = %66
%70 = load double, double* %6
%71 = fcmp olt double %70, 1.000000e-01
br i1 %71, label %72, label %76
72: ; preds = %69
%73 = load double, double* %6
%74 = fadd double %73, 1.500000e-01
%75 = fmul double 4.000000e+00, %74
store double %75, double* %13
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %11
br label %107
76: ; preds = %69
%77 = load double, double* %6
%78 = fcmp olt double %77, 3.500000e-01
br i1 %78, label %79, label %83
79: ; preds = %76
store double 1.000000e+00, double* %13
%80 = load double, double* %6
%81 = fsub double %80, 1.000000e-01
%82 = fmul double 4.000000e+00, %81
store double %82, double* %12
store double 0.000000e+00, double* %11
br label %106
83: ; preds = %76
%84 = load double, double* %6
%85 = fcmp olt double %84, 6.000000e-01
br i1 %85, label %86, label %93
86: ; preds = %83
%87 = load double, double* %6
%88 = fsub double 6.000000e-01, %87
%89 = fmul double 4.000000e+00, %88
store double %89, double* %13
store double 1.000000e+00, double* %12
%90 = load double, double* %6
%91 = fsub double %90, 3.500000e-01
%92 = fmul double 4.000000e+00, %91
store double %92, double* %11
br label %105
93: ; preds = %83
%94 = load double, double* %6
%95 = fcmp olt double %94, 8.500000e-01
br i1 %95, label %96, label %100
96: ; preds = %93
store double 0.000000e+00, double* %13
%97 = load double, double* %6
%98 = fsub double 8.500000e-01, %97
%99 = fmul double 4.000000e+00, %98
store double %99, double* %12
store double 1.000000e+00, double* %11
br label %104
100: ; preds = %93
store double 0.000000e+00, double* %13
store double 0.000000e+00, double* %12
%101 = load double, double* %6
%102 = fsub double 1.100000e+00, %101
%103 = fmul double 4.000000e+00, %102
store double %103, double* %11
br label %104
104: ; preds = %100, %96
br label %105
105: ; preds = %104, %86
br label %106
106: ; preds = %105, %79
br label %107
107: ; preds = %106, %72
br label %328
108: ; preds = %66
%109 = load i32, i32* %10
%110 = icmp eq i32 %109, 2
br i1 %110, label %111, label %118
111: ; preds = %108
%112 = load double, double* %6
%113 = fmul double 2.000000e+00, %112
store double %113, double* %11
%114 = load double, double* %6
%115 = fmul double 1.200000e+00, %114
store double %115, double* %12
%116 = load double, double* %6
%117 = fmul double 8.000000e-01, %116
store double %117, double* %13
br label %327
118: ; preds = %108
%119 = load i32, i32* %10
%120 = icmp eq i32 %119, 3
br i1 %120, label %121, label %256
121: ; preds = %118
store double 8.000000e-01, double* %15
store double 8.000000e-01, double* %20
store double 1.000000e-01, double* %21
%122 = load double, double* %6
%123 = load double, double* %20
%124 = fcmp ogt double %122, %123
br i1 %124, label %125, label %133
125: ; preds = %121
%126 = load double, double* %6
%127 = fsub double 1.000000e+00, %126
%128 = fmul double 0x3FE6666666666666, %127
%129 = load double, double* %20
%130 = fsub double 1.000000e+00, %129
%131 = fdiv double %128, %130
%132 = fadd double 3.000000e-01, %131
store double %132, double* %16
br label %145
133: ; preds = %121
%134 = load double, double* %6
%135 = load double, double* %21
%136 = fcmp olt double %134, %135
br i1 %136, label %137, label %143
137: ; preds = %133
%138 = load double, double* %6
%139 = fmul double 0x3FE6666666666666, %138
%140 = load double, double* %21
%141 = fdiv double %139, %140
%142 = fadd double 3.000000e-01, %141
store double %142, double* %16
br label %144
143: ; preds = %133
store double 1.000000e+00, double* %16
br label %144
144: ; preds = %143, %137
br label %145
145: ; preds = %144, %125
store double 5.000000e-01, double* %22
store double 3.250000e-01, double* %23
store double 1.500000e-01, double* %24
store double 0.000000e+00, double* %25
%146 = load double, double* %6
%147 = load double, double* %22
%148 = fcmp ogt double %146, %147
br i1 %148, label %149, label %150
149: ; preds = %145
store double 1.000000e+00, double* %17
br label %183
150: ; preds = %145
%151 = load double, double* %6
%152 = load double, double* %23
%153 = fcmp ogt double %151, %152
br i1 %153, label %154, label %162
154: ; preds = %150
%155 = load double, double* %6
%156 = load double, double* %23
%157 = fsub double %155, %156
%158 = load double, double* %22
%159 = load double, double* %23
%160 = fsub double %158, %159
%161 = fdiv double %157, %160
store double %161, double* %17
br label %182
162: ; preds = %150
%163 = load double, double* %6
%164 = load double, double* %24
%165 = fcmp ogt double %163, %164
br i1 %165, label %166, label %167
166: ; preds = %162
store double 0.000000e+00, double* %17
br label %181
167: ; preds = %162
%168 = load double, double* %6
%169 = load double, double* %25
%170 = fcmp ogt double %168, %169
br i1 %170, label %171, label %179
171: ; preds = %167
%172 = load double, double* %6
%173 = load double, double* %24
%174 = fsub double %172, %173
%175 = load double, double* %25
%176 = load double, double* %24
%177 = fsub double %175, %176
%178 = fdiv double %174, %177
store double %178, double* %17
br label %180
179: ; preds = %167
store double 1.000000e+00, double* %17
br label %180
180: ; preds = %179, %171
br label %181
181: ; preds = %180, %166
br label %182
182: ; preds = %181, %154
br label %183
183: ; preds = %182, %149
store double 6.625000e-01, double* %22
store double 5.000000e-01, double* %23
store double 2.750000e-01, double* %24
store double 1.500000e-01, double* %25
%184 = load double, double* %6
%185 = load double, double* %22
%186 = fcmp ogt double %184, %185
br i1 %186, label %187, label %188
187: ; preds = %183
store double 0.000000e+00, double* %18
br label %221
188: ; preds = %183
%189 = load double, double* %6
%190 = load double, double* %23
%191 = fcmp ogt double %189, %190
br i1 %191, label %192, label %200
192: ; preds = %188
%193 = load double, double* %6
%194 = load double, double* %22
%195 = fsub double %193, %194
%196 = load double, double* %23
%197 = load double, double* %22
%198 = fsub double %196, %197
%199 = fdiv double %195, %198
store double %199, double* %18
br label %220
200: ; preds = %188
%201 = load double, double* %6
%202 = load double, double* %24
%203 = fcmp ogt double %201, %202
br i1 %203, label %204, label %205
204: ; preds = %200
store double 1.000000e+00, double* %18
br label %219
205: ; preds = %200
%206 = load double, double* %6
%207 = load double, double* %25
%208 = fcmp ogt double %206, %207
br i1 %208, label %209, label %217
209: ; preds = %205
%210 = load double, double* %6
%211 = load double, double* %25
%212 = fsub double %210, %211
%213 = load double, double* %24
%214 = load double, double* %25
%215 = fsub double %213, %214
%216 = fdiv double %212, %215
store double %216, double* %18
br label %218
217: ; preds = %205
store double 0.000000e+00, double* %18
br label %218
218: ; preds = %217, %209
br label %219
219: ; preds = %218, %204
br label %220
220: ; preds = %219, %192
br label %221
221: ; preds = %220, %187
store double 3.250000e-01, double* %22
store double 2.750000e-01, double* %23
%222 = load double, double* %6
%223 = load double, double* %22
%224 = fcmp ogt double %222, %223
br i1 %224, label %225, label %226
225: ; preds = %221
store double 0.000000e+00, double* %19
br label %240
226: ; preds = %221
%227 = load double, double* %6
%228 = load double, double* %23
%229 = fcmp ogt double %227, %228
br i1 %229, label %230, label %238
230: ; preds = %226
%231 = load double, double* %6
%232 = load double, double* %22
%233 = fsub double %231, %232
%234 = load double, double* %23
%235 = load double, double* %22
%236 = fsub double %234, %235
%237 = fdiv double %233, %236
store double %237, double* %19
br label %239
238: ; preds = %226
store double 1.000000e+00, double* %19
br label %239
239: ; preds = %238, %230
br label %240
240: ; preds = %239, %225
%241 = load double, double* %16
%242 = load double, double* %17
%243 = fmul double %241, %242
%244 = load double, double* %15
%245 = call double @pow(double %243, double %244)
store double %245, double* %11
%246 = load double, double* %16
%247 = load double, double* %18
%248 = fmul double %246, %247
%249 = load double, double* %15
%250 = call double @pow(double %248, double %249)
store double %250, double* %12
%251 = load double, double* %16
%252 = load double, double* %19
%253 = fmul double %251, %252
%254 = load double, double* %15
%255 = call double @pow(double %253, double %254)
store double %255, double* %13
br label %326
256: ; preds = %118
%257 = load i32, i32* %10
%258 = icmp eq i32 %257, 4
br i1 %258, label %259, label %305
259: ; preds = %256
%260 = load double, double* %6
%261 = fcmp olt double %260, 1.000000e-01
br i1 %261, label %262, label %266
262: ; preds = %259
%263 = load double, double* %6
%264 = fadd double %263, 1.250000e-01
%265 = fmul double 4.000000e+00, %264
store double %265, double* %13
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %11
br label %304
266: ; preds = %259
%267 = load double, double* %6
%268 = fcmp olt double %267, 3.750000e-01
br i1 %268, label %269, label %273
269: ; preds = %266
store double 1.000000e+00, double* %13
%270 = load double, double* %6
%271 = fsub double %270, 1.250000e-01
%272 = fmul double 4.000000e+00, %271
store double %272, double* %12
store double 0.000000e+00, double* %11
br label %303
273: ; preds = %266
%274 = load double, double* %6
%275 = fcmp olt double %274, 6.250000e-01
br i1 %275, label %276, label %290
276: ; preds = %273
%277 = load double, double* %6
%278 = fsub double 6.250000e-01, %277
%279 = fmul double 4.000000e+00, %278
store double %279, double* %13
%280 = load double, double* %6
%281 = fsub double %280, 3.750000e-01
%282 = fmul double 4.000000e+00, %281
store double %282, double* %11
%283 = load double, double* %13
store double %283, double* %12
%284 = load double, double* %11
%285 = load double, double* %13
%286 = fcmp ogt double %284, %285
br i1 %286, label %287, label %289
287: ; preds = %276
%288 = load double, double* %11
store double %288, double* %12
br label %289
289: ; preds = %287, %276
br label %302
290: ; preds = %273
%291 = load double, double* %6
%292 = fcmp olt double %291, 8.750000e-01
br i1 %292, label %293, label %297
293: ; preds = %290
store double 0.000000e+00, double* %13
%294 = load double, double* %6
%295 = fsub double 8.750000e-01, %294
%296 = fmul double 4.000000e+00, %295
store double %296, double* %12
store double 1.000000e+00, double* %11
br label %301
297: ; preds = %290
store double 0.000000e+00, double* %13
store double 0.000000e+00, double* %12
%298 = load double, double* %6
%299 = fsub double 1.125000e+00, %298
%300 = fmul double 4.000000e+00, %299
store double %300, double* %11
br label %301
301: ; preds = %297, %293
br label %302
302: ; preds = %301, %289
br label %303
303: ; preds = %302, %269
br label %304
304: ; preds = %303, %262
br label %325
305: ; preds = %256
%306 = load i32, i32* %10
%307 = icmp eq i32 %306, 5
br i1 %307, label %308, label %312
308: ; preds = %305
%309 = load double, double* %6
store double %309, double* %11
%310 = load double, double* %6
store double %310, double* %12
%311 = load double, double* %6
store double %311, double* %13
br label %324
312: ; preds = %305
%313 = load i32, i32* %10
%314 = icmp eq i32 %313, 6
br i1 %314, label %315, label %322
315: ; preds = %312
%316 = load double, double* %6
%317 = fsub double 1.000000e+00, %316
store double %317, double* %11
%318 = load double, double* %6
%319 = fsub double 1.000000e+00, %318
store double %319, double* %12
%320 = load double, double* %6
%321 = fsub double 1.000000e+00, %320
store double %321, double* %13
br label %323
322: ; preds = %312
store double 1.000000e+00, double* %11
store double 1.000000e+00, double* %12
store double 1.000000e+00, double* %13
br label %323
323: ; preds = %322, %315
br label %324
324: ; preds = %323, %308
br label %325
325: ; preds = %324, %304
br label %326
326: ; preds = %325, %240
br label %327
327: ; preds = %326, %111
br label %328
328: ; preds = %327, %107
br label %329
329: ; preds = %328, %28
%330 = load double, double* %11
%331 = fptrunc double %330 to float
%332 = load float*, float** %7
store float %331, float* %332
%333 = load double, double* %12
%334 = fptrunc double %333 to float
%335 = load float*, float** %8
store float %334, float* %335
%336 = load double, double* %13
%337 = fptrunc double %336 to float
%338 = load float*, float** %9
store float %337, float* %338
ret void
}

LLVM IR (-O2):
define void @get_rgb(double %0, float* nocapture writeonly %1, float* nocapture writeonly %2, float* nocapture writeonly %3, i32 %4) {
switch i32 %4, label %147 [
i32 0, label %6
i32 1, label %29
i32 2, label %54
i32 3, label %58
i32 4, label %118
i32 5, label %148
i32 6, label %145
]
6: ; preds = %5
%7 = fadd double %0, 0xBFEAAAAAAAAAAAAB
%8 = fmul double %7, %7
%9 = fmul double %8, -8.000000e+00
%10 = tail call double @exp(double %9)
%11 = fadd double %0, 0x3FC5555555555555
%12 = fmul double %11, %11
%13 = fmul double %12, -8.000000e+00
%14 = tail call double @exp(double %13)
%15 = tail call double @llvm.fmuladd.f64(double %14, double 2.500000e-01, double %10)
%16 = fadd double %0, -5.000000e-01
%17 = fmul double %16, %16
%18 = fmul double %17, -8.000000e+00
%19 = tail call double @exp(double %18)
%20 = fadd double %0, 0xBFC5555555555555
%21 = fmul double %20, %20
%22 = fmul double %21, -8.000000e+00
%23 = tail call double @exp(double %22)
%24 = fadd double %0, 0xBFF2AAAAAAAAAAAB
%25 = fmul double %24, %24
%26 = fmul double %25, -8.000000e+00
%27 = tail call double @exp(double %26)
%28 = tail call double @llvm.fmuladd.f64(double %27, double 2.500000e-01, double %23)
br label %148
29: ; preds = %5
%30 = fcmp olt double %0, 1.000000e-01
br i1 %30, label %31, label %34
31: ; preds = %29
%32 = fadd double %0, 1.500000e-01
%33 = fmul double %32, 4.000000e+00
br label %148
34: ; preds = %29
%35 = fcmp olt double %0, 3.500000e-01
br i1 %35, label %36, label %39
36: ; preds = %34
%37 = fadd double %0, -1.000000e-01
%38 = fmul double %37, 4.000000e+00
br label %148
39: ; preds = %34
%40 = fcmp olt double %0, 6.000000e-01
br i1 %40, label %41, label %46
41: ; preds = %39
%42 = fsub double 6.000000e-01, %0
%43 = fmul double %42, 4.000000e+00
%44 = fadd double %0, -3.500000e-01
%45 = fmul double %44, 4.000000e+00
br label %148
46: ; preds = %39
%47 = fcmp olt double %0, 8.500000e-01
br i1 %47, label %48, label %51
48: ; preds = %46
%49 = fsub double 8.500000e-01, %0
%50 = fmul double %49, 4.000000e+00
br label %148
51: ; preds = %46
%52 = fsub double 1.100000e+00, %0
%53 = fmul double %52, 4.000000e+00
br label %148
54: ; preds = %5
%55 = fmul double %0, 2.000000e+00
%56 = fmul double %0, 1.200000e+00
%57 = fmul double %0, 8.000000e-01
br label %148
58: ; preds = %5
%59 = fcmp ogt double %0, 8.000000e-01
br i1 %59, label %60, label %65
60: ; preds = %58
%61 = fsub double 1.000000e+00, %0
%62 = fmul double %61, 0x3FE6666666666666
%63 = fdiv double %62, 0x3FC9999999999998
%64 = fadd double %63, 3.000000e-01
br label %71
65: ; preds = %58
%66 = fcmp olt double %0, 1.000000e-01
br i1 %66, label %67, label %71
67: ; preds = %65
%68 = fmul double %0, 0x3FE6666666666666
%69 = fdiv double %68, 1.000000e-01
%70 = fadd double %69, 3.000000e-01
br label %71
71: ; preds = %65, %67, %60
%72 = phi double [ %64, %60 ], [ %70, %67 ], [ 1.000000e+00, %65 ]
%73 = fcmp ogt double %0, 5.000000e-01
br i1 %73, label %89, label %74
74: ; preds = %71
%75 = fcmp ogt double %0, 3.250000e-01
br i1 %75, label %76, label %79
76: ; preds = %74
%77 = fadd double %0, -3.250000e-01
%78 = fdiv double %77, 1.750000e-01
br label %86
79: ; preds = %74
%80 = fcmp ogt double %0, 1.500000e-01
br i1 %80, label %86, label %81
81: ; preds = %79
%82 = fcmp ogt double %0, 0.000000e+00
br i1 %82, label %83, label %86
83: ; preds = %81
%84 = fadd double %0, -1.500000e-01
%85 = fdiv double %84, -1.500000e-01
br label %86
86: ; preds = %81, %79, %76, %83
%87 = phi double [ %78, %76 ], [ %85, %83 ], [ 0.000000e+00, %79 ], [ 1.000000e+00, %81 ]
%88 = fcmp ogt double %0, 6.625000e-01
br i1 %88, label %101, label %94
89: ; preds = %71
%90 = fcmp ogt double %0, 6.625000e-01
br i1 %90, label %101, label %91
91: ; preds = %89
%92 = fadd double %0, -6.625000e-01
%93 = fdiv double %92, 0xBFC4CCCCCCCCCCCC
br label %101
94: ; preds = %86
%95 = fcmp ogt double %0, 2.750000e-01
br i1 %95, label %101, label %96
96: ; preds = %94
%97 = fcmp ogt double %0, 1.500000e-01
br i1 %97, label %98, label %101
98: ; preds = %96
%99 = fadd double %0, -1.500000e-01
%100 = fdiv double %99, 0x3FC0000000000001
br label %101
101: ; preds = %89, %96, %94, %86, %91, %98
%102 = phi double [ 1.000000e+00, %91 ], [ %87, %98 ], [ %87, %86 ], [ %87, %94 ], [ %87, %96 ], [ 1.000000e+00, %89 ]
%103 = phi double [ %93, %91 ], [ %100, %98 ], [ 0.000000e+00, %86 ], [ 1.000000e+00, %94 ], [ 0.000000e+00, %96 ], [ 0.000000e+00, %89 ]
%104 = fcmp ogt double %0, 3.250000e-01
br i1 %104, label %110, label %105
105: ; preds = %101
%106 = fcmp ogt double %0, 2.750000e-01
br i1 %106, label %107, label %110
107: ; preds = %105
%108 = fadd double %0, -3.250000e-01
%109 = fdiv double %108, 0xBFA9999999999998
br label %110
110: ; preds = %105, %101, %107
%111 = phi double [ %109, %107 ], [ 0.000000e+00, %101 ], [ 1.000000e+00, %105 ]
%112 = fmul double %72, %102
%113 = tail call double @pow(double %112, double 8.000000e-01)
%114 = fmul double %72, %103
%115 = tail call double @pow(double %114, double 8.000000e-01)
%116 = fmul double %72, %111
%117 = tail call double @pow(double %116, double 8.000000e-01)
br label %148
118: ; preds = %5
%119 = fcmp olt double %0, 1.000000e-01
br i1 %119, label %120, label %123
120: ; preds = %118
%121 = fadd double %0, 1.250000e-01
%122 = fmul double %121, 4.000000e+00
br label %148
123: ; preds = %118
%124 = fcmp olt double %0, 3.750000e-01
br i1 %124, label %125, label %128
125: ; preds = %123
%126 = fadd double %0, -1.250000e-01
%127 = fmul double %126, 4.000000e+00
br label %148
128: ; preds = %123
%129 = fcmp olt double %0, 6.250000e-01
br i1 %129, label %130, label %137
130: ; preds = %128
%131 = fsub double 6.250000e-01, %0
%132 = fmul double %131, 4.000000e+00
%133 = fadd double %0, -3.750000e-01
%134 = fmul double %133, 4.000000e+00
%135 = fcmp ogt double %134, %132
br i1 %135, label %136, label %148
136: ; preds = %130
br label %148
137: ; preds = %128
%138 = fcmp olt double %0, 8.750000e-01
br i1 %138, label %139, label %142
139: ; preds = %137
%140 = fsub double 8.750000e-01, %0
%141 = fmul double %140, 4.000000e+00
br label %148
142: ; preds = %137
%143 = fsub double 1.125000e+00, %0
%144 = fmul double %143, 4.000000e+00
br label %148
145: ; preds = %5
%146 = fsub double 1.000000e+00, %0
br label %148
147: ; preds = %5
br label %148
148: ; preds = %5, %36, %48, %51, %41, %31, %110, %147, %145, %120, %136, %130, %142, %139, %125, %54, %6
%149 = phi double [ %28, %6 ], [ %33, %31 ], [ 1.000000e+00, %36 ], [ %43, %41 ], [ 0.000000e+00, %48 ], [ 0.000000e+00, %51 ], [ %57, %54 ], [ %117, %110 ], [ %122, %120 ], [ 1.000000e+00, %125 ], [ %132, %136 ], [ %132, %130 ], [ 0.000000e+00, %139 ], [ 0.000000e+00, %142 ], [ %146, %145 ], [ 1.000000e+00, %147 ], [ %0, %5 ]
%150 = phi double [ %19, %6 ], [ 0.000000e+00, %31 ], [ %38, %36 ], [ 1.000000e+00, %41 ], [ %50, %48 ], [ 0.000000e+00, %51 ], [ %56, %54 ], [ %115, %110 ], [ 0.000000e+00, %120 ], [ %127, %125 ], [ %134, %136 ], [ %132, %130 ], [ %141, %139 ], [ 0.000000e+00, %142 ], [ %146, %145 ], [ 1.000000e+00, %147 ], [ %0, %5 ]
%151 = phi double [ %15, %6 ], [ 0.000000e+00, %31 ], [ 0.000000e+00, %36 ], [ %45, %41 ], [ 1.000000e+00, %48 ], [ %53, %51 ], [ %55, %54 ], [ %113, %110 ], [ 0.000000e+00, %120 ], [ 0.000000e+00, %125 ], [ %134, %136 ], [ %134, %130 ], [ 1.000000e+00, %139 ], [ %144, %142 ], [ %146, %145 ], [ 1.000000e+00, %147 ], [ %0, %5 ]
%152 = fptrunc double %151 to float
store float %152, float* %1
%153 = fptrunc double %150 to float
store float %153, float* %2
%154 = fptrunc double %149 to float
store float %154, float* %3
ret void
}