#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*/ SIGKILL;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigismember(int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(void) {
  sigset_t sig_set;
  sigemptyset(&sig_set);
  sigaddset(&sig_set, SIGKILL);
  if ((sigismember(&sig_set, SIGKILL)) == 1)
    printf("SIGKILL has been set\n");
  else
    printf("can’t set signal set\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdi
call   1060 <sigaddset@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigismember@plt>
cmp    $0x1,%eax
jne    1196 <main+0x56>
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
jmp    11a2 <main+0x62>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2e88(%rip),%r14
mov    (%r14),%esi
mov    %rbx,%rdi
call   1060 <sigaddset@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
call   1050 <sigismember@plt>
cmp    $0x1,%eax
lea    0xe9f(%rip),%rax
lea    0xe81(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIGKILL = global i32 0
@.str = [22 x i8] c"SIGKILL has been set\0A\00"
@.str.1 = [24 x i8] c"can\E2\80\99t set signal set\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @sigemptyset(i32* %2)
%4 = load i32, i32* @SIGKILL
%5 = call i32 @sigaddset(i32* %2, i32 %4)
%6 = load i32, i32* @SIGKILL
%7 = call i32 @sigismember(i32* %2, i32 %6)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
@SIGKILL = global i32 0
@str = [23 x i8] c"can\E2\80\99t set signal set\00"
@str.2 = [21 x i8] c"SIGKILL has been set\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = load i32, i32* @SIGKILL
%5 = call i32 @sigaddset(i32* %1, i32 %4)
%6 = load i32, i32* @SIGKILL
%7 = call i32 @sigismember(i32* %1, i32 %6)
%8 = icmp eq i32 %7, 1
%9 = select i1 %8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}