#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 double GLfloat;

/* Variables and functions */
int fabs(double);
void colorMap_rainbow(GLfloat fin, GLfloat *fcol) {
  int i;
  GLfloat xmin, xmax;
  GLfloat dx = 0.10;
  GLfloat ga = (6.0 - 2.0 * dx) * fin + dx;
  fcol[0] = ((0) > ((3 - fabs(ga - 4) - fabs(ga - 5)) / 2)
                 ? (0)
                 : ((3 - fabs(ga - 4) - fabs(ga - 5)) / 2));
  fcol[1] = ((0) > ((4 - fabs(ga - 2) - fabs(ga - 4)) / 2)
                 ? (0)
                 : ((4 - fabs(ga - 2) - fabs(ga - 4)) / 2));
  fcol[2] = ((0) > ((3 - fabs(ga - 1) - fabs(ga - 2)) / 2)
                 ? (0)
                 : ((3 - fabs(ga - 1) - fabs(ga - 2)) / 2));
  for (i = 0; i < 3; i++) {
    xmin = ((fcol[i]) > (0.0) ? (fcol[i]) : (0.0));
    fcol[i] = ((xmin) < (1.0) ? (xmin) : (1.0));
  }
}


x86 assembly (clang, -O0):
<colorMap_rainbow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xed1(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xea1(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    $0x3,%eax
sub    %ecx,%eax
mov    %eax,-0x3c(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xe77(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jle    11b7 <colorMap_rainbow+0xa7>
xor    %eax,%eax
mov    %eax,-0x40(%rbp)
jmp    1201 <colorMap_rainbow+0xf1>
movsd  -0x38(%rbp),%xmm0
movsd  0xe44(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    $0x3,%eax
sub    %ecx,%eax
mov    %eax,-0x44(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xe1a(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
movsd  0xe03(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    $0x4,%eax
sub    %ecx,%eax
mov    %eax,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xdc9(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jle    126d <colorMap_rainbow+0x15d>
xor    %eax,%eax
mov    %eax,-0x4c(%rbp)
jmp    12b7 <colorMap_rainbow+0x1a7>
movsd  -0x38(%rbp),%xmm0
movsd  0xda6(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    $0x4,%eax
sub    %ecx,%eax
mov    %eax,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xd6c(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x38(%rbp),%xmm0
movsd  0xd54(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    $0x3,%eax
sub    %ecx,%eax
mov    %eax,-0x54(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xd2a(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jle    1324 <colorMap_rainbow+0x214>
xor    %eax,%eax
mov    %eax,-0x58(%rbp)
jmp    136e <colorMap_rainbow+0x25e>
movsd  -0x38(%rbp),%xmm0
movsd  0xcf7(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    $0x3,%eax
sub    %ecx,%eax
mov    %eax,-0x5c(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xccd(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    142b <colorMap_rainbow+0x31b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    13c0 <colorMap_rainbow+0x2b0>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    13cd <colorMap_rainbow+0x2bd>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    13cd <colorMap_rainbow+0x2bd>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xc49(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    13f9 <colorMap_rainbow+0x2e9>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    140b <colorMap_rainbow+0x2fb>
movsd  0xc27(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    140b <colorMap_rainbow+0x2fb>
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1385 <colorMap_rainbow+0x275>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<colorMap_rainbow>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r14
movapd %xmm0,%xmm1
mulsd  0xeda(%rip),%xmm1
addsd  0xeda(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xed4(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
call   1030 <fabs@plt>
mov    %eax,%ebx
movsd  0xec3(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rsp)
call   1030 <fabs@plt>
add    %ebx,%eax
add    $0xfffffffc,%eax
xorpd  %xmm0,%xmm0
test   %eax,%eax
jg     11a2 <colorMap_rainbow+0x92>
movsd  0x10(%rsp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
call   1030 <fabs@plt>
add    %ebx,%eax
mov    $0x3,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r14)
movsd  0xe71(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rsp)
call   1030 <fabs@plt>
mov    %eax,%ebx
movsd  0x10(%rsp),%xmm0
call   1030 <fabs@plt>
add    %ebx,%eax
add    $0xfffffffb,%eax
test   %eax,%eax
xorpd  %xmm0,%xmm0
jg     1209 <colorMap_rainbow+0xf9>
movsd  (%rsp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ebx
movsd  0x10(%rsp),%xmm0
call   1030 <fabs@plt>
add    %ebx,%eax
mov    $0x4,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%r14)
movsd  0x8(%rsp),%xmm0
addsd  0xe0b(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <fabs@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
call   1030 <fabs@plt>
add    %ebx,%eax
add    $0xfffffffc,%eax
xorpd  %xmm4,%xmm4
xorpd  %xmm0,%xmm0
test   %eax,%eax
jg     1279 <colorMap_rainbow+0x169>
movsd  0x8(%rsp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
call   1030 <fabs@plt>
xorpd  %xmm4,%xmm4
add    %ebx,%eax
mov    $0x3,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%r14),%xmm1
movsd  0x8(%r14),%xmm2
maxsd  %xmm4,%xmm1
movsd  0xda0(%rip),%xmm3
minsd  %xmm3,%xmm1
movsd  %xmm1,(%r14)
maxsd  %xmm4,%xmm2
minsd  %xmm3,%xmm2
movsd  %xmm2,0x8(%r14)
maxsd  %xmm4,%xmm0
minsd  %xmm3,%xmm0
movsd  %xmm0,0x10(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @colorMap_rainbow(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %3
store double* %1, double** %4
store double 1.000000e-01, double* %8
%10 = load double, double* %8
%11 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %10, double 6.000000e+00)
%12 = load double, double* %3
%13 = load double, double* %8
%14 = call double @llvm.fmuladd.f64(double %11, double %12, double %13)
store double %14, double* %9
%15 = load double, double* %9
%16 = fsub double %15, 4.000000e+00
%17 = call i32 @fabs(double %16)
%18 = sub nsw i32 3, %17
%19 = load double, double* %9
%20 = fsub double %19, 5.000000e+00
%21 = call i32 @fabs(double %20)
%22 = sub nsw i32 %18, %21
%23 = sdiv i32 %22, 2
%24 = icmp sgt i32 0, %23
br i1 %24, label %25, label %26
25: ; preds = %2
br label %36
26: ; preds = %2
%27 = load double, double* %9
%28 = fsub double %27, 4.000000e+00
%29 = call i32 @fabs(double %28)
%30 = sub nsw i32 3, %29
%31 = load double, double* %9
%32 = fsub double %31, 5.000000e+00
%33 = call i32 @fabs(double %32)
%34 = sub nsw i32 %30, %33
%35 = sdiv i32 %34, 2
br label %36
36: ; preds = %26, %25
%37 = phi i32 [ 0, %25 ], [ %35, %26 ]
%38 = sitofp i32 %37 to double
%39 = load double*, double** %4
%40 = getelementptr inbounds double, double* %39, i64 0
store double %38, double* %40
%41 = load double, double* %9
%42 = fsub double %41, 2.000000e+00
%43 = call i32 @fabs(double %42)
%44 = sub nsw i32 4, %43
%45 = load double, double* %9
%46 = fsub double %45, 4.000000e+00
%47 = call i32 @fabs(double %46)
%48 = sub nsw i32 %44, %47
%49 = sdiv i32 %48, 2
%50 = icmp sgt i32 0, %49
br i1 %50, label %51, label %52
51: ; preds = %36
br label %62
52: ; preds = %36
%53 = load double, double* %9
%54 = fsub double %53, 2.000000e+00
%55 = call i32 @fabs(double %54)
%56 = sub nsw i32 4, %55
%57 = load double, double* %9
%58 = fsub double %57, 4.000000e+00
%59 = call i32 @fabs(double %58)
%60 = sub nsw i32 %56, %59
%61 = sdiv i32 %60, 2
br label %62
62: ; preds = %52, %51
%63 = phi i32 [ 0, %51 ], [ %61, %52 ]
%64 = sitofp i32 %63 to double
%65 = load double*, double** %4
%66 = getelementptr inbounds double, double* %65, i64 1
store double %64, double* %66
%67 = load double, double* %9
%68 = fsub double %67, 1.000000e+00
%69 = call i32 @fabs(double %68)
%70 = sub nsw i32 3, %69
%71 = load double, double* %9
%72 = fsub double %71, 2.000000e+00
%73 = call i32 @fabs(double %72)
%74 = sub nsw i32 %70, %73
%75 = sdiv i32 %74, 2
%76 = icmp sgt i32 0, %75
br i1 %76, label %77, label %78
77: ; preds = %62
br label %88
78: ; preds = %62
%79 = load double, double* %9
%80 = fsub double %79, 1.000000e+00
%81 = call i32 @fabs(double %80)
%82 = sub nsw i32 3, %81
%83 = load double, double* %9
%84 = fsub double %83, 2.000000e+00
%85 = call i32 @fabs(double %84)
%86 = sub nsw i32 %82, %85
%87 = sdiv i32 %86, 2
br label %88
88: ; preds = %78, %77
%89 = phi i32 [ 0, %77 ], [ %87, %78 ]
%90 = sitofp i32 %89 to double
%91 = load double*, double** %4
%92 = getelementptr inbounds double, double* %91, i64 2
store double %90, double* %92
store i32 0, i32* %5
br label %93
93: ; preds = %123, %88
%94 = load i32, i32* %5
%95 = icmp slt i32 %94, 3
br i1 %95, label %96, label %126
96: ; preds = %93
%97 = load double*, double** %4
%98 = load i32, i32* %5
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double, double* %97, i64 %99
%101 = load double, double* %100
%102 = fcmp ogt double %101, 0.000000e+00
br i1 %102, label %103, label %109
103: ; preds = %96
%104 = load double*, double** %4
%105 = load i32, i32* %5
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds double, double* %104, i64 %106
%108 = load double, double* %107
br label %110
109: ; preds = %96
br label %110
110: ; preds = %109, %103
%111 = phi double [ %108, %103 ], [ 0.000000e+00, %109 ]
store double %111, double* %6
%112 = load double, double* %6
%113 = fcmp olt double %112, 1.000000e+00
br i1 %113, label %114, label %116
114: ; preds = %110
%115 = load double, double* %6
br label %117
116: ; preds = %110
br label %117
117: ; preds = %116, %114
%118 = phi double [ %115, %114 ], [ 1.000000e+00, %116 ]
%119 = load double*, double** %4
%120 = load i32, i32* %5
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds double, double* %119, i64 %121
store double %118, double* %122
br label %123
123: ; preds = %117
%124 = load i32, i32* %5
%125 = add nsw i32 %124, 1
store i32 %125, i32* %5
br label %93
126: ; preds = %93
ret void
}

LLVM IR (-O2):
define void @colorMap_rainbow(double %0, double* nocapture %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double 5.800000e+00, double 1.000000e-01)
%4 = fadd double %3, -4.000000e+00
%5 = tail call i32 @fabs(double %4)
%6 = fadd double %3, -5.000000e+00
%7 = tail call i32 @fabs(double %6)
%8 = add i32 %5, -4
%9 = add i32 %8, %7
%10 = icmp sgt i32 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %2
%12 = tail call i32 @fabs(double %4)
%13 = tail call i32 @fabs(double %6)
%14 = add i32 %12, %13
%15 = sub i32 3, %14
%16 = sdiv i32 %15, 2
%17 = sitofp i32 %16 to double
br label %18
18: ; preds = %2, %11
%19 = phi double [ %17, %11 ], [ 0.000000e+00, %2 ]
store double %19, double* %1
%20 = fadd double %3, -2.000000e+00
%21 = tail call i32 @fabs(double %20)
%22 = tail call i32 @fabs(double %4)
%23 = add i32 %21, -5
%24 = add i32 %23, %22
%25 = icmp sgt i32 %24, 0
br i1 %25, label %33, label %26
26: ; preds = %18
%27 = tail call i32 @fabs(double %20)
%28 = tail call i32 @fabs(double %4)
%29 = add i32 %27, %28
%30 = sub i32 4, %29
%31 = sdiv i32 %30, 2
%32 = sitofp i32 %31 to double
br label %33
33: ; preds = %18, %26
%34 = phi double [ %32, %26 ], [ 0.000000e+00, %18 ]
%35 = getelementptr inbounds double, double* %1, i64 1
store double %34, double* %35
%36 = fadd double %3, -1.000000e+00
%37 = tail call i32 @fabs(double %36)
%38 = tail call i32 @fabs(double %20)
%39 = add i32 %37, -4
%40 = add i32 %39, %38
%41 = icmp sgt i32 %40, 0
br i1 %41, label %49, label %42
42: ; preds = %33
%43 = tail call i32 @fabs(double %36)
%44 = tail call i32 @fabs(double %20)
%45 = add i32 %43, %44
%46 = sub i32 3, %45
%47 = sdiv i32 %46, 2
%48 = sitofp i32 %47 to double
br label %49
49: ; preds = %33, %42
%50 = phi double [ %48, %42 ], [ 0.000000e+00, %33 ]
%51 = getelementptr inbounds double, double* %1, i64 2
%52 = load double, double* %1
%53 = fcmp ogt double %52, 0.000000e+00
%54 = select i1 %53, double %52, double 0.000000e+00
%55 = fcmp olt double %54, 1.000000e+00
%56 = select i1 %55, double %54, double 1.000000e+00
store double %56, double* %1
%57 = load double, double* %35
%58 = fcmp ogt double %57, 0.000000e+00
%59 = select i1 %58, double %57, double 0.000000e+00
%60 = fcmp olt double %59, 1.000000e+00
%61 = select i1 %60, double %59, double 1.000000e+00
store double %61, double* %35
%62 = fcmp ogt double %50, 0.000000e+00
%63 = select i1 %62, double %50, double 0.000000e+00
%64 = fcmp olt double %63, 1.000000e+00
%65 = select i1 %64, double %63, double 1.000000e+00
store double %65, double* %51
ret void
}