#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*/ SIGBUS;
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ test(int, int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  test(0, SIGSEGV, SIGBUS);
  test(0, SIGSEGV, SIGHUP);
  test(0, SIGUSR1, SIGBUS);
  test(0, SIGUSR1, SIGHUP);
  test(1, SIGSEGV, SIGBUS);
  test(1, SIGSEGV, SIGHUP);
  test(1, SIGUSR1, SIGBUS);
  test(1, SIGUSR1, SIGHUP);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
call   1030 <test@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
call   1030 <test@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
mov    0x2e87(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
call   1030 <test@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%esi
mov    0x2e76(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
call   1030 <test@plt>
mov    0x2e46(%rip),%rax
mov    (%rax),%esi
mov    0x2e55(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <test@plt>
mov    0x2e2a(%rip),%rax
mov    (%rax),%esi
mov    0x2e41(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <test@plt>
mov    0x2e16(%rip),%rax
mov    (%rax),%esi
mov    0x2e1d(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <test@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%esi
mov    0x2e09(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2eb1(%rip),%r12
mov    (%r12),%esi
mov    0x2ebe(%rip),%r14
mov    (%r14),%edx
xor    %edi,%edi
call   1030 <test@plt>
mov    (%r12),%esi
mov    0x2eb1(%rip),%r15
mov    (%r15),%edx
xor    %edi,%edi
call   1030 <test@plt>
mov    0x2e88(%rip),%rbx
mov    (%rbx),%esi
mov    (%r14),%edx
xor    %edi,%edi
call   1030 <test@plt>
mov    (%rbx),%esi
mov    (%r15),%edx
xor    %edi,%edi
call   1030 <test@plt>
mov    (%r12),%esi
mov    (%r14),%edx
mov    $0x1,%edi
call   1030 <test@plt>
mov    (%r12),%esi
mov    (%r15),%edx
mov    $0x1,%edi
call   1030 <test@plt>
mov    (%rbx),%esi
mov    (%r14),%edx
mov    $0x1,%edi
call   1030 <test@plt>
mov    (%rbx),%esi
mov    (%r15),%edx
mov    $0x1,%edi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SIGSEGV = global i32 0
@SIGBUS = global i32 0
@SIGHUP = global i32 0
@SIGUSR1 = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @SIGSEGV
%3 = load i32, i32* @SIGBUS
%4 = call i32 @test(i32 0, i32 %2, i32 %3)
%5 = load i32, i32* @SIGSEGV
%6 = load i32, i32* @SIGHUP
%7 = call i32 @test(i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @SIGUSR1
%9 = load i32, i32* @SIGBUS
%10 = call i32 @test(i32 0, i32 %8, i32 %9)
%11 = load i32, i32* @SIGUSR1
%12 = load i32, i32* @SIGHUP
%13 = call i32 @test(i32 0, i32 %11, i32 %12)
%14 = load i32, i32* @SIGSEGV
%15 = load i32, i32* @SIGBUS
%16 = call i32 @test(i32 1, i32 %14, i32 %15)
%17 = load i32, i32* @SIGSEGV
%18 = load i32, i32* @SIGHUP
%19 = call i32 @test(i32 1, i32 %17, i32 %18)
%20 = load i32, i32* @SIGUSR1
%21 = load i32, i32* @SIGBUS
%22 = call i32 @test(i32 1, i32 %20, i32 %21)
%23 = load i32, i32* @SIGUSR1
%24 = load i32, i32* @SIGHUP
%25 = call i32 @test(i32 1, i32 %23, i32 %24)
ret i32 0
}

LLVM IR (-O2):
@SIGSEGV = global i32 0
@SIGBUS = global i32 0
@SIGHUP = global i32 0
@SIGUSR1 = global i32 0
define i32 @main() {
%1 = load i32, i32* @SIGSEGV
%2 = load i32, i32* @SIGBUS
%3 = tail call i32 @test(i32 0, i32 %1, i32 %2)
%4 = load i32, i32* @SIGSEGV
%5 = load i32, i32* @SIGHUP
%6 = tail call i32 @test(i32 0, i32 %4, i32 %5)
%7 = load i32, i32* @SIGUSR1
%8 = load i32, i32* @SIGBUS
%9 = tail call i32 @test(i32 0, i32 %7, i32 %8)
%10 = load i32, i32* @SIGUSR1
%11 = load i32, i32* @SIGHUP
%12 = tail call i32 @test(i32 0, i32 %10, i32 %11)
%13 = load i32, i32* @SIGSEGV
%14 = load i32, i32* @SIGBUS
%15 = tail call i32 @test(i32 1, i32 %13, i32 %14)
%16 = load i32, i32* @SIGSEGV
%17 = load i32, i32* @SIGHUP
%18 = tail call i32 @test(i32 1, i32 %16, i32 %17)
%19 = load i32, i32* @SIGUSR1
%20 = load i32, i32* @SIGBUS
%21 = tail call i32 @test(i32 1, i32 %19, i32 %20)
%22 = load i32, i32* @SIGUSR1
%23 = load i32, i32* @SIGHUP
%24 = tail call i32 @test(i32 1, i32 %22, i32 %23)
ret i32 0
}