#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*/ PR_SET_NAME;
int const SIGALRM;
int const SIGHUP;
int const SIGINT;
int const SIGPIPE;
int const SIGPOLL;
int const SIGPROF;
int const SIGQUIT;
int const SIGVTALRM;
int const SIGXCPU;
int const SIGXFSZ;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ pause();
int /*<<< orphan*/ prctl(int /*<<< orphan*/, char *, int /*<<< orphan*/ *,
                         int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sigaction(int const, struct sigaction *,
                             int /*<<< orphan*/ *);
void do_pause() {
  int i;
  struct sigaction act;
  int const sig[] = {SIGALRM, SIGHUP,    SIGINT,  SIGPIPE, SIGQUIT, SIGPOLL,
                     SIGPROF, SIGVTALRM, SIGXCPU, SIGXFSZ, 0};
  act.sa_handler = SIG_IGN;
  for (i = 0; sig[i]; i++)
    sigaction(sig[i], &act, NULL);
  prctl(PR_SET_NAME, "podman pause", NULL, NULL, NULL);
  while (1)
    pause();
}


x86 assembly (clang, -O0):
<do_pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    0x2e35(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    0x2e61(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    0x2e0d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    0x2e41(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    0x2e15(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    0x2df1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2e15(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    0x2dfa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rax
cmpl   $0x0,-0x40(%rbp,%rax,4)
je     11fc <do_pause+0xcc>
movslq -0x4(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11ca <do_pause+0x9a>
mov    0x2d9d(%rip),%rax
mov    (%rax),%edi
lea    0xe1c(%rip),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1040 <prctl@plt>
mov    $0x0,%al
call   1050 <pause@plt>
jmp    121c <do_pause+0xec>

x86 assembly (clang, -O2):
<do_pause>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xef7(%rip),%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <prctl@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <pause@plt>
jmp    1140 <do_pause+0x20>

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@SIGALRM = constant i32 0
@SIGHUP = constant i32 0
@SIGINT = constant i32 0
@SIGPIPE = constant i32 0
@SIGQUIT = constant i32 0
@SIGPOLL = constant i32 0
@SIGPROF = constant i32 0
@SIGVTALRM = constant i32 0
@SIGXCPU = constant i32 0
@SIGXFSZ = constant i32 0
@SIG_IGN = global i32 0
@PR_SET_NAME = global i32 0
@.str = [13 x i8] c"podman pause\00"
define void @do_pause() {
%1 = alloca i32
%2 = alloca %struct.sigaction
%3 = alloca [11 x i32]
%4 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 0
%5 = load i32, i32* @SIGALRM
store i32 %5, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* @SIGHUP
store i32 %7, i32* %6
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* @SIGINT
store i32 %9, i32* %8
%10 = getelementptr inbounds i32, i32* %8, i64 1
%11 = load i32, i32* @SIGPIPE
store i32 %11, i32* %10
%12 = getelementptr inbounds i32, i32* %10, i64 1
%13 = load i32, i32* @SIGQUIT
store i32 %13, i32* %12
%14 = getelementptr inbounds i32, i32* %12, i64 1
%15 = load i32, i32* @SIGPOLL
store i32 %15, i32* %14
%16 = getelementptr inbounds i32, i32* %14, i64 1
%17 = load i32, i32* @SIGPROF
store i32 %17, i32* %16
%18 = getelementptr inbounds i32, i32* %16, i64 1
%19 = load i32, i32* @SIGVTALRM
store i32 %19, i32* %18
%20 = getelementptr inbounds i32, i32* %18, i64 1
%21 = load i32, i32* @SIGXCPU
store i32 %21, i32* %20
%22 = getelementptr inbounds i32, i32* %20, i64 1
%23 = load i32, i32* @SIGXFSZ
store i32 %23, i32* %22
%24 = getelementptr inbounds i32, i32* %22, i64 1
store i32 0, i32* %24
%25 = load i32, i32* @SIG_IGN
%26 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %2, i32 0, i32 0
store i32 %25, i32* %26
store i32 0, i32* %1
br label %27
27: ; preds = %39, %0
%28 = load i32, i32* %1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %42
33: ; preds = %27
%34 = load i32, i32* %1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = call i32 @sigaction(i32 %37, %struct.sigaction* %2, i32* null)
br label %39
39: ; preds = %33
%40 = load i32, i32* %1
%41 = add nsw i32 %40, 1
store i32 %41, i32* %1
br label %27
42: ; preds = %27
%43 = load i32, i32* @PR_SET_NAME
%44 = call i32 @prctl(i32 %43, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, i32* null)
br label %45
45: ; preds = %42, %45
%46 = call i32 (...) @pause()
br label %45
}

LLVM IR (-O2):
@SIGALRM = constant i32 0
@SIGHUP = constant i32 0
@SIGINT = constant i32 0
@SIGPIPE = constant i32 0
@SIGQUIT = constant i32 0
@SIGPOLL = constant i32 0
@SIGPROF = constant i32 0
@SIGVTALRM = constant i32 0
@SIGXCPU = constant i32 0
@SIGXFSZ = constant i32 0
@SIG_IGN = global i32 0
@PR_SET_NAME = global i32 0
@.str = [13 x i8] c"podman pause\00"
define void @do_pause() {
%1 = load i32, i32* @PR_SET_NAME
%2 = call i32 @prctl(i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, i32* null)
br label %3
3: ; preds = %3, %0
%4 = call i32 (...) @pause()
br label %3
}