#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 NSIG;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
scalar_t__ sigismember(int /*<<< orphan*/ *, int);
void print(sigset_t *ret) {
  int i;
  for (i = 1; i < NSIG; i++) {
    if (sigismember(ret, i))
      putchar('1');
    else
      putchar('0');
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
jge    1197 <print+0x67>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <sigismember@plt>
cmp    $0x0,%rax
je     117a <print+0x4a>
mov    $0x31,%edi
call   1030 <putchar@plt>
jmp    1184 <print+0x54>
mov    $0x30,%edi
call   1030 <putchar@plt>
jmp    1189 <print+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <print+0x13>
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbp
push   %r14
push   %rbx
mov    0x2eb5(%rip),%r14
cmpl   $0x2,(%r14)
jl     1163 <print+0x43>
mov    %rdi,%rbx
mov    $0x1,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <sigismember@plt>
cmp    $0x1,%rax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    (%r14),%ebp
jl     1140 <print+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@NSIG = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @print(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 1, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %3
%6 = load i32, i32* @NSIG
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %21
8: ; preds = %4
%9 = load i32*, i32** %2
%10 = load i32, i32* %3
%11 = call i64 @sigismember(i32* %9, i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 @putchar(i8 signext 49)
br label %17
15: ; preds = %8
%16 = call i32 @putchar(i8 signext 48)
br label %17
17: ; preds = %15, %13
br label %18
18: ; preds = %17
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@NSIG = global i32 0
define void @print(i32* %0) {
%2 = load i32, i32* @NSIG
%3 = icmp sgt i32 %2, 1
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i32 [ %10, %4 ], [ 1, %1 ]
%6 = tail call i64 @sigismember(i32* %0, i32 %5)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8 48, i8 49
%9 = tail call i32 @putchar(i8 signext %8)
%10 = add nuw nsw i32 %5, 1
%11 = load i32, i32* @NSIG
%12 = icmp slt i32 %10, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
%14 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret void
}