#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 */

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ putstr(char const *);
int /*<<< orphan*/ stdout;
void bail_out(const char *reason) {
  putstr("Bail out!");
  if (reason != NULL) {
    fputc((' '), stdout);
    fputc((' '), stdout);
    putstr(reason);
  }
  fputc(('\n'), stdout);
  fflush(stdout);
  exit(-1);
}


x86 assembly (clang, -O0):
<bail_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1050 <putstr@plt>
cmpq   $0x0,-0x8(%rbp)
je     1192 <bail_out+0x52>
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rdi
call   1050 <putstr@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    0x2e34(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<bail_out>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeb2(%rip),%rdi
call   1050 <putstr@plt>
test   %rbx,%rbx
je     1181 <bail_out+0x41>
mov    0x2e81(%rip),%r14
mov    (%r14),%esi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    (%r14),%esi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    %rbx,%rdi
call   1050 <putstr@plt>
mov    0x2e58(%rip),%rbx
mov    (%rbx),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Bail out!\00"
@stdout = global i32 0
define void @bail_out(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* @stdout
%8 = call i32 @fputc(i8 signext 32, i32 %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fputc(i8 signext 32, i32 %9)
%11 = load i8*, i8** %2
%12 = call i32 @putstr(i8* %11)
br label %13
13: ; preds = %6, %1
%14 = load i32, i32* @stdout
%15 = call i32 @fputc(i8 signext 10, i32 %14)
%16 = load i32, i32* @stdout
%17 = call i32 @fflush(i32 %16)
%18 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"Bail out!\00"
@stdout = global i32 0
define void @bail_out(i8* %0) {
%2 = tail call i32 @putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %0, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputc(i8 signext 32, i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fputc(i8 signext 32, i32 %7)
%9 = tail call i32 @putstr(i8* %0)
br label %10
10: ; preds = %4, %1
%11 = load i32, i32* @stdout
%12 = tail call i32 @fputc(i8 signext 10, i32 %11)
%13 = load i32, i32* @stdout
%14 = tail call i32 @fflush(i32 %13)
%15 = tail call i32 @exit(i32 -1)
unreachable
}