#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 stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ content_length_header;

/* Variables and functions */
scalar_t__ EACCES;
int /*<<< orphan*/ O_RDONLY;
scalar_t__ errno;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int read(int, void **, int);
int send(int, ...);
int /*<<< orphan*/ snprintf(char *, int, char *, int /*<<< orphan*/);
int stat(char *, struct stat *);
int strlen(char *);
void send_file(int fd, char *file_name) {
  int err = 0;
  struct stat file_stats;
  off_t file_size;
  void *buffer[1024];
  int buffer_length;
  char content_length_header[1024];
  err = stat(file_name, &file_stats);
  if (err == -1) {
    perror("stat() failed");
    if (errno == EACCES) {
      err = send(fd, "File does not exist.", 20, 0);
      if (err == -1) {
        perror("send() failed");
      }
    } else {
      err = send(fd, "Reading file failed.", 20, 0);
      if (err == -1) {
        perror("send() failed");
      }
    }
    return;
  }
  file_size = file_stats.st_size;
  err = send(fd, "HTTP/1.0 200 OK\nContent-Type: text/html; charset=UTF-8\n",
             56, 0);
  if (err == -1) {
    perror("send() failed");
    return;
  }
  snprintf(content_length_header, sizeof(content_length_header),
           "Content-Length: %zd\n\n", file_size);
  err = send(fd, content_length_header, strlen(content_length_header), 0);
  if (err == -1) {
    perror("send() failed");
    return;
  }
  int file_fd = open(file_name, O_RDONLY);
  if (file_fd == -1) {
    perror("open() failed");
    return;
  }
  printf("Sending %s\n", file_name);
  do {
    buffer_length = read(file_fd, buffer, 1024);
    if (buffer_length == -1) {
      perror("read() failed");
      return;
    }
    int already_sent = 0;
    while (already_sent != buffer_length) {
      int sent_now =
          send(fd, buffer + already_sent, buffer_length - already_sent, 0);
      if (sent_now == -1) {
        perror("send() failed");
        return;
      }
      already_sent += sent_now;
    }
  } while (buffer_length > 0);
}


