#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 */
struct iovec {
  char *iov_base;
  int iov_len;
};

/* Variables and functions */
int O_CREAT;
int O_RDWR;
int O_TRUNC;
int /*<<< orphan*/ SEEK_SET;
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 *);
scalar_t__ readv(int, struct iovec *, int);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
scalar_t__ writev(int, struct iovec *, int);
int main(int argc, char *argv[]) {
  int fd, j;
  char *filename = "/tmp/junkfile";
  struct iovec iov[4];
  if (argc > 1)
    filename = argv[1];
  for (j = 0; j < 4; j++) {
    char *buf = malloc(1024);
    memset(buf, '0' + j, 1024);
    iov[j].iov_base = buf;
    iov[j].iov_len = 1024;
  }
  if ((fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, 0666)) < 0) {
    perror("open");
    exit(errno);
  };
  if (writev(fd, iov, 4) < 0) {
    perror("writev");
    exit(errno);
  };
  for (j = 0; j < 4; j++) {
    char *buf = iov[j].iov_base;
    memset(buf, 0, 1024);
  }
  if (-1 == lseek(fd, 0, SEEK_SET)) {
    perror("lseek");
    exit(errno);
  };
  if (readv(fd, iov, 4) < 0) {
    perror("readv");
    exit(errno);
  };
  for (j = 0; j < 4; j++) {
    write(STDOUT_FILENO, iov[j].iov_base, 1024);
    write(STDOUT_FILENO, "\n\n", 2);
    free(iov[j].iov_base);
  }
  close(fd);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe33(%rip),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11e7 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    1254 <main+0xa4>
