#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
#define SIGALRM 129
#define SIGINT 128
int /*<<< orphan*/ printf(char *, ...);
void sig_fun(int s) {
  printf("%s:%d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/"
         "clang/posix/raise.c",
         25);
  switch (s) {
  case SIGALRM:
    printf("in SIGALRM\n\n");
    break;
  case SIGINT:
    printf("in SIGINT\n\n");
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<sig_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xede(%rip),%rsi
xor    %eax,%eax
mov    $0x19,%edx
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x80,%eax
je     1171 <sig_fun+0x61>
jmp    114b <sig_fun+0x3b>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
jne    1184 <sig_fun+0x74>
jmp    115e <sig_fun+0x4e>
lea    0xf37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1189 <sig_fun+0x79>
lea    0xf31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1189 <sig_fun+0x79>
jmp    1189 <sig_fun+0x79>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_fun>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
lea    0xed6(%rip),%rsi
mov    $0x19,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x81,%ebx
je     115a <sig_fun+0x3a>
cmp    $0x80,%ebx
jne    1167 <sig_fun+0x47>
lea    0xf48(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
lea    0xf46(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/clang/posix/raise.c\00"
@.str.2 = [13 x i8] c"in SIGALRM\0A\0A\00"
@.str.3 = [12 x i8] c"in SIGINT\0A\0A\00"
define void @sig_fun(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 25)
%4 = load i32, i32* %2
switch i32 %4, label %9 [
i32 129, label %5
i32 128, label %7
]
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %7, %5
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/clang/posix/raise.c\00"
@str = [11 x i8] c"in SIGINT\0A\00"
@str.4 = [12 x i8] c"in SIGALRM\0A\00"
define void @sig_fun(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 25)
switch i32 %0, label %7 [
i32 129, label %4
i32 128, label %3
]
3: ; preds = %1
br label %4
4: ; preds = %1, %3
%5 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0), %1 ]
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
br label %7
7: ; preds = %4, %1
ret void
}