#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_handler;
};

/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/ *);
void int_off(void) {
  static struct sigaction newact;
  newact.sa_handler = SIG_DFL;
  sigaction(SIGINT, &newact, NULL);
  sigaction(SIGQUIT, &newact, NULL);
  sigaction(SIGTERM, &newact, NULL);
}


x86 assembly (clang, -O0):
<int_off>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x2f09(%rip)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0x2ef9(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0x2ee0(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0x2ec7(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_off>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x2f0c(%rip)
lea    0x2f05(%rip),%rbx
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
pop    %rbx
jmp    1030 <sigaction@plt>

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@int_off.newact = internal global %struct.sigaction zeroinitializer
@SIG_DFL = global i32 0
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@SIGTERM = global i32 0
define void @int_off() {
%1 = load i32, i32* @SIG_DFL
store i32 %1, i32* getelementptr inbounds (%struct.sigaction, %struct.sigaction* @int_off.newact, i32 0, i32 0)
%2 = load i32, i32* @SIGINT
%3 = call i32 @sigaction(i32 %2, %struct.sigaction* @int_off.newact, i32* null)
%4 = load i32, i32* @SIGQUIT
%5 = call i32 @sigaction(i32 %4, %struct.sigaction* @int_off.newact, i32* null)
%6 = load i32, i32* @SIGTERM
%7 = call i32 @sigaction(i32 %6, %struct.sigaction* @int_off.newact, i32* null)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@int_off.newact = internal global %struct.sigaction zeroinitializer
@SIG_DFL = global i32 0
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@SIGTERM = global i32 0
define void @int_off() {
%1 = load i32, i32* @SIG_DFL
store i32 %1, i32* getelementptr inbounds (%struct.sigaction, %struct.sigaction* @int_off.newact, i64 0, i32 0)
%2 = load i32, i32* @SIGINT
%3 = tail call i32 @sigaction(i32 %2, %struct.sigaction* @int_off.newact, i32* null)
%4 = load i32, i32* @SIGQUIT
%5 = tail call i32 @sigaction(i32 %4, %struct.sigaction* @int_off.newact, i32* null)
%6 = load i32, i32* @SIGTERM
%7 = tail call i32 @sigaction(i32 %6, %struct.sigaction* @int_off.newact, i32* null)
ret void
}