mov    $0x400,%edi
call   1090 <malloc@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rdi
mov    -0x18(%rbp),%esi
add    $0x30,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    -0x68(%rbp),%rcx
movslq -0x18(%rbp),%rdx
lea    -0x60(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %rcx,(%rax)
movslq -0x18(%rbp),%rcx
lea    -0x60(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movl   $0x400,0x8(%rax)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11ee <main+0x3e>
mov    -0x20(%rbp),%rdi
mov    0x2d71(%rip),%rax
mov    (%rax),%esi
mov    0x2d90(%rip),%rax
or     (%rax),%esi
mov    0x2d7f(%rip),%rax
or     (%rax),%esi
mov    $0x1b6,%edx
call   10b0 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    12a3 <main+0xf3>
lea    0xd7e(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    -0x14(%rbp),%edi
lea    -0x60(%rbp),%rsi
mov    $0x4,%edx
call   1040 <writev@plt>
cmp    $0x0,%rax
jge    12d8 <main+0x128>
lea    0xd4e(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2cef(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    131d <main+0x16d>
movslq -0x18(%rbp),%rcx
lea    -0x60(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12df <main+0x12f>
mov    -0x14(%rbp),%edi
mov    0x2c91(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <lseek@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1359 <main+0x1a9>
lea    0xcd4(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2c6e(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    -0x14(%rbp),%edi
lea    -0x60(%rbp),%rsi
mov    $0x4,%edx
call   10a0 <readv@plt>
cmp    $0x0,%rax
jge    138e <main+0x1de>
lea    0xca5(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2c39(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    1403 <main+0x253>
mov    0x2c3a(%rip),%rax
mov    (%rax),%edi
movslq -0x18(%rbp),%rcx
lea    -0x60(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rsi
mov    $0x400,%edx
call   1050 <write@plt>
mov    0x2c15(%rip),%rax
mov    (%rax),%edi
lea    0xc52(%rip),%rsi
mov    $0x2,%edx
call   1050 <write@plt>
movslq -0x18(%rbp),%rcx
lea    -0x60(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1395 <main+0x1e5>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
cmp    $0x2,%edi
jl     11c4 <main+0x14>
mov    0x8(%rsi),%r14
jmp    11cb <main+0x1b>
lea    0xe35(%rip),%r14
mov    $0x400,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x30,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    %rbx,(%rsp)
movl   $0x400,0x8(%rsp)
mov    $0x400,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x31,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    %rbx,0x10(%rsp)
movl   $0x400,0x18(%rsp)
mov    $0x400,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x32,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    %rbx,0x20(%rsp)
movl   $0x400,0x28(%rsp)
mov    $0x400,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x33,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    %rbx,0x30(%rsp)
mov    0x2d57(%rip),%rax
mov    0x2d78(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
movl   $0x400,0x38(%rsp)
mov    0x2d5d(%rip),%rax
or     (%rax),%esi
mov    %r14,%rdi
mov    $0x1b6,%edx
call   10b0 <open@plt>
test   %eax,%eax
jns    12b2 <main+0x102>
lea    0xd61(%rip),%rdi
jmp    134f <main+0x19f>
mov    %eax,%ebx
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   1040 <writev@plt>
test   %rax,%rax
jns    12d1 <main+0x121>
lea    0xd44(%rip),%rdi
jmp    134f <main+0x19f>
mov    (%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    0x20(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    0x30(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    0x2c9d(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1060 <lseek@plt>
cmp    $0xffffffff,%eax
jne    1334 <main+0x184>
lea    0xce8(%rip),%rdi
jmp    134f <main+0x19f>
mov    %rsp,%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   10a0 <readv@plt>
test   %rax,%rax
jns    1362 <main+0x1b2>
lea    0xcd1(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2c65(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    0x2c77(%rip),%r15
mov    (%r15),%edi
mov    (%rsp),%rsi
mov    $0x400,%edx
call   1050 <write@plt>
mov    (%r15),%edi
lea    0xca2(%rip),%r14
mov    %r14,%rsi
mov    $0x2,%edx
call   1050 <write@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    (%r15),%edi
mov    0x10(%rsp),%rsi
mov    $0x400,%edx
call   1050 <write@plt>
mov    (%r15),%edi
mov    %r14,%rsi
mov    $0x2,%edx
call   1050 <write@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    (%r15),%edi
mov    0x20(%rsp),%rsi
mov    $0x400,%edx
call   1050 <write@plt>
mov    (%r15),%edi
mov    %r14,%rsi
mov    $0x2,%edx
call   1050 <write@plt>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    (%r15),%edi
mov    0x30(%rsp),%rsi
mov    $0x400,%edx
call   1050 <write@plt>
mov    (%r15),%edi
mov    %r14,%rsi
mov    $0x2,%edx
call   1050 <write@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    %ebx,%edi
call   1080 <close@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.iovec = type { i8*, i32 }
@.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 = [7 x i8] c"writev\00"
@SEEK_SET = global i32 0
@.str.3 = [6 x i8] c"lseek\00"
@.str.4 = [6 x i8] c"readv\00"
@STDOUT_FILENO = global i32 0
@.str.5 = [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 [4 x %struct.iovec]
%10 = alloca i8*
%11 = 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
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 1
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
store i8* %17, i8** %8
br label %18
18: ; preds = %14, %2
store i32 0, i32* %7
br label %19
19: ; preds = %37, %18
%20 = load i32, i32* %7
%21 = icmp slt i32 %20, 4
br i1 %21, label %22, label %40
22: ; preds = %19
%23 = call i8* @malloc(i32 1024)
store i8* %23, i8** %10
%24 = load i8*, i8** %10
%25 = load i32, i32* %7
%26 = add nsw i32 48, %25
%27 = call i32 @memset(i8* %24, i32 %26, i32 1024)
%28 = load i8*, i8** %10
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %9, i64 0, i64 %30
%32 = getelementptr inbounds %struct.iovec, %struct.iovec* %31, i32 0, i32 0
store i8* %28, i8** %32
%33 = load i32, i32* %7
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %9, i64 0, i64 %34
%36 = getelementptr inbounds %struct.iovec, %struct.iovec* %35, i32 0, i32 1
store i32 1024, i32* %36
br label %37
37: ; preds = %22
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %19
40: ; preds = %19
%41 = load i8*, i8** %8
%42 = load i32, i32* @O_RDWR
%43 = load i32, i32* @O_CREAT
%44 = or i32 %42, %43
%45 = load i32, i32* @O_TRUNC
%46 = or i32 %44, %45
%47 = call i32 @open(i8* %41, i32 %46, i32 438)
store i32 %47, i32* %6
%48 = icmp slt i32 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %40
%50 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%51 = load i32, i32* @errno
%52 = call i32 @exit(i32 %51)
unreachable
53: ; preds = %40
%54 = load i32, i32* %6
%55 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %9, i64 0, i64 0
%56 = call i64 @writev(i32 %54, %struct.iovec* %55, i32 4)
%57 = icmp slt i64 %56, 0
br i1 %57, label %58, label %62
58: ; preds = %53
%59 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%60 = load i32, i32* @errno
%61 = call i32 @exit(i32 %60)
unreachable
62: ; preds = %53
store i32 0, i32* %7
br label %63
63: ; preds = %74, %62
%64 = load i32, i32* %7
%65 = icmp slt i32 %64, 4
br i1 %65, label %66, label %77
66: ; preds = %63
%67 = load i32, i32* %7
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %9, i64 0, i64 %68
%70 = getelementptr inbounds %struct.iovec, %struct.iovec* %69, i32 0, i32 0
%71 = load i8*, i8** %70
store i8* %71, i8** %11
%72 = load i8*, i8** %11
%73 = call i32 @memset(i8* %72, i32 0, i32 1024)
br label %74
74: ; preds = %66
%75 = load i32, i32* %7
%76 = add nsw i32 %75, 1
store i32 %76, i32* %7
br label %63
77: ; preds = %63
%78 = load i32, i32* %6
%79 = load i32, i32* @SEEK_SET
%80 = call i32 @lseek(i32 %78, i32 0, i32 %79)
%81 = icmp eq i32 -1, %80
br i1 %81, label %82, label %86
82: ; preds = %77
%83 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%84 = load i32, i32* @errno
%85 = call i32 @exit(i32 %84)
unreachable
86: ; preds = %77
%87 = load i32, i32* %6
%88 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %9, i64 0, i64 0
%89 = call i64 @readv(i32 %87, %struct.iovec* %88, i32 4)
%90 = icmp slt i64 %89, 0
br i1 %90, label %91, label %95
91: ; preds = %86
%92 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%93 = load i32, i32* @errno
%94 = call i32 @exit(i32 %93)
unreachable
95: ; preds = %86
store i32 0, i32* %7
br label %96
96: ; preds = %115, %95
%97 = load i32, i32* %7
%98 = icmp slt i32 %97, 4
br i1 %98, label %99, label %118
99: ; preds = %96
%100 = load i32, i32* @STDOUT_FILENO
%101 = load i32, i32* %7
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %9, i64 0, i64 %102
%104 = getelementptr inbounds %struct.iovec, %struct.iovec* %103, i32 0, i32 0
%105 = load i8*, i8** %104
%106 = call i32 @write(i32 %100, i8* %105, i32 1024)
%107 = load i32, i32* @STDOUT_FILENO
%108 = call i32 @write(i32 %107, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%109 = load i32, i32* %7
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %9, i64 0, i64 %110
%112 = getelementptr inbounds %struct.iovec, %struct.iovec* %111, i32 0, i32 0
%113 = load i8*, i8** %112
%114 = call i32 @free(i8* %113)
br label %115
115: ; preds = %99
%116 = load i32, i32* %7
%117 = add nsw i32 %116, 1
store i32 %117, i32* %7
br label %96
118: ; preds = %96
%119 = load i32, i32* %6
%120 = call i32 @close(i32 %119)
%121 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.iovec = type { i8*, i32 }
@.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 = [7 x i8] c"writev\00"
@SEEK_SET = global i32 0
@.str.3 = [6 x i8] c"lseek\00"
@.str.4 = [6 x i8] c"readv\00"
@STDOUT_FILENO = global i32 0
@.str.5 = [3 x i8] c"\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4 x %struct.iovec]
%4 = bitcast [4 x %struct.iovec]* %3 to i8*
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
br label %9
9: ; preds = %6, %2
%10 = phi i8* [ %8, %6 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %2 ]
%11 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%12 = tail call i32 @memset(i8* %11, i32 48, i32 1024)
%13 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %3, i64 0, i64 0, i32 0
store i8* %11, i8** %13
%14 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %3, i64 0, i64 0, i32 1
store i32 1024, i32* %14
%15 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%16 = tail call i32 @memset(i8* %15, i32 49, i32 1024)
%17 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %3, i64 0, i64 1, i32 0
store i8* %15, i8** %17
%18 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %3, i64 0, i64 1, i32 1
store i32 1024, i32* %18
%19 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%20 = tail call i32 @memset(i8* %19, i32 50, i32 1024)
%21 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %3, i64 0, i64 2, i32 0
store i8* %19, i8** %21
%22 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %3, i64 0, i64 2, i32 1
store i32 1024, i32* %22
%23 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%24 = tail call i32 @memset(i8* %23, i32 51, i32 1024)
%25 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %3, i64 0, i64 3, i32 0
store i8* %23, i8** %25
%26 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %3, i64 0, i64 3, i32 1
store i32 1024, i32* %26
%27 = load i32, i32* @O_RDWR
%28 = load i32, i32* @O_CREAT
%29 = or i32 %28, %27
%30 = load i32, i32* @O_TRUNC
%31 = or i32 %29, %30
%32 = tail call i32 @open(i8* %10, i32 %31, i32 438)
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %9
%35 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%36 = load i32, i32* @errno
%37 = tail call i32 @exit(i32 %36)
unreachable
38: ; preds = %9
%39 = getelementptr inbounds [4 x %struct.iovec], [4 x %struct.iovec]* %3, i64 0, i64 0
%40 = call i64 @writev(i32 %32, %struct.iovec* %39, i32 4)
%41 = icmp slt i64 %40, 0
br i1 %41, label %54, label %42
42: ; preds = %38
%43 = load i8*, i8** %13
%44 = call i32 @memset(i8* %43, i32 0, i32 1024)
%45 = load i8*, i8** %17
%46 = call i32 @memset(i8* %45, i32 0, i32 1024)
%47 = load i8*, i8** %21
%48 = call i32 @memset(i8* %47, i32 0, i32 1024)
%49 = load i8*, i8** %25
%50 = call i32 @memset(i8* %49, i32 0, i32 1024)
%51 = load i32, i32* @SEEK_SET
%52 = call i32 @lseek(i32 %32, i32 0, i32 %51)
%53 = icmp eq i32 %52, -1
br i1 %53, label %58, label %62
54: ; preds = %38
%55 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%56 = load i32, i32* @errno
%57 = call i32 @exit(i32 %56)
unreachable
58: ; preds = %42
%59 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%60 = load i32, i32* @errno
%61 = call i32 @exit(i32 %60)
unreachable
62: ; preds = %42
%63 = call i64 @readv(i32 %32, %struct.iovec* %39, i32 4)
%64 = icmp slt i64 %63, 0
br i1 %64, label %96, label %65
65: ; preds = %62
%66 = load i32, i32* @STDOUT_FILENO
%67 = load i8*, i8** %13
%68 = call i32 @write(i32 %66, i8* %67, i32 1024)
%69 = load i32, i32* @STDOUT_FILENO
%70 = call i32 @write(i32 %69, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%71 = load i8*, i8** %13
%72 = call i32 @free(i8* %71)
%73 = load i32, i32* @STDOUT_FILENO
%74 = load i8*, i8** %17
%75 = call i32 @write(i32 %73, i8* %74, i32 1024)
%76 = load i32, i32* @STDOUT_FILENO
%77 = call i32 @write(i32 %76, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%78 = load i8*, i8** %17
%79 = call i32 @free(i8* %78)
%80 = load i32, i32* @STDOUT_FILENO
%81 = load i8*, i8** %21
%82 = call i32 @write(i32 %80, i8* %81, i32 1024)
%83 = load i32, i32* @STDOUT_FILENO
%84 = call i32 @write(i32 %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%85 = load i8*, i8** %21
%86 = call i32 @free(i8* %85)
%87 = load i32, i32* @STDOUT_FILENO
%88 = load i8*, i8** %25
%89 = call i32 @write(i32 %87, i8* %88, i32 1024)
%90 = load i32, i32* @STDOUT_FILENO
%91 = call i32 @write(i32 %90, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%92 = load i8*, i8** %25
%93 = call i32 @free(i8* %92)
%94 = call i32 @close(i32 %32)
%95 = call i32 @exit(i32 0)
unreachable
96: ; preds = %62
%97 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%98 = load i32, i32* @errno
%99 = call i32 @exit(i32 %98)
unreachable
}