#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 */
int /*<<< orphan*/ strcpy(char *, char *);
char *m_to_h(char *target, double h) {
  if (h < 50.0) {
    strcpy(target, "0");
  } else if (h < 100.0) {
    strcpy(target, "1");
  } else if (h < 200.0) {
    strcpy(target, "2");
  } else if (h < 300.0) {
    strcpy(target, "3");
  } else if (h < 600.0) {
    strcpy(target, "4");
  } else if (h < 1000.0) {
    strcpy(target, "5");
  } else if (h < 1500.0) {
    strcpy(target, "6");
  } else if (h < 2000.0) {
    strcpy(target, "7");
  } else if (h < 2500.0) {
    strcpy(target, "8");
  } else {
    strcpy(target, "9");
  }
  return target;
}


x86 assembly (clang, -O0):
<m_to_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  0xed7(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1149 <m_to_h+0x39>
mov    -0x8(%rbp),%rdi
lea    0xf09(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c1 <m_to_h+0x1b1>
movsd  0xeb7(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1171 <m_to_h+0x61>
mov    -0x8(%rbp),%rdi
lea    0xee3(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12bc <m_to_h+0x1ac>
movsd  0xe97(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1199 <m_to_h+0x89>
mov    -0x8(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b7 <m_to_h+0x1a7>
movsd  0xe77(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11c1 <m_to_h+0xb1>
mov    -0x8(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b2 <m_to_h+0x1a2>
movsd  0xe57(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11e9 <m_to_h+0xd9>
mov    -0x8(%rbp),%rdi
lea    0xe71(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12ad <m_to_h+0x19d>
movsd  0xe37(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1211 <m_to_h+0x101>
mov    -0x8(%rbp),%rdi
lea    0xe4b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12a8 <m_to_h+0x198>
movsd  0xe17(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1239 <m_to_h+0x129>
mov    -0x8(%rbp),%rdi
lea    0xe25(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12a3 <m_to_h+0x193>
movsd  0xdf7(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1261 <m_to_h+0x151>
mov    -0x8(%rbp),%rdi
lea    0xdff(%rip),%rsi
call   1030 <strcpy@plt>
jmp    129e <m_to_h+0x18e>
movsd  0xdd7(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1289 <m_to_h+0x179>
mov    -0x8(%rbp),%rdi
lea    0xdd9(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1299 <m_to_h+0x189>
mov    -0x8(%rbp),%rdi
lea    0xdc6(%rip),%rsi
call   1030 <strcpy@plt>
jmp    129e <m_to_h+0x18e>
jmp    12a3 <m_to_h+0x193>
jmp    12a8 <m_to_h+0x198>
jmp    12ad <m_to_h+0x19d>
jmp    12b2 <m_to_h+0x1a2>
jmp    12b7 <m_to_h+0x1a7>
jmp    12bc <m_to_h+0x1ac>
jmp    12c1 <m_to_h+0x1b1>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_to_h>:
push   %rbx
mov    %rdi,%rbx
movsd  0xee4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    112e <m_to_h+0x1e>
lea    0xf1f(%rip),%rsi
jmp    11f3 <m_to_h+0xe3>
movsd  0xed2(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1148 <m_to_h+0x38>
lea    0xf07(%rip),%rsi
jmp    11f3 <m_to_h+0xe3>
movsd  0xec0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1162 <m_to_h+0x52>
lea    0xeef(%rip),%rsi
jmp    11f3 <m_to_h+0xe3>
movsd  0xeae(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1179 <m_to_h+0x69>
lea    0xed7(%rip),%rsi
jmp    11f3 <m_to_h+0xe3>
movsd  0xe9f(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1190 <m_to_h+0x80>
lea    0xec2(%rip),%rsi
jmp    11f3 <m_to_h+0xe3>
movsd  0xe90(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11a7 <m_to_h+0x97>
lea    0xead(%rip),%rsi
jmp    11f3 <m_to_h+0xe3>
movsd  0xe81(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11be <m_to_h+0xae>
lea    0xe98(%rip),%rsi
jmp    11f3 <m_to_h+0xe3>
movsd  0xe72(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11d5 <m_to_h+0xc5>
lea    0xe83(%rip),%rsi
jmp    11f3 <m_to_h+0xe3>
movsd  0xe63(%rip),%xmm1
ucomisd %xmm0,%xmm1
lea    0xe70(%rip),%rax
lea    0xe6b(%rip),%rsi
cmova  %rax,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [2 x i8] c"2\00"
@.str.3 = [2 x i8] c"3\00"
@.str.4 = [2 x i8] c"4\00"
@.str.5 = [2 x i8] c"5\00"
@.str.6 = [2 x i8] c"6\00"
@.str.7 = [2 x i8] c"7\00"
@.str.8 = [2 x i8] c"8\00"
@.str.9 = [2 x i8] c"9\00"
define i8* @m_to_h(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp olt double %5, 5.000000e+01
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %69
10: ; preds = %2
%11 = load double, double* %4
%12 = fcmp olt double %11, 1.000000e+02
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %68
16: ; preds = %10
%17 = load double, double* %4
%18 = fcmp olt double %17, 2.000000e+02
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i8*, i8** %3
%21 = call i32 @strcpy(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %67
22: ; preds = %16
%23 = load double, double* %4
%24 = fcmp olt double %23, 3.000000e+02
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i8*, i8** %3
%27 = call i32 @strcpy(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %66
28: ; preds = %22
%29 = load double, double* %4
%30 = fcmp olt double %29, 6.000000e+02
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i8*, i8** %3
%33 = call i32 @strcpy(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %65
34: ; preds = %28
%35 = load double, double* %4
%36 = fcmp olt double %35, 1.000000e+03
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i8*, i8** %3
%39 = call i32 @strcpy(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %64
40: ; preds = %34
%41 = load double, double* %4
%42 = fcmp olt double %41, 1.500000e+03
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = load i8*, i8** %3
%45 = call i32 @strcpy(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %63
46: ; preds = %40
%47 = load double, double* %4
%48 = fcmp olt double %47, 2.000000e+03
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = load i8*, i8** %3
%51 = call i32 @strcpy(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %62
52: ; preds = %46
%53 = load double, double* %4
%54 = fcmp olt double %53, 2.500000e+03
br i1 %54, label %55, label %58
55: ; preds = %52
%56 = load i8*, i8** %3
%57 = call i32 @strcpy(i8* %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %61
58: ; preds = %52
%59 = load i8*, i8** %3
%60 = call i32 @strcpy(i8* %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %61
61: ; preds = %58, %55
br label %62
62: ; preds = %61, %49
br label %63
63: ; preds = %62, %43
br label %64
64: ; preds = %63, %37
br label %65
65: ; preds = %64, %31
br label %66
66: ; preds = %65, %25
br label %67
67: ; preds = %66, %19
br label %68
68: ; preds = %67, %13
br label %69
69: ; preds = %68, %7
%70 = load i8*, i8** %3
ret i8* %70
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [2 x i8] c"2\00"
@.str.3 = [2 x i8] c"3\00"
@.str.4 = [2 x i8] c"4\00"
@.str.5 = [2 x i8] c"5\00"
@.str.6 = [2 x i8] c"6\00"
@.str.7 = [2 x i8] c"7\00"
@.str.8 = [2 x i8] c"8\00"
@.str.9 = [2 x i8] c"9\00"
define i8* @m_to_h(i8* returned %0, double %1) {
%3 = fcmp olt double %1, 5.000000e+01
br i1 %3, label %21, label %4
4: ; preds = %2
%5 = fcmp olt double %1, 1.000000e+02
br i1 %5, label %21, label %6
6: ; preds = %4
%7 = fcmp olt double %1, 2.000000e+02
br i1 %7, label %21, label %8
8: ; preds = %6
%9 = fcmp olt double %1, 3.000000e+02
br i1 %9, label %21, label %10
10: ; preds = %8
%11 = fcmp olt double %1, 6.000000e+02
br i1 %11, label %21, label %12
12: ; preds = %10
%13 = fcmp olt double %1, 1.000000e+03
br i1 %13, label %21, label %14
14: ; preds = %12
%15 = fcmp olt double %1, 1.500000e+03
br i1 %15, label %21, label %16
16: ; preds = %14
%17 = fcmp olt double %1, 2.000000e+03
br i1 %17, label %21, label %18
18: ; preds = %16
%19 = fcmp olt double %1, 2.500000e+03
%20 = select i1 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0)
br label %21
21: ; preds = %18, %16, %14, %12, %10, %8, %6, %4, %2
%22 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %6 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %8 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), %10 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), %12 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), %14 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), %16 ], [ %20, %18 ]
%23 = tail call i32 @strcpy(i8* %0, i8* %22)
ret i8* %0
}