char *pgc_channel_to_string(unsigned int _channel) {
  switch (_channel) {
  case 1:
    return "Additive white Gaussian noise";
    break;
  case 2:
    return "Rayleigh";
    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_channel.c",
                         48);
    return "Unknown";
    break;
  }
}


x86 assembly (clang, -O0):
<pgc_channel_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     1140 <pgc_channel_to_string+0x30>
jmp    112f <pgc_channel_to_string+0x1f>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1150 <pgc_channel_to_string+0x40>
jmp    1160 <pgc_channel_to_string+0x50>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <pgc_channel_to_string+0x75>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <pgc_channel_to_string+0x75>
lea    0xec0(%rip),%rdi
lea    0xecf(%rip),%rsi
mov    $0x30,%edx
mov    $0x0,%al
call   1030 <__pgp_switch_default@plt>
lea    0xf4a(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgc_channel_to_string>:
cmp    $0x1,%edi
je     1122 <pgc_channel_to_string+0x12>
cmp    $0x2,%edi
jne    112a <pgc_channel_to_string+0x1a>
lea    0xefd(%rip),%rax
ret
lea    0xed7(%rip),%rax
ret
push   %rax
lea    0xef5(%rip),%rdi
lea    0xf04(%rip),%rsi
mov    $0x30,%edx
xor    %eax,%eax
call   1030 <__pgp_switch_default@plt>
lea    0xf7f(%rip),%rax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Additive white Gaussian noise\00"
@.str.1 = [9 x i8] c"Rayleigh\00"
@__func__.pgc_channel_to_string = [22 x i8] c"pgc_channel_to_string\00"
@.str.2 = [142 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_channel.c\00"
@.str.3 = [8 x i8] c"Unknown\00"
define i8* @pgc_channel_to_string(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 %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
%8 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @__pgp_switch_default to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.pgc_channel_to_string, i64 0, i64 0), i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.2, i64 0, i64 0), i32 48)
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [30 x i8] c"Additive white Gaussian noise\00"
@.str.1 = [9 x i8] c"Rayleigh\00"
@__func__.pgc_channel_to_string = [22 x i8] c"pgc_channel_to_string\00"
@.str.2 = [142 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_channel.c\00"
@.str.3 = [8 x i8] c"Unknown\00"
define i8* @pgc_channel_to_string(i32 %0) {
switch i32 %0, label %3 [
i32 1, label %5
i32 2, label %2
]
2: ; preds = %1
br label %5
3: ; preds = %1
%4 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @__pgp_switch_default to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.pgc_channel_to_string, i64 0, i64 0), i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.2, i64 0, i64 0), i32 48)
br label %5
5: ; preds = %1, %3, %2
%6 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}