char *_dedx_get_energy_file(int program) {
  char *path;
  switch (program) {
  case 1:
    path = "astarEng";
    break;
  case 2:
    path = "pstarEng";
    break;
  case 3:
    path = "estarEng";
    break;
  case 4:
    path = "mstarEng";
    break;
  case 5:
    path = "icru73Eng";
    break;
  case 6:
    path = "icru73_newEng";
    break;
  case 7:
    path = "icru_astarEng";
    break;
  case 8:
    path = "icru_pstarEng";
    break;
  case 101:
    path = "betheEng";
    break;
  default:
    path = "";
  }
  return path;
}


x86 assembly (clang, -O0):
<_dedx_get_energy_file>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     11a3 <_dedx_get_energy_file+0xa3>
jmp    111b <_dedx_get_energy_file+0x1b>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     11b3 <_dedx_get_energy_file+0xb3>
jmp    112c <_dedx_get_energy_file+0x2c>
mov    -0x14(%rbp),%eax
sub    $0x3,%eax
je     11c3 <_dedx_get_energy_file+0xc3>
jmp    113d <_dedx_get_energy_file+0x3d>
mov    -0x14(%rbp),%eax
sub    $0x4,%eax
je     11d3 <_dedx_get_energy_file+0xd3>
jmp    114e <_dedx_get_energy_file+0x4e>
mov    -0x14(%rbp),%eax
sub    $0x5,%eax
je     11e3 <_dedx_get_energy_file+0xe3>
jmp    115f <_dedx_get_energy_file+0x5f>
mov    -0x14(%rbp),%eax
sub    $0x6,%eax
je     11f3 <_dedx_get_energy_file+0xf3>
jmp    1170 <_dedx_get_energy_file+0x70>
mov    -0x14(%rbp),%eax
sub    $0x7,%eax
je     1203 <_dedx_get_energy_file+0x103>
jmp    1181 <_dedx_get_energy_file+0x81>
mov    -0x14(%rbp),%eax
sub    $0x8,%eax
je     1213 <_dedx_get_energy_file+0x113>
jmp    1192 <_dedx_get_energy_file+0x92>
mov    -0x14(%rbp),%eax
sub    $0x65,%eax
je     1223 <_dedx_get_energy_file+0x123>
jmp    1233 <_dedx_get_energy_file+0x133>
lea    0xe85(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    123e <_dedx_get_energy_file+0x13e>
lea    0xe83(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    123e <_dedx_get_energy_file+0x13e>
lea    0xe36(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    123e <_dedx_get_energy_file+0x13e>
lea    0xe2f(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    123e <_dedx_get_energy_file+0x13e>
lea    0xe28(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    123e <_dedx_get_energy_file+0x13e>
lea    0xe22(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    123e <_dedx_get_energy_file+0x13e>
lea    0xe20(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    123e <_dedx_get_energy_file+0x13e>
lea    0xe1e(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    123e <_dedx_get_energy_file+0x13e>
lea    0xe1c(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    123e <_dedx_get_energy_file+0x13e>
lea    0xde1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dedx_get_energy_file>:
lea    -0x1(%rdi),%ecx
cmp    $0x7,%ecx
ja     1127 <_dedx_get_energy_file+0x27>
lea    0xf40(%rip),%rax
lea    0xeea(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf37(%rip),%rax
ret
cmp    $0x65,%edi
jne    1164 <_dedx_get_energy_file+0x64>
lea    0xf33(%rip),%rax
ret
lea    0xee5(%rip),%rax
ret
lea    0xee6(%rip),%rax
ret
lea    0xee7(%rip),%rax
ret
lea    0xee9(%rip),%rax
ret
lea    0xeef(%rip),%rax
ret
lea    0xef5(%rip),%rax
ret
lea    0xed0(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"astarEng\00"
@.str.1 = [9 x i8] c"pstarEng\00"
@.str.2 = [9 x i8] c"estarEng\00"
@.str.3 = [9 x i8] c"mstarEng\00"
@.str.4 = [10 x i8] c"icru73Eng\00"
@.str.5 = [14 x i8] c"icru73_newEng\00"
@.str.6 = [14 x i8] c"icru_astarEng\00"
@.str.7 = [14 x i8] c"icru_pstarEng\00"
@.str.8 = [9 x i8] c"betheEng\00"
@.str.9 = [1 x i8] zeroinitializer
define i8* @_dedx_get_energy_file(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %14 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
i32 6, label %10
i32 7, label %11
i32 8, label %12
i32 101, label %13
]
5: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3
br label %15
6: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %15
7: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %15
8: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %15
9: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %15
10: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %15
11: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %15
12: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %15
13: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %15
14: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [9 x i8] c"astarEng\00"
@.str.1 = [9 x i8] c"pstarEng\00"
@.str.2 = [9 x i8] c"estarEng\00"
@.str.3 = [9 x i8] c"mstarEng\00"
@.str.4 = [10 x i8] c"icru73Eng\00"
@.str.5 = [14 x i8] c"icru73_newEng\00"
@.str.6 = [14 x i8] c"icru_astarEng\00"
@.str.7 = [14 x i8] c"icru_pstarEng\00"
@.str.8 = [9 x i8] c"betheEng\00"
@.str.9 = [1 x i8] zeroinitializer
define i8* @_dedx_get_energy_file(i32 %0) {
switch i32 %0, label %10 [
i32 1, label %11
i32 2, label %2
i32 3, label %3
i32 4, label %4
i32 5, label %5
i32 6, label %6
i32 7, label %7
i32 8, label %8
i32 101, label %9
]
2: ; preds = %1
br label %11
3: ; preds = %1
br label %11
4: ; preds = %1
br label %11
5: ; preds = %1
br label %11
6: ; preds = %1
br label %11
7: ; preds = %1
br label %11
8: ; preds = %1
br label %11
9: ; preds = %1
br label %11
10: ; preds = %1
br label %11
11: ; preds = %1, %10, %9, %8, %7, %6, %5, %4, %3, %2
%12 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %12
}