#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 my_write(int, char *, int);
int read(int, char *, int);
scalar_t__ strcasecmp(char *, char *);
int strlen(char *);
int write_page(int cfd, int fd, char *path) {
  int n;
  char buf[1024];
  if (my_write(cfd, "HTTP/1.1 200 OK\r\n", strlen("HTTP/1.1 200 OK\r\n")) == -1)
    return -1;
  if (my_write(cfd, "Content-Type: ", strlen("Content-Type: ")) == -1)
    return -1;
  n = strlen(path);
  if (strcasecmp(&path[n - 3], "jpg") == 0 ||
      (strcasecmp(&path[n - 4], "jpeg") == 0))
    if (my_write(cfd, "image/jpeg", strlen("image/jpeg")) == -1)
      return -1;
    else if (strcasecmp(&path[n - 3], "gif") == 0)
      if (my_write(cfd, "image/gif", strlen("image/gif")) == -1)
        return -1;
      else if (strcasecmp(&path[n - 3], "png") == 0)
        if (my_write(cfd, "image/png", strlen("image/png")) == -1)
          return -1;
        else if (my_write(cfd, "text/html", strlen("text/html")) == -1)
          return -1;
  if (my_write(cfd, "\r\n\r\n", 4) == -1)
    return -1;
  while ((n = read(fd, buf, 1024)) > 0)
    if (my_write(cfd, buf, n) == -1)
      return -1;
  return 0;
}


