#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);
int 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    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
jge    1197 <print+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x14(%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    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1143 <print+0x13>
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%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 i32 @print(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 1, i32* %4
br label %5
5: ; preds = %19, %1
%6 = load i32, i32* %4
%7 = load i32, i32* @NSIG
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %22
9: ; preds = %5
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = call i64 @sigismember(i32* %10, i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 @putchar(i8 signext 49)
br label %18
16: ; preds = %9
%17 = call i32 @putchar(i8 signext 48)
br label %18
18: ; preds = %16, %14
br label %19
19: ; preds = %18
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %5
22: ; preds = %5
%23 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
@NSIG = global i32 0
define i32 @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 i32 undef
}