#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void bailer(const char *s1, const char *s2, const char *s3) {
  fprintf(stderr, "ERROR");
  if (s1)
    fprintf(stderr, ": %s", s1);
  if (s2)
    fprintf(stderr, ": %s", s2);
  if (s3)
    fprintf(stderr, ": %s", s3);
  fprintf(stderr, "\n");
  fflush(stderr);
}


x86 assembly (clang, -O0):
<bailer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1171 <bailer+0x51>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe9c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x10(%rbp)
je     1197 <bailer+0x77>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x18(%rbp)
je     11bd <bailer+0x9d>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe50(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
lea    0xe3e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e05(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bailer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    0x2ea8(%rip),%r12
mov    (%r12),%edi
lea    0xebd(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %rbx,%rbx
je     1164 <bailer+0x44>
mov    (%r12),%edi
lea    0xeac(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %r15,%r15
je     117e <bailer+0x5e>
mov    (%r12),%edi
lea    0xe92(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %r14,%r14
je     1198 <bailer+0x78>
mov    (%r12),%edi
lea    0xe78(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
lea    0xe68(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"ERROR\00"
@.str.1 = [5 x i8] c": %s\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @bailer(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %4
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %11, %3
%16 = load i8*, i8** %5
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %5
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %20)
br label %22
22: ; preds = %18, %15
%23 = load i8*, i8** %6
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = load i32, i32* @stderr
%27 = load i8*, i8** %6
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %27)
br label %29
29: ; preds = %25, %22
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = call i32 @fflush(i32 %32)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"ERROR\00"
@.str.1 = [5 x i8] c": %s\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @bailer(i8* %0, i8* %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %0, null
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %10
10: ; preds = %7, %3
%11 = icmp eq i8* %1, null
br i1 %11, label %15, label %12
12: ; preds = %10
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %15
15: ; preds = %12, %10
%16 = icmp eq i8* %2, null
br i1 %16, label %20, label %17
17: ; preds = %15
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %20
20: ; preds = %17, %15
%21 = load i32, i32* @stderr
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%23 = load i32, i32* @stderr
%24 = tail call i32 @fflush(i32 %23)
ret void
}