#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 off_t;

/* Variables and functions */
int O_CREAT;
int O_RDWR;
int O_TRUNC;
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ memset(char *, int, int);
int open(char *, int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ pread(int, char *, int, int);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ pwrite(int, char *, int, int);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
int main(int argc, char *argv[]) {
  int fd, j;
  char *filename = "/tmp/junkfile";
  off_t pos;
  char *buf;
  if (argc > 1)
    filename = argv[1];
  buf = malloc(1024);
  if ((fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, 0666)) < 0) {
    perror("open");
    exit(errno);
  };
  for (j = 0; j < 4; j++) {
    memset(buf, '0' + j, 1024);
    pos = j * 1024;
    printf("Going to write at pos = %d\n", (int)pos);
    pwrite(fd, buf, 1024, pos);
    pos = lseek(fd, 0, SEEK_CUR);
    printf("After the %d'th write, the position is %d\n", j, (int)pos);
  }
  for (j = 0; j < 4; j++) {
    memset(buf, 0, 1024);
    pos = j * 1024;
    printf("Going to read at pos = %d\n", (int)pos);
    pread(fd, buf, 1024, pos);
    pos = lseek(fd, 0, SEEK_CUR);
    printf("After the %d'th read, the position is %d\n", j, (int)pos);
    write(STDOUT_FILENO, buf, 1024);
    write(STDOUT_FILENO, "\n\n", 2);
  }
  free(buf);
  close(fd);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe23(%rip),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11f7 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    $0x400,%edi
call   1090 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2dc0(%rip),%rax
mov    (%rax),%esi
mov    0x2ddf(%rip),%rax
or     (%rax),%esi
mov    0x2dce(%rip),%rax
or     (%rax),%esi
mov    $0x1b6,%edx
call   10b0 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1254 <main+0x94>
lea    0xdcd(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2d6b(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    12df <main+0x11f>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%esi
add    $0x30,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    -0x18(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x24(%rbp),%ecx
mov    $0x400,%edx
call   10a0 <pwrite@plt>
mov    -0x14(%rbp),%edi
mov    0x2d17(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <lseek@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    125b <main+0x9b>
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    1397 <main+0x1d7>
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    -0x18(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xd47(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x24(%rbp),%ecx
mov    $0x400,%edx
call   10d0 <pread@plt>
mov    -0x14(%rbp),%edi
mov    0x2c90(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <lseek@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2c81(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rsi
mov    $0x400,%edx
call   1040 <write@plt>
mov    0x2c6a(%rip),%rax
mov    (%rax),%edi
lea    0xd20(%rip),%rsi
mov    $0x2,%edx
call   1040 <write@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12e6 <main+0x126>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
xor    %edi,%edi
call   10e0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     11d6 <main+0x16>
mov    0x8(%rsi),%rbp
jmp    11dd <main+0x1d>
lea    0xe23(%rip),%rbp
mov    $0x400,%edi
call   1090 <malloc@plt>
mov    0x2de2(%rip),%rcx
mov    0x2e03(%rip),%rdx
mov    (%rdx),%esi
or     (%rcx),%esi
mov    %rax,%rbx
mov    0x2ded(%rip),%rax
or     (%rax),%esi
mov    %rbp,%rdi
mov    $0x1b6,%edx
call   10b0 <open@plt>
test   %eax,%eax
jns    1230 <main+0x70>
lea    0xdf1(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2d8f(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x30,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
lea    0xdc8(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   10a0 <pwrite@plt>
mov    0x2d59(%rip),%r12
mov    (%r12),%edx
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <lseek@plt>
lea    0xdac(%rip),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x31,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    %r14,%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
mov    $0x400,%ecx
call   10a0 <pwrite@plt>
mov    (%r12),%edx
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <lseek@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x32,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    %r14,%rdi
mov    $0x800,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
mov    $0x800,%ecx
call   10a0 <pwrite@plt>
mov    (%r12),%edx
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <lseek@plt>
mov    %r15,%rdi
mov    $0x2,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x33,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    %r14,%rdi
mov    $0xc00,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
mov    $0xc00,%ecx
call   10a0 <pwrite@plt>
mov    (%r12),%edx
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <lseek@plt>
mov    %r15,%rdi
mov    $0x3,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
lea    0xcba(%rip),%r15
mov    %r15,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   10d0 <pread@plt>
mov    (%r12),%edx
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <lseek@plt>
lea    0xca4(%rip),%rdi
xor    %esi,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2bfd(%rip),%r13
mov    0x0(%r13),%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1040 <write@plt>
mov    0x0(%r13),%edi
lea    0xca0(%rip),%r14
mov    %r14,%rsi
mov    $0x2,%edx
call   1040 <write@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    %r15,%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
mov    $0x400,%ecx
call   10d0 <pread@plt>
mov    (%r12),%edx
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <lseek@plt>
lea    0xc23(%rip),%rdi
mov    $0x1,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%r13),%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1040 <write@plt>
mov    0x0(%r13),%edi
mov    %r14,%rsi
mov    $0x2,%edx
call   1040 <write@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    %r15,%rdi
mov    $0x800,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
mov    $0x800,%ecx
call   10d0 <pread@plt>
mov    (%r12),%edx
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <lseek@plt>
lea    0xbad(%rip),%rdi
mov    $0x2,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%r13),%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1040 <write@plt>
mov    0x0(%r13),%edi
mov    %r14,%rsi
mov    $0x2,%edx
call   1040 <write@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    %r15,%rdi
mov    $0xc00,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
mov    $0xc00,%ecx
call   10d0 <pread@plt>
mov    (%r12),%edx
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <lseek@plt>
lea    0xb37(%rip),%rdi
mov    $0x3,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%r13),%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1040 <write@plt>
mov    0x0(%r13),%edi
mov    %r14,%rsi
mov    $0x2,%edx
call   1040 <write@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%edi
call   1080 <close@plt>
xor    %edi,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"/tmp/junkfile\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@.str.1 = [5 x i8] c"open\00"
@errno = global i32 0
@.str.2 = [28 x i8] c"Going to write at pos = %d\0A\00"
@SEEK_CUR = global i32 0
@.str.3 = [43 x i8] c"After the %d'th write, the position is %d\0A\00"
@.str.4 = [27 x i8] c"Going to read at pos = %d\0A\00"
@.str.5 = [42 x i8] c"After the %d'th read, the position is %d\0A\00"
@STDOUT_FILENO = global i32 0
@.str.6 = [3 x i8] c"\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %8
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
store i8* %16, i8** %8
br label %17
17: ; preds = %13, %2
%18 = call i8* @malloc(i32 1024)
store i8* %18, i8** %10
%19 = load i8*, i8** %8
%20 = load i32, i32* @O_RDWR
%21 = load i32, i32* @O_CREAT
%22 = or i32 %20, %21
%23 = load i32, i32* @O_TRUNC
%24 = or i32 %22, %23
%25 = call i32 @open(i8* %19, i32 %24, i32 438)
store i32 %25, i32* %6
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %17
%28 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%29 = load i32, i32* @errno
%30 = call i32 @exit(i32 %29)
unreachable
31: ; preds = %17
store i32 0, i32* %7
br label %32
32: ; preds = %54, %31
%33 = load i32, i32* %7
%34 = icmp slt i32 %33, 4
br i1 %34, label %35, label %57
35: ; preds = %32
%36 = load i8*, i8** %10
%37 = load i32, i32* %7
%38 = add nsw i32 48, %37
%39 = call i32 @memset(i8* %36, i32 %38, i32 1024)
%40 = load i32, i32* %7
%41 = mul nsw i32 %40, 1024
store i32 %41, i32* %9
%42 = load i32, i32* %9
%43 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%44 = load i32, i32* %6
%45 = load i8*, i8** %10
%46 = load i32, i32* %9
%47 = call i32 @pwrite(i32 %44, i8* %45, i32 1024, i32 %46)
%48 = load i32, i32* %6
%49 = load i32, i32* @SEEK_CUR
%50 = call i32 @lseek(i32 %48, i32 0, i32 %49)
store i32 %50, i32* %9
%51 = load i32, i32* %7
%52 = load i32, i32* %9
%53 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %51, i32 %52)
br label %54
54: ; preds = %35
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 1
store i32 %56, i32* %7
br label %32
57: ; preds = %32
store i32 0, i32* %7
br label %58
58: ; preds = %83, %57
%59 = load i32, i32* %7
%60 = icmp slt i32 %59, 4
br i1 %60, label %61, label %86
61: ; preds = %58
%62 = load i8*, i8** %10
%63 = call i32 @memset(i8* %62, i32 0, i32 1024)
%64 = load i32, i32* %7
%65 = mul nsw i32 %64, 1024
store i32 %65, i32* %9
%66 = load i32, i32* %9
%67 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %66)
%68 = load i32, i32* %6
%69 = load i8*, i8** %10
%70 = load i32, i32* %9
%71 = call i32 @pread(i32 %68, i8* %69, i32 1024, i32 %70)
%72 = load i32, i32* %6
%73 = load i32, i32* @SEEK_CUR
%74 = call i32 @lseek(i32 %72, i32 0, i32 %73)
store i32 %74, i32* %9
%75 = load i32, i32* %7
%76 = load i32, i32* %9
%77 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 %75, i32 %76)
%78 = load i32, i32* @STDOUT_FILENO
%79 = load i8*, i8** %10
%80 = call i32 @write(i32 %78, i8* %79, i32 1024)
%81 = load i32, i32* @STDOUT_FILENO
%82 = call i32 @write(i32 %81, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
br label %83
83: ; preds = %61
%84 = load i32, i32* %7
%85 = add nsw i32 %84, 1
store i32 %85, i32* %7
br label %58
86: ; preds = %58
%87 = load i8*, i8** %10
%88 = call i32 @free(i8* %87)
%89 = load i32, i32* %6
%90 = call i32 @close(i32 %89)
%91 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"/tmp/junkfile\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@.str.1 = [5 x i8] c"open\00"
@errno = global i32 0
@.str.2 = [28 x i8] c"Going to write at pos = %d\0A\00"
@SEEK_CUR = global i32 0
@.str.3 = [43 x i8] c"After the %d'th write, the position is %d\0A\00"
@.str.4 = [27 x i8] c"Going to read at pos = %d\0A\00"
@.str.5 = [42 x i8] c"After the %d'th read, the position is %d\0A\00"
@STDOUT_FILENO = global i32 0
@.str.6 = [3 x i8] c"\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%10 = load i32, i32* @O_RDWR
%11 = load i32, i32* @O_CREAT
%12 = or i32 %11, %10
%13 = load i32, i32* @O_TRUNC
%14 = or i32 %12, %13
%15 = tail call i32 @open(i8* %8, i32 %14, i32 438)
%16 = icmp slt i32 %15, 0
br i1 %16, label %85, label %17
17: ; preds = %7
%18 = tail call i32 @memset(i8* %9, i32 48, i32 1024)
%19 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 0)
%20 = tail call i32 @pwrite(i32 %15, i8* %9, i32 1024, i32 0)
%21 = load i32, i32* @SEEK_CUR
%22 = tail call i32 @lseek(i32 %15, i32 0, i32 %21)
%23 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 %22)
%24 = tail call i32 @memset(i8* %9, i32 49, i32 1024)
%25 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 1024)
%26 = tail call i32 @pwrite(i32 %15, i8* %9, i32 1024, i32 1024)
%27 = load i32, i32* @SEEK_CUR
%28 = tail call i32 @lseek(i32 %15, i32 0, i32 %27)
%29 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 %28)
%30 = tail call i32 @memset(i8* %9, i32 50, i32 1024)
%31 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 2048)
%32 = tail call i32 @pwrite(i32 %15, i8* %9, i32 1024, i32 2048)
%33 = load i32, i32* @SEEK_CUR
%34 = tail call i32 @lseek(i32 %15, i32 0, i32 %33)
%35 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 %34)
%36 = tail call i32 @memset(i8* %9, i32 51, i32 1024)
%37 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 3072)
%38 = tail call i32 @pwrite(i32 %15, i8* %9, i32 1024, i32 3072)
%39 = load i32, i32* @SEEK_CUR
%40 = tail call i32 @lseek(i32 %15, i32 0, i32 %39)
%41 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 3, i32 %40)
%42 = tail call i32 @memset(i8* %9, i32 0, i32 1024)
%43 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 0)
%44 = tail call i32 @pread(i32 %15, i8* %9, i32 1024, i32 0)
%45 = load i32, i32* @SEEK_CUR
%46 = tail call i32 @lseek(i32 %15, i32 0, i32 %45)
%47 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 0, i32 %46)
%48 = load i32, i32* @STDOUT_FILENO
%49 = tail call i32 @write(i32 %48, i8* %9, i32 1024)
%50 = load i32, i32* @STDOUT_FILENO
%51 = tail call i32 @write(i32 %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%52 = tail call i32 @memset(i8* %9, i32 0, i32 1024)
%53 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 1024)
%54 = tail call i32 @pread(i32 %15, i8* %9, i32 1024, i32 1024)
%55 = load i32, i32* @SEEK_CUR
%56 = tail call i32 @lseek(i32 %15, i32 0, i32 %55)
%57 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 1, i32 %56)
%58 = load i32, i32* @STDOUT_FILENO
%59 = tail call i32 @write(i32 %58, i8* %9, i32 1024)
%60 = load i32, i32* @STDOUT_FILENO
%61 = tail call i32 @write(i32 %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%62 = tail call i32 @memset(i8* %9, i32 0, i32 1024)
%63 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 2048)
%64 = tail call i32 @pread(i32 %15, i8* %9, i32 1024, i32 2048)
%65 = load i32, i32* @SEEK_CUR
%66 = tail call i32 @lseek(i32 %15, i32 0, i32 %65)
%67 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 2, i32 %66)
%68 = load i32, i32* @STDOUT_FILENO
%69 = tail call i32 @write(i32 %68, i8* %9, i32 1024)
%70 = load i32, i32* @STDOUT_FILENO
%71 = tail call i32 @write(i32 %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%72 = tail call i32 @memset(i8* %9, i32 0, i32 1024)
%73 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 3072)
%74 = tail call i32 @pread(i32 %15, i8* %9, i32 1024, i32 3072)
%75 = load i32, i32* @SEEK_CUR
%76 = tail call i32 @lseek(i32 %15, i32 0, i32 %75)
%77 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 3, i32 %76)
%78 = load i32, i32* @STDOUT_FILENO
%79 = tail call i32 @write(i32 %78, i8* %9, i32 1024)
%80 = load i32, i32* @STDOUT_FILENO
%81 = tail call i32 @write(i32 %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%82 = tail call i32 @free(i8* %9)
%83 = tail call i32 @close(i32 %15)
%84 = tail call i32 @exit(i32 0)
unreachable
85: ; preds = %7
%86 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%87 = load i32, i32* @errno
%88 = tail call i32 @exit(i32 %87)
unreachable
}