#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 */

/* Variables and functions */
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void set_signals(void) {
  signal(SIGTERM, SIG_DFL);
  signal(SIGINT, SIG_IGN);
  signal(SIGHUP, SIG_IGN);
  signal(SIGUSR1, SIG_IGN);
  signal(SIGUSR2, SIG_IGN);
  signal(SIGPIPE, SIG_IGN);
}


x86 assembly (clang, -O0):
<set_signals>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    0x2e5f(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
mov    0x2e48(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e22(%rip),%rax
mov    (%rax),%edi
mov    0x2e31(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_signals>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2e90(%rip),%rbx
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
@SIG_DFL = global i32 0
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@SIGHUP = global i32 0
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
@SIGPIPE = global i32 0
define void @set_signals() {
%1 = load i32, i32* @SIGTERM
%2 = load i32, i32* @SIG_DFL
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGINT
%5 = load i32, i32* @SIG_IGN
%6 = call i32 @signal(i32 %4, i32 %5)
%7 = load i32, i32* @SIGHUP
%8 = load i32, i32* @SIG_IGN
%9 = call i32 @signal(i32 %7, i32 %8)
%10 = load i32, i32* @SIGUSR1
%11 = load i32, i32* @SIG_IGN
%12 = call i32 @signal(i32 %10, i32 %11)
%13 = load i32, i32* @SIGUSR2
%14 = load i32, i32* @SIG_IGN
%15 = call i32 @signal(i32 %13, i32 %14)
%16 = load i32, i32* @SIGPIPE
%17 = load i32, i32* @SIG_IGN
%18 = call i32 @signal(i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
@SIG_DFL = global i32 0
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@SIGHUP = global i32 0
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
@SIGPIPE = global i32 0
define void @set_signals() {
%1 = load i32, i32* @SIGTERM
%2 = load i32, i32* @SIG_DFL
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGINT
%5 = load i32, i32* @SIG_IGN
%6 = tail call i32 @signal(i32 %4, i32 %5)
%7 = load i32, i32* @SIGHUP
%8 = load i32, i32* @SIG_IGN
%9 = tail call i32 @signal(i32 %7, i32 %8)
%10 = load i32, i32* @SIGUSR1
%11 = load i32, i32* @SIG_IGN
%12 = tail call i32 @signal(i32 %10, i32 %11)
%13 = load i32, i32* @SIGUSR2
%14 = load i32, i32* @SIG_IGN
%15 = tail call i32 @signal(i32 %13, i32 %14)
%16 = load i32, i32* @SIGPIPE
%17 = load i32, i32* @SIG_IGN
%18 = tail call i32 @signal(i32 %16, i32 %17)
ret void
}