#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 */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ _err_exit(char *, int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ errno;
int sigfillset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void block_all_signals(void) {
  sigset_t set;
  int rc;
  rc = sigfillset(&set);
  if (rc != 0)
    _err_exit("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/Morgan-Stanley/treadmill-pid1/refs/"
              "heads/main/src/pid1.c",
              89, errno, "sigfillset");
  rc = sigprocmask(SIG_SETMASK, &set, NULL);
  if (rc != 0)
    _err_exit("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/Morgan-Stanley/treadmill-pid1/refs/"
              "heads/main/src/pid1.c",
              93, errno, "sigprocmask");
}


x86 assembly (clang, -O0):
<block_all_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1050 <sigfillset@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116f <block_all_signals+0x3f>
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
lea    0xea2(%rip),%rdi
mov    $0x59,%esi
lea    0xf29(%rip),%rcx
call   1040 <_err_exit@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11b3 <block_all_signals+0x83>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edx
lea    0xe5e(%rip),%rdi
mov    $0x5d,%esi
lea    0xef0(%rip),%rcx
call   1040 <_err_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_all_signals>:
push   %rax
lea    0x4(%rsp),%rdi
call   1050 <sigfillset@plt>
test   %eax,%eax
je     1160 <block_all_signals+0x30>
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
lea    0xeb1(%rip),%rdi
lea    0xf3d(%rip),%rcx
mov    $0x59,%esi
call   1040 <_err_exit@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
test   %eax,%eax
je     119a <block_all_signals+0x6a>
mov    0x2e58(%rip),%rax
mov    (%rax),%edx
lea    0xe77(%rip),%rdi
lea    0xf0e(%rip),%rcx
mov    $0x5d,%esi
call   1040 <_err_exit@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Morgan-Stanley/treadmill-pid1/refs/heads/main/src/pid1.c\00"
@errno = global i32 0
@.str.1 = [11 x i8] c"sigfillset\00"
@SIG_SETMASK = global i32 0
@.str.2 = [12 x i8] c"sigprocmask\00"
define void @block_all_signals() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @sigfillset(i32* %1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @errno
%8 = call i32 @_err_exit(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 89, i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %6, %0
%10 = load i32, i32* @SIG_SETMASK
%11 = call i32 @sigprocmask(i32 %10, i32* %1, i32* null)
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i32, i32* @errno
%16 = call i32 @_err_exit(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 93, i32 %15, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %14, %9
ret void
}

LLVM IR (-O2):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Morgan-Stanley/treadmill-pid1/refs/heads/main/src/pid1.c\00"
@errno = global i32 0
@.str.1 = [11 x i8] c"sigfillset\00"
@SIG_SETMASK = global i32 0
@.str.2 = [12 x i8] c"sigprocmask\00"
define void @block_all_signals() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* @errno
%7 = call i32 @_err_exit(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 89, i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %5, %0
%9 = load i32, i32* @SIG_SETMASK
%10 = call i32 @sigprocmask(i32 %9, i32* %1, i32* null)
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %8
%13 = load i32, i32* @errno
%14 = call i32 @_err_exit(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 93, i32 %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %12, %8
ret void
}