char *difficulty(int score) {
  if (score <= 25)
    return "simple";
  if (score <= 150)
    return "easy";
  if (score <= 900)
    return "moderate";
  if (score <= 5400)
    return "hard";
  if (score == 99999)
    return "impossible";
  return "diabolical";
}


x86 assembly (clang, -O0):
<difficulty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x19,-0xc(%rbp)
jg     1121 <difficulty+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11a0 <difficulty+0xa0>
cmpl   $0x96,-0xc(%rbp)
jg     113e <difficulty+0x3e>
lea    0xed2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11a0 <difficulty+0xa0>
cmpl   $0x384,-0xc(%rbp)
jg     115b <difficulty+0x5b>
lea    0xeba(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11a0 <difficulty+0xa0>
cmpl   $0x1518,-0xc(%rbp)
jg     1178 <difficulty+0x78>
lea    0xea6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11a0 <difficulty+0xa0>
cmpl   $0x1869f,-0xc(%rbp)
jne    1195 <difficulty+0x95>
lea    0xe8e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11a0 <difficulty+0xa0>
lea    0xe89(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<difficulty>:
cmp    $0x1a,%edi
jge    110d <difficulty+0xd>
lea    0xef4(%rip),%rax
ret
cmp    $0x97,%edi
jae    111d <difficulty+0x1d>
lea    0xeeb(%rip),%rax
ret
cmp    $0x385,%edi
jae    112d <difficulty+0x2d>
lea    0xee0(%rip),%rax
ret
cmp    $0x1519,%edi
jae    113d <difficulty+0x3d>
lea    0xed9(%rip),%rax
ret
cmp    $0x1869f,%edi
lea    0xed0(%rip),%rcx
lea    0xed4(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"simple\00"
@.str.1 = [5 x i8] c"easy\00"
@.str.2 = [9 x i8] c"moderate\00"
@.str.3 = [5 x i8] c"hard\00"
@.str.4 = [11 x i8] c"impossible\00"
@.str.5 = [11 x i8] c"diabolical\00"
define i8* @difficulty(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 25
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %24
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 150
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %24
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 900
br i1 %13, label %14, label %15
14: ; preds = %11
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %24
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 5400
br i1 %17, label %18, label %19
18: ; preds = %15
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %24
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 99999
br i1 %21, label %22, label %23
22: ; preds = %19
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %24
23: ; preds = %19
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %24
24: ; preds = %23, %22, %18, %14, %10, %6
%25 = load i8*, i8** %2
ret i8* %25
}

LLVM IR (-O2):
@.str = [7 x i8] c"simple\00"
@.str.1 = [5 x i8] c"easy\00"
@.str.2 = [9 x i8] c"moderate\00"
@.str.3 = [5 x i8] c"hard\00"
@.str.4 = [11 x i8] c"impossible\00"
@.str.5 = [11 x i8] c"diabolical\00"
define i8* @difficulty(i32 %0) {
%2 = icmp slt i32 %0, 26
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 151
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 901
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 5401
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp eq i32 %0, 99999
%11 = select i1 %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0)
br label %12
12: ; preds = %9, %7, %5, %3, %1
%13 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %7 ], [ %11, %9 ]
ret i8* %13
}