#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 SIGABRT;
int SIGALRM;
int SIGBUS;
int SIGFPE;
int SIGHUP;
int SIGILL;
int SIGINT;
int SIGIOT;
int SIGPIPE;
int SIGPOLL;
int SIGPROF;
int SIGQUIT;
int SIGSYS;
int SIGTERM;
int SIGTRAP;
int SIGTSTP;
int SIGTTIN;
int SIGTTOU;
int SIGUSR1;
int SIGUSR2;
int SIGVTALRM;
int SIGXCPU;
int SIGXFSZ;
int /*<<< orphan*/ exit(int);
scalar_t__ sigaddset(int /*<<< orphan*/ *, int);
scalar_t__ sigemptyset(int /*<<< orphan*/ *);
int init_blocked_signals(sigset_t *signals_to_block) {
  int signals[] = {SIGHUP,  SIGINT,    SIGQUIT, SIGILL,  SIGTRAP, SIGABRT,
                   SIGIOT,  SIGFPE,    SIGBUS,  SIGSYS,  SIGPIPE, SIGALRM,
                   SIGTERM, SIGUSR1,   SIGUSR2, SIGPOLL, SIGTSTP, SIGTTIN,
                   SIGTTOU, SIGVTALRM, SIGPROF, SIGXCPU, SIGXFSZ};
  int num_signals = 23;
  int i;
  if (sigemptyset(signals_to_block)) {
    exit(-1);
  }
  for (i = 0; i < num_signals; i++) {
    if (sigaddset(signals_to_block, signals[i])) {
      exit(-1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<init_blocked_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x70(%rbp)
mov    0x2e6e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
mov    0x2e52(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x68(%rbp)
mov    0x2e0e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    0x2dba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
mov    0x2dbe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    0x2dfa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    0x2e06(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    0x2e42(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
mov    0x2d9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    0x2d9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
mov    0x2dfe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2de2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    0x2dee(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2d72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    0x2d3e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    0x2d8a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    0x2d6e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    0x2dba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    0x2d3e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    0x2d72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2d06(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2d4a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
movl   $0x17,-0x74(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sigemptyset@plt>
cmp    $0x0,%rax
je     1277 <init_blocked_signals+0x147>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
movl   $0x0,-0x78(%rbp)
mov    -0x78(%rbp),%eax
cmp    -0x74(%rbp),%eax
jge    12c2 <init_blocked_signals+0x192>
mov    -0x8(%rbp),%rdi
movslq -0x78(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%esi
call   1050 <sigaddset@plt>
cmp    $0x0,%rax
je     12af <init_blocked_signals+0x17f>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
jmp    12b4 <init_blocked_signals+0x184>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    127e <init_blocked_signals+0x14e>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_blocked_signals>:
push   %rbp
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,(%rsp)
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    0x2e57(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    0x2e12(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
mov    0x2dbd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
mov    0x2dc0(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    0x2dfb(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x18(%rsp)
mov    0x2e06(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x1c(%rsp)
mov    0x2e41(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x20(%rsp)
mov    0x2d9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x24(%rsp)
mov    0x2d97(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x28(%rsp)
mov    0x2dfa(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x2c(%rsp)
mov    0x2ddd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x30(%rsp)
mov    0x2de8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x34(%rsp)
mov    0x2d6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x38(%rsp)
mov    0x2d36(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x3c(%rsp)
mov    0x2d81(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x40(%rsp)
mov    0x2d64(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x44(%rsp)
mov    0x2daf(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x48(%rsp)
mov    0x2d32(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4c(%rsp)
mov    0x2d65(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x50(%rsp)
mov    0x2cf8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x54(%rsp)
mov    0x2d3b(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x58(%rsp)
call   1030 <sigemptyset@plt>
test   %rax,%rax
jne    12aa <init_blocked_signals+0x17a>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <sigaddset@plt>
test   %rax,%rax
jne    12aa <init_blocked_signals+0x17a>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x17,%rbp
je     12b4 <init_blocked_signals+0x184>
mov    (%rsp,%rbp,4),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
add    $0x1,%rbp
test   %rax,%rax
je     1290 <init_blocked_signals+0x160>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SIGHUP = global i32 0
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@SIGILL = global i32 0
@SIGTRAP = global i32 0
@SIGABRT = global i32 0
@SIGIOT = global i32 0
@SIGFPE = global i32 0
@SIGBUS = global i32 0
@SIGSYS = global i32 0
@SIGPIPE = global i32 0
@SIGALRM = global i32 0
@SIGTERM = global i32 0
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
@SIGPOLL = global i32 0
@SIGTSTP = global i32 0
@SIGTTIN = global i32 0
@SIGTTOU = global i32 0
@SIGVTALRM = global i32 0
@SIGPROF = global i32 0
@SIGXCPU = global i32 0
@SIGXFSZ = global i32 0
define i32 @init_blocked_signals(i32* %0) {
%2 = alloca i32*
%3 = alloca [23 x i32]
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
%6 = getelementptr inbounds [23 x i32], [23 x i32]* %3, i64 0, i64 0
%7 = load i32, i32* @SIGHUP
store i32 %7, i32* %6
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* @SIGINT
store i32 %9, i32* %8
%10 = getelementptr inbounds i32, i32* %8, i64 1
%11 = load i32, i32* @SIGQUIT
store i32 %11, i32* %10
%12 = getelementptr inbounds i32, i32* %10, i64 1
%13 = load i32, i32* @SIGILL
store i32 %13, i32* %12
%14 = getelementptr inbounds i32, i32* %12, i64 1
%15 = load i32, i32* @SIGTRAP
store i32 %15, i32* %14
%16 = getelementptr inbounds i32, i32* %14, i64 1
%17 = load i32, i32* @SIGABRT
store i32 %17, i32* %16
%18 = getelementptr inbounds i32, i32* %16, i64 1
%19 = load i32, i32* @SIGIOT
store i32 %19, i32* %18
%20 = getelementptr inbounds i32, i32* %18, i64 1
%21 = load i32, i32* @SIGFPE
store i32 %21, i32* %20
%22 = getelementptr inbounds i32, i32* %20, i64 1
%23 = load i32, i32* @SIGBUS
store i32 %23, i32* %22
%24 = getelementptr inbounds i32, i32* %22, i64 1
%25 = load i32, i32* @SIGSYS
store i32 %25, i32* %24
%26 = getelementptr inbounds i32, i32* %24, i64 1
%27 = load i32, i32* @SIGPIPE
store i32 %27, i32* %26
%28 = getelementptr inbounds i32, i32* %26, i64 1
%29 = load i32, i32* @SIGALRM
store i32 %29, i32* %28
%30 = getelementptr inbounds i32, i32* %28, i64 1
%31 = load i32, i32* @SIGTERM
store i32 %31, i32* %30
%32 = getelementptr inbounds i32, i32* %30, i64 1
%33 = load i32, i32* @SIGUSR1
store i32 %33, i32* %32
%34 = getelementptr inbounds i32, i32* %32, i64 1
%35 = load i32, i32* @SIGUSR2
store i32 %35, i32* %34
%36 = getelementptr inbounds i32, i32* %34, i64 1
%37 = load i32, i32* @SIGPOLL
store i32 %37, i32* %36
%38 = getelementptr inbounds i32, i32* %36, i64 1
%39 = load i32, i32* @SIGTSTP
store i32 %39, i32* %38
%40 = getelementptr inbounds i32, i32* %38, i64 1
%41 = load i32, i32* @SIGTTIN
store i32 %41, i32* %40
%42 = getelementptr inbounds i32, i32* %40, i64 1
%43 = load i32, i32* @SIGTTOU
store i32 %43, i32* %42
%44 = getelementptr inbounds i32, i32* %42, i64 1
%45 = load i32, i32* @SIGVTALRM
store i32 %45, i32* %44
%46 = getelementptr inbounds i32, i32* %44, i64 1
%47 = load i32, i32* @SIGPROF
store i32 %47, i32* %46
%48 = getelementptr inbounds i32, i32* %46, i64 1
%49 = load i32, i32* @SIGXCPU
store i32 %49, i32* %48
%50 = getelementptr inbounds i32, i32* %48, i64 1
%51 = load i32, i32* @SIGXFSZ
store i32 %51, i32* %50
store i32 23, i32* %4
%52 = load i32*, i32** %2
%53 = call i64 @sigemptyset(i32* %52)
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %1
%56 = call i32 @exit(i32 -1)
unreachable
57: ; preds = %1
store i32 0, i32* %5
br label %58
58: ; preds = %73, %57
%59 = load i32, i32* %5
%60 = load i32, i32* %4
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %76
62: ; preds = %58
%63 = load i32*, i32** %2
%64 = load i32, i32* %5
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [23 x i32], [23 x i32]* %3, i64 0, i64 %65
%67 = load i32, i32* %66
%68 = call i64 @sigaddset(i32* %63, i32 %67)
%69 = icmp ne i64 %68, 0
br i1 %69, label %70, label %72
70: ; preds = %62
%71 = call i32 @exit(i32 -1)
unreachable
72: ; preds = %62
br label %73
73: ; preds = %72
%74 = load i32, i32* %5
%75 = add nsw i32 %74, 1
store i32 %75, i32* %5
br label %58
76: ; preds = %58
ret i32 0
}

LLVM IR (-O2):
@SIGHUP = global i32 0
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@SIGILL = global i32 0
@SIGTRAP = global i32 0
@SIGABRT = global i32 0
@SIGIOT = global i32 0
@SIGFPE = global i32 0
@SIGBUS = global i32 0
@SIGSYS = global i32 0
@SIGPIPE = global i32 0
@SIGALRM = global i32 0
@SIGTERM = global i32 0
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
@SIGPOLL = global i32 0
@SIGTSTP = global i32 0
@SIGTTIN = global i32 0
@SIGTTOU = global i32 0
@SIGVTALRM = global i32 0
@SIGPROF = global i32 0
@SIGXCPU = global i32 0
@SIGXFSZ = global i32 0
define i32 @init_blocked_signals(i32* %0) {
%2 = alloca [23 x i32]
%3 = bitcast [23 x i32]* %2 to i8*
%4 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 0
%5 = load i32, i32* @SIGHUP
store i32 %5, i32* %4
%6 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 1
%7 = load i32, i32* @SIGINT
store i32 %7, i32* %6
%8 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 2
%9 = load i32, i32* @SIGQUIT
store i32 %9, i32* %8
%10 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 3
%11 = load i32, i32* @SIGILL
store i32 %11, i32* %10
%12 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 4
%13 = load i32, i32* @SIGTRAP
store i32 %13, i32* %12
%14 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 5
%15 = load i32, i32* @SIGABRT
store i32 %15, i32* %14
%16 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 6
%17 = load i32, i32* @SIGIOT
store i32 %17, i32* %16
%18 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 7
%19 = load i32, i32* @SIGFPE
store i32 %19, i32* %18
%20 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 8
%21 = load i32, i32* @SIGBUS
store i32 %21, i32* %20
%22 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 9
%23 = load i32, i32* @SIGSYS
store i32 %23, i32* %22
%24 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 10
%25 = load i32, i32* @SIGPIPE
store i32 %25, i32* %24
%26 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 11
%27 = load i32, i32* @SIGALRM
store i32 %27, i32* %26
%28 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 12
%29 = load i32, i32* @SIGTERM
store i32 %29, i32* %28
%30 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 13
%31 = load i32, i32* @SIGUSR1
store i32 %31, i32* %30
%32 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 14
%33 = load i32, i32* @SIGUSR2
store i32 %33, i32* %32
%34 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 15
%35 = load i32, i32* @SIGPOLL
store i32 %35, i32* %34
%36 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 16
%37 = load i32, i32* @SIGTSTP
store i32 %37, i32* %36
%38 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 17
%39 = load i32, i32* @SIGTTIN
store i32 %39, i32* %38
%40 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 18
%41 = load i32, i32* @SIGTTOU
store i32 %41, i32* %40
%42 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 19
%43 = load i32, i32* @SIGVTALRM
store i32 %43, i32* %42
%44 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 20
%45 = load i32, i32* @SIGPROF
store i32 %45, i32* %44
%46 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 21
%47 = load i32, i32* @SIGXCPU
store i32 %47, i32* %46
%48 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 22
%49 = load i32, i32* @SIGXFSZ
store i32 %49, i32* %48
%50 = tail call i64 @sigemptyset(i32* %0)
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %1
%53 = tail call i64 @sigaddset(i32* %0, i32 %5)
%54 = icmp eq i64 %53, 0
br i1 %54, label %57, label %66
55: ; preds = %1
%56 = tail call i32 @exit(i32 -1)
unreachable
57: ; preds = %52, %61
%58 = phi i64 [ %59, %61 ], [ 0, %52 ]
%59 = add nuw nsw i64 %58, 1
%60 = icmp eq i64 %59, 23
br i1 %60, label %68, label %61
61: ; preds = %57
%62 = getelementptr inbounds [23 x i32], [23 x i32]* %2, i64 0, i64 %59
%63 = load i32, i32* %62
%64 = tail call i64 @sigaddset(i32* %0, i32 %63)
%65 = icmp eq i64 %64, 0
br i1 %65, label %57, label %66
66: ; preds = %61, %52
%67 = tail call i32 @exit(i32 -1)
unreachable
68: ; preds = %57
ret i32 0
}