#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*/ SIGABRT;
int /*<<< orphan*/ SIG_UNBLOCK;
int /*<<< orphan*/ __stdio_flushall();
int /*<<< orphan*/ exit(int);
scalar_t__ raise(int /*<<< orphan*/);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/);
void abort() {
  sigset_t t;
  __stdio_flushall();
  if (!sigemptyset(&t) && !sigaddset(&t, SIGABRT))
    sigprocmask(SIG_UNBLOCK, &t, 0);
  while (1)
    if (raise(SIGABRT))
      exit(127);
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <__stdio_flushall@plt>
lea    -0x4(%rbp),%rdi
call   1050 <sigemptyset@plt>
cmp    $0x0,%eax
jne    11b0 <abort+0x50>
mov    0x2e50(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1080 <sigaddset@plt>
cmp    $0x0,%eax
jne    11b0 <abort+0x50>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
jmp    11b5 <abort+0x55>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
call   1040 <raise@plt>
cmp    $0x0,%rax
je     11d7 <abort+0x77>
mov    $0x7f,%edi
call   1070 <exit@plt>
jmp    11b5 <abort+0x55>

x86 assembly (clang, -O2):
<abort>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1060 <__stdio_flushall@plt>
lea    0xc(%rsp),%rdi
call   1050 <sigemptyset@plt>
test   %eax,%eax
jne    11a6 <abort+0x46>
mov    0x2e57(%rip),%rax
mov    (%rax),%esi
lea    0xc(%rsp),%rdi
call   1080 <sigaddset@plt>
test   %eax,%eax
jne    11a6 <abort+0x46>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
mov    0x2e2b(%rip),%rbx
nopl   (%rax)
mov    (%rbx),%edi
call   1040 <raise@plt>
test   %rax,%rax
je     11b0 <abort+0x50>
mov    $0x7f,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
@SIG_UNBLOCK = global i32 0
define void @abort() {
%1 = alloca i32
%2 = call i32 (...) @__stdio_flushall()
%3 = call i32 @sigemptyset(i32* %1)
%4 = icmp ne i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %0
%6 = load i32, i32* @SIGABRT
%7 = call i32 @sigaddset(i32* %1, i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = load i32, i32* @SIG_UNBLOCK
%11 = call i32 @sigprocmask(i32 %10, i32* %1, i32 0)
br label %12
12: ; preds = %9, %5, %0
br label %13
13: ; preds = %12, %19
%14 = load i32, i32* @SIGABRT
%15 = call i64 @raise(i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 @exit(i32 127)
unreachable
19: ; preds = %13
br label %13
}

LLVM IR (-O2):
@SIGABRT = global i32 0
@SIG_UNBLOCK = global i32 0
define void @abort() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @__stdio_flushall()
%4 = call i32 @sigemptyset(i32* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load i32, i32* @SIGABRT
%8 = call i32 @sigaddset(i32* %1, i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* @SIG_UNBLOCK
%12 = call i32 @sigprocmask(i32 %11, i32* %1, i32 0)
br label %13
13: ; preds = %10, %6, %0
br label %14
14: ; preds = %13, %14
%15 = load i32, i32* @SIGABRT
%16 = call i64 @raise(i32 %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %14, label %18
18: ; preds = %14
%19 = call i32 @exit(i32 127)
unreachable
}