#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 *percent_to_okta(char *target, double perc) {
  if (perc == 0.0) {
    strcpy(target, "0");
  } else if (perc < (25.0 - 6.25)) {
    strcpy(target, "1");
  } else if (perc < (37.5 - 6.25)) {
    strcpy(target, "2");
  } else if (perc < (50.0 - 6.25)) {
    strcpy(target, "3");
  } else if (perc < (62.5 - 6.25)) {
    strcpy(target, "4");
  } else if (perc < (75.0 - 6.25)) {
    strcpy(target, "5");
  } else if (perc < (87.5 - 6.25)) {
    strcpy(target, "6");
  } else if (perc < 100.0) {
    strcpy(target, "7");
  } else if (perc <= 112.5) {
    strcpy(target, "8");
  } else if (perc == 113.0) {
    strcpy(target, "9");
  }
  return target;
}


x86 assembly (clang, -O0):
<percent_to_okta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114e <percent_to_okta+0x3e>
jp     114e <percent_to_okta+0x3e>
mov    -0x8(%rbp),%rdi
lea    0xf04(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12e8 <percent_to_okta+0x1d8>
movsd  0xeaa(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1176 <percent_to_okta+0x66>
mov    -0x8(%rbp),%rdi
lea    0xede(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12e3 <percent_to_okta+0x1d3>
movsd  0xe8a(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    119e <percent_to_okta+0x8e>
mov    -0x8(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12de <percent_to_okta+0x1ce>
movsd  0xe6a(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11c6 <percent_to_okta+0xb6>
mov    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12d9 <percent_to_okta+0x1c9>
movsd  0xe4a(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11ee <percent_to_okta+0xde>
mov    -0x8(%rbp),%rdi
lea    0xe6c(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12d4 <percent_to_okta+0x1c4>
movsd  0xe2a(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1216 <percent_to_okta+0x106>
mov    -0x8(%rbp),%rdi
lea    0xe46(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12cf <percent_to_okta+0x1bf>
movsd  0xe0a(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    123e <percent_to_okta+0x12e>
mov    -0x8(%rbp),%rdi
lea    0xe20(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12ca <percent_to_okta+0x1ba>
movsd  0xdea(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1266 <percent_to_okta+0x156>
mov    -0x8(%rbp),%rdi
lea    0xdfa(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c5 <percent_to_okta+0x1b5>
movsd  0xdca(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     128e <percent_to_okta+0x17e>
mov    -0x8(%rbp),%rdi
lea    0xdd4(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c0 <percent_to_okta+0x1b0>
movsd  -0x10(%rbp),%xmm0
movsd  0xda5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    12bb <percent_to_okta+0x1ab>
jp     12bb <percent_to_okta+0x1ab>
mov    -0x8(%rbp),%rdi
lea    0xda4(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c0 <percent_to_okta+0x1b0>
jmp    12c5 <percent_to_okta+0x1b5>
jmp    12ca <percent_to_okta+0x1ba>
jmp    12cf <percent_to_okta+0x1bf>
jmp    12d4 <percent_to_okta+0x1c4>
jmp    12d9 <percent_to_okta+0x1c9>
jmp    12de <percent_to_okta+0x1ce>
jmp    12e3 <percent_to_okta+0x1d3>
jmp    12e8 <percent_to_okta+0x1d8>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<percent_to_okta>:
push   %rbx
mov    %rdi,%rbx
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112c <percent_to_okta+0x1c>
jp     112c <percent_to_okta+0x1c>
lea    0xf21(%rip),%rsi
jmp    1200 <percent_to_okta+0xf0>
movsd  0xecc(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1146 <percent_to_okta+0x36>
lea    0xf09(%rip),%rsi
jmp    1200 <percent_to_okta+0xf0>
movsd  0xeba(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1160 <percent_to_okta+0x50>
lea    0xef1(%rip),%rsi
jmp    1200 <percent_to_okta+0xf0>
movsd  0xea8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    117a <percent_to_okta+0x6a>
lea    0xed9(%rip),%rsi
jmp    1200 <percent_to_okta+0xf0>
movsd  0xe96(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1191 <percent_to_okta+0x81>
lea    0xec1(%rip),%rsi
jmp    1200 <percent_to_okta+0xf0>
movsd  0xe87(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11a8 <percent_to_okta+0x98>
lea    0xeac(%rip),%rsi
jmp    1200 <percent_to_okta+0xf0>
movsd  0xe78(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11bf <percent_to_okta+0xaf>
lea    0xe97(%rip),%rsi
jmp    1200 <percent_to_okta+0xf0>
movsd  0xe69(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11d6 <percent_to_okta+0xc6>
lea    0xe82(%rip),%rsi
jmp    1200 <percent_to_okta+0xf0>
movsd  0xe5a(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    11f9 <percent_to_okta+0xe9>
ucomisd 0xe54(%rip),%xmm0
jne    1208 <percent_to_okta+0xf8>
jp     1208 <percent_to_okta+0xf8>
lea    0xe63(%rip),%rsi
jmp    1200 <percent_to_okta+0xf0>
lea    0xe58(%rip),%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* @percent_to_okta(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 oeq double %5, 0.000000e+00
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 %73
10: ; preds = %2
%11 = load double, double* %4
%12 = fcmp olt double %11, 1.875000e+01
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 %72
16: ; preds = %10
%17 = load double, double* %4
%18 = fcmp olt double %17, 3.125000e+01
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 %71
22: ; preds = %16
%23 = load double, double* %4
%24 = fcmp olt double %23, 4.375000e+01
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 %70
28: ; preds = %22
%29 = load double, double* %4
%30 = fcmp olt double %29, 5.625000e+01
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 %69
34: ; preds = %28
%35 = load double, double* %4
%36 = fcmp olt double %35, 6.875000e+01
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 %68
40: ; preds = %34
%41 = load double, double* %4
%42 = fcmp olt double %41, 8.125000e+01
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 %67
46: ; preds = %40
%47 = load double, double* %4
%48 = fcmp olt double %47, 1.000000e+02
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 %66
52: ; preds = %46
%53 = load double, double* %4
%54 = fcmp ole double %53, 1.125000e+02
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 %65
58: ; preds = %52
%59 = load double, double* %4
%60 = fcmp oeq double %59, 1.130000e+02
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = load i8*, i8** %3
%63 = call i32 @strcpy(i8* %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %64
64: ; preds = %61, %58
br label %65
65: ; preds = %64, %55
br label %66
66: ; preds = %65, %49
br label %67
67: ; preds = %66, %43
br label %68
68: ; preds = %67, %37
br label %69
69: ; preds = %68, %31
br label %70
70: ; preds = %69, %25
br label %71
71: ; preds = %70, %19
br label %72
72: ; preds = %71, %13
br label %73
73: ; preds = %72, %7
%74 = load i8*, i8** %3
ret i8* %74
}

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* @percent_to_okta(i8* returned %0, double %1) {
%3 = fcmp oeq double %1, 0.000000e+00
br i1 %3, label %22, label %4
4: ; preds = %2
%5 = fcmp olt double %1, 1.875000e+01
br i1 %5, label %22, label %6
6: ; preds = %4
%7 = fcmp olt double %1, 3.125000e+01
br i1 %7, label %22, label %8
8: ; preds = %6
%9 = fcmp olt double %1, 4.375000e+01
br i1 %9, label %22, label %10
10: ; preds = %8
%11 = fcmp olt double %1, 5.625000e+01
br i1 %11, label %22, label %12
12: ; preds = %10
%13 = fcmp olt double %1, 6.875000e+01
br i1 %13, label %22, label %14
14: ; preds = %12
%15 = fcmp olt double %1, 8.125000e+01
br i1 %15, label %22, label %16
16: ; preds = %14
%17 = fcmp olt double %1, 1.000000e+02
br i1 %17, label %22, label %18
18: ; preds = %16
%19 = fcmp ugt double %1, 1.125000e+02
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = fcmp oeq double %1, 1.130000e+02
br i1 %21, label %22, label %25
22: ; preds = %20, %18, %16, %14, %12, %10, %8, %6, %4, %2
%23 = 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 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), %18 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), %20 ]
%24 = tail call i32 @strcpy(i8* %0, i8* %23)
br label %25
25: ; preds = %22, %20
ret i8* %0
}