#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_handler;
  int sa_flags;
  int /*<<< orphan*/ sa_mask;
};
typedef int /*<<< orphan*/ sigset_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EINVAL;
int NSIG;
scalar_t__ SIG_DFL;
scalar_t__ SIG_IGN;
int /*<<< orphan*/ abort();
scalar_t__ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ perror_and_exit(char *);
int sigaction(int, int /*<<< orphan*/ *, struct sigaction *);
int sigismember(int /*<<< orphan*/ *, int);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdout;
int main(int argc, char **argv) {
  int i;
  FILE *out;
  sigset_t sigset;
  int res;
  res = sigprocmask(0, NULL, &sigset);
  if (res != 0)
    perror_and_exit("sigprocmask");
  if (argc > 1)
    out = stdout;
  else {
    out = fopen("output.txt", "w");
    if (out == NULL)
      perror_and_exit("fopen");
  }
  for (i = 1; i < NSIG; i++) {
    struct sigaction oldact;
    fprintf(out, "signal %d: ", i);
    res = sigaction(i, NULL, &oldact);
    if (res == -1 && errno == EINVAL) {
      fprintf(out, "invalid");
    } else if (res == -1) {
      perror_and_exit("sigaction");
    } else {
      int m;
      fprintf(out, "sigaction={sa_handler=");
      if (oldact.sa_handler == SIG_DFL)
        fprintf(out, "SIG_DFL");
      else if (oldact.sa_handler == SIG_IGN)
        fprintf(out, "SIG_IGN");
      else
        abort();
      fprintf(out, ", sa_mask=");
      for (m = 1; m < NSIG; m++)
        fprintf(out, "%c", sigismember(&oldact.sa_mask, m) ? '1' : '0');
      fprintf(out, ", sa_flags=%d", oldact.sa_flags);
      fprintf(out, "}, masked=%d", sigismember(&sigset, i));
    }
    fprintf(out, "\n");
  }
  if (out != stdout)
    fclose(out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x24(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     11be <main+0x3e>
lea    0xe47(%rip),%rdi
call   1090 <perror_and_exit@plt>
cmpl   $0x1,-0x8(%rbp)
jle    11db <main+0x5b>
mov    0x2df1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    120e <main+0x8e>
lea    0xe2a(%rip),%rdi
lea    0xe2e(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1209 <main+0x89>
lea    0xe15(%rip),%rdi
call   1090 <perror_and_exit@plt>
jmp    120e <main+0x8e>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2d99(%rip),%rcx
cmp    (%rcx),%eax
jge    13f0 <main+0x270>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xdea(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x14(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x38(%rbp),%rdx
call   1050 <sigaction@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0xffffffff,-0x28(%rbp)
jne    128a <main+0x10a>
mov    0x2d78(%rip),%rax
mov    (%rax),%rax
mov    0x2d5e(%rip),%rcx
cmp    (%rcx),%rax
jne    128a <main+0x10a>
mov    -0x20(%rbp),%rdi
lea    0xdad(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    13d0 <main+0x250>
cmpl   $0xffffffff,-0x28(%rbp)
jne    12a5 <main+0x125>
lea    0xd98(%rip),%rdi
call   1090 <perror_and_exit@plt>
jmp    13cb <main+0x24b>
mov    -0x20(%rbp),%rdi
lea    0xd8d(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x38(%rbp),%rax
mov    0x2d0e(%rip),%rcx
cmp    (%rcx),%rax
jne    12e2 <main+0x162>
mov    -0x20(%rbp),%rdi
lea    0xd7e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1319 <main+0x199>
mov    -0x38(%rbp),%rax
mov    0x2cfb(%rip),%rcx
cmp    (%rcx),%rax
jne    130d <main+0x18d>
mov    -0x20(%rbp),%rdi
lea    0xd5b(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1314 <main+0x194>
mov    $0x0,%al
call   1040 <abort@plt>
jmp    1319 <main+0x199>
mov    -0x20(%rbp),%rdi
lea    0xd40(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    0x2c7c(%rip),%rcx
cmp    (%rcx),%eax
jge    138e <main+0x20e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x38(%rbp),%rdi
add    $0xc,%rdi
mov    -0x3c(%rbp),%esi
call   10a0 <sigismember@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%ecx
mov    $0x30,%edx
mov    $0x31,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
lea    0xcf6(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1332 <main+0x1b2>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%edx
lea    0xcd6(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x14(%rbp),%esi
lea    -0x24(%rbp),%rdi
call   10a0 <sigismember@plt>
mov    -0x50(%rbp),%rdi
mov    %eax,%edx
lea    0xcbc(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    13d0 <main+0x250>
mov    -0x20(%rbp),%rdi
lea    0xcb2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1215 <main+0x95>
mov    -0x20(%rbp),%rax
mov    0x2bc5(%rip),%rcx
cmp    (%rcx),%rax
je     140d <main+0x28d>
mov    -0x20(%rbp),%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
lea    0x4(%rsp),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <sigprocmask@plt>
test   %eax,%eax
je     11ce <main+0x2e>
lea    0xe37(%rip),%rdi
call   10a0 <perror_and_exit@plt>
cmp    $0x2,%ebx
jl     11df <main+0x3f>
mov    0x2de6(%rip),%rax
mov    (%rax),%rbx
jmp    1208 <main+0x68>
lea    0xe26(%rip),%rdi
lea    0xe2a(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1208 <main+0x68>
lea    0xe18(%rip),%rdi
call   10a0 <perror_and_exit@plt>
xor    %ebx,%ebx
mov    0x2da9(%rip),%r15
cmpl   $0x2,(%r15)
jl     13a5 <main+0x205>
mov    $0x1,%ebp
lea    0x14(%rsp),%r14
lea    0x8(%rsp),%r12
jmp    127d <main+0xdd>
nopw   0x0(%rax,%rax,1)
mov    0x10(%rsp),%edx
mov    %rbx,%rdi
lea    0xe31(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0x4(%rsp),%rdi
mov    %ebp,%esi
call   10b0 <sigismember@plt>
mov    %rbx,%rdi
lea    0xe22(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1070 <fputc@plt>
add    $0x1,%ebp
cmp    (%r15),%ebp
jge    13a5 <main+0x205>
mov    %rbx,%rdi
lea    0xd98(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %ebp,%edi
xor    %esi,%esi
mov    %r12,%rdx
call   1050 <sigaction@plt>
cmp    $0xffffffff,%eax
je     1360 <main+0x1c0>
mov    $0x16,%esi
mov    $0x1,%edx
lea    0xd87(%rip),%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
mov    0x8(%rsp),%rax
lea    0xd8a(%rip),%rdi
mov    0x2cff(%rip),%rcx
cmp    (%rcx),%rax
je     12ed <main+0x14d>
lea    0xd7f(%rip),%rdi
mov    0x2d04(%rip),%rcx
cmp    (%rcx),%rax
jne    13ca <main+0x22a>
mov    $0x7,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
mov    $0xa,%esi
mov    $0x1,%edx
lea    0xd54(%rip),%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
cmpl   $0x2,(%r15)
jl     1230 <main+0x90>
mov    $0x1,%r13d
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r13d,%esi
call   10b0 <sigismember@plt>
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
mov    %rbx,%rsi
call   1070 <fputc@plt>
add    $0x1,%r13d
cmp    (%r15),%r13d
jl     1330 <main+0x190>
jmp    1230 <main+0x90>
nopl   0x0(%rax)
mov    0x2c71(%rip),%rax
mov    (%rax),%rax
mov    0x2c57(%rip),%rcx
cmp    (%rcx),%rax
jne    1394 <main+0x1f4>
mov    $0x7,%esi
mov    $0x1,%edx
lea    0xca4(%rip),%rdi
mov    %rbx,%rcx
call   10c0 <fwrite@plt>
jmp    1264 <main+0xc4>
lea    0xc98(%rip),%rdi
call   10a0 <perror_and_exit@plt>
jmp    1264 <main+0xc4>
mov    0x2c14(%rip),%rax
cmp    (%rax),%rbx
je     13b9 <main+0x219>
mov    %rbx,%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
%struct.sigaction = type { i64, i32, i32 }
@.str = [12 x i8] c"sigprocmask\00"
@stdout = global i32* null
@.str.1 = [11 x i8] c"output.txt\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [6 x i8] c"fopen\00"
@NSIG = global i32 0
@.str.4 = [12 x i8] c"signal %d: \00"
@errno = global i64 0
@EINVAL = global i64 0
@.str.5 = [8 x i8] c"invalid\00"
@.str.6 = [10 x i8] c"sigaction\00"
@.str.7 = [23 x i8] c"sigaction={sa_handler=\00"
@SIG_DFL = global i64 0
@.str.8 = [8 x i8] c"SIG_DFL\00"
@SIG_IGN = global i64 0
@.str.9 = [8 x i8] c"SIG_IGN\00"
@.str.10 = [11 x i8] c", sa_mask=\00"
@.str.11 = [3 x i8] c"%c\00"
@.str.12 = [14 x i8] c", sa_flags=%d\00"
@.str.13 = [13 x i8] c"}, masked=%d\00"
@.str.14 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.sigaction
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i32 @sigprocmask(i32 0, i32* null, i32* %8)
store i32 %12, i32* %9
%13 = load i32, i32* %9
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @perror_and_exit(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %2
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 1
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = load i32*, i32** @stdout
store i32* %21, i32** %7
br label %29
22: ; preds = %17
%23 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %23, i32** %7
%24 = load i32*, i32** %7
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @perror_and_exit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %26, %22
br label %29
29: ; preds = %28, %20
store i32 1, i32* %6
br label %30
30: ; preds = %107, %29
%31 = load i32, i32* %6
%32 = load i32, i32* @NSIG
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %110
34: ; preds = %30
%35 = load i32*, i32** %7
%36 = load i32, i32* %6
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %35, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %36)
%38 = load i32, i32* %6
%39 = call i32 @sigaction(i32 %38, i32* null, %struct.sigaction* %10)
store i32 %39, i32* %9
%40 = load i32, i32* %9
%41 = icmp eq i32 %40, -1
br i1 %41, label %42, label %49
42: ; preds = %34
%43 = load i64, i64* @errno
%44 = load i64, i64* @EINVAL
%45 = icmp eq i64 %43, %44
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load i32*, i32** %7
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %104
49: ; preds = %42, %34
%50 = load i32, i32* %9
%51 = icmp eq i32 %50, -1
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = call i32 @perror_and_exit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %103
54: ; preds = %49
%55 = load i32*, i32** %7
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %55, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%57 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %10, i32 0, i32 0
%58 = load i64, i64* %57
%59 = load i64, i64* @SIG_DFL
%60 = icmp eq i64 %58, %59
br i1 %60, label %61, label %64
61: ; preds = %54
%62 = load i32*, i32** %7
%63 = call i32 (i32*, i8*, ...) @fprintf(i32* %62, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %75
64: ; preds = %54
%65 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %10, i32 0, i32 0
%66 = load i64, i64* %65
%67 = load i64, i64* @SIG_IGN
%68 = icmp eq i64 %66, %67
br i1 %68, label %69, label %72
69: ; preds = %64
%70 = load i32*, i32** %7
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %70, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
br label %74
72: ; preds = %64
%73 = call i32 (...) @abort()
unreachable
74: ; preds = %69
br label %75
75: ; preds = %74, %61
%76 = load i32*, i32** %7
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
store i32 1, i32* %11
br label %78
78: ; preds = %91, %75
%79 = load i32, i32* %11
%80 = load i32, i32* @NSIG
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %94
82: ; preds = %78
%83 = load i32*, i32** %7
%84 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %10, i32 0, i32 2
%85 = load i32, i32* %11
%86 = call i32 @sigismember(i32* %84, i32 %85)
%87 = icmp ne i32 %86, 0
%88 = zext i1 %87 to i64
%89 = select i1 %87, i32 49, i32 48
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %89)
br label %91
91: ; preds = %82
%92 = load i32, i32* %11
%93 = add nsw i32 %92, 1
store i32 %93, i32* %11
br label %78
94: ; preds = %78
%95 = load i32*, i32** %7
%96 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %10, i32 0, i32 1
%97 = load i32, i32* %96
%98 = call i32 (i32*, i8*, ...) @fprintf(i32* %95, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i32 %97)
%99 = load i32*, i32** %7
%100 = load i32, i32* %6
%101 = call i32 @sigismember(i32* %8, i32 %100)
%102 = call i32 (i32*, i8*, ...) @fprintf(i32* %99, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 %101)
br label %103
103: ; preds = %94, %52
br label %104
104: ; preds = %103, %46
%105 = load i32*, i32** %7
%106 = call i32 (i32*, i8*, ...) @fprintf(i32* %105, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
br label %107
107: ; preds = %104
%108 = load i32, i32* %6
%109 = add nsw i32 %108, 1
store i32 %109, i32* %6
br label %30
110: ; preds = %30
%111 = load i32*, i32** %7
%112 = load i32*, i32** @stdout
%113 = icmp ne i32* %111, %112
br i1 %113, label %114, label %117
114: ; preds = %110
%115 = load i32*, i32** %7
%116 = call i32 @fclose(i32* %115)
br label %117
117: ; preds = %114, %110
ret i32 0
}

LLVM IR (-O2):
%struct.sigaction = type { i64, i32, i32 }
@.str = [12 x i8] c"sigprocmask\00"
@stdout = global i32* null
@.str.1 = [11 x i8] c"output.txt\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [6 x i8] c"fopen\00"
@NSIG = global i32 0
@.str.4 = [12 x i8] c"signal %d: \00"
@errno = global i64 0
@EINVAL = global i64 0
@.str.5 = [8 x i8] c"invalid\00"
@.str.6 = [10 x i8] c"sigaction\00"
@.str.7 = [23 x i8] c"sigaction={sa_handler=\00"
@SIG_DFL = global i64 0
@.str.8 = [8 x i8] c"SIG_DFL\00"
@SIG_IGN = global i64 0
@.str.9 = [8 x i8] c"SIG_IGN\00"
@.str.10 = [11 x i8] c", sa_mask=\00"
@.str.12 = [14 x i8] c", sa_flags=%d\00"
@.str.13 = [13 x i8] c"}, masked=%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca %struct.sigaction
%5 = bitcast i32* %3 to i8*
%6 = call i32 @sigprocmask(i32 0, i32* null, i32* %3)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @perror_and_exit(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = icmp sgt i32 %0, 1
br i1 %11, label %12, label %14
12: ; preds = %10
%13 = load i32*, i32** @stdout
br label %19
14: ; preds = %10
%15 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @perror_and_exit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %14, %17, %12
%20 = phi i32* [ %13, %12 ], [ null, %17 ], [ %15, %14 ]
%21 = load i32, i32* @NSIG
%22 = icmp sgt i32 %21, 1
br i1 %22, label %23, label %76
23: ; preds = %19
%24 = bitcast %struct.sigaction* %4 to i8*
%25 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %4, i64 0, i32 0
%26 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %4, i64 0, i32 2
%27 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %4, i64 0, i32 1
br label %28
28: ; preds = %23, %71
%29 = phi i32 [ 1, %23 ], [ %73, %71 ]
%30 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %29)
%31 = call i32 @sigaction(i32 %29, i32* null, %struct.sigaction* %4)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %41
33: ; preds = %28
%34 = load i64, i64* @errno
%35 = load i64, i64* @EINVAL
%36 = icmp eq i64 %34, %35
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i64 7, i64 1, i32* %20)
br label %71
39: ; preds = %33
%40 = call i32 @perror_and_exit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %71
41: ; preds = %28
%42 = call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i64 22, i64 1, i32* %20)
%43 = load i64, i64* %25
%44 = load i64, i64* @SIG_DFL
%45 = icmp eq i64 %43, %44
br i1 %45, label %51, label %46
46: ; preds = %41
%47 = load i64, i64* @SIG_IGN
%48 = icmp eq i64 %43, %47
br i1 %48, label %51, label %49
49: ; preds = %46
%50 = call i32 (...) @abort()
unreachable
51: ; preds = %46, %41
%52 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), %41 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), %46 ]
%53 = call i64 @fwrite(i8* %52, i64 7, i64 1, i32* %20)
%54 = call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i64 10, i64 1, i32* %20)
%55 = load i32, i32* @NSIG
%56 = icmp sgt i32 %55, 1
br i1 %56, label %57, label %66
57: ; preds = %51, %57
%58 = phi i32 [ %63, %57 ], [ 1, %51 ]
%59 = call i32 @sigismember(i32* %26, i32 %58)
%60 = icmp eq i32 %59, 0
%61 = select i1 %60, i32 48, i32 49
%62 = call i32 @fputc(i32 %61, i32* %20)
%63 = add nuw nsw i32 %58, 1
%64 = load i32, i32* @NSIG
%65 = icmp slt i32 %63, %64
br i1 %65, label %57, label %66
66: ; preds = %57, %51
%67 = load i32, i32* %27
%68 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i32 %67)
%69 = call i32 @sigismember(i32* %3, i32 %29)
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 %69)
br label %71
71: ; preds = %39, %66, %37
%72 = call i32 @fputc(i32 10, i32* %20)
%73 = add nuw nsw i32 %29, 1
%74 = load i32, i32* @NSIG
%75 = icmp slt i32 %73, %74
br i1 %75, label %28, label %76
76: ; preds = %71, %19
%77 = load i32*, i32** @stdout
%78 = icmp eq i32* %20, %77
br i1 %78, label %81, label %79
79: ; preds = %76
%80 = call i32 @fclose(i32* %20)
br label %81
81: ; preds = %79, %76
ret i32 0
}