int getDestination(int person) {
  int retValue_acc;
  {
    if (person == 0) {
      retValue_acc = 0;
      return (retValue_acc);
    } else {
      if (person == 1) {
        retValue_acc = 0;
        return (retValue_acc);
      } else {
        if (person == 2) {
          retValue_acc = 1;
          return (retValue_acc);
        } else {
          if (person == 3) {
            retValue_acc = 3;
            return (retValue_acc);
          } else {
            if (person == 4) {
              retValue_acc = 1;
              return (retValue_acc);
            } else {
              if (person == 5) {
                retValue_acc = 3;
                return (retValue_acc);
              } else {
                retValue_acc = 0;
                return (retValue_acc);
              }
            }
          }
        }
      }
    }
    return (retValue_acc);
  }
}


x86 assembly (clang, -O0):
<getDestination>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1123 <getDestination+0x23>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11bc <getDestination+0xbc>
cmpl   $0x1,-0x8(%rbp)
jne    113f <getDestination+0x3f>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11bc <getDestination+0xbc>
cmpl   $0x2,-0x8(%rbp)
jne    115b <getDestination+0x5b>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11bc <getDestination+0xbc>
cmpl   $0x3,-0x8(%rbp)
jne    1177 <getDestination+0x77>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11bc <getDestination+0xbc>
cmpl   $0x4,-0x8(%rbp)
jne    1193 <getDestination+0x93>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11bc <getDestination+0xbc>
cmpl   $0x5,-0x8(%rbp)
jne    11af <getDestination+0xaf>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11bc <getDestination+0xbc>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDestination>:
add    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x3,%edi
ja     1117 <getDestination+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.getDestination = [4 x i32] [i32 1, i32 3, i32 1, i32 3]
define i32 @getDestination(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.getDestination, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}