int report_magics_aux(int dur) {
  if (dur <= 5) {
    return 0;
  } else if (dur <= 10) {
    return 1;
  } else if (dur <= 20) {
    return 2;
  } else if (dur <= 50) {
    return 3;
  } else if (dur <= 100) {
    return 4;
  } else if (dur <= 200) {
    return 5;
  } else {
    return 6;
  }
}


x86 assembly (clang, -O0):
<report_magics_aux>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     111d <report_magics_aux+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1195 <report_magics_aux+0x95>
cmpl   $0xa,-0x8(%rbp)
jg     1133 <report_magics_aux+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1195 <report_magics_aux+0x95>
cmpl   $0x14,-0x8(%rbp)
jg     1149 <report_magics_aux+0x49>
movl   $0x2,-0x4(%rbp)
jmp    1195 <report_magics_aux+0x95>
cmpl   $0x32,-0x8(%rbp)
jg     115f <report_magics_aux+0x5f>
movl   $0x3,-0x4(%rbp)
jmp    1195 <report_magics_aux+0x95>
cmpl   $0x64,-0x8(%rbp)
jg     1175 <report_magics_aux+0x75>
movl   $0x4,-0x4(%rbp)
jmp    1195 <report_magics_aux+0x95>
cmpl   $0xc8,-0x8(%rbp)
jg     118e <report_magics_aux+0x8e>
movl   $0x5,-0x4(%rbp)
jmp    1195 <report_magics_aux+0x95>
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_magics_aux>:
xor    %eax,%eax
cmp    $0x6,%edi
jl     113d <report_magics_aux+0x3d>
mov    $0x1,%eax
cmp    $0xb,%edi
jb     113d <report_magics_aux+0x3d>
mov    $0x2,%eax
cmp    $0x15,%edi
jb     113d <report_magics_aux+0x3d>
mov    $0x3,%eax
cmp    $0x33,%edi
jb     113d <report_magics_aux+0x3d>
mov    $0x4,%eax
cmp    $0x65,%edi
jb     113d <report_magics_aux+0x3d>
cmp    $0xc9,%edi
mov    $0x6,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @report_magics_aux(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 5
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %28
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %2
br label %28
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 20
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 2, i32* %2
br label %28
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 50
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 3, i32* %2
br label %28
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp sle i32 %20, 100
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 4, i32* %2
br label %28
23: ; preds = %19
%24 = load i32, i32* %3
%25 = icmp sle i32 %24, 200
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 5, i32* %2
br label %28
27: ; preds = %23
store i32 6, i32* %2
br label %28
28: ; preds = %27, %26, %22, %18, %14, %10, %6
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @report_magics_aux(i32 %0) {
%2 = icmp slt i32 %0, 6
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 11
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 21
br i1 %6, label %14, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 51
br i1 %8, label %14, label %9
9: ; preds = %7
%10 = icmp ult i32 %0, 101
br i1 %10, label %14, label %11
11: ; preds = %9
%12 = icmp ult i32 %0, 201
%13 = select i1 %12, i32 5, i32 6
br label %14
14: ; preds = %11, %9, %7, %5, %3, %1
%15 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 2, %5 ], [ 3, %7 ], [ 4, %9 ], [ %13, %11 ]
ret i32 %15
}