int pop_to_symbol(int num) {
  if (num > 400)
    return 8;
  else if (num > 200)
    return 7;
  else if (num > 100)
    return 6;
  else if (num > 50)
    return 5;
  else if (num > 25)
    return 4;
  else if (num > 12)
    return 3;
  else if (num > 6)
    return 2;
  else if (num > 3)
    return 1;
  else if (num > 0)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<pop_to_symbol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x190,-0x8(%rbp)
jle    1120 <pop_to_symbol+0x20>
movl   $0x8,-0x4(%rbp)
jmp    1202 <pop_to_symbol+0x102>
cmpl   $0xc8,-0x8(%rbp)
jle    1139 <pop_to_symbol+0x39>
movl   $0x7,-0x4(%rbp)
jmp    1202 <pop_to_symbol+0x102>
cmpl   $0x64,-0x8(%rbp)
jle    114f <pop_to_symbol+0x4f>
movl   $0x6,-0x4(%rbp)
jmp    1202 <pop_to_symbol+0x102>
cmpl   $0x32,-0x8(%rbp)
jle    1165 <pop_to_symbol+0x65>
movl   $0x5,-0x4(%rbp)
jmp    1202 <pop_to_symbol+0x102>
cmpl   $0x19,-0x8(%rbp)
jle    117b <pop_to_symbol+0x7b>
movl   $0x4,-0x4(%rbp)
jmp    1202 <pop_to_symbol+0x102>
cmpl   $0xc,-0x8(%rbp)
jle    1191 <pop_to_symbol+0x91>
movl   $0x3,-0x4(%rbp)
jmp    1202 <pop_to_symbol+0x102>
cmpl   $0x6,-0x8(%rbp)
jle    11a7 <pop_to_symbol+0xa7>
movl   $0x2,-0x4(%rbp)
jmp    1202 <pop_to_symbol+0x102>
cmpl   $0x3,-0x8(%rbp)
jle    11bd <pop_to_symbol+0xbd>
movl   $0x1,-0x4(%rbp)
jmp    1202 <pop_to_symbol+0x102>
cmpl   $0x0,-0x8(%rbp)
jle    11d3 <pop_to_symbol+0xd3>
movl   $0x0,-0x4(%rbp)
jmp    1202 <pop_to_symbol+0x102>
jmp    11d8 <pop_to_symbol+0xd8>
jmp    11dd <pop_to_symbol+0xdd>
jmp    11e2 <pop_to_symbol+0xe2>
jmp    11e7 <pop_to_symbol+0xe7>
jmp    11ec <pop_to_symbol+0xec>
jmp    11f1 <pop_to_symbol+0xf1>
jmp    11f6 <pop_to_symbol+0xf6>
jmp    11fb <pop_to_symbol+0xfb>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop_to_symbol>:
mov    $0x8,%eax
cmp    $0x190,%edi
jg     115f <pop_to_symbol+0x5f>
mov    $0x7,%eax
cmp    $0xc8,%edi
jg     115f <pop_to_symbol+0x5f>
mov    $0x6,%eax
cmp    $0x64,%edi
jg     115f <pop_to_symbol+0x5f>
mov    $0x5,%eax
cmp    $0x32,%edi
jg     115f <pop_to_symbol+0x5f>
mov    $0x4,%eax
cmp    $0x19,%edi
jg     115f <pop_to_symbol+0x5f>
mov    $0x3,%eax
cmp    $0xc,%edi
jg     115f <pop_to_symbol+0x5f>
mov    $0x2,%eax
cmp    $0x6,%edi
jg     115f <pop_to_symbol+0x5f>
mov    $0x1,%eax
cmp    $0x3,%edi
jg     115f <pop_to_symbol+0x5f>
xor    %eax,%eax
test   %edi,%edi
setle  %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @pop_to_symbol(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 400
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 8, i32* %2
br label %48
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 200
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 7, i32* %2
br label %48
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 100
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 6, i32* %2
br label %48
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 50
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 5, i32* %2
br label %48
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp sgt i32 %20, 25
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 4, i32* %2
br label %48
23: ; preds = %19
%24 = load i32, i32* %3
%25 = icmp sgt i32 %24, 12
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 3, i32* %2
br label %48
27: ; preds = %23
%28 = load i32, i32* %3
%29 = icmp sgt i32 %28, 6
br i1 %29, label %30, label %31
30: ; preds = %27
store i32 2, i32* %2
br label %48
31: ; preds = %27
%32 = load i32, i32* %3
%33 = icmp sgt i32 %32, 3
br i1 %33, label %34, label %35
34: ; preds = %31
store i32 1, i32* %2
br label %48
35: ; preds = %31
%36 = load i32, i32* %3
%37 = icmp sgt i32 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %35
store i32 0, i32* %2
br label %48
39: ; preds = %35
br label %40
40: ; preds = %39
br label %41
41: ; preds = %40
br label %42
42: ; preds = %41
br label %43
43: ; preds = %42
br label %44
44: ; preds = %43
br label %45
45: ; preds = %44
br label %46
46: ; preds = %45
br label %47
47: ; preds = %46
store i32 -1, i32* %2
br label %48
48: ; preds = %47, %38, %34, %30, %26, %22, %18, %14, %10, %6
%49 = load i32, i32* %2
ret i32 %49
}

LLVM IR (-O2):
define i32 @pop_to_symbol(i32 %0) {
%2 = icmp sgt i32 %0, 400
br i1 %2, label %20, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 200
br i1 %4, label %20, label %5
5: ; preds = %3
%6 = icmp sgt i32 %0, 100
br i1 %6, label %20, label %7
7: ; preds = %5
%8 = icmp sgt i32 %0, 50
br i1 %8, label %20, label %9
9: ; preds = %7
%10 = icmp sgt i32 %0, 25
br i1 %10, label %20, label %11
11: ; preds = %9
%12 = icmp sgt i32 %0, 12
br i1 %12, label %20, label %13
13: ; preds = %11
%14 = icmp sgt i32 %0, 6
br i1 %14, label %20, label %15
15: ; preds = %13
%16 = icmp sgt i32 %0, 3
br i1 %16, label %20, label %17
17: ; preds = %15
%18 = icmp slt i32 %0, 1
%19 = sext i1 %18 to i32
br label %20
20: ; preds = %17, %15, %13, %11, %9, %7, %5, %3, %1
%21 = phi i32 [ 8, %1 ], [ 7, %3 ], [ 6, %5 ], [ 5, %7 ], [ 4, %9 ], [ 3, %11 ], [ 2, %13 ], [ 1, %15 ], [ %19, %17 ]
ret i32 %21
}