#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*/ tmpfname;
struct timespec {
  int member_1;
  int /*<<< orphan*/ member_0;
};
struct aiocb {
  int aio_fildes;
  char *aio_buf;
  int aio_nbytes;
};
typedef int /*<<< orphan*/ aiocb_write;
typedef int /*<<< orphan*/ aiocb_fsync;

/* Variables and functions */
int EINPROGRESS;
scalar_t__ EINVAL;
int O_CREAT;
int O_EXCL;
int O_RDWR;
int S_IRUSR;
int S_IWUSR;
int /*<<< orphan*/ _SC_ASYNCHRONOUS_IO;
int aio_error(struct aiocb *);
int aio_fsync(int, struct aiocb *);
int aio_write(struct aiocb *);
int /*<<< orphan*/ close(int);
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int getpid();
int /*<<< orphan*/ memset(struct aiocb *, int /*<<< orphan*/, int);
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
int open(char *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *strerror(int);
long sysconf(int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char *);
int main(void) {
  char tmpfname[256];
  char buf[111];
  int fd;
  int ret;
  struct aiocb aiocb_write;
  struct aiocb aiocb_fsync;
  struct timespec aio_wait_ts = {0, 10000000};
  if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L)
    return 4;
  snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_fsync_14_1_%d", getpid());
  unlink(tmpfname);
  fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR);
  if (fd == -1) {
    printf("aio_fsync/14-1.c"
           " Error at open(): %s\n",
           strerror(errno));
    exit(2);
  }
  unlink(tmpfname);
  memset(&aiocb_write, 0, sizeof(aiocb_write));
  aiocb_write.aio_fildes = fd;
  aiocb_write.aio_buf = buf;
  aiocb_write.aio_nbytes = 111;
  if (aio_write(&aiocb_write) == -1) {
    printf("aio_fsync/14-1.c"
           " Error at aio_write(): %s\n",
           strerror(errno));
    exit(1);
  }
  do {
    nanosleep(&aio_wait_ts, NULL);
    ret = aio_error(&aiocb_write);
  } while (ret == EINPROGRESS);
  if (ret < 0) {
    printf("aio_fsync/14-1.c"
           " Error at aio_error() : %s\n",
           strerror(ret));
    exit(1);
  }
  memset(&aiocb_fsync, 0, sizeof(aiocb_fsync));
  aiocb_fsync.aio_fildes = fd;
  if (aio_fsync(-1, &aiocb_fsync) != -1) {
    printf("aio_fsync/14-1.c"
           " aio_fsync() accepts bad op\n");
    exit(1);
  }
  if (errno != EINVAL) {
    printf("aio_fsync/14-1.c"
           " errno is not EINVAL (%d)\n",
           errno);
    exit(1);
  }
  close(fd);
  printf("Test PASSED\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe07(%rip),%rax
mov    %rax,-0x1c0(%rbp)
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
call   10e0 <sysconf@plt>
cmp    $0x30db0,%rax
jge    1226 <main+0x46>
movl   $0x4,-0x4(%rbp)
jmp    1479 <main+0x299>
lea    -0x110(%rbp),%rax
mov    %rax,-0x1c8(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    -0x1c8(%rbp),%rdi
mov    %eax,%ecx
mov    $0x100,%esi
lea    0xdb8(%rip),%rdx
call   1070 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <unlink@plt>
lea    -0x110(%rbp),%rdi
mov    0x2d89(%rip),%rax
mov    (%rax),%esi
mov    0x2d68(%rip),%rax
or     (%rax),%esi
mov    0x2d37(%rip),%rax
or     (%rax),%esi
mov    0x2d1e(%rip),%rax
mov    (%rax),%edx
mov    0x2d35(%rip),%rax
or     (%rax),%edx
call   10d0 <open@plt>
mov    %eax,-0x184(%rbp)
cmpl   $0xffffffff,-0x184(%rbp)
jne    12d9 <main+0xf9>
mov    0x2cfc(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edi
call   1100 <strerror@plt>
mov    %rax,%rsi
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x2,%edi
call   10f0 <exit@plt>
lea    -0x110(%rbp),%rdi
call   1030 <unlink@plt>
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1090 <memset@plt>
mov    -0x184(%rbp),%eax
mov    %eax,-0x1a0(%rbp)
lea    -0x180(%rbp),%rax
mov    %rax,-0x198(%rbp)
movl   $0x6f,-0x190(%rbp)
lea    -0x1a0(%rbp),%rdi
call   1050 <aio_write@plt>
cmp    $0xffffffff,%eax
jne    135d <main+0x17d>
mov    0x2c78(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edi
call   1100 <strerror@plt>
mov    %rax,%rsi
lea    0xcfd(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
jmp    1362 <main+0x182>
lea    -0x1c0(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1080 <nanosleep@plt>
lea    -0x1a0(%rbp),%rdi
call   10b0 <aio_error@plt>
mov    %eax,-0x188(%rbp)
mov    -0x188(%rbp),%eax
mov    0x2c47(%rip),%rcx
cmp    (%rcx),%eax
je     1362 <main+0x182>
cmpl   $0x0,-0x188(%rbp)
jge    13cc <main+0x1ec>
mov    -0x188(%rbp),%edi
call   1100 <strerror@plt>
mov    %rax,%rsi
lea    0xcb9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    -0x1b8(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1090 <memset@plt>
mov    -0x184(%rbp),%eax
mov    %eax,-0x1b8(%rbp)
mov    $0xffffffff,%edi
lea    -0x1b8(%rbp),%rsi
call   10c0 <aio_fsync@plt>
cmp    $0xffffffff,%eax
je     141d <main+0x23d>
lea    0xc94(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    0x2b8c(%rip),%rax
mov    (%rax),%rax
mov    0x2b72(%rip),%rcx
cmp    (%rcx),%rax
je     1459 <main+0x279>
mov    0x2b72(%rip),%rax
mov    (%rax),%rsi
lea    0xc85(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x184(%rbp),%edi
call   10a0 <close@plt>
lea    0xc8d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x1b8,%rsp
movabs $0x98968000000000,%rax
mov    %rax,0x8(%rsp)
mov    0x2dbd(%rip),%rax
mov    (%rax),%edi
call   10f0 <sysconf@plt>
mov    %rax,%rcx
mov    $0x4,%eax
cmp    $0x30db0,%rcx
jl     137d <main+0x18d>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xdc3(%rip),%rdx
lea    0xb0(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %eax,%ecx
call   1080 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    0x2d95(%rip),%rax
mov    0x2d76(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2d43(%rip),%rax
or     (%rax),%esi
mov    0x2d2a(%rip),%rax
mov    0x2d43(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    %rbx,%rdi
call   10e0 <open@plt>
cmp    $0xffffffff,%eax
je     138b <main+0x19b>
mov    %eax,%r14d
lea    0xb0(%rsp),%rdi
call   1030 <unlink@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   10a0 <memset@plt>
mov    %r14d,0x10(%rsp)
lea    0x40(%rsp),%rax
mov    %rax,0x18(%rsp)
movl   $0x6f,0x20(%rsp)
mov    %rbx,%rdi
call   1060 <aio_write@plt>
cmp    $0xffffffff,%eax
je     13b4 <main+0x1c4>
lea    0x8(%rsp),%r15
lea    0x10(%rsp),%rbp
mov    0x2ce1(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %esi,%esi
call   1090 <nanosleep@plt>
mov    %rbp,%rdi
call   10c0 <aio_error@plt>
cmp    (%rbx),%eax
je     1300 <main+0x110>
test   %eax,%eax
js     13cb <main+0x1db>
lea    0x28(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   10a0 <memset@plt>
mov    %r14d,0x28(%rsp)
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   10d0 <aio_fsync@plt>
cmp    $0xffffffff,%eax
jne    13de <main+0x1ee>
mov    0x2c5c(%rip),%rax
mov    (%rax),%rsi
mov    0x2c42(%rip),%rax
cmp    (%rax),%rsi
jne    13f4 <main+0x204>
mov    %r14d,%edi
call   10b0 <close@plt>
lea    0xd4d(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x1b8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c1e(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
lea    0xc7b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x2,%edi
call   1100 <exit@plt>
mov    0x2bf5(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
lea    0xc78(%rip),%rdi
jmp    13d9 <main+0x1e9>
mov    %eax,%edi
call   1110 <strerror@plt>
lea    0xc93(%rip),%rdi
mov    %rax,%rsi
jmp    13fb <main+0x20b>
lea    0xcea(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xc9d(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
%struct.aiocb = type { i32, i8*, i32 }
@__const.main.aio_wait_ts = %struct.timespec { i32 0, i32 10000000 }
@_SC_ASYNCHRONOUS_IO = global i32 0
@.str = [27 x i8] c"/tmp/pts_aio_fsync_14_1_%d\00"
@O_CREAT = global i32 0
@O_RDWR = global i32 0
@O_EXCL = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@.str.1 = [38 x i8] c"aio_fsync/14-1.c Error at open(): %s\0A\00"
@errno = global i64 0
@.str.2 = [43 x i8] c"aio_fsync/14-1.c Error at aio_write(): %s\0A\00"
@EINPROGRESS = global i32 0
@.str.3 = [44 x i8] c"aio_fsync/14-1.c Error at aio_error() : %s\0A\00"
@.str.4 = [45 x i8] c"aio_fsync/14-1.c aio_fsync() accepts bad op\0A\00"
@EINVAL = global i64 0
@.str.5 = [43 x i8] c"aio_fsync/14-1.c errno is not EINVAL (%d)\0A\00"
@.str.6 = [13 x i8] c"Test PASSED\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca [111 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.aiocb
%7 = alloca %struct.aiocb
%8 = alloca %struct.timespec
store i32 0, i32* %1
%9 = bitcast %struct.timespec* %8 to i8*
%10 = load i32, i32* @_SC_ASYNCHRONOUS_IO
%11 = call i64 @sysconf(i32 %10)
%12 = icmp slt i64 %11, 200112
br i1 %12, label %13, label %14
13: ; preds = %0
store i32 4, i32* %1
br label %92
14: ; preds = %0
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%16 = call i32 (...) @getpid()
%17 = call i32 @snprintf(i8* %15, i32 256, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%19 = call i32 @unlink(i8* %18)
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%21 = load i32, i32* @O_CREAT
%22 = load i32, i32* @O_RDWR
%23 = or i32 %21, %22
%24 = load i32, i32* @O_EXCL
%25 = or i32 %23, %24
%26 = load i32, i32* @S_IRUSR
%27 = load i32, i32* @S_IWUSR
%28 = or i32 %26, %27
%29 = call i32 @open(i8* %20, i32 %25, i32 %28)
store i32 %29, i32* %4
%30 = load i32, i32* %4
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %38
32: ; preds = %14
%33 = load i64, i64* @errno
%34 = trunc i64 %33 to i32
%35 = call i8* @strerror(i32 %34)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %35)
%37 = call i32 @exit(i32 2)
unreachable
38: ; preds = %14
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%40 = call i32 @unlink(i8* %39)
%41 = call i32 @memset(%struct.aiocb* %6, i32 0, i32 24)
%42 = load i32, i32* %4
%43 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %6, i32 0, i32 0
store i32 %42, i32* %43
%44 = getelementptr inbounds [111 x i8], [111 x i8]* %3, i64 0, i64 0
%45 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %6, i32 0, i32 1
store i8* %44, i8** %45
%46 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %6, i32 0, i32 2
store i32 111, i32* %46
%47 = call i32 @aio_write(%struct.aiocb* %6)
%48 = icmp eq i32 %47, -1
br i1 %48, label %49, label %55
49: ; preds = %38
%50 = load i64, i64* @errno
%51 = trunc i64 %50 to i32
%52 = call i8* @strerror(i32 %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %52)
%54 = call i32 @exit(i32 1)
unreachable
55: ; preds = %38
br label %56
56: ; preds = %59, %55
%57 = call i32 @nanosleep(%struct.timespec* %8, i32* null)
%58 = call i32 @aio_error(%struct.aiocb* %6)
store i32 %58, i32* %5
br label %59
59: ; preds = %56
%60 = load i32, i32* %5
%61 = load i32, i32* @EINPROGRESS
%62 = icmp eq i32 %60, %61
br i1 %62, label %56, label %63
63: ; preds = %59
%64 = load i32, i32* %5
%65 = icmp slt i32 %64, 0
br i1 %65, label %66, label %71
66: ; preds = %63
%67 = load i32, i32* %5
%68 = call i8* @strerror(i32 %67)
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i8* %68)
%70 = call i32 @exit(i32 1)
unreachable
71: ; preds = %63
%72 = call i32 @memset(%struct.aiocb* %7, i32 0, i32 24)
%73 = load i32, i32* %4
%74 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %7, i32 0, i32 0
store i32 %73, i32* %74
%75 = call i32 @aio_fsync(i32 -1, %struct.aiocb* %7)
%76 = icmp ne i32 %75, -1
br i1 %76, label %77, label %80
77: ; preds = %71
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
%79 = call i32 @exit(i32 1)
unreachable
80: ; preds = %71
%81 = load i64, i64* @errno
%82 = load i64, i64* @EINVAL
%83 = icmp ne i64 %81, %82
br i1 %83, label %84, label %88
84: ; preds = %80
%85 = load i64, i64* @errno
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i64 %85)
%87 = call i32 @exit(i32 1)
unreachable
88: ; preds = %80
%89 = load i32, i32* %4
%90 = call i32 @close(i32 %89)
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %1
br label %92
92: ; preds = %88, %13
%93 = load i32, i32* %1
ret i32 %93
}

LLVM IR (-O2):
%struct.aiocb = type { i32, i8*, i32 }
%struct.timespec = type { i32, i32 }
@_SC_ASYNCHRONOUS_IO = global i32 0
@.str = [27 x i8] c"/tmp/pts_aio_fsync_14_1_%d\00"
@O_CREAT = global i32 0
@O_RDWR = global i32 0
@O_EXCL = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@.str.1 = [38 x i8] c"aio_fsync/14-1.c Error at open(): %s\0A\00"
@errno = global i64 0
@.str.2 = [43 x i8] c"aio_fsync/14-1.c Error at aio_write(): %s\0A\00"
@EINPROGRESS = global i32 0
@.str.3 = [44 x i8] c"aio_fsync/14-1.c Error at aio_error() : %s\0A\00"
@EINVAL = global i64 0
@.str.5 = [43 x i8] c"aio_fsync/14-1.c errno is not EINVAL (%d)\0A\00"
@str = [12 x i8] c"Test PASSED\00"
@str.7 = [44 x i8] c"aio_fsync/14-1.c aio_fsync() accepts bad op\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca [111 x i8]
%3 = alloca %struct.aiocb
%4 = alloca %struct.aiocb
%5 = alloca i64
%6 = bitcast i64* %5 to %struct.timespec*
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [111 x i8], [111 x i8]* %2, i64 0, i64 0
%9 = bitcast %struct.aiocb* %3 to i8*
%10 = bitcast %struct.aiocb* %4 to i8*
%11 = bitcast i64* %5 to i8*
store i64 42949672960000000, i64* %5
%12 = load i32, i32* @_SC_ASYNCHRONOUS_IO
%13 = tail call i64 @sysconf(i32 %12)
%14 = icmp slt i64 %13, 200112
br i1 %14, label %78, label %15
15: ; preds = %0
%16 = tail call i32 (...) @getpid()
%17 = call i32 @snprintf(i8* %7, i32 256, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = call i32 @unlink(i8* %7)
%19 = load i32, i32* @O_CREAT
%20 = load i32, i32* @O_RDWR
%21 = or i32 %20, %19
%22 = load i32, i32* @O_EXCL
%23 = or i32 %21, %22
%24 = load i32, i32* @S_IRUSR
%25 = load i32, i32* @S_IWUSR
%26 = or i32 %25, %24
%27 = call i32 @open(i8* %7, i32 %23, i32 %26)
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %35
29: ; preds = %15
%30 = load i64, i64* @errno
%31 = trunc i64 %30 to i32
%32 = call i8* @strerror(i32 %31)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %32)
%34 = call i32 @exit(i32 2)
unreachable
35: ; preds = %15
%36 = call i32 @unlink(i8* %7)
%37 = call i32 @memset(%struct.aiocb* %3, i32 0, i32 24)
%38 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %3, i64 0, i32 0
store i32 %27, i32* %38
%39 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %3, i64 0, i32 1
store i8* %8, i8** %39
%40 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %3, i64 0, i32 2
store i32 111, i32* %40
%41 = call i32 @aio_write(%struct.aiocb* %3)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %49
43: ; preds = %35
%44 = load i64, i64* @errno
%45 = trunc i64 %44 to i32
%46 = call i8* @strerror(i32 %45)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %46)
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %35, %49
%50 = call i32 @nanosleep(%struct.timespec* %6, i32* null)
%51 = call i32 @aio_error(%struct.aiocb* %3)
%52 = load i32, i32* @EINPROGRESS
%53 = icmp eq i32 %51, %52
br i1 %53, label %49, label %54
54: ; preds = %49
%55 = icmp slt i32 %51, 0
br i1 %55, label %56, label %60
56: ; preds = %54
%57 = call i8* @strerror(i32 %51)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i8* %57)
%59 = call i32 @exit(i32 1)
unreachable
60: ; preds = %54
%61 = call i32 @memset(%struct.aiocb* %4, i32 0, i32 24)
%62 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %4, i64 0, i32 0
store i32 %27, i32* %62
%63 = call i32 @aio_fsync(i32 -1, %struct.aiocb* %4)
%64 = icmp eq i32 %63, -1
br i1 %64, label %68, label %65
65: ; preds = %60
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.7, i64 0, i64 0))
%67 = call i32 @exit(i32 1)
unreachable
68: ; preds = %60
%69 = load i64, i64* @errno
%70 = load i64, i64* @EINVAL
%71 = icmp eq i64 %69, %70
br i1 %71, label %75, label %72
72: ; preds = %68
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i64 %69)
%74 = call i32 @exit(i32 1)
unreachable
75: ; preds = %68
%76 = call i32 @close(i32 %27)
%77 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %78
78: ; preds = %0, %75
%79 = phi i32 [ 0, %75 ], [ 4, %0 ]
ret i32 %79
}