#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*/ Printf(char *, ...);
int SIGRTMAX;
int SIGRTMIN;
scalar_t__ sigismember(int /*<<< orphan*/ *, int);
void display_sigmask(char *descrip, sigset_t *mask) {
  Printf("%s: ", descrip);
  int i;
  for (i = SIGRTMIN; i <= SIGRTMAX; i++) {
    if (sigismember(mask, i)) {
      Printf(" %d", i);
    }
  }
  Printf("\n");
}


x86 assembly (clang, -O0):
<display_sigmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <Printf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%eax
jg     119a <display_sigmask+0x7a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <sigismember@plt>
cmp    $0x0,%rax
je     1187 <display_sigmask+0x67>
mov    -0x14(%rbp),%esi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <Printf@plt>
jmp    118c <display_sigmask+0x6c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <display_sigmask+0x2e>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <Printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_sigmask>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rsi
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <Printf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%ebx
mov    0x2e94(%rip),%r12
cmp    (%r12),%ebx
jle    116b <display_sigmask+0x4b>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <Printf@plt>
lea    0xe93(%rip),%r15
jmp    118b <display_sigmask+0x6b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x1(%rbx),%eax
cmp    (%r12),%ebx
mov    %eax,%ebx
jge    1152 <display_sigmask+0x32>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <sigismember@plt>
test   %rax,%rax
je     1180 <display_sigmask+0x60>
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <Printf@plt>
jmp    1180 <display_sigmask+0x60>

LLVM IR (-O0):
@.str = [5 x i8] c"%s: \00"
@SIGRTMIN = global i32 0
@SIGRTMAX = global i32 0
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @display_sigmask(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) @Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @SIGRTMIN
store i32 %8, i32* %5
br label %9
9: ; preds = %22, %2
%10 = load i32, i32* %5
%11 = load i32, i32* @SIGRTMAX
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %9
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = call i64 @sigismember(i32* %14, i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i32, i32* %5
%20 = call i32 (i8*, ...) @Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %18, %13
br label %22
22: ; preds = %21
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %9
25: ; preds = %9
%26 = call i32 (i8*, ...) @Printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s: \00"
@SIGRTMIN = global i32 0
@SIGRTMAX = global i32 0
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @display_sigmask(i8* %0, i32* %1) {
%3 = tail call i32 (i8*, ...) @Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @SIGRTMIN
%5 = load i32, i32* @SIGRTMAX
%6 = icmp sgt i32 %4, %5
br i1 %6, label %17, label %7
7: ; preds = %2, %13
%8 = phi i32 [ %14, %13 ], [ %4, %2 ]
%9 = tail call i64 @sigismember(i32* %1, i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = tail call i32 (i8*, ...) @Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %13
13: ; preds = %7, %11
%14 = add nsw i32 %8, 1
%15 = load i32, i32* @SIGRTMAX
%16 = icmp slt i32 %8, %15
br i1 %16, label %7, label %17
17: ; preds = %13, %2
%18 = tail call i32 (i8*, ...) @Printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}