#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 */
struct sigaction {
  int /*<<< orphan*/ sa_handler;
};
typedef int /*<<< orphan*/ sa;

/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ SIGBUS;
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ SIGILL;
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ SIGSYS;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ memset(struct sigaction *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/ *);
void sig_setup() {
  struct sigaction sa;
  memset(&sa, 0, sizeof(sa));
  sa.sa_handler = SIG_IGN;
  sigaction(SIGTERM, &sa, NULL);
  sigaction(SIGILL, &sa, NULL);
  sigaction(SIGABRT, &sa, NULL);
  sigaction(SIGHUP, &sa, NULL);
  sigaction(SIGFPE, &sa, NULL);
  sigaction(SIGSEGV, &sa, NULL);
  sigaction(SIGALRM, &sa, NULL);
  sigaction(SIGBUS, &sa, NULL);
  sigaction(SIGSYS, &sa, NULL);
  sigaction(SIGPIPE, &sa, NULL);
  sigaction(SIGQUIT, &sa, NULL);
}


x86 assembly (clang, -O0):
<sig_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2e03(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2d95(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2d87(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2d99(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_setup>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2dab(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2da0(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2db5(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@SIG_IGN = global i32 0
@SIGTERM = global i32 0
@SIGILL = global i32 0
@SIGABRT = global i32 0
@SIGHUP = global i32 0
@SIGFPE = global i32 0
@SIGSEGV = global i32 0
@SIGALRM = global i32 0
@SIGBUS = global i32 0
@SIGSYS = global i32 0
@SIGPIPE = global i32 0
@SIGQUIT = global i32 0
define void @sig_setup() {
%1 = alloca %struct.sigaction
%2 = call i32 @memset(%struct.sigaction* %1, i32 0, i32 4)
%3 = load i32, i32* @SIG_IGN
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
store i32 %3, i32* %4
%5 = load i32, i32* @SIGTERM
%6 = call i32 @sigaction(i32 %5, %struct.sigaction* %1, i32* null)
%7 = load i32, i32* @SIGILL
%8 = call i32 @sigaction(i32 %7, %struct.sigaction* %1, i32* null)
%9 = load i32, i32* @SIGABRT
%10 = call i32 @sigaction(i32 %9, %struct.sigaction* %1, i32* null)
%11 = load i32, i32* @SIGHUP
%12 = call i32 @sigaction(i32 %11, %struct.sigaction* %1, i32* null)
%13 = load i32, i32* @SIGFPE
%14 = call i32 @sigaction(i32 %13, %struct.sigaction* %1, i32* null)
%15 = load i32, i32* @SIGSEGV
%16 = call i32 @sigaction(i32 %15, %struct.sigaction* %1, i32* null)
%17 = load i32, i32* @SIGALRM
%18 = call i32 @sigaction(i32 %17, %struct.sigaction* %1, i32* null)
%19 = load i32, i32* @SIGBUS
%20 = call i32 @sigaction(i32 %19, %struct.sigaction* %1, i32* null)
%21 = load i32, i32* @SIGSYS
%22 = call i32 @sigaction(i32 %21, %struct.sigaction* %1, i32* null)
%23 = load i32, i32* @SIGPIPE
%24 = call i32 @sigaction(i32 %23, %struct.sigaction* %1, i32* null)
%25 = load i32, i32* @SIGQUIT
%26 = call i32 @sigaction(i32 %25, %struct.sigaction* %1, i32* null)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@SIG_IGN = global i32 0
@SIGTERM = global i32 0
@SIGILL = global i32 0
@SIGABRT = global i32 0
@SIGHUP = global i32 0
@SIGFPE = global i32 0
@SIGSEGV = global i32 0
@SIGALRM = global i32 0
@SIGBUS = global i32 0
@SIGSYS = global i32 0
@SIGPIPE = global i32 0
@SIGQUIT = global i32 0
define void @sig_setup() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = call i32 @memset(%struct.sigaction* %1, i32 0, i32 4)
%4 = load i32, i32* @SIG_IGN
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* @SIGTERM
%7 = call i32 @sigaction(i32 %6, %struct.sigaction* %1, i32* null)
%8 = load i32, i32* @SIGILL
%9 = call i32 @sigaction(i32 %8, %struct.sigaction* %1, i32* null)
%10 = load i32, i32* @SIGABRT
%11 = call i32 @sigaction(i32 %10, %struct.sigaction* %1, i32* null)
%12 = load i32, i32* @SIGHUP
%13 = call i32 @sigaction(i32 %12, %struct.sigaction* %1, i32* null)
%14 = load i32, i32* @SIGFPE
%15 = call i32 @sigaction(i32 %14, %struct.sigaction* %1, i32* null)
%16 = load i32, i32* @SIGSEGV
%17 = call i32 @sigaction(i32 %16, %struct.sigaction* %1, i32* null)
%18 = load i32, i32* @SIGALRM
%19 = call i32 @sigaction(i32 %18, %struct.sigaction* %1, i32* null)
%20 = load i32, i32* @SIGBUS
%21 = call i32 @sigaction(i32 %20, %struct.sigaction* %1, i32* null)
%22 = load i32, i32* @SIGSYS
%23 = call i32 @sigaction(i32 %22, %struct.sigaction* %1, i32* null)
%24 = load i32, i32* @SIGPIPE
%25 = call i32 @sigaction(i32 %24, %struct.sigaction* %1, i32* null)
%26 = load i32, i32* @SIGQUIT
%27 = call i32 @sigaction(i32 %26, %struct.sigaction* %1, i32* null)
ret void
}