x86 assembly (clang, -O0):
<send_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2450,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1080 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    124a <send_file+0xca>
lea    0xe46(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2e0a(%rip),%rax
mov    (%rax),%rax
mov    0x2e10(%rip),%rcx
cmp    (%rcx),%rax
jne    120f <send_file+0x8f>
mov    -0x4(%rbp),%edi
lea    0xe2b(%rip),%rsi
mov    $0x14,%edx
xor    %ecx,%ecx
mov    $0x0,%al
call   1040 <send@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    120a <send_file+0x8a>
lea    0xe1e(%rip),%rdi
call   10a0 <perror@plt>
jmp    1245 <send_file+0xc5>
mov    -0x4(%rbp),%edi
lea    0xe18(%rip),%rsi
mov    $0x14,%edx
xor    %ecx,%ecx
mov    $0x0,%al
call   1040 <send@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1240 <send_file+0xc0>
lea    0xde8(%rip),%rdi
call   10a0 <perror@plt>
jmp    1245 <send_file+0xc5>
jmp    1411 <send_file+0x291>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
lea    0xdec(%rip),%rsi
mov    $0x38,%edx
xor    %ecx,%ecx
mov    $0x0,%al
call   1040 <send@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1286 <send_file+0x106>
lea    0xda7(%rip),%rdi
call   10a0 <perror@plt>
jmp    1411 <send_file+0x291>
lea    -0x2430(%rbp),%rdi
mov    -0x1c(%rbp),%ecx
mov    $0x400,%esi
lea    0xde2(%rip),%rdx
call   1060 <snprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x244c(%rbp)
lea    -0x2430(%rbp),%rax
mov    %rax,-0x2448(%rbp)
lea    -0x2430(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x244c(%rbp),%edi
mov    -0x2448(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
mov    $0x0,%al
call   1040 <send@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    12fa <send_file+0x17a>
lea    0xd33(%rip),%rdi
call   10a0 <perror@plt>
jmp    1411 <send_file+0x291>
mov    -0x10(%rbp),%rdi
mov    0x2ce3(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
mov    %eax,-0x2434(%rbp)
cmpl   $0xffffffff,-0x2434(%rbp)
jne    1330 <send_file+0x1b0>
lea    0xd6e(%rip),%rdi
call   10a0 <perror@plt>
jmp    1411 <send_file+0x291>
mov    -0x10(%rbp),%rsi
lea    0xd67(%rip),%rdi
call   1050 <printf@plt>
mov    -0x2434(%rbp),%edi
lea    -0x2020(%rbp),%rsi
mov    $0x400,%edx
call   1070 <read@plt>
mov    %eax,-0x2024(%rbp)
cmpl   $0xffffffff,-0x2024(%rbp)
jne    137b <send_file+0x1fb>
lea    0xd3d(%rip),%rdi
call   10a0 <perror@plt>
jmp    1411 <send_file+0x291>
movl   $0x0,-0x2438(%rbp)
mov    -0x2438(%rbp),%eax
cmp    -0x2024(%rbp),%eax
je     13ff <send_file+0x27f>
mov    -0x4(%rbp),%edi
lea    -0x2020(%rbp),%rsi
movslq -0x2438(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x2024(%rbp),%edx
sub    -0x2438(%rbp),%edx
xor    %ecx,%ecx
mov    $0x0,%al
call   1040 <send@plt>
mov    %eax,-0x243c(%rbp)
cmpl   $0xffffffff,-0x243c(%rbp)
jne    13e8 <send_file+0x268>
lea    0xc45(%rip),%rdi
call   10a0 <perror@plt>
jmp    1411 <send_file+0x291>
mov    -0x243c(%rbp),%eax
add    -0x2438(%rbp),%eax
mov    %eax,-0x2438(%rbp)
jmp    1385 <send_file+0x205>
jmp    1404 <send_file+0x284>
cmpl   $0x0,-0x2024(%rbp)
jg     1340 <send_file+0x1c0>
add    $0x2450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_file>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x2410,%rsp
mov    %rsi,%r14
mov    %edi,%r12d
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
call   1080 <stat@plt>
cmp    $0xffffffff,%eax
je     12cb <send_file+0x14b>
mov    0x8(%rsp),%r15d
lea    0xe8f(%rip),%rsi
mov    %r12d,%edi
mov    $0x38,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <send@plt>
cmp    $0xffffffff,%eax
je     131c <send_file+0x19c>
lea    0xea6(%rip),%rdx
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x400,%esi
mov    %r15d,%ecx
call   1060 <snprintf@plt>
mov    %rbp,%rdi
call   1030 <strlen@plt>
mov    %r12d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <send@plt>
cmp    $0xffffffff,%eax
je     12af <send_file+0x12f>
mov    0x2dd2(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1090 <open@plt>
cmp    $0xffffffff,%eax
je     12f6 <send_file+0x176>
mov    %eax,%r15d
lea    0xe6f(%rip),%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
lea    0x410(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15d,%edi
mov    %r14,%rsi
mov    $0x400,%edx
call   1070 <read@plt>
test   %eax,%eax
je     12bb <send_file+0x13b>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     1337 <send_file+0x1b7>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq %ebx,%rax
lea    (%rsp,%rax,8),%rsi
add    $0x410,%rsi
mov    %ebp,%edx
sub    %eax,%edx
mov    %r12d,%edi
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <send@plt>
cmp    $0xffffffff,%eax
je     12af <send_file+0x12f>
add    %eax,%ebx
cmp    %ebx,%ebp
jne    1280 <send_file+0x100>
test   %ebp,%ebp
jg     1250 <send_file+0xd0>
jmp    12bb <send_file+0x13b>
lea    0xd6d(%rip),%rdi
call   10a0 <perror@plt>
add    $0x2410,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd2e(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2cf2(%rip),%rax
mov    (%rax),%rax
mov    0x2cf8(%rip),%rcx
cmp    (%rcx),%rax
jne    12ff <send_file+0x17f>
lea    0xd1a(%rip),%rsi
jmp    1306 <send_file+0x186>
lea    0xd97(%rip),%rdi
jmp    12b6 <send_file+0x136>
lea    0xd2b(%rip),%rsi
mov    %r12d,%edi
mov    $0x14,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <send@plt>
cmp    $0xffffffff,%eax
jne    12bb <send_file+0x13b>
lea    0xd00(%rip),%rdi
add    $0x2410,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    10a0 <perror@plt>
lea    0xd70(%rip),%rdi
jmp    12b6 <send_file+0x136>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [14 x i8] c"stat() failed\00"
@errno = global i64 0
@EACCES = global i64 0
@.str.1 = [21 x i8] c"File does not exist.\00"
@.str.2 = [14 x i8] c"send() failed\00"
@.str.3 = [21 x i8] c"Reading file failed.\00"
@.str.4 = [56 x i8] c"HTTP/1.0 200 OK\0AContent-Type: text/html; charset=UTF-8\0A\00"
@.str.5 = [22 x i8] c"Content-Length: %zd\0A\0A\00"
@O_RDONLY = global i32 0
@.str.6 = [14 x i8] c"open() failed\00"
@.str.7 = [12 x i8] c"Sending %s\0A\00"
@.str.8 = [14 x i8] c"read() failed\00"
define void @send_file(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.stat
%7 = alloca i32
%8 = alloca [1024 x i8*]
%9 = alloca i32
%10 = alloca [1024 x i8]
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
%14 = load i8*, i8** %4
%15 = call i32 @stat(i8* %14, %struct.stat* %6)
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %40
18: ; preds = %2
%19 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%20 = load i64, i64* @errno
%21 = load i64, i64* @EACCES
%22 = icmp eq i64 %20, %21
br i1 %22, label %23, label %31
23: ; preds = %18
%24 = load i32, i32* %3
%25 = call i32 (i32, ...) @send(i32 %24, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 20, i32 0)
store i32 %25, i32* %5
%26 = load i32, i32* %5
%27 = icmp eq i32 %26, -1
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %28, %23
br label %39
31: ; preds = %18
%32 = load i32, i32* %3
%33 = call i32 (i32, ...) @send(i32 %32, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 20, i32 0)
store i32 %33, i32* %5
%34 = load i32, i32* %5
%35 = icmp eq i32 %34, -1
br i1 %35, label %36, label %38
36: ; preds = %31
%37 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %38
38: ; preds = %36, %31
br label %39
39: ; preds = %38, %30
br label %108
40: ; preds = %2
%41 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%42 = load i32, i32* %41
store i32 %42, i32* %7
%43 = load i32, i32* %3
%44 = call i32 (i32, ...) @send(i32 %43, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0), i32 56, i32 0)
store i32 %44, i32* %5
%45 = load i32, i32* %5
%46 = icmp eq i32 %45, -1
br i1 %46, label %47, label %49
47: ; preds = %40
%48 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %108
49: ; preds = %40
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%51 = load i32, i32* %7
%52 = call i32 @snprintf(i8* %50, i32 1024, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %3
%54 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%55 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%56 = call i32 @strlen(i8* %55)
%57 = call i32 (i32, ...) @send(i32 %53, i8* %54, i32 %56, i32 0)
store i32 %57, i32* %5
%58 = load i32, i32* %5
%59 = icmp eq i32 %58, -1
br i1 %59, label %60, label %62
60: ; preds = %49
%61 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %108
62: ; preds = %49
%63 = load i8*, i8** %4
%64 = load i32, i32* @O_RDONLY
%65 = call i32 @open(i8* %63, i32 %64)
store i32 %65, i32* %11
%66 = load i32, i32* %11
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %70
68: ; preds = %62
%69 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
br label %108
70: ; preds = %62
%71 = load i8*, i8** %4
%72 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* %71)
br label %73
73: ; preds = %105, %70
%74 = load i32, i32* %11
%75 = getelementptr inbounds [1024 x i8*], [1024 x i8*]* %8, i64 0, i64 0
%76 = call i32 @read(i32 %74, i8** %75, i32 1024)
store i32 %76, i32* %9
%77 = load i32, i32* %9
%78 = icmp eq i32 %77, -1
br i1 %78, label %79, label %81
79: ; preds = %73
%80 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
br label %108
81: ; preds = %73
store i32 0, i32* %12
br label %82
82: ; preds = %100, %81
%83 = load i32, i32* %12
%84 = load i32, i32* %9
%85 = icmp ne i32 %83, %84
br i1 %85, label %86, label %104
86: ; preds = %82
%87 = load i32, i32* %3
%88 = getelementptr inbounds [1024 x i8*], [1024 x i8*]* %8, i64 0, i64 0
%89 = load i32, i32* %12
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8*, i8** %88, i64 %90
%92 = load i32, i32* %9
%93 = load i32, i32* %12
%94 = sub nsw i32 %92, %93
%95 = call i32 (i32, ...) @send(i32 %87, i8** %91, i32 %94, i32 0)
store i32 %95, i32* %13
%96 = load i32, i32* %13
%97 = icmp eq i32 %96, -1
br i1 %97, label %98, label %100
98: ; preds = %86
%99 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %108
100: ; preds = %86
%101 = load i32, i32* %13
%102 = load i32, i32* %12
%103 = add nsw i32 %102, %101
store i32 %103, i32* %12
br label %82
104: ; preds = %82
br label %105
105: ; preds = %104
%106 = load i32, i32* %9
%107 = icmp sgt i32 %106, 0
br i1 %107, label %73, label %108
108: ; preds = %39, %47, %60, %68, %79, %98, %105
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [14 x i8] c"stat() failed\00"
@errno = global i64 0
@EACCES = global i64 0
@.str.1 = [21 x i8] c"File does not exist.\00"
@.str.2 = [14 x i8] c"send() failed\00"
@.str.3 = [21 x i8] c"Reading file failed.\00"
@.str.4 = [56 x i8] c"HTTP/1.0 200 OK\0AContent-Type: text/html; charset=UTF-8\0A\00"
@.str.5 = [22 x i8] c"Content-Length: %zd\0A\0A\00"
@O_RDONLY = global i32 0
@.str.6 = [14 x i8] c"open() failed\00"
@.str.7 = [12 x i8] c"Sending %s\0A\00"
@.str.8 = [14 x i8] c"read() failed\00"
define void @send_file(i32 %0, i8* %1) {
%3 = alloca %struct.stat
%4 = alloca [1024 x i8*]
%5 = alloca [1024 x i8]
%6 = bitcast %struct.stat* %3 to i8*
%7 = bitcast [1024 x i8*]* %4 to i8*
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%9 = call i32 @stat(i8* %1, %struct.stat* %3)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %26
11: ; preds = %2
%12 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%13 = load i64, i64* @errno
%14 = load i64, i64* @EACCES
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = tail call i32 (i32, ...) @send(i32 %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 20, i32 0)
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %67
19: ; preds = %16
%20 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %67
21: ; preds = %11
%22 = tail call i32 (i32, ...) @send(i32 %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 20, i32 0)
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %67
24: ; preds = %21
%25 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %67
26: ; preds = %2
%27 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%28 = load i32, i32* %27
%29 = tail call i32 (i32, ...) @send(i32 %0, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0), i32 56, i32 0)
%30 = icmp eq i32 %29, -1
br i1 %30, label %31, label %33
31: ; preds = %26
%32 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %67
33: ; preds = %26
%34 = call i32 @snprintf(i8* %8, i32 1024, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %28)
%35 = call i32 @strlen(i8* %8)
%36 = call i32 (i32, ...) @send(i32 %0, i8* %8, i32 %35, i32 0)
%37 = icmp eq i32 %36, -1
br i1 %37, label %38, label %40
38: ; preds = %33
%39 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %67
40: ; preds = %33
%41 = load i32, i32* @O_RDONLY
%42 = call i32 @open(i8* %1, i32 %41)
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
br label %67
46: ; preds = %40
%47 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* %1)
%48 = getelementptr inbounds [1024 x i8*], [1024 x i8*]* %4, i64 0, i64 0
br label %49
49: ; preds = %65, %46
%50 = call i32 @read(i32 %42, i8** %48, i32 1024)
switch i32 %50, label %55 [
i32 -1, label %51
i32 0, label %67
]
51: ; preds = %49
%52 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
br label %67
53: ; preds = %55
%54 = icmp eq i32 %50, %62
br i1 %54, label %65, label %55
55: ; preds = %49, %53
%56 = phi i32 [ %62, %53 ], [ 0, %49 ]
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [1024 x i8*], [1024 x i8*]* %4, i64 0, i64 %57
%59 = sub nsw i32 %50, %56
%60 = call i32 (i32, ...) @send(i32 %0, i8** %58, i32 %59, i32 0)
%61 = icmp eq i32 %60, -1
%62 = add nsw i32 %60, %56
br i1 %61, label %63, label %53
63: ; preds = %55
%64 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %67
65: ; preds = %53
%66 = icmp sgt i32 %50, 0
br i1 %66, label %49, label %67
67: ; preds = %49, %65, %63, %44, %51, %19, %16, %24, %21, %38, %31
ret void
}