#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 SIG_BLOCK;
int SIG_SETMASK;
int /*<<< orphan*/ check_blocked_sigs();
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main() {
  sigset_t s_set;
  sigemptyset(&s_set);
  sigaddset(&s_set, 1);
  sigaddset(&s_set, 4);
  sigprocmask(SIG_BLOCK | SIG_SETMASK, &s_set, NULL);
  check_blocked_sigs();
  sigemptyset(&s_set);
  sigaddset(&s_set, 2);
  sigprocmask(SIG_BLOCK, &s_set, NULL);
  check_blocked_sigs();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <sigemptyset@plt>
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1060 <sigaddset@plt>
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1060 <sigaddset@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
mov    0x2e64(%rip),%rax
or     (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
mov    $0x0,%al
call   1040 <check_blocked_sigs@plt>
lea    -0x8(%rbp),%rdi
call   1050 <sigemptyset@plt>
lea    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1060 <sigaddset@plt>
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
mov    $0x0,%al
call   1040 <check_blocked_sigs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <sigemptyset@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1060 <sigaddset@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1060 <sigaddset@plt>
mov    0x2e66(%rip),%r14
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
or     (%r14),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
xor    %eax,%eax
call   1040 <check_blocked_sigs@plt>
mov    %rbx,%rdi
call   1050 <sigemptyset@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1060 <sigaddset@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
xor    %eax,%eax
call   1040 <check_blocked_sigs@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
@SIG_SETMASK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @sigemptyset(i32* %2)
%4 = call i32 @sigaddset(i32* %2, i32 1)
%5 = call i32 @sigaddset(i32* %2, i32 4)
%6 = load i32, i32* @SIG_BLOCK
%7 = load i32, i32* @SIG_SETMASK
%8 = or i32 %6, %7
%9 = call i32 @sigprocmask(i32 %8, i32* %2, i32* null)
%10 = call i32 (...) @check_blocked_sigs()
%11 = call i32 @sigemptyset(i32* %2)
%12 = call i32 @sigaddset(i32* %2, i32 2)
%13 = load i32, i32* @SIG_BLOCK
%14 = call i32 @sigprocmask(i32 %13, i32* %2, i32* null)
%15 = call i32 (...) @check_blocked_sigs()
ret i32 0
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
@SIG_SETMASK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = call i32 @sigaddset(i32* %1, i32 1)
%5 = call i32 @sigaddset(i32* %1, i32 4)
%6 = load i32, i32* @SIG_BLOCK
%7 = load i32, i32* @SIG_SETMASK
%8 = or i32 %7, %6
%9 = call i32 @sigprocmask(i32 %8, i32* %1, i32* null)
%10 = call i32 (...) @check_blocked_sigs()
%11 = call i32 @sigemptyset(i32* %1)
%12 = call i32 @sigaddset(i32* %1, i32 2)
%13 = load i32, i32* @SIG_BLOCK
%14 = call i32 @sigprocmask(i32 %13, i32* %1, i32* null)
%15 = call i32 (...) @check_blocked_sigs()
ret i32 0
}