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

/* Variables and functions */
int /*<<< orphan*/ SIGCONT;
int /*<<< orphan*/ SIGTSTP;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/ *);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
void pv_sig_nopause(void) {
  struct sigaction sa;
  sa.sa_handler = SIG_IGN;
  sigemptyset(&(sa.sa_mask));
  sa.sa_flags = 0;
  sigaction(SIGTSTP, &sa, NULL);
  sa.sa_handler = SIG_DFL;
  sigemptyset(&(sa.sa_mask));
  sa.sa_flags = 0;
  sigaction(SIGCONT, &sa, NULL);
}


x86 assembly (clang, -O0):
<pv_sig_nopause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   1040 <sigemptyset@plt>
movq   $0x0,-0x10(%rbp)
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   1040 <sigemptyset@plt>
movq   $0x0,-0x10(%rbp)
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pv_sig_nopause>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
movq   $0x0,0x8(%rsp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
movq   $0x0,0x8(%rsp)
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sigaction = type { i64, i32, i32 }
@SIG_IGN = global i32 0
@SIGTSTP = global i32 0
@SIG_DFL = global i32 0
@SIGCONT = global i32 0
define void @pv_sig_nopause() {
%1 = alloca %struct.sigaction
%2 = load i32, i32* @SIG_IGN
%3 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 2
store i32 %2, i32* %3
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 1
%5 = call i32 @sigemptyset(i32* %4)
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
store i64 0, i64* %6
%7 = load i32, i32* @SIGTSTP
%8 = call i32 @sigaction(i32 %7, %struct.sigaction* %1, i32* null)
%9 = load i32, i32* @SIG_DFL
%10 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 2
store i32 %9, i32* %10
%11 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 1
%12 = call i32 @sigemptyset(i32* %11)
%13 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
store i64 0, i64* %13
%14 = load i32, i32* @SIGCONT
%15 = call i32 @sigaction(i32 %14, %struct.sigaction* %1, i32* null)
ret void
}

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