char *pge_to_string(unsigned int _error) {
  switch (_error) {
  case 1:
    return "Bit error rate";
    break;
  case 2:
    return "Symbol error rate";
    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_error.c",
                         39);
    return "Unknown";
    break;
  }
}


x86 assembly (clang, -O0):
<pge_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 <pge_to_string+0x30>
jmp    112f <pge_to_string+0x1f>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1150 <pge_to_string+0x40>
jmp    1160 <pge_to_string+0x50>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <pge_to_string+0x75>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <pge_to_string+0x75>
lea    0xeba(%rip),%rdi
lea    0xec1(%rip),%rsi
mov    $0x27,%edx
mov    $0x0,%al
call   1030 <__pgp_switch_default@plt>
lea    0xf3a(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pge_to_string>:
cmp    $0x1,%edi
je     1122 <pge_to_string+0x12>
cmp    $0x2,%edi
jne    112a <pge_to_string+0x1a>
lea    0xeee(%rip),%rax
ret
lea    0xed7(%rip),%rax
ret
push   %rax
lea    0xeef(%rip),%rdi
lea    0xef6(%rip),%rsi
mov    $0x27,%edx
xor    %eax,%eax
call   1030 <__pgp_switch_default@plt>
lea    0xf6f(%rip),%rax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Bit error rate\00"
@.str.1 = [18 x i8] c"Symbol error rate\00"
@__func__.pge_to_string = [14 x i8] c"pge_to_string\00"
@.str.2 = [140 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_error.c\00"
@.str.3 = [8 x i8] c"Unknown\00"
define i8* @pge_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 ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 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 ([14 x i8], [14 x i8]* @__func__.pge_to_string, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i32 39)
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 = [15 x i8] c"Bit error rate\00"
@.str.1 = [18 x i8] c"Symbol error rate\00"
@__func__.pge_to_string = [14 x i8] c"pge_to_string\00"
@.str.2 = [140 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_error.c\00"
@.str.3 = [8 x i8] c"Unknown\00"
define i8* @pge_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 ([14 x i8], [14 x i8]* @__func__.pge_to_string, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i32 39)
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 ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}