#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 EXIT_SUCCESS;
int SIGUSR1;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigdelset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
scalar_t__ sigismember(int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  sigset_t test_set;
  sigemptyset(&test_set);
  sigaddset(&test_set, SIGUSR1);
  if (sigismember(&test_set, SIGUSR1))
    printf("Segnale %d presente nel set\n", SIGUSR1);
  else
    printf("SIGUSR1 non presente\n");
  sigdelset(&test_set, SIGUSR1);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%esi
lea    -0x14(%rbp),%rdi
call   1070 <sigaddset@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%esi
lea    -0x14(%rbp),%rdi
call   1060 <sigismember@plt>
cmp    $0x0,%rax
je     11b9 <main+0x69>
mov    0x2e44(%rip),%rax
mov    (%rax),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c7 <main+0x77>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%esi
lea    -0x14(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <sigemptyset@plt>
mov    0x2e70(%rip),%r14
mov    (%r14),%esi
mov    %rbx,%rdi
call   1080 <sigaddset@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
call   1070 <sigismember@plt>
test   %rax,%rax
je     11a6 <main+0x46>
mov    (%r14),%esi
lea    0xe63(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11b2 <main+0x52>
lea    0xe70(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%esi
lea    0x4(%rsp),%rdi
call   1060 <sigdelset@plt>
mov    0x2e12(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIGUSR1 = global i32 0
@.str = [29 x i8] c"Segnale %d presente nel set\0A\00"
@.str.1 = [22 x i8] c"SIGUSR1 non presente\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @sigemptyset(i32* %6)
%8 = load i32, i32* @SIGUSR1
%9 = call i32 @sigaddset(i32* %6, i32 %8)
%10 = load i32, i32* @SIGUSR1
%11 = call i64 @sigismember(i32* %6, i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* @SIGUSR1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %18
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %13
%19 = load i32, i32* @SIGUSR1
%20 = call i32 @sigdelset(i32* %6, i32 %19)
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@.str = [29 x i8] c"Segnale %d presente nel set\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [21 x i8] c"SIGUSR1 non presente\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @sigemptyset(i32* %3)
%6 = load i32, i32* @SIGUSR1
%7 = call i32 @sigaddset(i32* %3, i32 %6)
%8 = load i32, i32* @SIGUSR1
%9 = call i64 @sigismember(i32* %3, i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* @SIGUSR1
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %16
14: ; preds = %2
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %16
16: ; preds = %14, %11
%17 = load i32, i32* @SIGUSR1
%18 = call i32 @sigdelset(i32* %3, i32 %17)
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}