#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;
int O_CREAT;
int O_EXCL;
int O_RDWR;
int /*<<< orphan*/ O_SYNC;
int S_IRUSR;
int S_IWUSR;
int /*<<< orphan*/ _SC_ASYNCHRONOUS_IO;
int aio_error(struct aiocb *);
scalar_t__ aio_fsync(int /*<<< orphan*/, struct aiocb *);
scalar_t__ aio_return(struct aiocb *);
int aio_write(struct aiocb *);
int /*<<< orphan*/ close(int);
int 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 = 0;
  struct aiocb aiocb_write;
  struct aiocb aiocb_fsync;
  if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L)
    return 4;
  snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_fsync_4_1_%d", getpid());
  unlink(tmpfname);
  fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR);
  if (fd == -1) {
    printf("aio_fsync/4-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/4-1.c"
           " Error at aio_write(): %s\n",
           strerror(errno));
    exit(1);
  }
  memset(&aiocb_fsync, 0, sizeof(aiocb_fsync));
  aiocb_fsync.aio_fildes = fd;
  if (aio_fsync(O_SYNC, &aiocb_fsync) != 0) {
    printf("aio_fsync/4-1.c"
           " Error at aio_fsync()\n");
    exit(1);
  }
  do {
    struct timespec completion_wait_ts = {0, 10000000};
    nanosleep(&completion_wait_ts, NULL);
    ret = aio_error(&aiocb_fsync);
  } while (ret == EINPROGRESS);
  if (ret < 0) {
    printf("aio_fsync/4-1.c"
           " Error at aio_error() : %s\n",
           strerror(ret));
    exit(1);
  }
  if (aio_return(&aiocb_fsync)) {
    printf("aio_fsync/4-1.c"
           " Error at aio_return()\n");
    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)
movl   $0x0,-0x188(%rbp)
mov    0x2db5(%rip),%rax
mov    (%rax),%edi
call   10f0 <sysconf@plt>
cmp    $0x30db0,%rax
jge    1232 <main+0x42>
movl   $0x4,-0x4(%rbp)
jmp    1484 <main+0x294>
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    0xda4(%rip),%rdx
call   1070 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <unlink@plt>
lea    -0x110(%rbp),%rdi
mov    0x2d7d(%rip),%rax
mov    (%rax),%esi
mov    0x2d5c(%rip),%rax
or     (%rax),%esi
mov    0x2d23(%rip),%rax
or     (%rax),%esi
mov    0x2d0a(%rip),%rax
mov    (%rax),%edx
mov    0x2d21(%rip),%rax
or     (%rax),%edx
call   10e0 <open@plt>
mov    %eax,-0x184(%rbp)
cmpl   $0xffffffff,-0x184(%rbp)
jne    12e2 <main+0xf2>
mov    0x2ce8(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    %rax,%rsi
lea    0xd49(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x2,%edi
call   1100 <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    1363 <main+0x173>
mov    0x2c67(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    %rax,%rsi
lea    0xced(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1100 <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    0x2c4f(%rip),%rax
mov    (%rax),%edi
lea    -0x1b8(%rbp),%rsi
call   10d0 <aio_fsync@plt>
cmp    $0x0,%rax
je     13b9 <main+0x1c9>
lea    0xcc1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
jmp    13be <main+0x1ce>
mov    0xd2b(%rip),%rax
mov    %rax,-0x1c0(%rbp)
lea    -0x1c0(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1080 <nanosleep@plt>
lea    -0x1b8(%rbp),%rdi
call   10b0 <aio_error@plt>
mov    %eax,-0x188(%rbp)
mov    -0x188(%rbp),%eax
mov    0x2bd5(%rip),%rcx
cmp    (%rcx),%eax
je     13be <main+0x1ce>
cmpl   $0x0,-0x188(%rbp)
jge    1436 <main+0x246>
mov    -0x188(%rbp),%edi
call   1110 <strerror@plt>
mov    %rax,%rsi
lea    0xc6a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    -0x1b8(%rbp),%rdi
call   10c0 <aio_return@plt>
cmp    $0x0,%rax
je     1464 <main+0x274>
lea    0xc67(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x184(%rbp),%edi
call   10a0 <close@plt>
lea    0xc6b(%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   %r12
push   %rbx
sub    $0x1b0,%rsp
mov    0x2db2(%rip),%rax
mov    (%rax),%edi
call   1100 <sysconf@plt>
mov    %rax,%rcx
mov    $0x4,%eax
cmp    $0x30db0,%rcx
jl     138c <main+0x18c>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xdc0(%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    0x2d92(%rip),%rax
mov    0x2d73(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2d38(%rip),%rax
or     (%rax),%esi
mov    0x2d1f(%rip),%rax
mov    0x2d38(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    %rbx,%rdi
call   10f0 <open@plt>
cmp    $0xffffffff,%eax
je     139c <main+0x19c>
mov    %eax,%r14d
lea    0xb0(%rsp),%rdi
call   1030 <unlink@plt>
lea    0x28(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   10a0 <memset@plt>
mov    %r14d,0x28(%rsp)
lea    0x40(%rsp),%rax
mov    %rax,0x30(%rsp)
movl   $0x6f,0x38(%rsp)
mov    %rbx,%rdi
call   1060 <aio_write@plt>
cmp    $0xffffffff,%eax
je     13c5 <main+0x1c5>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   10a0 <memset@plt>
mov    %r14d,0x10(%rsp)
mov    0x2ccf(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   10e0 <aio_fsync@plt>
test   %rax,%rax
jne    13dc <main+0x1dc>
movabs $0x98968000000000,%r15
lea    0x8(%rsp),%r12
lea    0x10(%rsp),%rbp
mov    0x2c99(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r15,0x8(%rsp)
mov    %r12,%rdi
xor    %esi,%esi
call   1090 <nanosleep@plt>
mov    %rbp,%rdi
call   10c0 <aio_error@plt>
cmp    (%rbx),%eax
je     1340 <main+0x140>
test   %eax,%eax
js     13e5 <main+0x1e5>
lea    0x10(%rsp),%rdi
call   10d0 <aio_return@plt>
test   %rax,%rax
jne    1407 <main+0x207>
mov    %r14d,%edi
call   10b0 <close@plt>
lea    0xd0f(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c05(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xc69(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x2,%edi
call   1110 <exit@plt>
mov    0x2bdc(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xc65(%rip),%rdi
jmp    13f3 <main+0x1f3>
lea    0xce3(%rip),%rdi
jmp    140e <main+0x20e>
mov    %eax,%edi
call   1120 <strerror@plt>
lea    0xc76(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    0xc92(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1110 <exit@plt>

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

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