#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*/ SIGALRM;
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sigdelset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main() {
  sigset_t mask;
  sigfillset(&mask);
  sigdelset(&mask, SIGALRM);
  sigprocmask(SIG_SETMASK, &mask, 0);
  printf("Signals are blocked\n");
  fflush(stdout);
  alarm(60);
  for (;;)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1060 <sigfillset@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdi
call   1080 <sigdelset@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
lea    0xe5b(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0x3c,%edi
call   1050 <alarm@plt>
jmp    11c2 <main+0x62>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <sigfillset@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1080 <sigdelset@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
lea    0xe63(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    $0x3c,%edi
call   1050 <alarm@plt>
nopw   0x0(%rax,%rax,1)
jmp    11c0 <main+0x60>

LLVM IR (-O0):
@SIGALRM = global i32 0
@SIG_SETMASK = global i32 0
@.str = [21 x i8] c"Signals are blocked\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @sigfillset(i32* %2)
%4 = load i32, i32* @SIGALRM
%5 = call i32 @sigdelset(i32* %2, i32 %4)
%6 = load i32, i32* @SIG_SETMASK
%7 = call i32 @sigprocmask(i32 %6, i32* %2, i32 0)
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
%11 = call i32 @alarm(i32 60)
br label %12
12: ; preds = %12, %0
br label %12
}

LLVM IR (-O2):
@SIGALRM = global i32 0
@SIG_SETMASK = global i32 0
@stdout = global i32 0
@str = [20 x i8] c"Signals are blocked\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
%4 = load i32, i32* @SIGALRM
%5 = call i32 @sigdelset(i32* %1, i32 %4)
%6 = load i32, i32* @SIG_SETMASK
%7 = call i32 @sigprocmask(i32 %6, i32* %1, i32 0)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
%11 = call i32 @alarm(i32 60)
br label %12
12: ; preds = %12, %0
br label %12
}