char *solver_name(int solver) {
  switch (solver) {
  case 1:
    return "Richardson";
  case 3:
    return "steepest descent";
  case 4:
    return "minimum residual";
  case 6:
    return "residual norm steepest descent";
  case 7:
    return "GMRES";
  case 8:
    return "Gaussian elimination";
  case 9:
    return "conjugate gradient";
  case 10:
    return "conjugate gradient squared";
  case 11:
    return "conjugate gradient NR";
  case 12:
    return "conjugate gradient NE";
  case 100:
    return "Aztec GMRES";
  case 101:
    return "Aztec conjugate gradient";
  case 102:
    return "Aztec conjugate gradient squared";
  case 103:
    return "Aztec TFQMR";
  case 104:
    return "Aztec BiCGSTAB";
  case 105:
    return "Aztec LU";
  default:
    return "UNKNOWN";
  }
}


x86 assembly (clang, -O0):
<solver_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x68,%eax
ja     1230 <solver_name+0x130>
mov    -0x18(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x106d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x1087(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x1058(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x1059(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x10af(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x1058(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x109b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x10a4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x103d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x1043(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x1049(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x1045(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x104e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x105f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x105b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x105a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123b <solver_name+0x13b>
lea    0x1053(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<solver_name>:
add    $0xffffffff,%edi
cmp    $0x68,%edi
ja     119b <solver_name+0x9b>
lea    0x1091(%rip),%rax
lea    0xee6(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0x10a4(%rip),%rax
ret
lea    0x107d(%rip),%rax
ret
lea    0x1086(%rip),%rax
ret
lea    0x10e4(%rip),%rax
ret
lea    0x1095(%rip),%rax
ret
lea    0x10e0(%rip),%rax
ret
lea    0x10f1(%rip),%rax
ret
lea    0x1092(%rip),%rax
ret
lea    0x10a0(%rip),%rax
ret
lea    0x10ae(%rip),%rax
ret
lea    0x10b2(%rip),%rax
ret
lea    0x10c3(%rip),%rax
ret
lea    0x10dc(%rip),%rax
ret
lea    0x10e0(%rip),%rax
ret
lea    0x10e7(%rip),%rax
ret
lea    0x10e8(%rip),%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Richardson\00"
@.str.1 = [17 x i8] c"steepest descent\00"
@.str.2 = [17 x i8] c"minimum residual\00"
@.str.3 = [31 x i8] c"residual norm steepest descent\00"
@.str.4 = [6 x i8] c"GMRES\00"
@.str.5 = [21 x i8] c"Gaussian elimination\00"
@.str.6 = [19 x i8] c"conjugate gradient\00"
@.str.7 = [27 x i8] c"conjugate gradient squared\00"
@.str.8 = [22 x i8] c"conjugate gradient NR\00"
@.str.9 = [22 x i8] c"conjugate gradient NE\00"
@.str.10 = [12 x i8] c"Aztec GMRES\00"
@.str.11 = [25 x i8] c"Aztec conjugate gradient\00"
@.str.12 = [33 x i8] c"Aztec conjugate gradient squared\00"
@.str.13 = [12 x i8] c"Aztec TFQMR\00"
@.str.14 = [15 x i8] c"Aztec BiCGSTAB\00"
@.str.15 = [9 x i8] c"Aztec LU\00"
@.str.16 = [8 x i8] c"UNKNOWN\00"
define i8* @solver_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %21 [
i32 1, label %5
i32 3, label %6
i32 4, label %7
i32 6, label %8
i32 7, label %9
i32 8, label %10
i32 9, label %11
i32 10, label %12
i32 11, label %13
i32 12, label %14
i32 100, label %15
i32 101, label %16
i32 102, label %17
i32 103, label %18
i32 104, label %19
i32 105, label %20
]
5: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
br label %22
6: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %22
7: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %22
8: ; preds = %1
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %22
9: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %22
10: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %22
11: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %22
12: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %22
13: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %22
14: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %22
15: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %22
16: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %22
17: ; preds = %1
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %22
18: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %22
19: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %22
20: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %22
21: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %22
22: ; preds = %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
@.str = [11 x i8] c"Richardson\00"
@.str.1 = [17 x i8] c"steepest descent\00"
@.str.2 = [17 x i8] c"minimum residual\00"
@.str.3 = [31 x i8] c"residual norm steepest descent\00"
@.str.4 = [6 x i8] c"GMRES\00"
@.str.5 = [21 x i8] c"Gaussian elimination\00"
@.str.6 = [19 x i8] c"conjugate gradient\00"
@.str.7 = [27 x i8] c"conjugate gradient squared\00"
@.str.8 = [22 x i8] c"conjugate gradient NR\00"
@.str.9 = [22 x i8] c"conjugate gradient NE\00"
@.str.10 = [12 x i8] c"Aztec GMRES\00"
@.str.11 = [25 x i8] c"Aztec conjugate gradient\00"
@.str.12 = [33 x i8] c"Aztec conjugate gradient squared\00"
@.str.13 = [12 x i8] c"Aztec TFQMR\00"
@.str.14 = [15 x i8] c"Aztec BiCGSTAB\00"
@.str.15 = [9 x i8] c"Aztec LU\00"
@.str.16 = [8 x i8] c"UNKNOWN\00"
define i8* @solver_name(i32 %0) {
switch i32 %0, label %17 [
i32 1, label %18
i32 3, label %2
i32 4, label %3
i32 6, label %4
i32 7, label %5
i32 8, label %6
i32 9, label %7
i32 10, label %8
i32 11, label %9
i32 12, label %10
i32 100, label %11
i32 101, label %12
i32 102, label %13
i32 103, label %14
i32 104, label %15
i32 105, label %16
]
2: ; preds = %1
br label %18
3: ; preds = %1
br label %18
4: ; preds = %1
br label %18
5: ; preds = %1
br label %18
6: ; preds = %1
br label %18
7: ; preds = %1
br label %18
8: ; preds = %1
br label %18
9: ; preds = %1
br label %18
10: ; preds = %1
br label %18
11: ; preds = %1
br label %18
12: ; preds = %1
br label %18
13: ; preds = %1
br label %18
14: ; preds = %1
br label %18
15: ; preds = %1
br label %18
16: ; preds = %1
br label %18
17: ; preds = %1
br label %18
18: ; preds = %1, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%19 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), %17 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), %16 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), %14 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %19
}