#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 */
scalar_t__ EFBIG;
scalar_t__ EOVERFLOW;
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
char *strerror(scalar_t__);
void io_error(char *message) {
  char buf[(16384)];
  if ((errno == EOVERFLOW) || (errno == EFBIG))
    sprintf(buf, "Bonnie: drastic I/O error (%s): %s", message,
            strerror(errno));
  else
    sprintf(buf, "Bonnie: drastic I/O error (%s)", message);
  perror(buf);
  exit(1);
}


x86 assembly (clang, -O0):
<io_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4020,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%rax
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%rax
je     1183 <io_error+0x43>
mov    0x2e60(%rip),%rax
mov    (%rax),%rax
mov    0x2e66(%rip),%rcx
cmp    (%rcx),%rax
jne    11cf <io_error+0x8f>
lea    -0x4010(%rbp),%rax
mov    %rax,-0x4020(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x4018(%rbp)
mov    0x2e2d(%rip),%rax
mov    (%rax),%rdi
call   1060 <strerror@plt>
mov    -0x4020(%rbp),%rdi
mov    -0x4018(%rbp),%rdx
mov    %rax,%rcx
lea    0xe3d(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    11e8 <io_error+0xa8>
lea    -0x4010(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe42(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x4010(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<io_error>:
push   %rbx
sub    $0x4000,%rsp
mov    %rdi,%rbx
mov    0x2e7e(%rip),%rax
mov    (%rax),%rdi
mov    0x2e94(%rip),%rax
cmp    (%rax),%rdi
je     1183 <io_error+0x43>
mov    0x2e78(%rip),%rax
cmp    (%rax),%rdi
je     1183 <io_error+0x43>
lea    0xeaf(%rip),%rsi
mov    %rsp,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sprintf@plt>
jmp    119f <io_error+0x5f>
call   1060 <strerror@plt>
lea    0xe71(%rip),%rsi
mov    %rsp,%rdi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rsp,%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@EOVERFLOW = global i64 0
@EFBIG = global i64 0
@.str = [35 x i8] c"Bonnie: drastic I/O error (%s): %s\00"
@.str.1 = [31 x i8] c"Bonnie: drastic I/O error (%s)\00"
define void @io_error(i8* %0) {
%2 = alloca i8*
%3 = alloca [16384 x i8]
store i8* %0, i8** %2
%4 = load i64, i64* @errno
%5 = load i64, i64* @EOVERFLOW
%6 = icmp eq i64 %4, %5
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i64, i64* @errno
%9 = load i64, i64* @EFBIG
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %7, %1
%12 = getelementptr inbounds [16384 x i8], [16384 x i8]* %3, i64 0, i64 0
%13 = load i8*, i8** %2
%14 = load i64, i64* @errno
%15 = call i8* @strerror(i64 %14)
%16 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %12, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %15)
br label %21
17: ; preds = %7
%18 = getelementptr inbounds [16384 x i8], [16384 x i8]* %3, i64 0, i64 0
%19 = load i8*, i8** %2
%20 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %18, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %17, %11
%22 = getelementptr inbounds [16384 x i8], [16384 x i8]* %3, i64 0, i64 0
%23 = call i32 @perror(i8* %22)
%24 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@EOVERFLOW = global i64 0
@EFBIG = global i64 0
@.str = [35 x i8] c"Bonnie: drastic I/O error (%s): %s\00"
@.str.1 = [31 x i8] c"Bonnie: drastic I/O error (%s)\00"
define void @io_error(i8* %0) {
%2 = alloca [16384 x i8]
%3 = getelementptr inbounds [16384 x i8], [16384 x i8]* %2, i64 0, i64 0
%4 = load i64, i64* @errno
%5 = load i64, i64* @EOVERFLOW
%6 = icmp eq i64 %4, %5
%7 = load i64, i64* @EFBIG
%8 = icmp eq i64 %4, %7
%9 = select i1 %6, i1 true, i1 %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = tail call i8* @strerror(i64 %4)
%12 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %11)
br label %15
13: ; preds = %1
%14 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %15
15: ; preds = %13, %10
%16 = call i32 @perror(i8* %3)
%17 = tail call i32 @exit(i32 1)
unreachable
}