#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
double decode_speed(uint8_t mov) {
  if (!mov)
    return 0.0;
  else if (mov == 1)
    return 0.125;
  else if (mov <= 8)
    return 0.125 + 0.125 * (mov - 2);
  else if (mov <= 12)
    return 1.0 + 0.25 * (mov - 9);
  else if (mov <= 38)
    return 2.0 + 0.5 * (mov - 13);
  else if (mov <= 93)
    return 15.0 + 1.0 * (mov - 39);
  else if (mov <= 108)
    return 70.0 + 2.0 * (mov - 94);
  else if (mov <= 123)
    return 100.0 + 5.0 * (mov - 109);
  else if (mov == 124)
    return 324.1;
  else
    return -1.0;
}


x86 assembly (clang, -O0):
<decode_speed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111e <decode_speed+0x1e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    128b <decode_speed+0x18b>
cmpl   $0x1,-0xc(%rbp)
jne    113a <decode_speed+0x3a>
movsd  0xf20(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    128b <decode_speed+0x18b>
cmpl   $0x8,-0xc(%rbp)
jg     1168 <decode_speed+0x68>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
cvtsi2sd %eax,%xmm0
movsd  0xefa(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    128b <decode_speed+0x18b>
cmpl   $0xc,-0xc(%rbp)
jg     119e <decode_speed+0x9e>
mov    -0xc(%rbp),%eax
sub    $0x9,%eax
cvtsi2sd %eax,%xmm0
movsd  0xebc(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    128b <decode_speed+0x18b>
cmpl   $0x26,-0xc(%rbp)
jg     11d4 <decode_speed+0xd4>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe76(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe72(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    128b <decode_speed+0x18b>
cmpl   $0x5d,-0xc(%rbp)
jg     11fe <decode_speed+0xfe>
mov    -0xc(%rbp),%eax
sub    $0x27,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe38(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    128b <decode_speed+0x18b>
cmpl   $0x6c,-0xc(%rbp)
jg     122c <decode_speed+0x12c>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
movsd  0xe02(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    128b <decode_speed+0x18b>
cmpl   $0x7b,-0xc(%rbp)
jg     1262 <decode_speed+0x162>
mov    -0xc(%rbp),%eax
sub    $0x6d,%eax
cvtsi2sd %eax,%xmm0
movsd  0xdc8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdc4(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    128b <decode_speed+0x18b>
cmpl   $0x7c,-0xc(%rbp)
jne    127e <decode_speed+0x17e>
movsd  0xd94(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    128b <decode_speed+0x18b>
movsd  0xd7a(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_speed>:
test   %edi,%edi
je     1112 <decode_speed+0x12>
cmp    $0x1,%edi
jne    1116 <decode_speed+0x16>
movsd  0xeef(%rip),%xmm0
ret
xorps  %xmm0,%xmm0
ret
cmp    $0x8,%edi
jg     1133 <decode_speed+0x33>
add    $0xfffffffe,%edi
cvtsi2sd %edi,%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
ret
cmp    $0xc,%edi
ja     1150 <decode_speed+0x50>
add    $0xfffffff7,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xee9(%rip),%xmm0
addsd  0xee9(%rip),%xmm0
ret
cmp    $0x26,%edi
ja     116d <decode_speed+0x6d>
add    $0xfffffff3,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xebc(%rip),%xmm0
addsd  0xebc(%rip),%xmm0
ret
cmp    $0x5d,%edi
ja     117a <decode_speed+0x7a>
add    $0xffffffe8,%edi
cvtsi2sd %edi,%xmm0
ret
cmp    $0x6c,%edi
ja     1193 <decode_speed+0x93>
add    $0xffffffa2,%edi
cvtsi2sd %edi,%xmm0
addsd  %xmm0,%xmm0
addsd  0xe86(%rip),%xmm0
ret
cmp    $0x7b,%edi
ja     11b0 <decode_speed+0xb0>
add    $0xffffff93,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xe61(%rip),%xmm0
addsd  0xe61(%rip),%xmm0
ret
xor    %eax,%eax
cmp    $0x7c,%edi
sete   %al
lea    0xe81(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @decode_speed(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %64
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store double 1.250000e-01, double* %2
br label %64
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 8
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 2
%17 = sitofp i32 %16 to double
%18 = call double @llvm.fmuladd.f64(double 1.250000e-01, double %17, double 1.250000e-01)
store double %18, double* %2
br label %64
19: ; preds = %11
%20 = load i32, i32* %3
%21 = icmp sle i32 %20, 12
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load i32, i32* %3
%24 = sub nsw i32 %23, 9
%25 = sitofp i32 %24 to double
%26 = call double @llvm.fmuladd.f64(double 2.500000e-01, double %25, double 1.000000e+00)
store double %26, double* %2
br label %64
27: ; preds = %19
%28 = load i32, i32* %3
%29 = icmp sle i32 %28, 38
br i1 %29, label %30, label %35
30: ; preds = %27
%31 = load i32, i32* %3
%32 = sub nsw i32 %31, 13
%33 = sitofp i32 %32 to double
%34 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %33, double 2.000000e+00)
store double %34, double* %2
br label %64
35: ; preds = %27
%36 = load i32, i32* %3
%37 = icmp sle i32 %36, 93
br i1 %37, label %38, label %43
38: ; preds = %35
%39 = load i32, i32* %3
%40 = sub nsw i32 %39, 39
%41 = sitofp i32 %40 to double
%42 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %41, double 1.500000e+01)
store double %42, double* %2
br label %64
43: ; preds = %35
%44 = load i32, i32* %3
%45 = icmp sle i32 %44, 108
br i1 %45, label %46, label %51
46: ; preds = %43
%47 = load i32, i32* %3
%48 = sub nsw i32 %47, 94
%49 = sitofp i32 %48 to double
%50 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %49, double 7.000000e+01)
store double %50, double* %2
br label %64
51: ; preds = %43
%52 = load i32, i32* %3
%53 = icmp sle i32 %52, 123
br i1 %53, label %54, label %59
54: ; preds = %51
%55 = load i32, i32* %3
%56 = sub nsw i32 %55, 109
%57 = sitofp i32 %56 to double
%58 = call double @llvm.fmuladd.f64(double 5.000000e+00, double %57, double 1.000000e+02)
store double %58, double* %2
br label %64
59: ; preds = %51
%60 = load i32, i32* %3
%61 = icmp eq i32 %60, 124
br i1 %61, label %62, label %63
62: ; preds = %59
store double 3.241000e+02, double* %2
br label %64
63: ; preds = %59
store double -1.000000e+00, double* %2
br label %64
64: ; preds = %63, %62, %54, %46, %38, %30, %22, %14, %10, %6
%65 = load double, double* %2
ret double %65
}

LLVM IR (-O2):
define double @decode_speed(i32 %0) {
switch i32 %0, label %3 [
i32 0, label %41
i32 1, label %2
]
2: ; preds = %1
br label %41
3: ; preds = %1
%4 = icmp slt i32 %0, 9
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = add nsw i32 %0, -2
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %7, double 1.250000e-01, double 1.250000e-01)
br label %41
9: ; preds = %3
%10 = icmp ult i32 %0, 13
br i1 %10, label %11, label %15
11: ; preds = %9
%12 = add nsw i32 %0, -9
%13 = sitofp i32 %12 to double
%14 = tail call double @llvm.fmuladd.f64(double %13, double 2.500000e-01, double 1.000000e+00)
br label %41
15: ; preds = %9
%16 = icmp ult i32 %0, 39
br i1 %16, label %17, label %21
17: ; preds = %15
%18 = add nsw i32 %0, -13
%19 = sitofp i32 %18 to double
%20 = tail call double @llvm.fmuladd.f64(double %19, double 5.000000e-01, double 2.000000e+00)
br label %41
21: ; preds = %15
%22 = icmp ult i32 %0, 94
br i1 %22, label %23, label %26
23: ; preds = %21
%24 = add nsw i32 %0, -24
%25 = sitofp i32 %24 to double
br label %41
26: ; preds = %21
%27 = icmp ult i32 %0, 109
br i1 %27, label %28, label %32
28: ; preds = %26
%29 = add nsw i32 %0, -94
%30 = sitofp i32 %29 to double
%31 = tail call double @llvm.fmuladd.f64(double %30, double 2.000000e+00, double 7.000000e+01)
br label %41
32: ; preds = %26
%33 = icmp ult i32 %0, 124
br i1 %33, label %34, label %38
34: ; preds = %32
%35 = add nsw i32 %0, -109
%36 = sitofp i32 %35 to double
%37 = tail call double @llvm.fmuladd.f64(double %36, double 5.000000e+00, double 1.000000e+02)
br label %41
38: ; preds = %32
%39 = icmp eq i32 %0, 124
%40 = select i1 %39, double 3.241000e+02, double -1.000000e+00
br label %41
41: ; preds = %38, %1, %34, %28, %23, %17, %11, %5, %2
%42 = phi double [ 1.250000e-01, %2 ], [ %8, %5 ], [ %14, %11 ], [ %20, %17 ], [ %25, %23 ], [ %31, %28 ], [ %37, %34 ], [ 0.000000e+00, %1 ], [ %40, %38 ]
ret double %42
}