x86 assembly (clang, -O0):
<write_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x424(%rbp)
lea    0xe9b(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x424(%rbp),%edi
mov    %eax,%edx
lea    0xe87(%rip),%rsi
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
jne    1193 <write_page+0x53>
movl   $0xffffffff,-0x4(%rbp)
jmp    1408 <write_page+0x2c8>
mov    -0x8(%rbp),%eax
mov    %eax,-0x428(%rbp)
lea    0xe6f(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x428(%rbp),%edi
mov    %eax,%edx
lea    0xe5b(%rip),%rsi
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
jne    11d1 <write_page+0x91>
movl   $0xffffffff,-0x4(%rbp)
jmp    1408 <write_page+0x2c8>
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%eax
sub    $0x3,%eax
cltq
add    %rax,%rdi
lea    0xe2e(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     1227 <write_page+0xe7>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%eax
sub    $0x4,%eax
cltq
add    %rax,%rdi
lea    0xe13(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1387 <write_page+0x247>
mov    -0x8(%rbp),%eax
mov    %eax,-0x42c(%rbp)
lea    0xdee(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x42c(%rbp),%edi
mov    %eax,%edx
lea    0xdda(%rip),%rsi
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
jne    1265 <write_page+0x125>
movl   $0xffffffff,-0x4(%rbp)
jmp    1408 <write_page+0x2c8>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%eax
sub    $0x3,%eax
cltq
add    %rax,%rdi
lea    0xdbb(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    137d <write_page+0x23d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x430(%rbp)
lea    0xd96(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x430(%rbp),%edi
mov    %eax,%edx
lea    0xd82(%rip),%rsi
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
jne    12c8 <write_page+0x188>
movl   $0xffffffff,-0x4(%rbp)
jmp    1408 <write_page+0x2c8>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%eax
sub    $0x3,%eax
cltq
add    %rax,%rdi
lea    0xd62(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1373 <write_page+0x233>
mov    -0x8(%rbp),%eax
mov    %eax,-0x434(%rbp)
lea    0xd3d(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x434(%rbp),%edi
mov    %eax,%edx
lea    0xd29(%rip),%rsi
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
jne    132b <write_page+0x1eb>
movl   $0xffffffff,-0x4(%rbp)
jmp    1408 <write_page+0x2c8>
mov    -0x8(%rbp),%eax
mov    %eax,-0x438(%rbp)
lea    0xd09(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x438(%rbp),%edi
mov    %eax,%edx
lea    0xcf5(%rip),%rsi
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
jne    1369 <write_page+0x229>
movl   $0xffffffff,-0x4(%rbp)
jmp    1408 <write_page+0x2c8>
jmp    136e <write_page+0x22e>
jmp    1373 <write_page+0x233>
jmp    1378 <write_page+0x238>
jmp    137d <write_page+0x23d>
jmp    1382 <write_page+0x242>
jmp    1387 <write_page+0x247>
mov    -0x8(%rbp),%edi
lea    0xcbd(%rip),%rsi
mov    $0x4,%edx
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
jne    13b0 <write_page+0x270>
movl   $0xffffffff,-0x4(%rbp)
jmp    1408 <write_page+0x2c8>
jmp    13b5 <write_page+0x275>
mov    -0xc(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
call   1050 <read@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jle    1401 <write_page+0x2c1>
mov    -0x8(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
jne    13fc <write_page+0x2bc>
movl   $0xffffffff,-0x4(%rbp)
jmp    1408 <write_page+0x2c8>
jmp    13b5 <write_page+0x275>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_page>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    %rdx,%r13
mov    %esi,%r12d
mov    %edi,%ebx
lea    0xea0(%rip),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1060 <my_write@plt>
mov    $0xffffffff,%r14d
cmp    $0xffffffff,%eax
je     126a <write_page+0x12a>
lea    0xe88(%rip),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
je     126a <write_page+0x12a>
mov    %r13,%rdi
call   1040 <strlen@plt>
movslq %eax,%rbp
lea    -0x3(,%r13,1),%r15
ff
add    %rbp,%r15
lea    0xe5d(%rip),%rsi
mov    %r15,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11ed <write_page+0xad>
lea    -0x4(,%r13,1),%rdi
ff
add    %rbp,%rdi
lea    0xe48(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
jne    1221 <write_page+0xe1>
lea    0xe31(%rip),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
je     126a <write_page+0x12a>
lea    0xe22(%rip),%rsi
mov    %r15,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     127f <write_page+0x13f>
lea    0xe26(%rip),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
je     126a <write_page+0x12a>
mov    %rsp,%rbp
nopl   0x0(%rax)
mov    %r12d,%edi
mov    %rbp,%rsi
mov    $0x400,%edx
call   1050 <read@plt>
test   %eax,%eax
jle    1267 <write_page+0x127>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
jne    1240 <write_page+0x100>
jmp    126a <write_page+0x12a>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdaa(%rip),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
je     126a <write_page+0x12a>
lea    0xd9a(%rip),%rsi
mov    %r15,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
jne    1221 <write_page+0xe1>
lea    0xd7c(%rip),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
je     126a <write_page+0x12a>
lea    0xd66(%rip),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1060 <my_write@plt>
cmp    $0xffffffff,%eax
jne    1221 <write_page+0xe1>
jmp    126a <write_page+0x12a>

LLVM IR (-O0):
@.str = [18 x i8] c"HTTP/1.1 200 OK\0D\0A\00"
@.str.1 = [15 x i8] c"Content-Type: \00"
@.str.2 = [4 x i8] c"jpg\00"
@.str.3 = [5 x i8] c"jpeg\00"
@.str.4 = [11 x i8] c"image/jpeg\00"
@.str.5 = [4 x i8] c"gif\00"
@.str.6 = [10 x i8] c"image/gif\00"
@.str.7 = [4 x i8] c"png\00"
@.str.8 = [10 x i8] c"image/png\00"
@.str.9 = [10 x i8] c"text/html\00"
@.str.10 = [5 x i8] c"\0D\0A\0D\0A\00"
define i32 @write_page(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [1024 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%10 = load i32, i32* %5
%11 = call i32 @strlen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @my_write(i32 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 -1, i32* %4
br label %105
15: ; preds = %3
%16 = load i32, i32* %5
%17 = call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 @my_write(i32 %16, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %21
20: ; preds = %15
store i32 -1, i32* %4
br label %105
21: ; preds = %15
%22 = load i8*, i8** %7
%23 = call i32 @strlen(i8* %22)
store i32 %23, i32* %8
%24 = load i8*, i8** %7
%25 = load i32, i32* %8
%26 = sub nsw i32 %25, 3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %24, i64 %27
%29 = call i64 @strcasecmp(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %39, label %31
31: ; preds = %21
%32 = load i8*, i8** %7
%33 = load i32, i32* %8
%34 = sub nsw i32 %33, 4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %32, i64 %35
%37 = call i64 @strcasecmp(i8* %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %85
39: ; preds = %31, %21
%40 = load i32, i32* %5
%41 = call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%42 = call i32 @my_write(i32 %40, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %41)
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %45
44: ; preds = %39
store i32 -1, i32* %4
br label %105
45: ; preds = %39
%46 = load i8*, i8** %7
%47 = load i32, i32* %8
%48 = sub nsw i32 %47, 3
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %46, i64 %49
%51 = call i64 @strcasecmp(i8* %50, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %83
53: ; preds = %45
%54 = load i32, i32* %5
%55 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%56 = call i32 @my_write(i32 %54, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %55)
%57 = icmp eq i32 %56, -1
br i1 %57, label %58, label %59
58: ; preds = %53
store i32 -1, i32* %4
br label %105
59: ; preds = %53
%60 = load i8*, i8** %7
%61 = load i32, i32* %8
%62 = sub nsw i32 %61, 3
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %60, i64 %63
%65 = call i64 @strcasecmp(i8* %64, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %81
67: ; preds = %59
%68 = load i32, i32* %5
%69 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%70 = call i32 @my_write(i32 %68, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %69)
%71 = icmp eq i32 %70, -1
br i1 %71, label %72, label %73
72: ; preds = %67
store i32 -1, i32* %4
br label %105
73: ; preds = %67
%74 = load i32, i32* %5
%75 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%76 = call i32 @my_write(i32 %74, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 %75)
%77 = icmp eq i32 %76, -1
br i1 %77, label %78, label %79
78: ; preds = %73
store i32 -1, i32* %4
br label %105
79: ; preds = %73
br label %80
80: ; preds = %79
br label %81
81: ; preds = %80, %59
br label %82
82: ; preds = %81
br label %83
83: ; preds = %82, %45
br label %84
84: ; preds = %83
br label %85
85: ; preds = %84, %31
%86 = load i32, i32* %5
%87 = call i32 @my_write(i32 %86, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%88 = icmp eq i32 %87, -1
br i1 %88, label %89, label %90
89: ; preds = %85
store i32 -1, i32* %4
br label %105
90: ; preds = %85
br label %91
91: ; preds = %103, %90
%92 = load i32, i32* %6
%93 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%94 = call i32 @read(i32 %92, i8* %93, i32 1024)
store i32 %94, i32* %8
%95 = icmp sgt i32 %94, 0
br i1 %95, label %96, label %104
96: ; preds = %91
%97 = load i32, i32* %5
%98 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%99 = load i32, i32* %8
%100 = call i32 @my_write(i32 %97, i8* %98, i32 %99)
%101 = icmp eq i32 %100, -1
br i1 %101, label %102, label %103
102: ; preds = %96
store i32 -1, i32* %4
br label %105
103: ; preds = %96
br label %91
104: ; preds = %91
store i32 0, i32* %4
br label %105
105: ; preds = %104, %102, %89, %78, %72, %58, %44, %20, %14
%106 = load i32, i32* %4
ret i32 %106
}

LLVM IR (-O2):
@.str = [18 x i8] c"HTTP/1.1 200 OK\0D\0A\00"
@.str.1 = [15 x i8] c"Content-Type: \00"
@.str.2 = [4 x i8] c"jpg\00"
@.str.3 = [5 x i8] c"jpeg\00"
@.str.4 = [11 x i8] c"image/jpeg\00"
@.str.5 = [4 x i8] c"gif\00"
@.str.6 = [10 x i8] c"image/gif\00"
@.str.7 = [4 x i8] c"png\00"
@.str.8 = [10 x i8] c"image/png\00"
@.str.9 = [10 x i8] c"text/html\00"
@.str.10 = [5 x i8] c"\0D\0A\0D\0A\00"
define i32 @write_page(i32 %0, i32 %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @strlen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @my_write(i32 %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %57, label %9
9: ; preds = %3
%10 = tail call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @my_write(i32 %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %57, label %13
13: ; preds = %9
%14 = tail call i32 @strlen(i8* %2)
%15 = add nsw i32 %14, -3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %2, i64 %16
%18 = tail call i64 @strcasecmp(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %26, label %20
20: ; preds = %13
%21 = add nsw i32 %14, -4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %2, i64 %22
%24 = tail call i64 @strcasecmp(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %48
26: ; preds = %20, %13
%27 = tail call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%28 = tail call i32 @my_write(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %27)
%29 = icmp eq i32 %28, -1
br i1 %29, label %57, label %30
30: ; preds = %26
%31 = tail call i64 @strcasecmp(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %48
33: ; preds = %30
%34 = tail call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%35 = tail call i32 @my_write(i32 %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %34)
%36 = icmp eq i32 %35, -1
br i1 %36, label %57, label %37
37: ; preds = %33
%38 = tail call i64 @strcasecmp(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %48
40: ; preds = %37
%41 = tail call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%42 = tail call i32 @my_write(i32 %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %41)
%43 = icmp eq i32 %42, -1
br i1 %43, label %57, label %44
44: ; preds = %40
%45 = tail call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%46 = tail call i32 @my_write(i32 %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 %45)
%47 = icmp eq i32 %46, -1
br i1 %47, label %57, label %48
48: ; preds = %44, %37, %30, %20
%49 = tail call i32 @my_write(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%50 = icmp eq i32 %49, -1
br i1 %50, label %57, label %51
51: ; preds = %48, %54
%52 = call i32 @read(i32 %1, i8* %5, i32 1024)
%53 = icmp sgt i32 %52, 0
br i1 %53, label %54, label %57
54: ; preds = %51
%55 = call i32 @my_write(i32 %0, i8* %5, i32 %52)
%56 = icmp eq i32 %55, -1
br i1 %56, label %57, label %51
57: ; preds = %51, %54, %48, %44, %40, %33, %26, %9, %3
%58 = phi i32 [ -1, %3 ], [ -1, %9 ], [ -1, %26 ], [ -1, %33 ], [ -1, %40 ], [ -1, %44 ], [ -1, %48 ], [ 0, %51 ], [ -1, %54 ]
ret i32 %58
}