#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 */
int SIGINT;
int SIGTERM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ system_log(char *, char *, int, char *, ...);
void sig_exit(int signo) {
  if (signo == SIGTERM) {
    system_log("<D>",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/holger24/AFD/refs/heads/"
               "master/src/init_afd/init_afd.c",
               3552, ("Received SIGTERM!"));
  } else if (signo == SIGINT) {
    system_log("<D>",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/holger24/AFD/refs/heads/"
               "master/src/init_afd/init_afd.c",
               3556, ("Received SIGINT!"));
  } else {
    system_log("<D>",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/holger24/AFD/refs/heads/"
               "master/src/init_afd/init_afd.c",
               3560, ("Received %d!"), signo);
  }
  exit(-1);
}


x86 assembly (clang, -O0):
<sig_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%eax
jne    1163 <sig_exit+0x43>
lea    0xebc(%rip),%rdi
lea    0xeb9(%rip),%rsi
mov    $0xde0,%edx
lea    0xf3e(%rip),%rcx
mov    $0x0,%al
call   1030 <system_log@plt>
jmp    11c5 <sig_exit+0xa5>
mov    -0x4(%rbp),%eax
mov    0x2e7b(%rip),%rcx
cmp    (%rcx),%eax
jne    119b <sig_exit+0x7b>
lea    0xe84(%rip),%rdi
lea    0xe81(%rip),%rsi
mov    $0xde4,%edx
lea    0xf18(%rip),%rcx
mov    $0x0,%al
call   1030 <system_log@plt>
jmp    11c0 <sig_exit+0xa0>
mov    -0x4(%rbp),%r8d
lea    0xe5a(%rip),%rdi
lea    0xe57(%rip),%rsi
mov    $0xde8,%edx
lea    0xeff(%rip),%rcx
mov    $0x0,%al
call   1030 <system_log@plt>
jmp    11c5 <sig_exit+0xa5>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig_exit>:
push   %rax
mov    0x2eb8(%rip),%rax
cmp    %edi,(%rax)
jne    1148 <sig_exit+0x28>
lea    0xecd(%rip),%rdi
lea    0xeca(%rip),%rsi
lea    0xf54(%rip),%rcx
mov    $0xde0,%edx
jmp    1170 <sig_exit+0x50>
mov    %edi,%r8d
mov    0x2e96(%rip),%rax
cmp    %edi,(%rax)
jne    1181 <sig_exit+0x61>
lea    0xea3(%rip),%rdi
lea    0xea0(%rip),%rsi
lea    0xf3c(%rip),%rcx
mov    $0xde4,%edx
xor    %eax,%eax
call   1030 <system_log@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
lea    0xe78(%rip),%rdi
lea    0xe75(%rip),%rsi
lea    0xf22(%rip),%rcx
mov    $0xde8,%edx
xor    %eax,%eax
call   1030 <system_log@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
@.str = [4 x i8] c"<D>\00"
@.str.1 = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/holger24/AFD/refs/heads/master/src/init_afd/init_afd.c\00"
@.str.2 = [18 x i8] c"Received SIGTERM!\00"
@SIGINT = global i32 0
@.str.3 = [17 x i8] c"Received SIGINT!\00"
@.str.4 = [13 x i8] c"Received %d!\00"
define void @sig_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGTERM
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, i8*, i32, i8*, ...) @system_log(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 3552, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %18
8: ; preds = %1
%9 = load i32, i32* %2
%10 = load i32, i32* @SIGINT
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (i8*, i8*, i32, i8*, ...) @system_log(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 3556, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %17
14: ; preds = %8
%15 = load i32, i32* %2
%16 = call i32 (i8*, i8*, i32, i8*, ...) @system_log(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 3560, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %12
br label %18
18: ; preds = %17, %6
%19 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@SIGTERM = global i32 0
@.str = [4 x i8] c"<D>\00"
@.str.1 = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/holger24/AFD/refs/heads/master/src/init_afd/init_afd.c\00"
@.str.2 = [18 x i8] c"Received SIGTERM!\00"
@SIGINT = global i32 0
@.str.3 = [17 x i8] c"Received SIGINT!\00"
@.str.4 = [13 x i8] c"Received %d!\00"
define void @sig_exit(i32 %0) {
%2 = load i32, i32* @SIGTERM
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, i8*, i32, i8*, ...) @system_log(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 3552, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %13
6: ; preds = %1
%7 = load i32, i32* @SIGINT
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 (i8*, i8*, i32, i8*, ...) @system_log(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 3556, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %13
11: ; preds = %6
%12 = tail call i32 (i8*, i8*, i32, i8*, ...) @system_log(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 3560, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %0)
br label %13
13: ; preds = %9, %11, %4
%14 = tail call i32 @exit(i32 -1)
unreachable
}