const char *rrddim_algorithm_name(int chart_type) {
  static char absolute[] = "absolute";
  static char incremental[] = "incremental";
  static char percentage_of_absolute_row[] = "percentage-of-absolute-row";
  static char percentage_of_incremental_row[] = "percentage-of-incremental-row";
  switch (chart_type) {
  case 0:
    return absolute;
  case 1:
    return incremental;
  case 3:
    return percentage_of_absolute_row;
  case 2:
    return percentage_of_incremental_row;
  }
  return absolute;
}


x86 assembly (clang, -O0):
<rrddim_algorithm_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     116c <rrddim_algorithm_name+0x6c>
mov    -0x18(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x2efd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <rrddim_algorithm_name+0x77>
lea    0x2ef6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <rrddim_algorithm_name+0x77>
lea    0x2efd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <rrddim_algorithm_name+0x77>
lea    0x2f0d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <rrddim_algorithm_name+0x77>
lea    0x2ebd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rrddim_algorithm_name>:
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     1117 <rrddim_algorithm_name+0x17>
movslq %edi,%rax
lea    0x2d26(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret
lea    0x2f12(%rip),%rax
ret

LLVM IR (-O0):
@rrddim_algorithm_name.absolute = internal global [9 x i8] c"absolute\00"
@rrddim_algorithm_name.incremental = internal global [12 x i8] c"incremental\00"
@rrddim_algorithm_name.percentage_of_absolute_row = internal global [27 x i8] c"percentage-of-absolute-row\00"
@rrddim_algorithm_name.percentage_of_incremental_row = internal global [30 x i8] c"percentage-of-incremental-row\00"
define i8* @rrddim_algorithm_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 3, label %7
i32 2, label %8
]
5: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rrddim_algorithm_name.absolute, i64 0, i64 0), i8** %2
br label %10
6: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @rrddim_algorithm_name.incremental, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @rrddim_algorithm_name.percentage_of_absolute_row, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @rrddim_algorithm_name.percentage_of_incremental_row, i64 0, i64 0), i8** %2
br label %10
9: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rrddim_algorithm_name.absolute, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@rrddim_algorithm_name.absolute = internal global [9 x i8] c"absolute\00"
@rrddim_algorithm_name.incremental = internal global [12 x i8] c"incremental\00"
@rrddim_algorithm_name.percentage_of_absolute_row = internal global [27 x i8] c"percentage-of-absolute-row\00"
@rrddim_algorithm_name.percentage_of_incremental_row = internal global [30 x i8] c"percentage-of-incremental-row\00"
@switch.table.rrddim_algorithm_name = [3 x i8*] [i8* getelementptr inbounds ([12 x i8], [12 x i8]* @rrddim_algorithm_name.incremental, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @rrddim_algorithm_name.percentage_of_incremental_row, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @rrddim_algorithm_name.percentage_of_absolute_row, i64 0, i64 0)]
define i8* @rrddim_algorithm_name(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* @switch.table.rrddim_algorithm_name, i64 0, i64 %5
%7 = load i8*, i8** %6
br label %8
8: ; preds = %4, %1
%9 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @rrddim_algorithm_name.absolute, i64 0, i64 0), %1 ], [ %7, %4 ]
ret i8* %9
}