long _convertBinary(long EV_number) {
  if ((EV_number == 0)) {
    return 0;
  } else {
    if ((EV_number == 1)) {
      return 1;
    } else {
      if ((EV_number == 2)) {
        return 10;
      } else {
        if ((EV_number == 3)) {
          return 11;
        } else {
          if ((EV_number == 4)) {
            return 100;
          } else {
            if ((EV_number == 5)) {
              return 101;
            } else {
              if ((EV_number == 6)) {
                return 110;
              } else {
                if ((EV_number == 7)) {
                  return 111;
                } else {
                  if ((EV_number == 8)) {
                    return 1000;
                  } else {
                    return 1001;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<_convertBinary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <_convertBinary+0x20>
movq   $0x0,-0x8(%rbp)
jmp    11e8 <_convertBinary+0xe8>
cmpq   $0x1,-0x10(%rbp)
jne    1138 <_convertBinary+0x38>
movq   $0x1,-0x8(%rbp)
jmp    11e8 <_convertBinary+0xe8>
cmpq   $0x2,-0x10(%rbp)
jne    1150 <_convertBinary+0x50>
movq   $0xa,-0x8(%rbp)
jmp    11e8 <_convertBinary+0xe8>
cmpq   $0x3,-0x10(%rbp)
jne    1168 <_convertBinary+0x68>
movq   $0xb,-0x8(%rbp)
jmp    11e8 <_convertBinary+0xe8>
cmpq   $0x4,-0x10(%rbp)
jne    1180 <_convertBinary+0x80>
movq   $0x64,-0x8(%rbp)
jmp    11e8 <_convertBinary+0xe8>
cmpq   $0x5,-0x10(%rbp)
jne    1198 <_convertBinary+0x98>
movq   $0x65,-0x8(%rbp)
jmp    11e8 <_convertBinary+0xe8>
cmpq   $0x6,-0x10(%rbp)
jne    11b0 <_convertBinary+0xb0>
movq   $0x6e,-0x8(%rbp)
jmp    11e8 <_convertBinary+0xe8>
cmpq   $0x7,-0x10(%rbp)
jne    11c8 <_convertBinary+0xc8>
movq   $0x6f,-0x8(%rbp)
jmp    11e8 <_convertBinary+0xe8>
cmpq   $0x8,-0x10(%rbp)
jne    11e0 <_convertBinary+0xe0>
movq   $0x3e8,-0x8(%rbp)
jmp    11e8 <_convertBinary+0xe8>
movq   $0x3e9,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_convertBinary>:
mov    $0x3e9,%eax
cmp    $0x8,%rdi
ja     1116 <_convertBinary+0x16>
lea    0xeee(%rip),%rax
mov    (%rax,%rdi,8),%rax
ret

LLVM IR (-O0):
define i64 @_convertBinary(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 0, i64* %2
br label %40
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 1, i64* %2
br label %40
11: ; preds = %7
%12 = load i64, i64* %3
%13 = icmp eq i64 %12, 2
br i1 %13, label %14, label %15
14: ; preds = %11
store i64 10, i64* %2
br label %40
15: ; preds = %11
%16 = load i64, i64* %3
%17 = icmp eq i64 %16, 3
br i1 %17, label %18, label %19
18: ; preds = %15
store i64 11, i64* %2
br label %40
19: ; preds = %15
%20 = load i64, i64* %3
%21 = icmp eq i64 %20, 4
br i1 %21, label %22, label %23
22: ; preds = %19
store i64 100, i64* %2
br label %40
23: ; preds = %19
%24 = load i64, i64* %3
%25 = icmp eq i64 %24, 5
br i1 %25, label %26, label %27
26: ; preds = %23
store i64 101, i64* %2
br label %40
27: ; preds = %23
%28 = load i64, i64* %3
%29 = icmp eq i64 %28, 6
br i1 %29, label %30, label %31
30: ; preds = %27
store i64 110, i64* %2
br label %40
31: ; preds = %27
%32 = load i64, i64* %3
%33 = icmp eq i64 %32, 7
br i1 %33, label %34, label %35
34: ; preds = %31
store i64 111, i64* %2
br label %40
35: ; preds = %31
%36 = load i64, i64* %3
%37 = icmp eq i64 %36, 8
br i1 %37, label %38, label %39
38: ; preds = %35
store i64 1000, i64* %2
br label %40
39: ; preds = %35
store i64 1001, i64* %2
br label %40
40: ; preds = %39, %38, %34, %30, %26, %22, %18, %14, %10, %6
%41 = load i64, i64* %2
ret i64 %41
}

LLVM IR (-O2):
@switch.table._convertBinary = [9 x i64] [i64 0, i64 1, i64 10, i64 11, i64 100, i64 101, i64 110, i64 111, i64 1000]
define i64 @_convertBinary(i64 %0) {
%2 = icmp ult i64 %0, 9
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = getelementptr inbounds [9 x i64], [9 x i64]* @switch.table._convertBinary, i64 0, i64 %0
%5 = load i64, i64* %4
br label %6
6: ; preds = %1, %3
%7 = phi i64 [ %5, %3 ], [ 1001, %1 ]
ret i64 %7
}