#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ uc_sigmask;
};
typedef TYPE_1__ ucontext_t;

/* Variables and functions */
int SIGRTMAX;
int SIGRTMIN;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ sigismember(int /*<<< orphan*/ *, int);
void display_sigmask(char *descrip, ucontext_t *context) {
  printf("  %s", descrip);
  int i;
  for (i = SIGRTMIN; i <= SIGRTMAX; i++) {
    if (sigismember(&context->uc_sigmask, 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    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%ebx
mov    0x2e84(%rip),%r12
cmp    (%r12),%ebx
jle    1177 <display_sigmask+0x47>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>
lea    0xe87(%rip),%r15
jmp    118b <display_sigmask+0x5b>
lea    0x1(%rbx),%eax
cmp    (%r12),%ebx
mov    %eax,%ebx
jge    1162 <display_sigmask+0x32>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigismember@plt>
test   %rax,%rax
je     1180 <display_sigmask+0x50>
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1180 <display_sigmask+0x50>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@.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, %struct.TYPE_3__* %1) {
%3 = alloca i8*
%4 = alloca %struct.TYPE_3__*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %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 = %23, %2
%10 = load i32, i32* %5
%11 = load i32, i32* @SIGRTMAX
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %14, i32 0, i32 0
%16 = load i32, i32* %5
%17 = call i64 @sigismember(i32* %15, i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load i32, i32* %5
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %19, %13
br label %23
23: ; preds = %22
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %9
26: ; preds = %9
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@.str = [5 x i8] c" %s\00"
@SIGRTMIN = global i32 0
@SIGRTMAX = global i32 0
@.str.1 = [4 x i8] c" %d\00"
define void @display_sigmask(i8* %0, %struct.TYPE_3__* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) 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 %19, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
br label %9
9: ; preds = %7, %15
%10 = phi i32 [ %4, %7 ], [ %16, %15 ]
%11 = tail call i64 @sigismember(i32* %8, i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %9
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %15
15: ; preds = %9, %13
%16 = add nsw i32 %10, 1
%17 = load i32, i32* @SIGRTMAX
%18 = icmp slt i32 %10, %17
br i1 %18, label %9, label %19
19: ; preds = %15, %2
%20 = tail call i32 @putchar(i32 10)
ret void
}