#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 *how_good(int percent) {
  static char buf[256];
  if (percent == 0)
    strcpy(buf, " (not learned)");
  else if (percent <= 10)
    strcpy(buf, " (awful)");
  else if (percent <= 20)
    strcpy(buf, " (bad)");
  else if (percent <= 40)
    strcpy(buf, " (poor)");
  else if (percent <= 55)
    strcpy(buf, " (average)");
  else if (percent <= 70)
    strcpy(buf, " (fair)");
  else if (percent <= 80)
    strcpy(buf, " (good)");
  else if (percent <= 85)
    strcpy(buf, " (very good)");
  else
    strcpy(buf, " (Superb)");
  return (buf);
}


x86 assembly (clang, -O0):
<how_good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113d <how_good+0x2d>
lea    0x2f14(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1261 <how_good+0x151>
cmpl   $0xa,-0x4(%rbp)
jg     115f <how_good+0x4f>
lea    0x2ef2(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1030 <strcpy@plt>
jmp    125c <how_good+0x14c>
cmpl   $0x14,-0x4(%rbp)
jg     1181 <how_good+0x71>
lea    0x2ed0(%rip),%rdi
lea    0xea1(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1257 <how_good+0x147>
cmpl   $0x28,-0x4(%rbp)
jg     11a3 <how_good+0x93>
lea    0x2eae(%rip),%rdi
lea    0xe86(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1252 <how_good+0x142>
cmpl   $0x37,-0x4(%rbp)
jg     11c5 <how_good+0xb5>
lea    0x2e8c(%rip),%rdi
lea    0xe6c(%rip),%rsi
call   1030 <strcpy@plt>
jmp    124d <how_good+0x13d>
cmpl   $0x46,-0x4(%rbp)
jg     11e7 <how_good+0xd7>
lea    0x2e6a(%rip),%rdi
lea    0xe55(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1248 <how_good+0x138>
cmpl   $0x50,-0x4(%rbp)
jg     1209 <how_good+0xf9>
lea    0x2e48(%rip),%rdi
lea    0xe3b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1243 <how_good+0x133>
cmpl   $0x55,-0x4(%rbp)
jg     122b <how_good+0x11b>
lea    0x2e26(%rip),%rdi
lea    0xe21(%rip),%rsi
call   1030 <strcpy@plt>
jmp    123e <how_good+0x12e>
lea    0x2e0e(%rip),%rdi
lea    0xe16(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1243 <how_good+0x133>
jmp    1248 <how_good+0x138>
jmp    124d <how_good+0x13d>
jmp    1252 <how_good+0x142>
jmp    1257 <how_good+0x147>
jmp    125c <how_good+0x14c>
jmp    1261 <how_good+0x151>
lea    0x2dd8(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<how_good>:
test   %edi,%edi
je     1122 <how_good+0x12>
cmp    $0xb,%edi
jge    112b <how_good+0x1b>
lea    0xeef(%rip),%rsi
jmp    1186 <how_good+0x76>
lea    0xed7(%rip),%rsi
jmp    1186 <how_good+0x76>
cmp    $0x15,%edi
jae    1139 <how_good+0x29>
lea    0xee1(%rip),%rsi
jmp    1186 <how_good+0x76>
cmp    $0x29,%edi
jae    1147 <how_good+0x37>
lea    0xeda(%rip),%rsi
jmp    1186 <how_good+0x76>
cmp    $0x38,%edi
jae    1155 <how_good+0x45>
lea    0xed4(%rip),%rsi
jmp    1186 <how_good+0x76>
cmp    $0x47,%edi
jae    1163 <how_good+0x53>
lea    0xed1(%rip),%rsi
jmp    1186 <how_good+0x76>
cmp    $0x51,%edi
jae    1171 <how_good+0x61>
lea    0xecb(%rip),%rsi
jmp    1186 <how_good+0x76>
cmp    $0x56,%edi
lea    0xec7(%rip),%rax
lea    0xecd(%rip),%rsi
cmovb  %rax,%rsi
push   %rbx
lea    0x2eb2(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@how_good.buf = internal global [256 x i8] zeroinitializer
@.str = [15 x i8] c" (not learned)\00"
@.str.1 = [9 x i8] c" (awful)\00"
@.str.2 = [7 x i8] c" (bad)\00"
@.str.3 = [8 x i8] c" (poor)\00"
@.str.4 = [11 x i8] c" (average)\00"
@.str.5 = [8 x i8] c" (fair)\00"
@.str.6 = [8 x i8] c" (good)\00"
@.str.7 = [13 x i8] c" (very good)\00"
@.str.8 = [10 x i8] c" (Superb)\00"
define i8* @how_good(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @how_good.buf, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %51
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 10
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @how_good.buf, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %50
12: ; preds = %7
%13 = load i32, i32* %2
%14 = icmp sle i32 %13, 20
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @how_good.buf, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %49
17: ; preds = %12
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 40
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @how_good.buf, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %48
22: ; preds = %17
%23 = load i32, i32* %2
%24 = icmp sle i32 %23, 55
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @how_good.buf, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %47
27: ; preds = %22
%28 = load i32, i32* %2
%29 = icmp sle i32 %28, 70
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @how_good.buf, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %46
32: ; preds = %27
%33 = load i32, i32* %2
%34 = icmp sle i32 %33, 80
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @how_good.buf, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %45
37: ; preds = %32
%38 = load i32, i32* %2
%39 = icmp sle i32 %38, 85
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @how_good.buf, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
br label %44
42: ; preds = %37
%43 = call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @how_good.buf, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
br label %45
45: ; preds = %44, %35
br label %46
46: ; preds = %45, %30
br label %47
47: ; preds = %46, %25
br label %48
48: ; preds = %47, %20
br label %49
49: ; preds = %48, %15
br label %50
50: ; preds = %49, %10
br label %51
51: ; preds = %50, %5
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @how_good.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@how_good.buf = internal global [256 x i8] zeroinitializer
@.str = [15 x i8] c" (not learned)\00"
@.str.1 = [9 x i8] c" (awful)\00"
@.str.2 = [7 x i8] c" (bad)\00"
@.str.3 = [8 x i8] c" (poor)\00"
@.str.4 = [11 x i8] c" (average)\00"
@.str.5 = [8 x i8] c" (fair)\00"
@.str.6 = [8 x i8] c" (good)\00"
@.str.7 = [13 x i8] c" (very good)\00"
@.str.8 = [10 x i8] c" (Superb)\00"
define i8* @how_good(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %18, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 11
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 21
br i1 %6, label %18, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 41
br i1 %8, label %18, label %9
9: ; preds = %7
%10 = icmp ult i32 %0, 56
br i1 %10, label %18, label %11
11: ; preds = %9
%12 = icmp ult i32 %0, 71
br i1 %12, label %18, label %13
13: ; preds = %11
%14 = icmp ult i32 %0, 81
br i1 %14, label %18, label %15
15: ; preds = %13
%16 = icmp ult i32 %0, 86
%17 = select i1 %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0)
br label %18
18: ; preds = %15, %13, %11, %9, %7, %5, %3, %1
%19 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %7 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), %9 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), %11 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), %13 ], [ %17, %15 ]
%20 = tail call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @how_good.buf, i64 0, i64 0), i8* %19)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @how_good.buf, i64 0, i64 0)
}