const char *spec_pha_axis_units(int quant) {
  switch (quant) {
  case 0x0001:
  case 0x0002:
    return ("c/\\omega_p");
    break;
  case 0x0004:
  case 0x0005:
  case 0x0006:
    return ("m_e c");
  }
  return ("");
}


x86 assembly (clang, -O0):
<spec_pha_axis_units>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     1132 <spec_pha_axis_units+0x32>
jmp    111e <spec_pha_axis_units+0x1e>
mov    -0x10(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x3,%eax
jb     1142 <spec_pha_axis_units+0x42>
jmp    1152 <spec_pha_axis_units+0x52>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <spec_pha_axis_units+0x5d>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <spec_pha_axis_units+0x5d>
lea    0xeb7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spec_pha_axis_units>:
add    $0xffffffff,%edi
cmp    $0x5,%edi
ja     111a <spec_pha_axis_units+0x1a>
movslq %edi,%rax
lea    0xf02(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xeef(%rip),%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"c/\\omega_p\00"
@.str.1 = [6 x i8] c"m_e c\00"
@.str.2 = [1 x i8] zeroinitializer
define i8* @spec_pha_axis_units(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 1, label %5
i32 2, label %5
i32 4, label %6
i32 5, label %6
i32 6, label %6
]
5: ; preds = %1, %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1, %1, %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"c/\\omega_p\00"
@.str.1 = [6 x i8] c"m_e c\00"
@.str.2 = [1 x i8] zeroinitializer
@reltable.spec_pha_axis_units = [6 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str to i64), i64 ptrtoint ([6 x i32]* @reltable.spec_pha_axis_units to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str to i64), i64 ptrtoint ([6 x i32]* @reltable.spec_pha_axis_units to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.2 to i64), i64 ptrtoint ([6 x i32]* @reltable.spec_pha_axis_units to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64 ptrtoint ([6 x i32]* @reltable.spec_pha_axis_units to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64 ptrtoint ([6 x i32]* @reltable.spec_pha_axis_units to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64 ptrtoint ([6 x i32]* @reltable.spec_pha_axis_units to i64)) to i32)]
define i8* @spec_pha_axis_units(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([6 x i32]* @reltable.spec_pha_axis_units to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %1 ]
ret i8* %9
}