#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*/ SIGQUIT;
int /*<<< orphan*/ SIGSTOP;
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ print_sigset(int /*<<< orphan*/ *);
int sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int sigdelset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int sigemptyset(int /*<<< orphan*/ *);
int sigfillset(int /*<<< orphan*/ *);
int main() {
  int ret = 0;
  sigset_t sigset;
  ret &= sigemptyset(&sigset);
  ret &= sigfillset(&sigset);
  print_sigset(&sigset);
  ret &= sigemptyset(&sigset);
  ret &= sigaddset(&sigset, SIGINT);
  ret &= sigaddset(&sigset, SIGQUIT);
  ret &= sigaddset(&sigset, SIGUSR1);
  ret &= sigaddset(&sigset, SIGUSR2);
  ret &= sigaddset(&sigset, SIGSTOP);
  print_sigset(&sigset);
  ret &= sigdelset(&sigset, SIGSTOP);
  ret &= sigdelset(&sigset, SIGUSR2);
  print_sigset(&sigset);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <sigemptyset@plt>
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <sigfillset@plt>
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <print_sigset@plt>
lea    -0xc(%rbp),%rdi
call   1040 <sigemptyset@plt>
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e3d(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1070 <sigaddset@plt>
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e1d(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1070 <sigaddset@plt>
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e15(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1070 <sigaddset@plt>
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2ddd(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1070 <sigaddset@plt>
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2dbd(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1070 <sigaddset@plt>
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <print_sigset@plt>
mov    0x2d9c(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1060 <sigdelset@plt>
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2d8c(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1060 <sigdelset@plt>
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <print_sigset@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    %rbx,%rdi
call   1050 <sigfillset@plt>
mov    %rbx,%rdi
call   1030 <print_sigset@plt>
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1070 <sigaddset@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1070 <sigaddset@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1070 <sigaddset@plt>
mov    0x2e10(%rip),%r14
mov    (%r14),%esi
mov    %rbx,%rdi
call   1070 <sigaddset@plt>
mov    0x2df6(%rip),%r15
mov    (%r15),%esi
mov    %rbx,%rdi
call   1070 <sigaddset@plt>
mov    %rbx,%rdi
call   1030 <print_sigset@plt>
mov    (%r15),%esi
mov    %rbx,%rdi
call   1060 <sigdelset@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
call   1060 <sigdelset@plt>
mov    %rbx,%rdi
call   1030 <print_sigset@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
@SIGSTOP = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i32 @sigemptyset(i32* %3)
%5 = load i32, i32* %2
%6 = and i32 %5, %4
store i32 %6, i32* %2
%7 = call i32 @sigfillset(i32* %3)
%8 = load i32, i32* %2
%9 = and i32 %8, %7
store i32 %9, i32* %2
%10 = call i32 @print_sigset(i32* %3)
%11 = call i32 @sigemptyset(i32* %3)
%12 = load i32, i32* %2
%13 = and i32 %12, %11
store i32 %13, i32* %2
%14 = load i32, i32* @SIGINT
%15 = call i32 @sigaddset(i32* %3, i32 %14)
%16 = load i32, i32* %2
%17 = and i32 %16, %15
store i32 %17, i32* %2
%18 = load i32, i32* @SIGQUIT
%19 = call i32 @sigaddset(i32* %3, i32 %18)
%20 = load i32, i32* %2
%21 = and i32 %20, %19
store i32 %21, i32* %2
%22 = load i32, i32* @SIGUSR1
%23 = call i32 @sigaddset(i32* %3, i32 %22)
%24 = load i32, i32* %2
%25 = and i32 %24, %23
store i32 %25, i32* %2
%26 = load i32, i32* @SIGUSR2
%27 = call i32 @sigaddset(i32* %3, i32 %26)
%28 = load i32, i32* %2
%29 = and i32 %28, %27
store i32 %29, i32* %2
%30 = load i32, i32* @SIGSTOP
%31 = call i32 @sigaddset(i32* %3, i32 %30)
%32 = load i32, i32* %2
%33 = and i32 %32, %31
store i32 %33, i32* %2
%34 = call i32 @print_sigset(i32* %3)
%35 = load i32, i32* @SIGSTOP
%36 = call i32 @sigdelset(i32* %3, i32 %35)
%37 = load i32, i32* %2
%38 = and i32 %37, %36
store i32 %38, i32* %2
%39 = load i32, i32* @SIGUSR2
%40 = call i32 @sigdelset(i32* %3, i32 %39)
%41 = load i32, i32* %2
%42 = and i32 %41, %40
store i32 %42, i32* %2
%43 = call i32 @print_sigset(i32* %3)
ret i32 1
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
@SIGSTOP = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = call i32 @sigfillset(i32* %1)
%5 = call i32 @print_sigset(i32* %1)
%6 = call i32 @sigemptyset(i32* %1)
%7 = load i32, i32* @SIGINT
%8 = call i32 @sigaddset(i32* %1, i32 %7)
%9 = load i32, i32* @SIGQUIT
%10 = call i32 @sigaddset(i32* %1, i32 %9)
%11 = load i32, i32* @SIGUSR1
%12 = call i32 @sigaddset(i32* %1, i32 %11)
%13 = load i32, i32* @SIGUSR2
%14 = call i32 @sigaddset(i32* %1, i32 %13)
%15 = load i32, i32* @SIGSTOP
%16 = call i32 @sigaddset(i32* %1, i32 %15)
%17 = call i32 @print_sigset(i32* %1)
%18 = load i32, i32* @SIGSTOP
%19 = call i32 @sigdelset(i32* %1, i32 %18)
%20 = load i32, i32* @SIGUSR2
%21 = call i32 @sigdelset(i32* %1, i32 %20)
%22 = call i32 @print_sigset(i32* %1)
ret i32 1
}