#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);
  sigaddset(&s_set, 3);
  sigprocmask(SIG_BLOCK | SIG_SETMASK, &s_set, NULL);
  check_blocked_sigs();
  sigemptyset(&s_set);
  sigaddset(&s_set, 2);
  sigprocmask(SIG_BLOCK | SIG_SETMASK, &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>
lea    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1060 <sigaddset@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
mov    0x2e56(%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    0x2e12(%rip),%rax
mov    (%rax),%edi
mov    0x2e19(%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>
xor    %eax,%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   1050 <sigemptyset@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1060 <sigaddset@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1060 <sigaddset@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1060 <sigaddset@plt>
mov    0x2e54(%rip),%r14
mov    0x2e5d(%rip),%r15
mov    (%r15),%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    (%r15),%edi
or     (%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    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
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 = call i32 @sigaddset(i32* %2, i32 3)
%7 = load i32, i32* @SIG_BLOCK
%8 = load i32, i32* @SIG_SETMASK
%9 = or i32 %7, %8
%10 = call i32 @sigprocmask(i32 %9, i32* %2, i32* null)
%11 = call i32 (...) @check_blocked_sigs()
%12 = call i32 @sigemptyset(i32* %2)
%13 = call i32 @sigaddset(i32* %2, i32 2)
%14 = load i32, i32* @SIG_BLOCK
%15 = load i32, i32* @SIG_SETMASK
%16 = or i32 %14, %15
%17 = call i32 @sigprocmask(i32 %16, i32* %2, i32* null)
%18 = 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 = call i32 @sigaddset(i32* %1, i32 3)
%7 = load i32, i32* @SIG_BLOCK
%8 = load i32, i32* @SIG_SETMASK
%9 = or i32 %8, %7
%10 = call i32 @sigprocmask(i32 %9, i32* %1, i32* null)
%11 = call i32 (...) @check_blocked_sigs()
%12 = call i32 @sigemptyset(i32* %1)
%13 = call i32 @sigaddset(i32* %1, i32 2)
%14 = load i32, i32* @SIG_BLOCK
%15 = load i32, i32* @SIG_SETMASK
%16 = or i32 %15, %14
%17 = call i32 @sigprocmask(i32 %16, i32* %1, i32* null)
%18 = call i32 (...) @check_blocked_sigs()
ret i32 0
}