#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*/ SIGSEGV;
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ sigismember(int /*<<< orphan*/ *, int /*<<< orphan*/);
void CheckSigs(sigset_t *ss, const char *mesg) {
  printf("%s:\n", mesg);
  if (sigismember(ss, SIGUSR1))
    printf(" USR1 is blocked\n");
  else
    printf(" USR1 is not blocked\n");
  if (sigismember(ss, SIGUSR2))
    printf(" USR2 is blocked\n");
  else
    printf(" USR2 is not blocked\n");
  if (sigismember(ss, SIGSEGV))
    printf(" SEGV is blocked\n");
  else
    printf(" SEGV is not blocked\n");
}


x86 assembly (clang, -O0):
<CheckSigs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
call   1040 <sigismember@plt>
cmp    $0x0,%rax
je     1171 <CheckSigs+0x51>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117f <CheckSigs+0x5f>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e46(%rip),%rax
mov    (%rax),%esi
call   1040 <sigismember@plt>
cmp    $0x0,%rax
je     11ae <CheckSigs+0x8e>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bc <CheckSigs+0x9c>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e19(%rip),%rax
mov    (%rax),%esi
call   1040 <sigismember@plt>
cmp    $0x0,%rax
je     11eb <CheckSigs+0xcb>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f9 <CheckSigs+0xd9>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckSigs>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigismember@plt>
test   %rax,%rax
lea    0xea8(%rip),%rax
lea    0xf02(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigismember@plt>
test   %rax,%rax
lea    0xe92(%rip),%rax
lea    0xec6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigismember@plt>
test   %rax,%rax
lea    0xe7c(%rip),%rax
lea    0xe8a(%rip),%rdi
cmove  %rax,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s:\0A\00"
@SIGUSR1 = global i32 0
@.str.1 = [18 x i8] c" USR1 is blocked\0A\00"
@.str.2 = [22 x i8] c" USR1 is not blocked\0A\00"
@SIGUSR2 = global i32 0
@.str.3 = [18 x i8] c" USR2 is blocked\0A\00"
@.str.4 = [22 x i8] c" USR2 is not blocked\0A\00"
@SIGSEGV = global i32 0
@.str.5 = [18 x i8] c" SEGV is blocked\0A\00"
@.str.6 = [22 x i8] c" SEGV is not blocked\0A\00"
define void @CheckSigs(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32*, i32** %3
%8 = load i32, i32* @SIGUSR1
%9 = call i64 @sigismember(i32* %7, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
%16 = load i32*, i32** %3
%17 = load i32, i32* @SIGUSR2
%18 = call i64 @sigismember(i32* %16, i32 %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %24
22: ; preds = %15
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %24
24: ; preds = %22, %20
%25 = load i32*, i32** %3
%26 = load i32, i32* @SIGSEGV
%27 = call i64 @sigismember(i32* %25, i32 %26)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
br label %33
31: ; preds = %24
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s:\0A\00"
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
@SIGSEGV = global i32 0
@str = [21 x i8] c" USR1 is not blocked\00"
@str.7 = [21 x i8] c" USR2 is not blocked\00"
@str.8 = [21 x i8] c" SEGV is not blocked\00"
@str.9 = [17 x i8] c" SEGV is blocked\00"
@str.10 = [17 x i8] c" USR2 is blocked\00"
@str.11 = [17 x i8] c" USR1 is blocked\00"
define void @CheckSigs(i32* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = load i32, i32* @SIGUSR1
%5 = tail call i64 @sigismember(i32* %0, i32 %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.11, i64 0, i64 0)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
%9 = load i32, i32* @SIGUSR2
%10 = tail call i64 @sigismember(i32* %0, i32 %9)
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.10, i64 0, i64 0)
%13 = tail call i32 @puts(i8* dereferenceable(1) %12)
%14 = load i32, i32* @SIGSEGV
%15 = tail call i64 @sigismember(i32* %0, i32 %14)
%16 = icmp eq i64 %15, 0
%17 = select i1 %16, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.9, i64 0, i64 0)
%18 = tail call i32 @puts(i8* dereferenceable(1) %17)
ret void
}