#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*/ SIGINT;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int sigismember(int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  sigset_t set;
  int sig_ret;
  sigemptyset(&set);
  sig_ret = sigismember(&set, SIGINT);
  printf("sig_ret is %d\n", sig_ret);
  sigaddset(&set, SIGINT);
  sig_ret = sigismember(&set, SIGINT);
  printf("sig_ret is %d\n", sig_ret);
  sigfillset(&set);
  return 0;
}


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   1060 <sigismember@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%esi
lea    -0x14(%rbp),%rdi
call   1070 <sigaddset@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%esi
lea    -0x14(%rbp),%rdi
call   1060 <sigismember@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
lea    -0x14(%rbp),%rdi
call   1050 <sigfillset@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2e7b(%rip),%r15
mov    (%r15),%esi
mov    %rbx,%rdi
call   1060 <sigismember@plt>
lea    0xe81(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%r15),%esi
mov    %rbx,%rdi
call   1070 <sigaddset@plt>
mov    (%r15),%esi
mov    %rbx,%rdi
call   1060 <sigismember@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <sigfillset@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [15 x i8] c"sig_ret is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @sigemptyset(i32* %6)
%9 = load i32, i32* @SIGINT
%10 = call i32 @sigismember(i32* %6, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @SIGINT
%14 = call i32 @sigaddset(i32* %6, i32 %13)
%15 = load i32, i32* @SIGINT
%16 = call i32 @sigismember(i32* %6, i32 %15)
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = call i32 @sigfillset(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@SIGINT = global i32 0
@.str = [15 x i8] c"sig_ret is %d\0A\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* @SIGINT
%7 = call i32 @sigismember(i32* %3, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @SIGINT
%10 = call i32 @sigaddset(i32* %3, i32 %9)
%11 = load i32, i32* @SIGINT
%12 = call i32 @sigismember(i32* %3, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 @sigfillset(i32* %3)
ret i32 0
}