#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*/ SIGABRT;
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ SIGILL;
int /*<<< orphan*/ SIGIOT;
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ SIGTRAP;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigdelset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
scalar_t__ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
sigset_t *__utmp_block_signals(sigset_t *oldset) {
  sigset_t blockset;
  sigfillset(&blockset);
  sigdelset(&blockset, SIGILL);
  sigdelset(&blockset, SIGTRAP);
  sigdelset(&blockset, SIGABRT);
  sigdelset(&blockset, SIGIOT);
  sigdelset(&blockset, SIGFPE);
  sigdelset(&blockset, SIGSEGV);
  if (sigprocmask(SIG_BLOCK, &blockset, oldset) < 0)
    oldset = (sigset_t *)0;
  return oldset;
}


x86 assembly (clang, -O0):
<__utmp_block_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <sigfillset@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rsi
call   1030 <sigprocmask@plt>
cmp    $0x0,%rax
jge    11d9 <__utmp_block_signals+0xa9>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__utmp_block_signals>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigfillset@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigdelset@plt>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <sigprocmask@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmovns %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIGILL = global i32 0
@SIGTRAP = global i32 0
@SIGABRT = global i32 0
@SIGIOT = global i32 0
@SIGFPE = global i32 0
@SIGSEGV = global i32 0
@SIG_BLOCK = global i32 0
define i32* @__utmp_block_signals(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @sigfillset(i32* %3)
%5 = load i32, i32* @SIGILL
%6 = call i32 @sigdelset(i32* %3, i32 %5)
%7 = load i32, i32* @SIGTRAP
%8 = call i32 @sigdelset(i32* %3, i32 %7)
%9 = load i32, i32* @SIGABRT
%10 = call i32 @sigdelset(i32* %3, i32 %9)
%11 = load i32, i32* @SIGIOT
%12 = call i32 @sigdelset(i32* %3, i32 %11)
%13 = load i32, i32* @SIGFPE
%14 = call i32 @sigdelset(i32* %3, i32 %13)
%15 = load i32, i32* @SIGSEGV
%16 = call i32 @sigdelset(i32* %3, i32 %15)
%17 = load i32, i32* @SIG_BLOCK
%18 = load i32*, i32** %2
%19 = call i64 @sigprocmask(i32 %17, i32* %3, i32* %18)
%20 = icmp slt i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %1
store i32* null, i32** %2
br label %22
22: ; preds = %21, %1
%23 = load i32*, i32** %2
ret i32* %23
}

LLVM IR (-O2):
@SIGILL = global i32 0
@SIGTRAP = global i32 0
@SIGABRT = global i32 0
@SIGIOT = global i32 0
@SIGFPE = global i32 0
@SIGSEGV = global i32 0
@SIG_BLOCK = global i32 0
define i32* @__utmp_block_signals(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigfillset(i32* %2)
%5 = load i32, i32* @SIGILL
%6 = call i32 @sigdelset(i32* %2, i32 %5)
%7 = load i32, i32* @SIGTRAP
%8 = call i32 @sigdelset(i32* %2, i32 %7)
%9 = load i32, i32* @SIGABRT
%10 = call i32 @sigdelset(i32* %2, i32 %9)
%11 = load i32, i32* @SIGIOT
%12 = call i32 @sigdelset(i32* %2, i32 %11)
%13 = load i32, i32* @SIGFPE
%14 = call i32 @sigdelset(i32* %2, i32 %13)
%15 = load i32, i32* @SIGSEGV
%16 = call i32 @sigdelset(i32* %2, i32 %15)
%17 = load i32, i32* @SIG_BLOCK
%18 = call i64 @sigprocmask(i32 %17, i32* %2, i32* %0)
%19 = icmp slt i64 %18, 0
%20 = select i1 %19, i32* null, i32* %0
ret i32* %20
}