char *pgs_source_to_string(unsigned int _source) {
  switch (_source) {
  case 1:
    return "Random bits sequence";
    break;
  case 2:
    return "Predefined bits sequence";
    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_source.c",
                         50);
    return "Unknown";
    break;
  }
}


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

x86 assembly (clang, -O2):
<pgs_source_to_string>:
cmp    $0x1,%edi
je     1122 <pgs_source_to_string+0x12>
cmp    $0x2,%edi
jne    112a <pgs_source_to_string+0x1a>
lea    0xef4(%rip),%rax
ret
lea    0xed7(%rip),%rax
ret
push   %rax
lea    0xefc(%rip),%rdi
lea    0xf0a(%rip),%rsi
mov    $0x32,%edx
xor    %eax,%eax
call   1030 <__pgp_switch_default@plt>
lea    0xf84(%rip),%rax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Random bits sequence\00"
@.str.1 = [25 x i8] c"Predefined bits sequence\00"
@__func__.pgs_source_to_string = [21 x i8] c"pgs_source_to_string\00"
@.str.2 = [141 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_source.c\00"
@.str.3 = [8 x i8] c"Unknown\00"
define i8* @pgs_source_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 ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 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 ([21 x i8], [21 x i8]* @__func__.pgs_source_to_string, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.2, i64 0, i64 0), i32 50)
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 = [21 x i8] c"Random bits sequence\00"
@.str.1 = [25 x i8] c"Predefined bits sequence\00"
@__func__.pgs_source_to_string = [21 x i8] c"pgs_source_to_string\00"
@.str.2 = [141 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_source.c\00"
@.str.3 = [8 x i8] c"Unknown\00"
define i8* @pgs_source_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 ([21 x i8], [21 x i8]* @__func__.pgs_source_to_string, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.2, i64 0, i64 0), i32 50)
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 ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}