char *pgm_to_string(unsigned int _modulation) {
  switch (_modulation) {
  case 1:
    return "Amplitude-shift keying";
    break;
  case 2:
    return "Frequency-shift keying";
    break;
  case 3:
    return "Binary phase-shift keying";
    break;
  case 4:
    return "Quadrature phase-shift keying";
    break;
  case 5:
    return "8-phase shift keying";
    break;
  case 6:
    return "16-phase shift keying";
    break;
  case 7:
    return "32-phase shift keying";
    break;
  case 8:
    return "64-phase shift keying";
    break;
  case 9:
    return "256-phase shift keying";
    break;
  case 10:
    return "1024-phase shift keying";
    break;
  case 11:
    return "4096-phase shift keying";
    break;
  case 12:
    return "16-quadrature-amplitude modulation";
    break;
  case 13:
    return "32-quadrature-amplitude modulation";
    break;
  case 14:
    return "64-quadrature-amplitude modulation";
    break;
  case 15:
    return "256-quadrature-amplitude modulation";
    break;
  case 16:
    return "1024-quadrature-amplitude modulation";
    break;
  case 17:
    return "4096-quadrature-amplitude modulation";
    break;
  default:
    __pgp_switch_default(__func__,
                         "/scratch/repos/new/home/jordi_armengol_estape/"
                         "c-scraper/outputs/2022-01-22/02-19-57/repos/pfactum/"
                         "pegasus/refs/heads/master/pegasus_modulation.c",
                         278);
    return "Unknown";
    break;
  }
}


x86 assembly (clang, -O0):
<pgm_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x10,%eax
ja     1254 <pgm_to_string+0x144>
mov    -0x18(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xef9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf00(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf07(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf11(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf1f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf24(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf2a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf30(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf36(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf3d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf45(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf4d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf60(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf73(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf86(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xf9a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xfaf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1279 <pgm_to_string+0x169>
lea    0xfc4(%rip),%rdi
lea    0xfcb(%rip),%rsi
mov    $0x116,%edx
mov    $0x0,%al
call   1030 <__pgp_switch_default@plt>
lea    0x1049(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgm_to_string>:
push   %rax
add    $0xffffffff,%edi
cmp    $0x11,%edi
jae    112c <pgm_to_string+0x1c>
movslq %edi,%rax
lea    0x1161(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
pop    %rcx
ret
lea    0x10a8(%rip),%rdi
lea    0x10af(%rip),%rsi
mov    $0x116,%edx
xor    %eax,%eax
call   1030 <__pgp_switch_default@plt>
lea    0x112d(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Amplitude-shift keying\00"
@.str.1 = [23 x i8] c"Frequency-shift keying\00"
@.str.2 = [26 x i8] c"Binary phase-shift keying\00"
@.str.3 = [30 x i8] c"Quadrature phase-shift keying\00"
@.str.4 = [21 x i8] c"8-phase shift keying\00"
@.str.5 = [22 x i8] c"16-phase shift keying\00"
@.str.6 = [22 x i8] c"32-phase shift keying\00"
@.str.7 = [22 x i8] c"64-phase shift keying\00"
@.str.8 = [23 x i8] c"256-phase shift keying\00"
@.str.9 = [24 x i8] c"1024-phase shift keying\00"
@.str.10 = [24 x i8] c"4096-phase shift keying\00"
@.str.11 = [35 x i8] c"16-quadrature-amplitude modulation\00"
@.str.12 = [35 x i8] c"32-quadrature-amplitude modulation\00"
@.str.13 = [35 x i8] c"64-quadrature-amplitude modulation\00"
@.str.14 = [36 x i8] c"256-quadrature-amplitude modulation\00"
@.str.15 = [37 x i8] c"1024-quadrature-amplitude modulation\00"
@.str.16 = [37 x i8] c"4096-quadrature-amplitude modulation\00"
@__func__.pgm_to_string = [14 x i8] c"pgm_to_string\00"
@.str.17 = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/pfactum/pegasus/refs/heads/master/pegasus_modulation.c\00"
@.str.18 = [8 x i8] c"Unknown\00"
define i8* @pgm_to_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %22 [
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 9, label %13
i32 10, label %14
i32 11, label %15
i32 12, label %16
i32 13, label %17
i32 14, label %18
i32 15, label %19
i32 16, label %20
i32 17, label %21
]
5: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %2
br label %24
6: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %24
7: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %24
8: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %24
9: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %24
10: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %24
11: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %24
12: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %24
13: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %24
14: ; preds = %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %24
15: ; preds = %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %24
16: ; preds = %1
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %24
17: ; preds = %1
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %24
18: ; preds = %1
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %24
19: ; preds = %1
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %24
20: ; preds = %1
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %24
21: ; preds = %1
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %24
22: ; preds = %1
%23 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @__pgp_switch_default to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.pgm_to_string, i64 0, i64 0), i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.17, i64 0, i64 0), i32 278)
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0), i8** %2
br label %24
24: ; preds = %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%25 = load i8*, i8** %2
ret i8* %25
}

LLVM IR (-O2):
@.str = [23 x i8] c"Amplitude-shift keying\00"
@.str.1 = [23 x i8] c"Frequency-shift keying\00"
@.str.2 = [26 x i8] c"Binary phase-shift keying\00"
@.str.3 = [30 x i8] c"Quadrature phase-shift keying\00"
@.str.4 = [21 x i8] c"8-phase shift keying\00"
@.str.5 = [22 x i8] c"16-phase shift keying\00"
@.str.6 = [22 x i8] c"32-phase shift keying\00"
@.str.7 = [22 x i8] c"64-phase shift keying\00"
@.str.8 = [23 x i8] c"256-phase shift keying\00"
@.str.9 = [24 x i8] c"1024-phase shift keying\00"
@.str.10 = [24 x i8] c"4096-phase shift keying\00"
@.str.11 = [35 x i8] c"16-quadrature-amplitude modulation\00"
@.str.12 = [35 x i8] c"32-quadrature-amplitude modulation\00"
@.str.13 = [35 x i8] c"64-quadrature-amplitude modulation\00"
@.str.14 = [36 x i8] c"256-quadrature-amplitude modulation\00"
@.str.15 = [37 x i8] c"1024-quadrature-amplitude modulation\00"
@.str.16 = [37 x i8] c"4096-quadrature-amplitude modulation\00"
@__func__.pgm_to_string = [14 x i8] c"pgm_to_string\00"
@.str.17 = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/pfactum/pegasus/refs/heads/master/pegasus_modulation.c\00"
@.str.18 = [8 x i8] c"Unknown\00"
@reltable.pgm_to_string = [17 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.1 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.2 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([30 x i8]* @.str.3 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.4 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.5 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.6 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.7 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.8 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.9 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.10 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([35 x i8]* @.str.11 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([35 x i8]* @.str.12 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([35 x i8]* @.str.13 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([36 x i8]* @.str.14 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([37 x i8]* @.str.15 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([37 x i8]* @.str.16 to i64), i64 ptrtoint ([17 x i32]* @reltable.pgm_to_string to i64)) to i32)]
define i8* @pgm_to_string(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 17
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @__pgp_switch_default to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.pgm_to_string, i64 0, i64 0), i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.17, i64 0, i64 0), i32 278)
br label %10
6: ; preds = %1
%7 = sext i32 %2 to i64
%8 = shl i64 %7, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([17 x i32]* @reltable.pgm_to_string to i8*), i64 %8)
br label %10
10: ; preds = %6, %4
%11 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0), %4 ], [ %9, %6 ]
ret i8* %11
}