#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*/ SIGQUIT;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
void register_signal_handl(void (*handl)(int)) {
  signal(SIGINT, handl);
  signal(SIGHUP, handl);
  signal(SIGTERM, handl);
  signal(SIGQUIT, handl);
  signal(SIGPIPE, handl);
}


x86 assembly (clang, -O0):
<register_signal_handl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <signal@plt>
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <signal@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <signal@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <signal@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_signal_handl>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1030 <signal@plt>
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1030 <signal@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1030 <signal@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1030 <signal@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIGHUP = global i32 0
@SIGTERM = global i32 0
@SIGQUIT = global i32 0
@SIGPIPE = global i32 0
define void @register_signal_handl(void (i32)* %0) {
%2 = alloca void (i32)*
store void (i32)* %0, void (i32)** %2
%3 = load i32, i32* @SIGINT
%4 = load void (i32)*, void (i32)** %2
%5 = call i32 @signal(i32 %3, void (i32)* %4)
%6 = load i32, i32* @SIGHUP
%7 = load void (i32)*, void (i32)** %2
%8 = call i32 @signal(i32 %6, void (i32)* %7)
%9 = load i32, i32* @SIGTERM
%10 = load void (i32)*, void (i32)** %2
%11 = call i32 @signal(i32 %9, void (i32)* %10)
%12 = load i32, i32* @SIGQUIT
%13 = load void (i32)*, void (i32)** %2
%14 = call i32 @signal(i32 %12, void (i32)* %13)
%15 = load i32, i32* @SIGPIPE
%16 = load void (i32)*, void (i32)** %2
%17 = call i32 @signal(i32 %15, void (i32)* %16)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIGHUP = global i32 0
@SIGTERM = global i32 0
@SIGQUIT = global i32 0
@SIGPIPE = global i32 0
define void @register_signal_handl(void (i32)* %0) {
%2 = load i32, i32* @SIGINT
%3 = tail call i32 @signal(i32 %2, void (i32)* %0)
%4 = load i32, i32* @SIGHUP
%5 = tail call i32 @signal(i32 %4, void (i32)* %0)
%6 = load i32, i32* @SIGTERM
%7 = tail call i32 @signal(i32 %6, void (i32)* %0)
%8 = load i32, i32* @SIGQUIT
%9 = tail call i32 @signal(i32 %8, void (i32)* %0)
%10 = load i32, i32* @SIGPIPE
%11 = tail call i32 @signal(i32 %10, void (i32)* %0)
ret void
}