#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*/ SIGINT;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ pthread_sigmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/ *);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
void mascheraSegnaliThread() {
  sigset_t set;
  sigemptyset(&set);
  sigaddset(&set, SIGINT);
  sigaddset(&set, SIGUSR1);
  sigaddset(&set, SIGTERM);
  pthread_sigmask(SIG_SETMASK, &set, NULL);
}


x86 assembly (clang, -O0):
<mascheraSegnaliThread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <sigemptyset@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <pthread_sigmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mascheraSegnaliThread>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sigemptyset@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1040 <pthread_sigmask@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@SIGUSR1 = global i32 0
@SIGTERM = global i32 0
@SIG_SETMASK = global i32 0
define void @mascheraSegnaliThread() {
%1 = alloca i32
%2 = call i32 @sigemptyset(i32* %1)
%3 = load i32, i32* @SIGINT
%4 = call i32 @sigaddset(i32* %1, i32 %3)
%5 = load i32, i32* @SIGUSR1
%6 = call i32 @sigaddset(i32* %1, i32 %5)
%7 = load i32, i32* @SIGTERM
%8 = call i32 @sigaddset(i32* %1, i32 %7)
%9 = load i32, i32* @SIG_SETMASK
%10 = call i32 @pthread_sigmask(i32 %9, i32* %1, i32* null)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIGUSR1 = global i32 0
@SIGTERM = global i32 0
@SIG_SETMASK = global i32 0
define void @mascheraSegnaliThread() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = load i32, i32* @SIGINT
%5 = call i32 @sigaddset(i32* %1, i32 %4)
%6 = load i32, i32* @SIGUSR1
%7 = call i32 @sigaddset(i32* %1, i32 %6)
%8 = load i32, i32* @SIGTERM
%9 = call i32 @sigaddset(i32* %1, i32 %8)
%10 = load i32, i32* @SIG_SETMASK
%11 = call i32 @pthread_sigmask(i32 %10, i32* %1, i32* null)
ret void
}