#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;
typedef int /*<<< orphan*/ sigjmp_buf;

/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ siglongjmp(int /*<<< orphan*/, int);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
int sigsetjmp(int /*<<< orphan*/, int);
main() {
  int code;
  sigset_t set, oset;
  sigjmp_buf xx;
  sigemptyset(&set);
  sigemptyset(&oset);
  sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &set);
  sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset);
  code = sigsetjmp(xx, 1);
  if (code)
    exit(0);
  sigaddset(&set, SIGINT);
  sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL);
  siglongjmp(xx, 10);
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <sigemptyset@plt>
lea    -0x10(%rbp),%rdi
call   1050 <sigemptyset@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0xc(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x10(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    -0x14(%rbp),%edi
mov    $0x1,%esi
call   1060 <sigsetjmp@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11ce <main+0x6e>
xor    %edi,%edi
call   1070 <exit@plt>
mov    0x2e13(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1080 <sigaddset@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
mov    -0x14(%rbp),%edi
mov    $0xa,%esi
call   1040 <siglongjmp@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsp,%r15
mov    %r15,%rdi
call   1050 <sigemptyset@plt>
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <sigemptyset@plt>
mov    0x2e51(%rip),%r12
mov    (%r12),%edi
xor    %eax,%eax
mov    %eax,%ebx
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <sigprocmask@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <sigprocmask@plt>
mov    $0x1,%esi
call   1060 <sigsetjmp@plt>
test   %eax,%eax
jne    11e5 <main+0x85>
mov    0x2e2a(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1080 <sigaddset@plt>
mov    (%r12),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rbx,%rsi
call   1030 <sigprocmask@plt>
mov    $0xa,%esi
call   1040 <siglongjmp@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
@SIGINT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @sigemptyset(i32* %3)
%7 = call i32 @sigemptyset(i32* %4)
%8 = load i32, i32* @SIG_BLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* null, i32* %3)
%10 = load i32, i32* @SIG_BLOCK
%11 = call i32 @sigprocmask(i32 %10, i32* null, i32* %4)
%12 = load i32, i32* %5
%13 = call i32 @sigsetjmp(i32 %12, i32 1)
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %0
%19 = load i32, i32* @SIGINT
%20 = call i32 @sigaddset(i32* %3, i32 %19)
%21 = load i32, i32* @SIG_BLOCK
%22 = call i32 @sigprocmask(i32 %21, i32* %3, i32* null)
%23 = load i32, i32* %5
%24 = call i32 @siglongjmp(i32 %23, i32 10)
unreachable
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
@SIGINT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @sigemptyset(i32* %1)
%6 = call i32 @sigemptyset(i32* %2)
%7 = load i32, i32* @SIG_BLOCK
%8 = call i32 @sigprocmask(i32 %7, i32* null, i32* %1)
%9 = load i32, i32* @SIG_BLOCK
%10 = call i32 @sigprocmask(i32 %9, i32* null, i32* %2)
%11 = call i32 @sigsetjmp(i32 undef, i32 1)
%12 = icmp eq i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %0
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %0
%16 = load i32, i32* @SIGINT
%17 = call i32 @sigaddset(i32* %1, i32 %16)
%18 = load i32, i32* @SIG_BLOCK
%19 = call i32 @sigprocmask(i32 %18, i32* %1, i32* null)
%20 = call i32 @siglongjmp(i32 undef, i32 10)
unreachable
}