#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 union sigval {
  int dummy;
} sigval;
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int SIGRTMAX;
int SIGRTMIN;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void signal_block_all() {
  int i;
  sigset_t set;
  union sigval data;
  sigemptyset(&set);
  for (i = SIGRTMIN; i <= SIGRTMAX; i++)
    sigaddset(&set, i);
  sigprocmask(SIG_BLOCK, &set, NULL);
}


x86 assembly (clang, -O0):
<signal_block_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jg     1179 <signal_block_all+0x49>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114d <signal_block_all+0x1d>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_block_all>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%ebx
mov    0x2e8d(%rip),%r15
cmp    (%r15),%ebx
jg     1174 <signal_block_all+0x44>
lea    0xc(%rsp),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
lea    0x1(%rbx),%eax
cmp    (%r15),%ebx
mov    %eax,%ebx
jl     1160 <signal_block_all+0x30>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%union.sigval = type { i32 }
@SIGRTMIN = global i32 0
@SIGRTMAX = global i32 0
@SIG_BLOCK = global i32 0
define void @signal_block_all() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %union.sigval
%4 = call i32 @sigemptyset(i32* %2)
%5 = load i32, i32* @SIGRTMIN
store i32 %5, i32* %1
br label %6
6: ; preds = %13, %0
%7 = load i32, i32* %1
%8 = load i32, i32* @SIGRTMAX
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %1
%12 = call i32 @sigaddset(i32* %2, i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %6
16: ; preds = %6
%17 = load i32, i32* @SIG_BLOCK
%18 = call i32 @sigprocmask(i32 %17, i32* %2, i32* null)
ret void
}

LLVM IR (-O2):
@SIGRTMIN = global i32 0
@SIGRTMAX = global i32 0
@SIG_BLOCK = global i32 0
define void @signal_block_all() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = load i32, i32* @SIGRTMIN
%5 = load i32, i32* @SIGRTMAX
%6 = icmp sgt i32 %4, %5
br i1 %6, label %13, label %7
7: ; preds = %0, %7
%8 = phi i32 [ %10, %7 ], [ %4, %0 ]
%9 = call i32 @sigaddset(i32* %1, i32 %8)
%10 = add nsw i32 %8, 1
%11 = load i32, i32* @SIGRTMAX
%12 = icmp slt i32 %8, %11
br i1 %12, label %7, label %13
13: ; preds = %7, %0
%14 = load i32, i32* @SIG_BLOCK
%15 = call i32 @sigprocmask(i32 %14, i32* %1, i32* null)
ret void
}