#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*/ SIG_BLOCK;
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void handler(int num) {
  printf("%d\n", num);
  sigset_t mask;
  sigprocmask(SIG_BLOCK, NULL, &mask);
  int *p = (void *)&mask;
  printf("0x%x, 0x%x\n", p[0], p[1]);
  return;
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x8(%rbp),%rdx
call   1030 <sigprocmask@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rdx
xor    %esi,%esi
call   1030 <sigprocmask@plt>
mov    0x4(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@SIG_BLOCK = global i32 0
@.str.1 = [12 x i8] c"0x%x, 0x%x\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @SIG_BLOCK
%8 = call i32 @sigprocmask(i32 %7, i32* null, i32* %3)
%9 = bitcast i32* %3 to i8*
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %4
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@SIG_BLOCK = global i32 0
@.str.1 = [12 x i8] c"0x%x, 0x%x\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* @SIG_BLOCK
%6 = call i32 @sigprocmask(i32 %5, i32* null, i32* %2)
%7 = load i32, i32* %2
%8 = getelementptr inbounds i32, i32* %2, i64 1
%9 = load i32, i32* %8
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %9)
ret void
}