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

/* Variables and functions */
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ memset(struct sigaction *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int main() {
  sigset_t mask;
  struct sigaction sa;
  pid_t pid;
  sigemptyset(&mask);
  sigaddset(&mask, SIGUSR2);
  memset(&sa, 0, sizeof(sa));
  sigfillset(&sa.sa_mask);
  sa.sa_handler = SIG_IGN;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdi
call   1060 <sigaddset@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
lea    -0x10(%rbp),%rdi
add    $0x4,%rdi
call   1050 <sigfillset@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1060 <sigaddset@plt>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
lea    0x4(%rsp),%rdi
call   1050 <sigfillset@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32, i32 }
@SIGUSR2 = global i32 0
@SIG_IGN = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.sigaction
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @sigemptyset(i32* %2)
%6 = load i32, i32* @SIGUSR2
%7 = call i32 @sigaddset(i32* %2, i32 %6)
%8 = call i32 @memset(%struct.sigaction* %3, i32 0, i32 8)
%9 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i32 0, i32 1
%10 = call i32 @sigfillset(i32* %9)
%11 = load i32, i32* @SIG_IGN
%12 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i32 0, i32 0
store i32 %11, i32* %12
ret i32 0
}

LLVM IR (-O2):
%struct.sigaction = type { i32, i32 }
@SIGUSR2 = global i32 0
@SIG_IGN = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.sigaction
%3 = bitcast i32* %1 to i8*
%4 = bitcast %struct.sigaction* %2 to i8*
%5 = call i32 @sigemptyset(i32* %1)
%6 = load i32, i32* @SIGUSR2
%7 = call i32 @sigaddset(i32* %1, i32 %6)
%8 = call i32 @memset(%struct.sigaction* %2, i32 0, i32 8)
%9 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %2, i64 0, i32 1
%10 = call i32 @sigfillset(i32* %9)
ret i32 0
}