#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 */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ SIGBUS;
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ SIGILL;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ SIGTRAP;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigdelset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int setup_sigmask(void) {
  sigset_t set;
  sigfillset(&set);
  sigdelset(&set, SIGQUIT);
  sigdelset(&set, SIGILL);
  sigdelset(&set, SIGTRAP);
  sigdelset(&set, SIGABRT);
  sigdelset(&set, SIGFPE);
  sigdelset(&set, SIGSEGV);
  sigdelset(&set, SIGBUS);
  sigdelset(&set, SIGTERM);
  sigdelset(&set, SIGINT);
  sigdelset(&set, SIGQUIT);
  sigdelset(&set, SIGCHLD);
  return (sigprocmask(SIG_BLOCK, &set, NULL));
}


x86 assembly (clang, -O0):
<setup_sigmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigfillset@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e30(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e0a(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e00(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2dde(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2dbc(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2d92(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_sigmask>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigfillset@plt>
mov    0x2e80(%rip),%r14
mov    (%r14),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2e25(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2e1c(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2e33(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2e10(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2e07(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2dcb(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2da2(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIGQUIT = global i32 0
@SIGILL = global i32 0
@SIGTRAP = global i32 0
@SIGABRT = global i32 0
@SIGFPE = global i32 0
@SIGSEGV = global i32 0
@SIGBUS = global i32 0
@SIGTERM = global i32 0
@SIGINT = global i32 0
@SIGCHLD = global i32 0
@SIG_BLOCK = global i32 0
define i32 @setup_sigmask() {
%1 = alloca i32
%2 = call i32 @sigfillset(i32* %1)
%3 = load i32, i32* @SIGQUIT
%4 = call i32 @sigdelset(i32* %1, i32 %3)
%5 = load i32, i32* @SIGILL
%6 = call i32 @sigdelset(i32* %1, i32 %5)
%7 = load i32, i32* @SIGTRAP
%8 = call i32 @sigdelset(i32* %1, i32 %7)
%9 = load i32, i32* @SIGABRT
%10 = call i32 @sigdelset(i32* %1, i32 %9)
%11 = load i32, i32* @SIGFPE
%12 = call i32 @sigdelset(i32* %1, i32 %11)
%13 = load i32, i32* @SIGSEGV
%14 = call i32 @sigdelset(i32* %1, i32 %13)
%15 = load i32, i32* @SIGBUS
%16 = call i32 @sigdelset(i32* %1, i32 %15)
%17 = load i32, i32* @SIGTERM
%18 = call i32 @sigdelset(i32* %1, i32 %17)
%19 = load i32, i32* @SIGINT
%20 = call i32 @sigdelset(i32* %1, i32 %19)
%21 = load i32, i32* @SIGQUIT
%22 = call i32 @sigdelset(i32* %1, i32 %21)
%23 = load i32, i32* @SIGCHLD
%24 = call i32 @sigdelset(i32* %1, i32 %23)
%25 = load i32, i32* @SIG_BLOCK
%26 = call i32 @sigprocmask(i32 %25, i32* %1, i32* null)
ret i32 %26
}

LLVM IR (-O2):
@SIGQUIT = global i32 0
@SIGILL = global i32 0
@SIGTRAP = global i32 0
@SIGABRT = global i32 0
@SIGFPE = global i32 0
@SIGSEGV = global i32 0
@SIGBUS = global i32 0
@SIGTERM = global i32 0
@SIGINT = global i32 0
@SIGCHLD = global i32 0
@SIG_BLOCK = global i32 0
define i32 @setup_sigmask() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
%4 = load i32, i32* @SIGQUIT
%5 = call i32 @sigdelset(i32* %1, i32 %4)
%6 = load i32, i32* @SIGILL
%7 = call i32 @sigdelset(i32* %1, i32 %6)
%8 = load i32, i32* @SIGTRAP
%9 = call i32 @sigdelset(i32* %1, i32 %8)
%10 = load i32, i32* @SIGABRT
%11 = call i32 @sigdelset(i32* %1, i32 %10)
%12 = load i32, i32* @SIGFPE
%13 = call i32 @sigdelset(i32* %1, i32 %12)
%14 = load i32, i32* @SIGSEGV
%15 = call i32 @sigdelset(i32* %1, i32 %14)
%16 = load i32, i32* @SIGBUS
%17 = call i32 @sigdelset(i32* %1, i32 %16)
%18 = load i32, i32* @SIGTERM
%19 = call i32 @sigdelset(i32* %1, i32 %18)
%20 = load i32, i32* @SIGINT
%21 = call i32 @sigdelset(i32* %1, i32 %20)
%22 = load i32, i32* @SIGQUIT
%23 = call i32 @sigdelset(i32* %1, i32 %22)
%24 = load i32, i32* @SIGCHLD
%25 = call i32 @sigdelset(i32* %1, i32 %24)
%26 = load i32, i32* @SIG_BLOCK
%27 = call i32 @sigprocmask(i32 %26, i32* %1, i32* null)
ret i32 %27
}