#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 */
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ close(int);
int creat(char *, int);
int /*<<< orphan*/ fsync(int);
int open(char *, int);
int /*<<< orphan*/ perror(char *);
int read(int, char *, int);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int /*<<< orphan*/ writer(int, char *, int *, int *);
int t03(void) {
  int fd;
  char *data[] = {"abcd one  \n", "efgh two  \n", "ijkl three\n"};
  int i, j, count, error;
  char buf[12];
  fd = creat("/tmp/file2", S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
  if (fd == -1) {
    perror("creat");
    return 0;
  }
  for (i = 0; i < 3; i++) {
    count = strlen(data[i]);
    error = 0;
    while (!error && count > 0)
      writer(fd, data[i], &count, &error);
  }
  if (count == -1) {
    perror("write");
    return 0;
  }
  fsync(fd);
  close(fd);
  fd = open("/tmp/file2", S_IRUSR);
  if (fd == -1) {
    perror("open");
    return 0;
  }
  for (i = 0; i < 12; i++)
    buf[i] = 0;
  j = 0;
  count = read(fd, buf, 12 - 1);
  while (count > 0) {
    assert(strcmp(data[j], buf) == 0);
    for (i = 0; i < 12; i++)
      buf[i] = 0;
    j++;
    count = read(fd, buf, 12 - 1);
  }
  if (count == -1) {
    perror("read");
    return 0;
  }
  close(fd);
  return 1;
}


x86 assembly (clang, -O0):
<t03>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x2c31(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2c2e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2c2b(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2df0(%rip),%rax
mov    (%rax),%esi
mov    0x2e07(%rip),%rax
or     (%rax),%esi
mov    0x2dee(%rip),%rax
or     (%rax),%esi
mov    0x2ddd(%rip),%rax
or     (%rax),%esi
lea    0xe30(%rip),%rdi
call   10c0 <creat@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    121e <t03+0x7e>
lea    0xe22(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    13f8 <t03+0x258>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    12a1 <t03+0x101>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,8),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x30(%rbp)
mov    %al,-0x3d(%rbp)
jne    1260 <t03+0xc0>
cmpl   $0x0,-0x2c(%rbp)
setg   %al
mov    %al,-0x3d(%rbp)
mov    -0x3d(%rbp),%al
test   $0x1,%al
jne    1270 <t03+0xd0>
jmp    128e <t03+0xee>
mov    -0x8(%rbp),%edi
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,8),%rsi
lea    -0x2c(%rbp),%rdx
lea    -0x30(%rbp),%rcx
call   1090 <writer@plt>
jmp    1247 <t03+0xa7>
jmp    1293 <t03+0xf3>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1225 <t03+0x85>
cmpl   $0xffffffff,-0x2c(%rbp)
jne    12c3 <t03+0x123>
lea    0xd83(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    13f8 <t03+0x258>
mov    -0x8(%rbp),%edi
call   1080 <fsync@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
mov    0x2ce6(%rip),%rax
mov    (%rax),%esi
lea    0xd41(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    130d <t03+0x16d>
lea    0xd3f(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    13f8 <t03+0x258>
movl   $0x0,-0x24(%rbp)
cmpl   $0xc,-0x24(%rbp)
jge    1335 <t03+0x195>
movslq -0x24(%rbp),%rax
movb   $0x0,-0x3c(%rbp,%rax,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1314 <t03+0x174>
movl   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x3c(%rbp),%rsi
mov    $0xb,%edx
call   1050 <read@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jle    13c7 <t03+0x227>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,8),%rdi
lea    -0x3c(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0xc,-0x24(%rbp)
jge    13a5 <t03+0x205>
movslq -0x24(%rbp),%rax
movb   $0x0,-0x3c(%rbp,%rax,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1384 <t03+0x1e4>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x3c(%rbp),%rsi
mov    $0xb,%edx
call   1050 <read@plt>
mov    %eax,-0x2c(%rbp)
jmp    1350 <t03+0x1b0>
cmpl   $0xffffffff,-0x2c(%rbp)
jne    13e9 <t03+0x249>
lea    0xc68(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    13f8 <t03+0x258>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t03>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    0x2e15(%rip),%r12
mov    0x2e2e(%rip),%rax
mov    (%rax),%esi
or     (%r12),%esi
mov    0x2e11(%rip),%rax
or     (%rax),%esi
mov    0x2e00(%rip),%rax
or     (%rax),%esi
lea    0xe4b(%rip),%rdi
call   10c0 <creat@plt>
cmp    $0xffffffff,%eax
je     13ae <t03+0x20e>
mov    %eax,%ebx
lea    0xe10(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,0x8(%rsp)
movl   $0x0,0xc(%rsp)
test   %eax,%eax
jle    123e <t03+0x9e>
lea    0xdf4(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xc(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %rbp,%rcx
call   1090 <writer@plt>
cmpl   $0x0,0xc(%rsp)
jne    123e <t03+0x9e>
cmpl   $0x0,0x8(%rsp)
jg     1220 <t03+0x80>
lea    0xdc7(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,0x8(%rsp)
movl   $0x0,0xc(%rsp)
test   %eax,%eax
jle    128e <t03+0xee>
lea    0xdab(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xc(%rsp),%rbp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %rbp,%rcx
call   1090 <writer@plt>
cmpl   $0x0,0xc(%rsp)
jne    128e <t03+0xee>
cmpl   $0x0,0x8(%rsp)
jg     1270 <t03+0xd0>
lea    0xd83(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,0x8(%rsp)
movl   $0x0,0xc(%rsp)
test   %eax,%eax
jle    12df <t03+0x13f>
lea    0xd67(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xc(%rsp),%rbp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %rbp,%rcx
call   1090 <writer@plt>
cmpl   $0x0,0xc(%rsp)
mov    0x8(%rsp),%eax
jne    12df <t03+0x13f>
test   %eax,%eax
jg     12c0 <t03+0x120>
cmp    $0xffffffff,%eax
je     13b7 <t03+0x217>
mov    %ebx,%edi
call   1080 <fsync@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    (%r12),%esi
lea    0xd23(%rip),%rdi
call   10a0 <open@plt>
cmp    $0xffffffff,%eax
je     13c0 <t03+0x220>
mov    %eax,%r15d
movl   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x10(%rsp),%rsi
mov    %eax,%edi
mov    $0xb,%edx
call   1050 <read@plt>
mov    %eax,0x8(%rsp)
test   %eax,%eax
jle    139a <t03+0x1fa>
lea    0xd05(%rip),%r14
lea    0x10(%rsp),%rbx
mov    %r14,%rbp
nopl   0x0(%rax,%rax,1)
movslq 0x0(%rbp),%rdi
add    %r14,%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1070 <assert@plt>
movq   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0xb,%edx
call   1050 <read@plt>
mov    %eax,0x8(%rsp)
add    $0x4,%rbp
test   %eax,%eax
jg     1350 <t03+0x1b0>
cmp    $0xffffffff,%eax
je     13c9 <t03+0x229>
mov    %r15d,%edi
call   1040 <close@plt>
mov    $0x1,%eax
jmp    13d7 <t03+0x237>
lea    0xc7a(%rip),%rdi
jmp    13d0 <t03+0x230>
lea    0xc77(%rip),%rdi
jmp    13d0 <t03+0x230>
lea    0xc74(%rip),%rdi
jmp    13d0 <t03+0x230>
lea    0xc70(%rip),%rdi
call   10b0 <perror@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"abcd one \0A\00"
@.str.1 = [12 x i8] c"efgh two \0A\00"
@.str.2 = [12 x i8] c"ijkl three\0A\00"
@__const.t03.data = [3 x i8*] [i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i32 0, i32 0)]
@.str.3 = [11 x i8] c"/tmp/file2\00"
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@.str.4 = [6 x i8] c"creat\00"
@.str.5 = [6 x i8] c"write\00"
@.str.6 = [5 x i8] c"open\00"
@.str.7 = [5 x i8] c"read\00"
define i32 @t03() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x i8*]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [12 x i8]
%9 = bitcast [3 x i8*]* %3 to i8*
%10 = load i32, i32* @S_IRUSR
%11 = load i32, i32* @S_IWUSR
%12 = or i32 %10, %11
%13 = load i32, i32* @S_IRGRP
%14 = or i32 %12, %13
%15 = load i32, i32* @S_IROTH
%16 = or i32 %14, %15
%17 = call i32 @creat(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %16)
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %22
20: ; preds = %0
%21 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %1
br label %119
22: ; preds = %0
store i32 0, i32* %4
br label %23
23: ; preds = %48, %22
%24 = load i32, i32* %4
%25 = icmp slt i32 %24, 3
br i1 %25, label %26, label %51
26: ; preds = %23
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [3 x i8*], [3 x i8*]* %3, i64 0, i64 %28
%30 = load i8*, i8** %29
%31 = call i32 @strlen(i8* %30)
store i32 %31, i32* %6
store i32 0, i32* %7
br label %32
32: ; preds = %40, %26
%33 = load i32, i32* %7
%34 = icmp ne i32 %33, 0
br i1 %34, label %38, label %35
35: ; preds = %32
%36 = load i32, i32* %6
%37 = icmp sgt i32 %36, 0
br label %38
38: ; preds = %35, %32
%39 = phi i1 [ false, %32 ], [ %37, %35 ]
br i1 %39, label %40, label %47
40: ; preds = %38
%41 = load i32, i32* %2
%42 = load i32, i32* %4
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [3 x i8*], [3 x i8*]* %3, i64 0, i64 %43
%45 = load i8*, i8** %44
%46 = call i32 @writer(i32 %41, i8* %45, i32* %6, i32* %7)
br label %32
47: ; preds = %38
br label %48
48: ; preds = %47
%49 = load i32, i32* %4
%50 = add nsw i32 %49, 1
store i32 %50, i32* %4
br label %23
51: ; preds = %23
%52 = load i32, i32* %6
%53 = icmp eq i32 %52, -1
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %1
br label %119
56: ; preds = %51
%57 = load i32, i32* %2
%58 = call i32 @fsync(i32 %57)
%59 = load i32, i32* %2
%60 = call i32 @close(i32 %59)
%61 = load i32, i32* @S_IRUSR
%62 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %61)
store i32 %62, i32* %2
%63 = load i32, i32* %2
%64 = icmp eq i32 %63, -1
br i1 %64, label %65, label %67
65: ; preds = %56
%66 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %1
br label %119
67: ; preds = %56
store i32 0, i32* %4
br label %68
68: ; preds = %75, %67
%69 = load i32, i32* %4
%70 = icmp slt i32 %69, 12
br i1 %70, label %71, label %78
71: ; preds = %68
%72 = load i32, i32* %4
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [12 x i8], [12 x i8]* %8, i64 0, i64 %73
store i8 0, i8* %74
br label %75
75: ; preds = %71
%76 = load i32, i32* %4
%77 = add nsw i32 %76, 1
store i32 %77, i32* %4
br label %68
78: ; preds = %68
store i32 0, i32* %5
%79 = load i32, i32* %2
%80 = getelementptr inbounds [12 x i8], [12 x i8]* %8, i64 0, i64 0
%81 = call i32 @read(i32 %79, i8* %80, i32 11)
store i32 %81, i32* %6
br label %82
82: ; preds = %105, %78
%83 = load i32, i32* %6
%84 = icmp sgt i32 %83, 0
br i1 %84, label %85, label %111
85: ; preds = %82
%86 = load i32, i32* %5
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [3 x i8*], [3 x i8*]* %3, i64 0, i64 %87
%89 = load i8*, i8** %88
%90 = getelementptr inbounds [12 x i8], [12 x i8]* %8, i64 0, i64 0
%91 = call i64 @strcmp(i8* %89, i8* %90)
%92 = icmp eq i64 %91, 0
%93 = zext i1 %92 to i32
%94 = call i32 @assert(i32 %93)
store i32 0, i32* %4
br label %95
95: ; preds = %102, %85
%96 = load i32, i32* %4
%97 = icmp slt i32 %96, 12
br i1 %97, label %98, label %105
98: ; preds = %95
%99 = load i32, i32* %4
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [12 x i8], [12 x i8]* %8, i64 0, i64 %100
store i8 0, i8* %101
br label %102
102: ; preds = %98
%103 = load i32, i32* %4
%104 = add nsw i32 %103, 1
store i32 %104, i32* %4
br label %95
105: ; preds = %95
%106 = load i32, i32* %5
%107 = add nsw i32 %106, 1
store i32 %107, i32* %5
%108 = load i32, i32* %2
%109 = getelementptr inbounds [12 x i8], [12 x i8]* %8, i64 0, i64 0
%110 = call i32 @read(i32 %108, i8* %109, i32 11)
store i32 %110, i32* %6
br label %82
111: ; preds = %82
%112 = load i32, i32* %6
%113 = icmp eq i32 %112, -1
br i1 %113, label %114, label %116
114: ; preds = %111
%115 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %1
br label %119
116: ; preds = %111
%117 = load i32, i32* %2
%118 = call i32 @close(i32 %117)
store i32 1, i32* %1
br label %119
119: ; preds = %116, %114, %65, %54, %20
%120 = load i32, i32* %1
ret i32 %120
}

LLVM IR (-O2):
@.str = [12 x i8] c"abcd one \0A\00"
@.str.1 = [12 x i8] c"efgh two \0A\00"
@.str.2 = [12 x i8] c"ijkl three\0A\00"
@reltable.t03 = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.t03 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.t03 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.t03 to i64)) to i32)]
@.str.3 = [11 x i8] c"/tmp/file2\00"
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@.str.4 = [6 x i8] c"creat\00"
@.str.5 = [6 x i8] c"write\00"
@.str.6 = [5 x i8] c"open\00"
@.str.7 = [5 x i8] c"read\00"
define i32 @t03() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* @S_IRUSR
%9 = load i32, i32* @S_IWUSR
%10 = or i32 %9, %8
%11 = load i32, i32* @S_IRGRP
%12 = or i32 %10, %11
%13 = load i32, i32* @S_IROTH
%14 = or i32 %12, %13
%15 = tail call i32 @creat(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = icmp eq i32 %15, -1
br i1 %16, label %20, label %17
17: ; preds = %0
%18 = call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 %18, i32* %1
store i32 0, i32* %2
%19 = icmp sgt i32 %18, 0
br i1 %19, label %22, label %29
20: ; preds = %0
%21 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %83
22: ; preds = %17, %22
%23 = call i32 @writer(i32 %15, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 0
%26 = load i32, i32* %1
%27 = icmp sgt i32 %26, 0
%28 = select i1 %25, i1 %27, i1 false
br i1 %28, label %22, label %29
29: ; preds = %22, %17
%30 = call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i32 %30, i32* %1
store i32 0, i32* %2
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %39
32: ; preds = %29, %32
%33 = call i32 @writer(i32 %15, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%34 = load i32, i32* %2
%35 = icmp eq i32 %34, 0
%36 = load i32, i32* %1
%37 = icmp sgt i32 %36, 0
%38 = select i1 %35, i1 %37, i1 false
br i1 %38, label %32, label %39
39: ; preds = %32, %29
%40 = call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
store i32 %40, i32* %1
store i32 0, i32* %2
%41 = icmp sgt i32 %40, 0
br i1 %41, label %42, label %49
42: ; preds = %39, %42
%43 = call i32 @writer(i32 %15, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2)
%44 = load i32, i32* %2
%45 = icmp eq i32 %44, 0
%46 = load i32, i32* %1
%47 = icmp sgt i32 %46, 0
%48 = select i1 %45, i1 %47, i1 false
br i1 %48, label %42, label %49
49: ; preds = %42, %39
%50 = phi i32 [ %40, %39 ], [ %46, %42 ]
%51 = icmp eq i32 %50, -1
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %83
54: ; preds = %49
%55 = call i32 @fsync(i32 %15)
%56 = call i32 @close(i32 %15)
%57 = load i32, i32* @S_IRUSR
%58 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %57)
%59 = icmp eq i32 %58, -1
br i1 %59, label %63, label %60
60: ; preds = %54
%61 = call i32 @read(i32 %58, i8* %7, i32 11)
store i32 %61, i32* %1
%62 = icmp sgt i32 %61, 0
br i1 %62, label %65, label %76
63: ; preds = %54
%64 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %83
65: ; preds = %60, %65
%66 = phi i64 [ %73, %65 ], [ 0, %60 ]
%67 = shl i64 %66, 2
%68 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.t03 to i8*), i64 %67)
%69 = call i64 @strcmp(i8* %68, i8* %7)
%70 = icmp eq i64 %69, 0
%71 = zext i1 %70 to i32
%72 = call i32 @assert(i32 %71)
%73 = add nuw i64 %66, 1
%74 = call i32 @read(i32 %58, i8* %7, i32 11)
store i32 %74, i32* %1
%75 = icmp sgt i32 %74, 0
br i1 %75, label %65, label %76
76: ; preds = %65, %60
%77 = phi i32 [ %61, %60 ], [ %74, %65 ]
%78 = icmp eq i32 %77, -1
br i1 %78, label %79, label %81
79: ; preds = %76
%80 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %83
81: ; preds = %76
%82 = call i32 @close(i32 %58)
br label %83
83: ; preds = %81, %79, %63, %52, %20
%84 = phi i32 [ 0, %20 ], [ 0, %52 ], [ 0, %63 ], [ 0, %79 ], [ 1, %81 ]
ret i32 %84
}