#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*/ abort();
scalar_t__ foo();
scalar_t__ sigfillset(int /*<<< orphan*/ *);
scalar_t__ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
int main() {
  sigset_t set;
  if (sigfillset(&set))
    abort();
  if (sigprocmask(SIG_BLOCK, &set, NULL))
    abort();
  if (foo() <= 0)
    abort();
  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   1050 <sigfillset@plt>
cmp    $0x0,%rax
je     1169 <main+0x29>
mov    $0x0,%al
call   1040 <abort@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
cmp    $0x0,%rax
je     1190 <main+0x50>
mov    $0x0,%al
call   1040 <abort@plt>
mov    $0x0,%al
call   1060 <foo@plt>
cmp    $0x0,%rax
jg     11a8 <main+0x68>
mov    $0x0,%al
call   1040 <abort@plt>
jmp    11ad <main+0x6d>
jmp    11ad <main+0x6d>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1050 <sigfillset@plt>
test   %rax,%rax
jne    1182 <main+0x42>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
test   %rax,%rax
jne    1182 <main+0x42>
xor    %eax,%eax
call   1060 <foo@plt>
test   %rax,%rax
jle    1182 <main+0x42>
cs nopw 0x0(%rax,%rax,1)
jmp    1180 <main+0x40>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i64 @sigfillset(i32* %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = load i32, i32* @SIG_BLOCK
%9 = call i64 @sigprocmask(i32 %8, i32* %2, i32* null)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %7
%14 = call i64 (...) @foo()
%15 = icmp sle i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %13
br label %19
19: ; preds = %19, %18
br label %19
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @sigfillset(i32* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = load i32, i32* @SIG_BLOCK
%9 = call i64 @sigprocmask(i32 %8, i32* %1, i32* null)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %7
%14 = call i64 (...) @foo()
%15 = icmp slt i64 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %13, %18
br label %18
}