#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 */
struct sigaction {
  int /*<<< orphan*/ sa_mask;
  int /*<<< orphan*/ sa_handler;
};

/* Variables and functions */
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/ *);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
void pdb_unregister_signals(void) {
  struct sigaction act;
  act.sa_handler = SIG_DFL;
  sigfillset(&act.sa_mask);
  sigaction(SIGHUP, &act, NULL);
  sigaction(SIGINT, &act, NULL);
  sigaction(SIGTERM, &act, NULL);
}


x86 assembly (clang, -O0):
<pdb_unregister_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigfillset@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdb_unregister_signals>:
push   %rbx
sub    $0x10,%rsp
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigfillset@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32, i32 }
@SIG_DFL = global i32 0
@SIGHUP = global i32 0
@SIGINT = global i32 0
@SIGTERM = global i32 0
define void @pdb_unregister_signals() {
%1 = alloca %struct.sigaction
%2 = load i32, i32* @SIG_DFL
%3 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 1
store i32 %2, i32* %3
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
%5 = call i32 @sigfillset(i32* %4)
%6 = load i32, i32* @SIGHUP
%7 = call i32 @sigaction(i32 %6, %struct.sigaction* %1, i32* null)
%8 = load i32, i32* @SIGINT
%9 = call i32 @sigaction(i32 %8, %struct.sigaction* %1, i32* null)
%10 = load i32, i32* @SIGTERM
%11 = call i32 @sigaction(i32 %10, %struct.sigaction* %1, i32* null)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32, i32 }
@SIG_DFL = global i32 0
@SIGHUP = global i32 0
@SIGINT = global i32 0
@SIGTERM = global i32 0
define void @pdb_unregister_signals() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = load i32, i32* @SIG_DFL
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 1
store i32 %3, i32* %4
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
%6 = call i32 @sigfillset(i32* %5)
%7 = load i32, i32* @SIGHUP
%8 = call i32 @sigaction(i32 %7, %struct.sigaction* %1, i32* null)
%9 = load i32, i32* @SIGINT
%10 = call i32 @sigaction(i32 %9, %struct.sigaction* %1, i32* null)
%11 = load i32, i32* @SIGTERM
%12 = call i32 @sigaction(i32 %11, %struct.sigaction* %1, i32* null)
ret void
}