#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*/ SIGHUP;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void install_handler() {
  sigset_t block, empty;
  sigemptyset(&empty);
  sigemptyset(&block);
  sigaddset(&block, SIGINT);
  sigaddset(&block, SIGHUP);
  sigaddset(&block, SIGABRT);
  sigprocmask(SIG_BLOCK, &block, &empty);
}


x86 assembly (clang, -O0):
<install_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
lea    -0x4(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<install_handler>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@SIGHUP = global i32 0
@SIGABRT = global i32 0
@SIG_BLOCK = global i32 0
define void @install_handler() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @sigemptyset(i32* %2)
%4 = call i32 @sigemptyset(i32* %1)
%5 = load i32, i32* @SIGINT
%6 = call i32 @sigaddset(i32* %1, i32 %5)
%7 = load i32, i32* @SIGHUP
%8 = call i32 @sigaddset(i32* %1, i32 %7)
%9 = load i32, i32* @SIGABRT
%10 = call i32 @sigaddset(i32* %1, i32 %9)
%11 = load i32, i32* @SIG_BLOCK
%12 = call i32 @sigprocmask(i32 %11, i32* %1, i32* %2)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIGHUP = global i32 0
@SIGABRT = global i32 0
@SIG_BLOCK = global i32 0
define void @install_handler() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @sigemptyset(i32* %2)
%6 = call i32 @sigemptyset(i32* %1)
%7 = load i32, i32* @SIGINT
%8 = call i32 @sigaddset(i32* %1, i32 %7)
%9 = load i32, i32* @SIGHUP
%10 = call i32 @sigaddset(i32* %1, i32 %9)
%11 = load i32, i32* @SIGABRT
%12 = call i32 @sigaddset(i32* %1, i32 %11)
%13 = load i32, i32* @SIG_BLOCK
%14 = call i32 @sigprocmask(i32 %13, i32* %1, i32* %2)
ret void
}