#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*/ SIGALRM;
int /*<<< orphan*/ SIGBUS;
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int (*)());
void signals() {
  int doquit();
  int time_out();
  int dump_me();
  int nopipe();
  (void)signal(SIGINT, doquit);
  (void)signal(SIGQUIT, dump_me);
  (void)signal(SIGPIPE, nopipe);
  (void)signal(SIGALRM, time_out);
  (void)signal(SIGBUS, doquit);
  (void)signal(SIGTERM, doquit);
  (void)signal(SIGFPE, doquit);
}


x86 assembly (clang, -O0):
<signals>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2ecc(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    0x2e8f(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
mov    0x2e3a(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    0x2e4d(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    0x2e78(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
mov    0x2e63(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
mov    0x2e4e(%rip),%rsi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<signals>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2ecf(%rip),%rbx
mov    %rbx,%rsi
call   1030 <signal@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    0x2e8f(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
mov    0x2e3a(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    0x2e4d(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1030 <signal@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1030 <signal@plt>
mov    0x2e17(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@SIGPIPE = global i32 0
@SIGALRM = global i32 0
@SIGBUS = global i32 0
@SIGTERM = global i32 0
@SIGFPE = global i32 0
define void @signals() {
%1 = load i32, i32* @SIGINT
%2 = call i32 @signal(i32 %1, i32 (...)* @doquit)
%3 = load i32, i32* @SIGQUIT
%4 = call i32 @signal(i32 %3, i32 (...)* @dump_me)
%5 = load i32, i32* @SIGPIPE
%6 = call i32 @signal(i32 %5, i32 (...)* @nopipe)
%7 = load i32, i32* @SIGALRM
%8 = call i32 @signal(i32 %7, i32 (...)* @time_out)
%9 = load i32, i32* @SIGBUS
%10 = call i32 @signal(i32 %9, i32 (...)* @doquit)
%11 = load i32, i32* @SIGTERM
%12 = call i32 @signal(i32 %11, i32 (...)* @doquit)
%13 = load i32, i32* @SIGFPE
%14 = call i32 @signal(i32 %13, i32 (...)* @doquit)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@SIGPIPE = global i32 0
@SIGALRM = global i32 0
@SIGBUS = global i32 0
@SIGTERM = global i32 0
@SIGFPE = global i32 0
define void @signals() {
%1 = load i32, i32* @SIGINT
%2 = tail call i32 @signal(i32 %1, i32 (...)* @doquit)
%3 = load i32, i32* @SIGQUIT
%4 = tail call i32 @signal(i32 %3, i32 (...)* @dump_me)
%5 = load i32, i32* @SIGPIPE
%6 = tail call i32 @signal(i32 %5, i32 (...)* @nopipe)
%7 = load i32, i32* @SIGALRM
%8 = tail call i32 @signal(i32 %7, i32 (...)* @time_out)
%9 = load i32, i32* @SIGBUS
%10 = tail call i32 @signal(i32 %9, i32 (...)* @doquit)
%11 = load i32, i32* @SIGTERM
%12 = tail call i32 @signal(i32 %11, i32 (...)* @doquit)
%13 = load i32, i32* @SIGFPE
%14 = tail call i32 @signal(i32 %13, i32 (...)* @doquit)
ret void
}