double dist_rt(int dist) {
  double result;
  if (700 <= dist && dist < 800) {
    result = 0.01;
  } else if (800 <= dist && dist < 900) {
    result = 0.02;
  } else if (900 <= dist && dist < 1000) {
    result = 0.01;
  } else if (1000 <= dist && dist < 1100) {
    result = 0.01;
  } else if (1100 <= dist && dist < 1200) {
    result = 0.04;
  } else if (1200 <= dist && dist < 1300) {
    result = 0.74;
  } else if (1300 <= dist && dist < 1400) {
    result = 0.17;
  } else if (1400 <= dist && dist < 1500) {
    result = 0.01;
  } else {
    result = 0.0000000000000000001;
  }
  return result;
}


x86 assembly (clang, -O0):
<dist_rt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x2bc,%eax
cmp    -0x4(%rbp),%eax
jg     1134 <dist_rt+0x34>
cmpl   $0x320,-0x4(%rbp)
jge    1134 <dist_rt+0x34>
movsd  0xede(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    129f <dist_rt+0x19f>
mov    $0x320,%eax
cmp    -0x4(%rbp),%eax
jg     1161 <dist_rt+0x61>
cmpl   $0x384,-0x4(%rbp)
jge    1161 <dist_rt+0x61>
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    129a <dist_rt+0x19a>
mov    $0x384,%eax
cmp    -0x4(%rbp),%eax
jg     118e <dist_rt+0x8e>
cmpl   $0x3e8,-0x4(%rbp)
jge    118e <dist_rt+0x8e>
movsd  0xe84(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1295 <dist_rt+0x195>
mov    $0x3e8,%eax
cmp    -0x4(%rbp),%eax
jg     11bb <dist_rt+0xbb>
cmpl   $0x44c,-0x4(%rbp)
jge    11bb <dist_rt+0xbb>
movsd  0xe57(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1290 <dist_rt+0x190>
mov    $0x44c,%eax
cmp    -0x4(%rbp),%eax
jg     11e8 <dist_rt+0xe8>
cmpl   $0x4b0,-0x4(%rbp)
jge    11e8 <dist_rt+0xe8>
movsd  0xe42(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    128b <dist_rt+0x18b>
mov    $0x4b0,%eax
cmp    -0x4(%rbp),%eax
jg     1215 <dist_rt+0x115>
cmpl   $0x514,-0x4(%rbp)
jge    1215 <dist_rt+0x115>
movsd  0xe0d(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1286 <dist_rt+0x186>
mov    $0x514,%eax
cmp    -0x4(%rbp),%eax
jg     1242 <dist_rt+0x142>
cmpl   $0x578,-0x4(%rbp)
jge    1242 <dist_rt+0x142>
movsd  0xdd8(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1281 <dist_rt+0x181>
mov    $0x578,%eax
cmp    -0x4(%rbp),%eax
jg     126f <dist_rt+0x16f>
cmpl   $0x5dc,-0x4(%rbp)
jge    126f <dist_rt+0x16f>
movsd  0xda3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    127c <dist_rt+0x17c>
movsd  0xd89(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1281 <dist_rt+0x181>
jmp    1286 <dist_rt+0x186>
jmp    128b <dist_rt+0x18b>
jmp    1290 <dist_rt+0x190>
jmp    1295 <dist_rt+0x195>
jmp    129a <dist_rt+0x19a>
jmp    129f <dist_rt+0x19f>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist_rt>:
lea    -0x2bc(%rdi),%eax
movsd  0xef2(%rip),%xmm0
cmp    $0x64,%eax
jb     1134 <dist_rt+0x34>
lea    -0x320(%rdi),%eax
cmp    $0x64,%eax
jae    1127 <dist_rt+0x27>
movsd  0xee2(%rip),%xmm0
ret
lea    -0x384(%rdi),%eax
cmp    $0xc8,%eax
jae    1135 <dist_rt+0x35>
ret
lea    -0x44c(%rdi),%eax
cmp    $0x64,%eax
jae    1149 <dist_rt+0x49>
movsd  0xec8(%rip),%xmm0
ret
lea    -0x4b0(%rdi),%eax
cmp    $0x64,%eax
jae    115d <dist_rt+0x5d>
movsd  0xebc(%rip),%xmm0
ret
lea    -0x514(%rdi),%eax
cmp    $0x64,%eax
jae    1171 <dist_rt+0x71>
movsd  0xeb0(%rip),%xmm0
ret
add    $0xfffffa88,%edi
xor    %eax,%eax
cmp    $0x64,%edi
setb   %al
lea    0xea2(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @dist_rt(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sle i32 700, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 800
br i1 %8, label %9, label %10
9: ; preds = %6
store double 1.000000e-02, double* %3
br label %67
10: ; preds = %6, %1
%11 = load i32, i32* %2
%12 = icmp sle i32 800, %11
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 900
br i1 %15, label %16, label %17
16: ; preds = %13
store double 2.000000e-02, double* %3
br label %66
17: ; preds = %13, %10
%18 = load i32, i32* %2
%19 = icmp sle i32 900, %18
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp slt i32 %21, 1000
br i1 %22, label %23, label %24
23: ; preds = %20
store double 1.000000e-02, double* %3
br label %65
24: ; preds = %20, %17
%25 = load i32, i32* %2
%26 = icmp sle i32 1000, %25
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = load i32, i32* %2
%29 = icmp slt i32 %28, 1100
br i1 %29, label %30, label %31
30: ; preds = %27
store double 1.000000e-02, double* %3
br label %64
31: ; preds = %27, %24
%32 = load i32, i32* %2
%33 = icmp sle i32 1100, %32
br i1 %33, label %34, label %38
34: ; preds = %31
%35 = load i32, i32* %2
%36 = icmp slt i32 %35, 1200
br i1 %36, label %37, label %38
37: ; preds = %34
store double 4.000000e-02, double* %3
br label %63
38: ; preds = %34, %31
%39 = load i32, i32* %2
%40 = icmp sle i32 1200, %39
br i1 %40, label %41, label %45
41: ; preds = %38
%42 = load i32, i32* %2
%43 = icmp slt i32 %42, 1300
br i1 %43, label %44, label %45
44: ; preds = %41
store double 0x3FE7AE147AE147AE, double* %3
br label %62
45: ; preds = %41, %38
%46 = load i32, i32* %2
%47 = icmp sle i32 1300, %46
br i1 %47, label %48, label %52
48: ; preds = %45
%49 = load i32, i32* %2
%50 = icmp slt i32 %49, 1400
br i1 %50, label %51, label %52
51: ; preds = %48
store double 1.700000e-01, double* %3
br label %61
52: ; preds = %48, %45
%53 = load i32, i32* %2
%54 = icmp sle i32 1400, %53
br i1 %54, label %55, label %59
55: ; preds = %52
%56 = load i32, i32* %2
%57 = icmp slt i32 %56, 1500
br i1 %57, label %58, label %59
58: ; preds = %55
store double 1.000000e-02, double* %3
br label %60
59: ; preds = %55, %52
store double 0x3BFD83C94FB6D2AC, double* %3
br label %60
60: ; preds = %59, %58
br label %61
61: ; preds = %60, %51
br label %62
62: ; preds = %61, %44
br label %63
63: ; preds = %62, %37
br label %64
64: ; preds = %63, %30
br label %65
65: ; preds = %64, %23
br label %66
66: ; preds = %65, %16
br label %67
67: ; preds = %66, %9
%68 = load double, double* %3
ret double %68
}

LLVM IR (-O2):
define double @dist_rt(i32 %0) {
%2 = add i32 %0, -700
%3 = icmp ult i32 %2, 100
br i1 %3, label %23, label %4
4: ; preds = %1
%5 = add i32 %0, -800
%6 = icmp ult i32 %5, 100
br i1 %6, label %23, label %7
7: ; preds = %4
%8 = add i32 %0, -900
%9 = icmp ult i32 %8, 200
br i1 %9, label %23, label %10
10: ; preds = %7
%11 = add i32 %0, -1100
%12 = icmp ult i32 %11, 100
br i1 %12, label %23, label %13
13: ; preds = %10
%14 = add i32 %0, -1200
%15 = icmp ult i32 %14, 100
br i1 %15, label %23, label %16
16: ; preds = %13
%17 = add i32 %0, -1300
%18 = icmp ult i32 %17, 100
br i1 %18, label %23, label %19
19: ; preds = %16
%20 = add i32 %0, -1400
%21 = icmp ult i32 %20, 100
%22 = select i1 %21, double 1.000000e-02, double 0x3BFD83C94FB6D2AC
br label %23
23: ; preds = %19, %16, %13, %10, %7, %4, %1
%24 = phi double [ 1.000000e-02, %1 ], [ 2.000000e-02, %4 ], [ 1.000000e-02, %7 ], [ 4.000000e-02, %10 ], [ 0x3FE7AE147AE147AE, %13 ], [ 1.700000e-01, %16 ], [ %22, %19 ]
ret double %24
}