#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 */
float fabs(float);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void init_topo_color_table(unsigned int ct[], int size, float minhgt,
                           float maxhgt) {
  static int nland = 4;
  static float land_red[4] = {20.0, 70.0, 165.0, 200.0};
  static float land_grn[4] = {170.0, 200.0, 42.0, 200.0};
  static float land_blu[4] = {42.0, 0.0, 42.0, 200.0};
  static float land_rng[4] = {0.0, 0.1, 1.0, 2.8};
  static int nocean = 7;
  static float ocean_red[7] = {5.0, 45.0, 20.0, 20.0, 70.0, 165.0, 200.0};
  static float ocean_grn[7] = {10.0, 50.0, 170.0, 170.0, 200.0, 42.0, 200.0};
  static float ocean_blu[7] = {30.0, 150.0, 42.0, 42.0, 0.0, 42.0, 200.0};
  static float ocean_rng[7] = {-5.0, -0.020, -0.015, 0.0, 0.1, 1.0, 2.8};
  int nrng;
  float *red, *grn, *blu, *rng;
  int i, j;
  float x0, x1;
  float r, g, b, dr, dg, db;
  for (i = 0; i < size - 1; i++) {
    ct[i] = 0xffffffff;
  }
  ct[size - 1] = ((255) << 24 | (255) << 16 | (25) << 8 | (25));
  if (minhgt < 0.0)
    nrng = nland;
  rng = land_rng;
  red = land_red;
  grn = land_grn;
  blu = land_blu;
  {
    if ((maxhgt <= 0.0) || (fabs(minhgt) > maxhgt)) {
      fprintf(stderr, "%s  %s\n", "Topo range is mostly < 0.0.",
              "Using the \"Ocean\" color table.");
      nrng = nocean;
      rng = ocean_rng;
      red = ocean_red;
      grn = ocean_grn;
      blu = ocean_blu;
    }
  }
  for (i = 0; i < nrng - 1; i++) {
    if (minhgt == maxhgt) {
      r = g = b = 0;
      dr = dg = db = 0;
      x0 = x1 = 0;
    } else {
      x0 = (rng[i] - minhgt) / (maxhgt - minhgt) * (float)(size - 1);
      x1 = (rng[i + 1] - minhgt) / (maxhgt - minhgt) * (float)(size - 1);
      dr = (red[i + 1] - red[i]) / (x1 - x0);
      dg = (grn[i + 1] - grn[i]) / (x1 - x0);
      db = (blu[i + 1] - blu[i]) / (x1 - x0);
      r = red[i];
      g = grn[i];
      b = blu[i];
    }
    for (j = (int)x0; j < (int)x1; j++) {
      if (j >= 0 && j < size - 1) {
        ct[j] = ((0xff) << 24 | ((int)b) << 16 | ((int)g) << 8 | ((int)r));
      }
      r += dr;
      g += dg;
      b += db;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<init_topo_color_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    116e <init_topo_color_table+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1140 <init_topo_color_table+0x20>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movl   $0xffff1919,(%rax,%rcx,4)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    11a1 <init_topo_color_table+0x81>
mov    0x2ea2(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    0x2ed8(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0x2e9d(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0x2ea2(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0x2ea7(%rip),%rax
mov    %rax,-0x30(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jae    11f7 <init_topo_color_table+0xd7>
movss  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
ucomiss -0x14(%rbp),%xmm0
jbe    124f <init_topo_color_table+0x12f>
mov    0x2de2(%rip),%rax
mov    (%rax),%edi
lea    0xdf9(%rip),%rsi
lea    0xdfa(%rip),%rdx
lea    0xe0f(%rip),%rcx
call   1040 <fprintf@plt>
mov    0x2e70(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    0x2ed6(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0x2e6b(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0x2e80(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0x2e95(%rip),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    14a3 <init_topo_color_table+0x383>
movss  -0x10(%rbp),%xmm0
ucomiss -0x14(%rbp),%xmm0
jne    12c1 <init_topo_color_table+0x1a1>
jp     12c1 <init_topo_color_table+0x1a1>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x54(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x5c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    13f8 <init_topo_color_table+0x2d8>
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
subss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
subss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
movss  -0x48(%rbp),%xmm1
subss  -0x44(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
movss  -0x48(%rbp),%xmm1
subss  -0x44(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x5c(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
movss  -0x48(%rbp),%xmm1
subss  -0x44(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x60(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x54(%rbp)
cvttss2si -0x44(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cvttss2si -0x48(%rbp),%ecx
cmp    %ecx,%eax
jge    1490 <init_topo_color_table+0x370>
cmpl   $0x0,-0x40(%rbp)
jl     1455 <init_topo_color_table+0x335>
mov    -0x40(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1455 <init_topo_color_table+0x335>
cvttss2si -0x54(%rbp),%edx
shl    $0x10,%edx
or     $0xff000000,%edx
cvttss2si -0x50(%rbp),%eax
shl    $0x8,%eax
or     %eax,%edx
cvttss2si -0x4c(%rbp),%eax
or     %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
movss  -0x58(%rbp),%xmm0
addss  -0x4c(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x5c(%rbp),%xmm0
addss  -0x50(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x60(%rbp),%xmm0
addss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x54(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1400 <init_topo_color_table+0x2e0>
jmp    1495 <init_topo_color_table+0x375>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1256 <init_topo_color_table+0x136>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_topo_color_table>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
movaps %xmm1,%xmm2
mov    %rdi,%r15
lea    -0x1(%rsi),%ebp
cmp    $0x2,%esi
movss  %xmm1,0xc(%rsp)
movaps %xmm0,0x10(%rsp)
jl     1161 <init_topo_color_table+0x41>
mov    %ebp,%edx
shl    $0x2,%rdx
mov    %r15,%rdi
mov    $0xff,%esi
call   1030 <memset@plt>
movaps 0x10(%rsp),%xmm0
movss  0xc(%rsp),%xmm2
movslq %ebp,%rax
movl   $0xffff1919,(%r15,%rax,4)
ff
xorps  %xmm1,%xmm1
ucomiss %xmm2,%xmm1
jae    11a7 <init_topo_color_table+0x87>
movaps 0xe85(%rip),%xmm1
andps  %xmm0,%xmm1
ucomiss %xmm2,%xmm1
ja     11a7 <init_topo_color_table+0x87>
lea    0xeb6(%rip),%r8
lea    0xe9f(%rip),%r9
lea    0xe88(%rip),%r10
lea    0xe71(%rip),%r11
mov    $0x3,%r14d
jmp    11f7 <init_topo_color_table+0xd7>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
lea    0xf15(%rip),%rsi
lea    0xf16(%rip),%rdx
lea    0xf2b(%rip),%rcx
call   1040 <fprintf@plt>
movaps 0x10(%rsp),%xmm0
movss  0xc(%rsp),%xmm2
lea    0xed4(%rip),%r8
lea    0xead(%rip),%r9
lea    0xe86(%rip),%r10
lea    0xe5f(%rip),%r11
mov    $0x6,%r14d
movaps %xmm2,%xmm10
subss  %xmm0,%xmm10
cvtsi2ss %ebp,%xmm8
movaps %xmm0,%xmm9
shufps $0x0,%xmm0,%xmm9
shufps $0x0,%xmm10,%xmm10
shufps $0x0,%xmm8,%xmm8
xor    %eax,%eax
jmp    122d <init_topo_color_table+0x10d>
nopl   0x0(%rax)
add    $0x1,%rax
cmp    %r14,%rax
je     1315 <init_topo_color_table+0x1f5>
ucomiss %xmm2,%xmm0
jne    1250 <init_topo_color_table+0x130>
jp     1250 <init_topo_color_table+0x130>
xorps  %xmm3,%xmm3
xorps  %xmm5,%xmm5
xorps  %xmm6,%xmm6
xorps  %xmm4,%xmm4
xorps  %xmm7,%xmm7
jmp    12ab <init_topo_color_table+0x18b>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%r8,%rax,4),%xmm7
subps  %xmm9,%xmm7
divps  %xmm10,%xmm7
mulps  %xmm8,%xmm7
movaps %xmm7,%xmm1
shufps $0x55,%xmm7,%xmm1
subps  %xmm7,%xmm1
movss  (%r11,%rax,4),%xmm3
movss  0x4(%r11,%rax,4),%xmm5
movss  (%r10,%rax,4),%xmm4
unpcklps %xmm3,%xmm4
movss  0x4(%r10,%rax,4),%xmm3
unpcklps %xmm5,%xmm3
subps  %xmm4,%xmm3
movss  (%r9,%rax,4),%xmm5
movss  0x4(%r9,%rax,4),%xmm6
subss  %xmm5,%xmm6
divss  %xmm1,%xmm6
shufps $0x0,%xmm1,%xmm1
divps  %xmm1,%xmm3
cvttps2dq %xmm7,%xmm1
movd   %xmm1,%ecx
pshufd $0x55,%xmm1,%xmm1
movd   %xmm1,%edx
cmp    %edx,%ecx
jl     12e2 <init_topo_color_table+0x1c2>
jmp    1220 <init_topo_color_table+0x100>
cs nopw 0x0(%rax,%rax,1)
nop
addps  %xmm3,%xmm4
addss  %xmm6,%xmm5
add    $0x1,%ecx
cmp    %ecx,%edx
je     1220 <init_topo_color_table+0x100>
test   %ecx,%ecx
js     12d0 <init_topo_color_table+0x1b0>
cmp    %ebp,%ecx
jge    12d0 <init_topo_color_table+0x1b0>
cvttss2si %xmm5,%esi
shl    $0x10,%esi
cvttss2si %xmm4,%edi
shl    $0x8,%edi
movaps %xmm4,%xmm1
shufps $0x55,%xmm4,%xmm1
cvttss2si %xmm1,%ebx
or     %edi,%ebx
or     %esi,%ebx
or     $0xff000000,%ebx
mov    %ecx,%esi
mov    %ebx,(%r15,%rsi,4)
jmp    12d0 <init_topo_color_table+0x1b0>
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@init_topo_color_table.nland = internal global i32 4
@init_topo_color_table.land_red = internal global [4 x float] [float 2.000000e+01, float 7.000000e+01, float 1.650000e+02, float 2.000000e+02]
@init_topo_color_table.land_grn = internal global [4 x float] [float 1.700000e+02, float 2.000000e+02, float 4.200000e+01, float 2.000000e+02]
@init_topo_color_table.land_blu = internal global [4 x float] [float 4.200000e+01, float 0.000000e+00, float 4.200000e+01, float 2.000000e+02]
@init_topo_color_table.land_rng = internal global [4 x float] [float 0.000000e+00, float 0x3FB99999A0000000, float 1.000000e+00, float 0x4006666660000000]
@init_topo_color_table.nocean = internal global i32 7
@init_topo_color_table.ocean_red = internal global [7 x float] [float 5.000000e+00, float 4.500000e+01, float 2.000000e+01, float 2.000000e+01, float 7.000000e+01, float 1.650000e+02, float 2.000000e+02]
@init_topo_color_table.ocean_grn = internal global [7 x float] [float 1.000000e+01, float 5.000000e+01, float 1.700000e+02, float 1.700000e+02, float 2.000000e+02, float 4.200000e+01, float 2.000000e+02]
@init_topo_color_table.ocean_blu = internal global [7 x float] [float 3.000000e+01, float 1.500000e+02, float 4.200000e+01, float 4.200000e+01, float 0.000000e+00, float 4.200000e+01, float 2.000000e+02]
@init_topo_color_table.ocean_rng = internal global [7 x float] [float -5.000000e+00, float 0xBF947AE140000000, float 0xBF8EB851E0000000, float 0.000000e+00, float 0x3FB99999A0000000, float 1.000000e+00, float 0x4006666660000000]
@stderr = global i32 0
@.str = [8 x i8] c"%s %s\0A\00"
@.str.1 = [28 x i8] c"Topo range is mostly < 0.0.\00"
@.str.2 = [31 x i8] c"Using the \22Ocean\22 color table.\00"
define void @init_topo_color_table(i32* %0, i32 %1, float %2, float %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca i32
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca float*
%14 = alloca i32
%15 = alloca i32
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca float
store i32* %0, i32** %5
store i32 %1, i32* %6
store float %2, float* %7
store float %3, float* %8
store i32 0, i32* %14
br label %24
24: ; preds = %34, %4
%25 = load i32, i32* %14
%26 = load i32, i32* %6
%27 = sub nsw i32 %26, 1
%28 = icmp slt i32 %25, %27
br i1 %28, label %29, label %37
29: ; preds = %24
%30 = load i32*, i32** %5
%31 = load i32, i32* %14
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %30, i64 %32
store i32 -1, i32* %33
br label %34
34: ; preds = %29
%35 = load i32, i32* %14
%36 = add nsw i32 %35, 1
store i32 %36, i32* %14
br label %24
37: ; preds = %24
%38 = load i32*, i32** %5
%39 = load i32, i32* %6
%40 = sub nsw i32 %39, 1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %38, i64 %41
store i32 -59111, i32* %42
%43 = load float, float* %7
%44 = fpext float %43 to double
%45 = fcmp olt double %44, 0.000000e+00
br i1 %45, label %46, label %48
46: ; preds = %37
%47 = load i32, i32* @init_topo_color_table.nland
store i32 %47, i32* %9
br label %48
48: ; preds = %46, %37
store float* getelementptr inbounds ([4 x float], [4 x float]* @init_topo_color_table.land_rng, i64 0, i64 0), float** %13
store float* getelementptr inbounds ([4 x float], [4 x float]* @init_topo_color_table.land_red, i64 0, i64 0), float** %10
store float* getelementptr inbounds ([4 x float], [4 x float]* @init_topo_color_table.land_grn, i64 0, i64 0), float** %11
store float* getelementptr inbounds ([4 x float], [4 x float]* @init_topo_color_table.land_blu, i64 0, i64 0), float** %12
%49 = load float, float* %8
%50 = fpext float %49 to double
%51 = fcmp ole double %50, 0.000000e+00
br i1 %51, label %57, label %52
52: ; preds = %48
%53 = load float, float* %7
%54 = call float @fabs(float %53)
%55 = load float, float* %8
%56 = fcmp ogt float %54, %55
br i1 %56, label %57, label %61
57: ; preds = %52, %48
%58 = load i32, i32* @stderr
%59 = call i32 @fprintf(i32 %58, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%60 = load i32, i32* @init_topo_color_table.nocean
store i32 %60, i32* %9
store float* getelementptr inbounds ([7 x float], [7 x float]* @init_topo_color_table.ocean_rng, i64 0, i64 0), float** %13
store float* getelementptr inbounds ([7 x float], [7 x float]* @init_topo_color_table.ocean_red, i64 0, i64 0), float** %10
store float* getelementptr inbounds ([7 x float], [7 x float]* @init_topo_color_table.ocean_grn, i64 0, i64 0), float** %11
store float* getelementptr inbounds ([7 x float], [7 x float]* @init_topo_color_table.ocean_blu, i64 0, i64 0), float** %12
br label %61
61: ; preds = %57, %52
store i32 0, i32* %14
br label %62
62: ; preds = %213, %61
%63 = load i32, i32* %14
%64 = load i32, i32* %9
%65 = sub nsw i32 %64, 1
%66 = icmp slt i32 %63, %65
br i1 %66, label %67, label %216
67: ; preds = %62
%68 = load float, float* %7
%69 = load float, float* %8
%70 = fcmp oeq float %68, %69
br i1 %70, label %71, label %72
71: ; preds = %67
store float 0.000000e+00, float* %20
store float 0.000000e+00, float* %19
store float 0.000000e+00, float* %18
store float 0.000000e+00, float* %23
store float 0.000000e+00, float* %22
store float 0.000000e+00, float* %21
store float 0.000000e+00, float* %17
store float 0.000000e+00, float* %16
br label %167
72: ; preds = %67
%73 = load float*, float** %13
%74 = load i32, i32* %14
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds float, float* %73, i64 %75
%77 = load float, float* %76
%78 = load float, float* %7
%79 = fsub float %77, %78
%80 = load float, float* %8
%81 = load float, float* %7
%82 = fsub float %80, %81
%83 = fdiv float %79, %82
%84 = load i32, i32* %6
%85 = sub nsw i32 %84, 1
%86 = sitofp i32 %85 to float
%87 = fmul float %83, %86
store float %87, float* %16
%88 = load float*, float** %13
%89 = load i32, i32* %14
%90 = add nsw i32 %89, 1
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds float, float* %88, i64 %91
%93 = load float, float* %92
%94 = load float, float* %7
%95 = fsub float %93, %94
%96 = load float, float* %8
%97 = load float, float* %7
%98 = fsub float %96, %97
%99 = fdiv float %95, %98
%100 = load i32, i32* %6
%101 = sub nsw i32 %100, 1
%102 = sitofp i32 %101 to float
%103 = fmul float %99, %102
store float %103, float* %17
%104 = load float*, float** %10
%105 = load i32, i32* %14
%106 = add nsw i32 %105, 1
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds float, float* %104, i64 %107
%109 = load float, float* %108
%110 = load float*, float** %10
%111 = load i32, i32* %14
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds float, float* %110, i64 %112
%114 = load float, float* %113
%115 = fsub float %109, %114
%116 = load float, float* %17
%117 = load float, float* %16
%118 = fsub float %116, %117
%119 = fdiv float %115, %118
store float %119, float* %21
%120 = load float*, float** %11
%121 = load i32, i32* %14
%122 = add nsw i32 %121, 1
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds float, float* %120, i64 %123
%125 = load float, float* %124
%126 = load float*, float** %11
%127 = load i32, i32* %14
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds float, float* %126, i64 %128
%130 = load float, float* %129
%131 = fsub float %125, %130
%132 = load float, float* %17
%133 = load float, float* %16
%134 = fsub float %132, %133
%135 = fdiv float %131, %134
store float %135, float* %22
%136 = load float*, float** %12
%137 = load i32, i32* %14
%138 = add nsw i32 %137, 1
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds float, float* %136, i64 %139
%141 = load float, float* %140
%142 = load float*, float** %12
%143 = load i32, i32* %14
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds float, float* %142, i64 %144
%146 = load float, float* %145
%147 = fsub float %141, %146
%148 = load float, float* %17
%149 = load float, float* %16
%150 = fsub float %148, %149
%151 = fdiv float %147, %150
store float %151, float* %23
%152 = load float*, float** %10
%153 = load i32, i32* %14
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds float, float* %152, i64 %154
%156 = load float, float* %155
store float %156, float* %18
%157 = load float*, float** %11
%158 = load i32, i32* %14
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds float, float* %157, i64 %159
%161 = load float, float* %160
store float %161, float* %19
%162 = load float*, float** %12
%163 = load i32, i32* %14
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds float, float* %162, i64 %164
%166 = load float, float* %165
store float %166, float* %20
br label %167
167: ; preds = %72, %71
%168 = load float, float* %16
%169 = fptosi float %168 to i32
store i32 %169, i32* %15
br label %170
170: ; preds = %209, %167
%171 = load i32, i32* %15
%172 = load float, float* %17
%173 = fptosi float %172 to i32
%174 = icmp slt i32 %171, %173
br i1 %174, label %175, label %212
175: ; preds = %170
%176 = load i32, i32* %15
%177 = icmp sge i32 %176, 0
br i1 %177, label %178, label %199
178: ; preds = %175
%179 = load i32, i32* %15
%180 = load i32, i32* %6
%181 = sub nsw i32 %180, 1
%182 = icmp slt i32 %179, %181
br i1 %182, label %183, label %199
183: ; preds = %178
%184 = load float, float* %20
%185 = fptosi float %184 to i32
%186 = shl i32 %185, 16
%187 = or i32 -16777216, %186
%188 = load float, float* %19
%189 = fptosi float %188 to i32
%190 = shl i32 %189, 8
%191 = or i32 %187, %190
%192 = load float, float* %18
%193 = fptosi float %192 to i32
%194 = or i32 %191, %193
%195 = load i32*, i32** %5
%196 = load i32, i32* %15
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds i32, i32* %195, i64 %197
store i32 %194, i32* %198
br label %199
199: ; preds = %183, %178, %175
%200 = load float, float* %21
%201 = load float, float* %18
%202 = fadd float %201, %200
store float %202, float* %18
%203 = load float, float* %22
%204 = load float, float* %19
%205 = fadd float %204, %203
store float %205, float* %19
%206 = load float, float* %23
%207 = load float, float* %20
%208 = fadd float %207, %206
store float %208, float* %20
br label %209
209: ; preds = %199
%210 = load i32, i32* %15
%211 = add nsw i32 %210, 1
store i32 %211, i32* %15
br label %170
212: ; preds = %170
br label %213
213: ; preds = %212
%214 = load i32, i32* %14
%215 = add nsw i32 %214, 1
store i32 %215, i32* %14
br label %62
216: ; preds = %62
ret void
}

LLVM IR (-O2):
@init_topo_color_table.land_red = internal unnamed_addr constant [4 x float] [float 2.000000e+01, float 7.000000e+01, float 1.650000e+02, float 2.000000e+02]
@init_topo_color_table.land_grn = internal unnamed_addr constant [4 x float] [float 1.700000e+02, float 2.000000e+02, float 4.200000e+01, float 2.000000e+02]
@init_topo_color_table.land_blu = internal unnamed_addr constant [4 x float] [float 4.200000e+01, float 0.000000e+00, float 4.200000e+01, float 2.000000e+02]
@init_topo_color_table.land_rng = internal unnamed_addr constant [4 x float] [float 0.000000e+00, float 0x3FB99999A0000000, float 1.000000e+00, float 0x4006666660000000]
@init_topo_color_table.ocean_red = internal unnamed_addr constant [7 x float] [float 5.000000e+00, float 4.500000e+01, float 2.000000e+01, float 2.000000e+01, float 7.000000e+01, float 1.650000e+02, float 2.000000e+02]
@init_topo_color_table.ocean_grn = internal unnamed_addr constant [7 x float] [float 1.000000e+01, float 5.000000e+01, float 1.700000e+02, float 1.700000e+02, float 2.000000e+02, float 4.200000e+01, float 2.000000e+02]
@init_topo_color_table.ocean_blu = internal unnamed_addr constant [7 x float] [float 3.000000e+01, float 1.500000e+02, float 4.200000e+01, float 4.200000e+01, float 0.000000e+00, float 4.200000e+01, float 2.000000e+02]
@init_topo_color_table.ocean_rng = internal unnamed_addr constant [7 x float] [float -5.000000e+00, float 0xBF947AE140000000, float 0xBF8EB851E0000000, float 0.000000e+00, float 0x3FB99999A0000000, float 1.000000e+00, float 0x4006666660000000]
@stderr = global i32 0
@.str = [8 x i8] c"%s %s\0A\00"
@.str.1 = [28 x i8] c"Topo range is mostly < 0.0.\00"
@.str.2 = [31 x i8] c"Using the \22Ocean\22 color table.\00"
define void @init_topo_color_table(i32* nocapture writeonly %0, i32 %1, float %2, float %3) {
%5 = add i32 %1, -1
%6 = icmp sgt i32 %1, 1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = bitcast i32* %0 to i8*
%9 = zext i32 %5 to i64
%10 = shl nuw nsw i64 %9, 2
br label %11
11: ; preds = %7, %4
%12 = sext i32 %5 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 -59111, i32* %13
%14 = fcmp ole float %3, 0.000000e+00
%15 = tail call float @llvm.fabs.f32(float %2)
%16 = fcmp ogt float %15, %3
%17 = select i1 %14, i1 true, i1 %16
br i1 %17, label %18, label %21
18: ; preds = %11
%19 = load i32, i32* @stderr
%20 = tail call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %11, %18
%22 = phi i64 [ 6, %18 ], [ 3, %11 ]
%23 = phi float* [ getelementptr inbounds ([7 x float], [7 x float]* @init_topo_color_table.ocean_red, i64 0, i64 0), %18 ], [ getelementptr inbounds ([4 x float], [4 x float]* @init_topo_color_table.land_red, i64 0, i64 0), %11 ]
%24 = phi float* [ getelementptr inbounds ([7 x float], [7 x float]* @init_topo_color_table.ocean_grn, i64 0, i64 0), %18 ], [ getelementptr inbounds ([4 x float], [4 x float]* @init_topo_color_table.land_grn, i64 0, i64 0), %11 ]
%25 = phi float* [ getelementptr inbounds ([7 x float], [7 x float]* @init_topo_color_table.ocean_blu, i64 0, i64 0), %18 ], [ getelementptr inbounds ([4 x float], [4 x float]* @init_topo_color_table.land_blu, i64 0, i64 0), %11 ]
%26 = phi float* [ getelementptr inbounds ([7 x float], [7 x float]* @init_topo_color_table.ocean_rng, i64 0, i64 0), %18 ], [ getelementptr inbounds ([4 x float], [4 x float]* @init_topo_color_table.land_rng, i64 0, i64 0), %11 ]
%27 = fcmp oeq float %2, %3
%28 = fsub float %3, %2
%29 = sitofp i32 %5 to float
%30 = insertelement <2 x float> poison, float %2, i64 0
%31 = shufflevector <2 x float> %30, <2 x float> poison, <2 x i32> zeroinitializer
%32 = insertelement <2 x float> poison, float %28, i64 0
%33 = shufflevector <2 x float> %32, <2 x float> poison, <2 x i32> zeroinitializer
%34 = insertelement <2 x float> poison, float %29, i64 0
%35 = shufflevector <2 x float> %34, <2 x float> poison, <2 x i32> zeroinitializer
br label %36
36: ; preds = %21, %105
%37 = phi i64 [ 0, %21 ], [ %106, %105 ]
br i1 %27, label %70, label %38
38: ; preds = %36
%39 = getelementptr inbounds float, float* %26, i64 %37
%40 = add nuw nsw i64 %37, 1
%41 = bitcast float* %39 to <2 x float>*
%42 = load <2 x float>, <2 x float>* %41
%43 = fsub <2 x float> %42, %31
%44 = fdiv <2 x float> %43, %33
%45 = fmul <2 x float> %44, %35
%46 = getelementptr inbounds float, float* %23, i64 %40
%47 = load float, float* %46
%48 = getelementptr inbounds float, float* %23, i64 %37
%49 = load float, float* %48
%50 = shufflevector <2 x float> %45, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%51 = fsub <2 x float> %50, %45
%52 = extractelement <2 x float> %51, i64 0
%53 = getelementptr inbounds float, float* %24, i64 %40
%54 = load float, float* %53
%55 = getelementptr inbounds float, float* %24, i64 %37
%56 = load float, float* %55
%57 = insertelement <2 x float> poison, float %54, i64 0
%58 = insertelement <2 x float> %57, float %47, i64 1
%59 = insertelement <2 x float> poison, float %56, i64 0
%60 = insertelement <2 x float> %59, float %49, i64 1
%61 = fsub <2 x float> %58, %60
%62 = shufflevector <2 x float> %51, <2 x float> undef, <2 x i32> zeroinitializer
%63 = fdiv <2 x float> %61, %62
%64 = getelementptr inbounds float, float* %25, i64 %40
%65 = load float, float* %64
%66 = getelementptr inbounds float, float* %25, i64 %37
%67 = load float, float* %66
%68 = fsub float %65, %67
%69 = fdiv float %68, %52
br label %70
70: ; preds = %36, %38
%71 = phi float [ %67, %38 ], [ 0.000000e+00, %36 ]
%72 = phi float [ %69, %38 ], [ 0.000000e+00, %36 ]
%73 = phi <2 x float> [ %63, %38 ], [ zeroinitializer, %36 ]
%74 = phi <2 x float> [ %60, %38 ], [ zeroinitializer, %36 ]
%75 = phi <2 x float> [ %45, %38 ], [ zeroinitializer, %36 ]
%76 = fptosi <2 x float> %75 to <2 x i32>
%77 = extractelement <2 x i32> %76, i64 0
%78 = extractelement <2 x i32> %76, i64 1
%79 = icmp slt i32 %77, %78
br i1 %79, label %80, label %105
80: ; preds = %70, %100
%81 = phi float [ %102, %100 ], [ %71, %70 ]
%82 = phi i32 [ %103, %100 ], [ %77, %70 ]
%83 = phi <2 x float> [ %101, %100 ], [ %74, %70 ]
%84 = icmp sgt i32 %82, -1
%85 = icmp slt i32 %82, %5
%86 = and i1 %84, %85
br i1 %86, label %87, label %100
87: ; preds = %80
%88 = fptosi float %81 to i32
%89 = shl i32 %88, 16
%90 = extractelement <2 x float> %83, i64 0
%91 = fptosi float %90 to i32
%92 = shl i32 %91, 8
%93 = extractelement <2 x float> %83, i64 1
%94 = fptosi float %93 to i32
%95 = or i32 %92, %94
%96 = or i32 %95, %89
%97 = or i32 %96, -16777216
%98 = zext i32 %82 to i64
%99 = getelementptr inbounds i32, i32* %0, i64 %98
store i32 %97, i32* %99
br label %100
100: ; preds = %87, %80
%101 = fadd <2 x float> %73, %83
%102 = fadd float %72, %81
%103 = add nsw i32 %82, 1
%104 = icmp eq i32 %103, %78
br i1 %104, label %105, label %80
105: ; preds = %100, %70
%106 = add nuw nsw i64 %37, 1
%107 = icmp eq i64 %106, %22
br i1 %107, label %108, label %36
108: ; preds = %105
ret void
}