#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct hostent {
  int /*<<< orphan*/ h_length;
  scalar_t__ h_addr;
};
typedef int /*<<< orphan*/ serv_addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int BUFSIZ;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ bcopy(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ error(char *);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int read(int, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int strlen(char *);
int write(int, char *, int);
void nhtml(char *msg, char *msg2) {
  struct sockaddr_in serv_addr;
  struct hostent *server;
  int sockfd;
  int portno;
  int buffn = 4000000;
  char buf[BUFSIZ + 1];
  int n;
  int left;
  int counter = 0;
  int i = 0;
  sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
  if (sockfd < 0)
    error("ERROR opening socket");
  memset(buf, 0, BUFSIZ);
  if ((server = gethostbyname(msg)) == NULL) {
    perror("ERROR, no such host\n");
  }
  bzero((char *)&serv_addr, sizeof(serv_addr));
  serv_addr.sin_family = AF_INET;
  bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr,
        server->h_length);
  serv_addr.sin_port = htons(80);
  if (connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0)
    error("ERROR connecting");
  printf("%s\n", msg2);
  n = write(sockfd, msg2, strlen(msg2));
  if (n < 0)
    error("ERROR writing to socket");
  memset(msg2, 0, buffn);
  left = 4000000;
  while (1) {
    n = 0;
    n = read(sockfd, buf, BUFSIZ);
    for (i = 0; i < strlen(buf); i++) {
      msg2[counter] = buf[i];
      counter++;
    }
    memset(buf, 0, n);
    left -= n;
    if ((n <= 0) || (left <= 0))
      break;
  }
  msg2[counter] = '\0';
  close(sockfd);
}


x86 assembly (clang, -O0):
<nhtml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3d0900,-0x34(%rbp)
mov    0x2dca(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
mov    0x2dad(%rip),%rax
mov    (%rax),%edi
mov    0x2d8c(%rip),%rax
mov    (%rax),%esi
mov    0x2d93(%rip),%rax
mov    (%rax),%edx
call   1100 <socket@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    126d <nhtml+0x8d>
lea    0xd98(%rip),%rdi
call   10c0 <error@plt>
mov    -0x60(%rbp),%rdi
mov    0x2d50(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x8(%rbp),%rdi
call   10a0 <gethostbyname@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    12a4 <nhtml+0xc4>
lea    0xd76(%rip),%rdi
call   10d0 <perror@plt>
lea    -0x20(%rbp),%rdi
mov    $0xc,%esi
call   10e0 <bzero@plt>
mov    0x2d2f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x20(%rbp),%rsi
add    $0x4,%rsi
mov    -0x28(%rbp),%rax
mov    (%rax),%edx
call   10b0 <bcopy@plt>
mov    $0x50,%edi
call   1050 <htons@plt>
mov    %eax,-0x20(%rbp)
mov    -0x2c(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0xc,%edx
call   10f0 <connect@plt>
cmp    $0x0,%rax
jge    130d <nhtml+0x12d>
lea    0xd22(%rip),%rdi
call   10c0 <error@plt>
mov    -0x10(%rbp),%rsi
lea    0xd23(%rip),%rdi
call   1060 <printf@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x6c(%rbp),%edi
mov    -0x68(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
jge    135b <nhtml+0x17b>
lea    0xce9(%rip),%rdi
call   10c0 <error@plt>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%edx
xor    %esi,%esi
call   1070 <memset@plt>
movl   $0x3d0900,-0x50(%rbp)
jmp    1375 <nhtml+0x195>
mov    -0x60(%rbp),%rsi
movl   $0x0,-0x4c(%rbp)
mov    -0x2c(%rbp),%edi
mov    0x2c3e(%rip),%rax
mov    (%rax),%edx
call   1090 <read@plt>
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x58(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x58(%rbp),%eax
mov    %eax,-0x70(%rbp)
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x70(%rbp),%eax
cmp    %ecx,%eax
jge    13e4 <nhtml+0x204>
mov    -0x60(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    139b <nhtml+0x1bb>
mov    -0x60(%rbp),%rdi
mov    -0x4c(%rbp),%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x4c(%rbp),%ecx
mov    -0x50(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x50(%rbp)
cmpl   $0x0,-0x4c(%rbp)
jle    1411 <nhtml+0x231>
cmpl   $0x0,-0x50(%rbp)
jg     1416 <nhtml+0x236>
jmp    141b <nhtml+0x23b>
jmp    1370 <nhtml+0x190>
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x2c(%rbp),%edi
call   1080 <close@plt>
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nhtml>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r13
mov    %rdi,%r12
mov    %rsp,-0x50(%rbp)
mov    0x2dc6(%rip),%r15
mov    (%r15),%eax
add    $0x1,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x2dc8(%rip),%r14
mov    (%r14),%edi
mov    0x2da6(%rip),%rax
mov    (%rax),%esi
mov    0x2dad(%rip),%rax
mov    (%rax),%edx
call   1100 <socket@plt>
mov    %eax,-0x2c(%rbp)
test   %eax,%eax
jns    124d <nhtml+0x6d>
lea    0xdb8(%rip),%rdi
call   10c0 <error@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    %r12,%rdi
call   10a0 <gethostbyname@plt>
mov    %rax,%r12
test   %rax,%rax
je     13c1 <nhtml+0x1e1>
lea    -0x48(%rbp),%rdi
mov    $0xc,%esi
call   10e0 <bzero@plt>
mov    (%r14),%eax
mov    %eax,-0x40(%rbp)
mov    0x8(%r12),%rsi
lea    -0x44(%rbp),%rdi
mov    (%r12),%edx
call   10b0 <memmove@plt>
mov    $0x50,%edi
call   1050 <htons@plt>
mov    %eax,-0x48(%rbp)
mov    -0x2c(%rbp),%r14d
mov    %r14d,%edi
lea    -0x48(%rbp),%rsi
mov    $0xc,%edx
call   10f0 <connect@plt>
test   %rax,%rax
jns    12c7 <nhtml+0xe7>
lea    0xd68(%rip),%rdi
call   10c0 <error@plt>
lea    0xd6d(%rip),%rdi
mov    %r13,%rsi
call   1060 <printf@plt>
mov    %r13,%rdi
call   1040 <strlen@plt>
mov    %r14d,%edi
mov    %r13,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %eax,%eax
jns    12fb <nhtml+0x11b>
lea    0xd49(%rip),%rdi
call   10c0 <error@plt>
xor    %eax,%eax
mov    %rax,-0x38(%rbp)
mov    $0x3d0900,%r14d
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x3d0900,%edx
call   1070 <memset@plt>
mov    %r13,-0x58(%rbp)
nopw   0x0(%rax,%rax,1)
mov    (%r15),%edx
mov    -0x2c(%rbp),%edi
mov    %rbx,%rsi
call   1090 <read@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1382 <nhtml+0x1a2>
movslq -0x38(%rbp),%r15
add    %r13,%r15
xor    %r13d,%r13d
nopw   0x0(%rax,%rax,1)
movzbl (%rbx,%r13,1),%eax
mov    %al,(%r15,%r13,1)
add    $0x1,%r13
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%r13
jl     1350 <nhtml+0x170>
mov    -0x38(%rbp),%rax
add    %r13d,%eax
mov    %rax,-0x38(%rbp)
mov    -0x58(%rbp),%r13
mov    0x2c46(%rip),%r15
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r12d,%edx
call   1070 <memset@plt>
test   %r12d,%r12d
jle    139c <nhtml+0x1bc>
sub    %r12d,%r14d
test   %r14d,%r14d
jg     1320 <nhtml+0x140>
movslq -0x38(%rbp),%rax
movb   $0x0,0x0(%r13,%rax,1)
mov    -0x2c(%rbp),%edi
call   1080 <close@plt>
mov    -0x50(%rbp),%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc4d(%rip),%rdi
call   10d0 <perror@plt>
jmp    126e <nhtml+0x8e>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i32, i64 }
%struct.sockaddr = type { i32 }
@BUFSIZ = global i32 0
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [21 x i8] c"ERROR opening socket\00"
@.str.1 = [21 x i8] c"ERROR, no such host\0A\00"
@.str.2 = [17 x i8] c"ERROR connecting\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [24 x i8] c"ERROR writing to socket\00"
define void @nhtml(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.sockaddr_in
%6 = alloca %struct.hostent*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 4000000, i32* %9
%16 = load i32, i32* @BUFSIZ
%17 = add nsw i32 %16, 1
%18 = zext i32 %17 to i64
%19 = call i8* @llvm.stacksave()
store i8* %19, i8** %10
%20 = alloca i8, i64 %18
store i64 %18, i64* %11
store i32 0, i32* %14
store i32 0, i32* %15
%21 = load i32, i32* @AF_INET
%22 = load i32, i32* @SOCK_STREAM
%23 = load i32, i32* @IPPROTO_TCP
%24 = call i32 @socket(i32 %21, i32 %22, i32 %23)
store i32 %24, i32* %7
%25 = load i32, i32* %7
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %2
%28 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %29
29: ; preds = %27, %2
%30 = load i32, i32* @BUFSIZ
%31 = call i32 @memset(i8* %20, i32 0, i32 %30)
%32 = load i8*, i8** %3
%33 = call %struct.hostent* @gethostbyname(i8* %32)
store %struct.hostent* %33, %struct.hostent** %6
%34 = icmp eq %struct.hostent* %33, null
br i1 %34, label %35, label %37
35: ; preds = %29
%36 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %37
37: ; preds = %35, %29
%38 = bitcast %struct.sockaddr_in* %5 to i8*
%39 = call i32 @bzero(i8* %38, i32 12)
%40 = load i32, i32* @AF_INET
%41 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i32 0, i32 2
store i32 %40, i32* %41
%42 = load %struct.hostent*, %struct.hostent** %6
%43 = getelementptr inbounds %struct.hostent, %struct.hostent* %42, i32 0, i32 1
%44 = load i64, i64* %43
%45 = inttoptr i64 %44 to i8*
%46 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i32 0, i32 1
%47 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %46, i32 0, i32 0
%48 = bitcast i32* %47 to i8*
%49 = load %struct.hostent*, %struct.hostent** %6
%50 = getelementptr inbounds %struct.hostent, %struct.hostent* %49, i32 0, i32 0
%51 = load i32, i32* %50
%52 = call i32 @bcopy(i8* %45, i8* %48, i32 %51)
%53 = call i32 @htons(i32 80)
%54 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i32 0, i32 0
store i32 %53, i32* %54
%55 = load i32, i32* %7
%56 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%57 = call i64 @connect(i32 %55, %struct.sockaddr* %56, i32 12)
%58 = icmp slt i64 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %37
%60 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %61
61: ; preds = %59, %37
%62 = load i8*, i8** %4
%63 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %62)
%64 = load i32, i32* %7
%65 = load i8*, i8** %4
%66 = load i8*, i8** %4
%67 = call i32 @strlen(i8* %66)
%68 = call i32 @write(i32 %64, i8* %65, i32 %67)
store i32 %68, i32* %12
%69 = load i32, i32* %12
%70 = icmp slt i32 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %61
%72 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %73
73: ; preds = %71, %61
%74 = load i8*, i8** %4
%75 = load i32, i32* %9
%76 = call i32 @memset(i8* %74, i32 0, i32 %75)
store i32 4000000, i32* %13
br label %77
77: ; preds = %112, %73
br label %78
78: ; preds = %77
store i32 0, i32* %12
%79 = load i32, i32* %7
%80 = load i32, i32* @BUFSIZ
%81 = call i32 @read(i32 %79, i8* %20, i32 %80)
store i32 %81, i32* %12
store i32 0, i32* %15
br label %82
82: ; preds = %97, %78
%83 = load i32, i32* %15
%84 = call i32 @strlen(i8* %20)
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %100
86: ; preds = %82
%87 = load i32, i32* %15
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8, i8* %20, i64 %88
%90 = load i8, i8* %89
%91 = load i8*, i8** %4
%92 = load i32, i32* %14
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8, i8* %91, i64 %93
store i8 %90, i8* %94
%95 = load i32, i32* %14
%96 = add nsw i32 %95, 1
store i32 %96, i32* %14
br label %97
97: ; preds = %86
%98 = load i32, i32* %15
%99 = add nsw i32 %98, 1
store i32 %99, i32* %15
br label %82
100: ; preds = %82
%101 = load i32, i32* %12
%102 = call i32 @memset(i8* %20, i32 0, i32 %101)
%103 = load i32, i32* %12
%104 = load i32, i32* %13
%105 = sub nsw i32 %104, %103
store i32 %105, i32* %13
%106 = load i32, i32* %12
%107 = icmp sle i32 %106, 0
br i1 %107, label %111, label %108
108: ; preds = %100
%109 = load i32, i32* %13
%110 = icmp sle i32 %109, 0
br i1 %110, label %111, label %112
111: ; preds = %108, %100
br label %113
112: ; preds = %108
br label %77
113: ; preds = %111
%114 = load i8*, i8** %4
%115 = load i32, i32* %14
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i8, i8* %114, i64 %116
store i8 0, i8* %117
%118 = load i32, i32* %7
%119 = call i32 @close(i32 %118)
%120 = load i8*, i8** %10
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i32, i64 }
%struct.sockaddr = type { i32 }
@BUFSIZ = global i32 0
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [21 x i8] c"ERROR opening socket\00"
@.str.1 = [21 x i8] c"ERROR, no such host\0A\00"
@.str.2 = [17 x i8] c"ERROR connecting\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [24 x i8] c"ERROR writing to socket\00"
define void @nhtml(i8* %0, i8* %1) {
%3 = alloca %struct.sockaddr_in
%4 = bitcast %struct.sockaddr_in* %3 to i8*
%5 = load i32, i32* @BUFSIZ
%6 = add nsw i32 %5, 1
%7 = zext i32 %6 to i64
%8 = tail call i8* @llvm.stacksave()
%9 = alloca i8, i64 %7
%10 = load i32, i32* @AF_INET
%11 = load i32, i32* @SOCK_STREAM
%12 = load i32, i32* @IPPROTO_TCP
%13 = tail call i32 @socket(i32 %10, i32 %11, i32 %12)
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = tail call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %2
%18 = load i32, i32* @BUFSIZ
%19 = call i32 @memset(i8* %9, i32 0, i32 %18)
%20 = call %struct.hostent* @gethostbyname(i8* %0)
%21 = icmp eq %struct.hostent* %20, null
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %22, %17
%25 = call i32 @bzero(i8* %4, i32 12)
%26 = load i32, i32* @AF_INET
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %26, i32* %27
%28 = getelementptr inbounds %struct.hostent, %struct.hostent* %20, i64 0, i32 1
%29 = load i64, i64* %28
%30 = inttoptr i64 %29 to i8*
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
%32 = bitcast i32* %31 to i8*
%33 = getelementptr inbounds %struct.hostent, %struct.hostent* %20, i64 0, i32 0
%34 = load i32, i32* %33
%35 = call i32 @htons(i32 80)
%36 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %35, i32* %36
%37 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%38 = call i64 @connect(i32 %13, %struct.sockaddr* %37, i32 12)
%39 = icmp slt i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %24
%41 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %42
42: ; preds = %40, %24
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%44 = call i32 @strlen(i8* %1)
%45 = call i32 @write(i32 %13, i8* %1, i32 %44)
%46 = icmp slt i32 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %42
%48 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %49
49: ; preds = %47, %42
%50 = call i32 @memset(i8* %1, i32 0, i32 4000000)
br label %51
51: ; preds = %73, %49
%52 = phi i32 [ 4000000, %49 ], [ %76, %73 ]
%53 = phi i32 [ 0, %49 ], [ %74, %73 ]
%54 = load i32, i32* @BUFSIZ
%55 = call i32 @read(i32 %13, i8* %9, i32 %54)
%56 = call i32 @strlen(i8* %9)
%57 = icmp sgt i32 %56, 0
br i1 %57, label %58, label %73
58: ; preds = %51
%59 = sext i32 %53 to i64
br label %60
60: ; preds = %58, %60
%61 = phi i64 [ %59, %58 ], [ %66, %60 ]
%62 = phi i64 [ 0, %58 ], [ %67, %60 ]
%63 = getelementptr inbounds i8, i8* %9, i64 %62
%64 = load i8, i8* %63
%65 = getelementptr inbounds i8, i8* %1, i64 %61
store i8 %64, i8* %65
%66 = add nsw i64 %61, 1
%67 = add nuw nsw i64 %62, 1
%68 = call i32 @strlen(i8* %9)
%69 = sext i32 %68 to i64
%70 = icmp slt i64 %67, %69
br i1 %70, label %60, label %71
71: ; preds = %60
%72 = trunc i64 %66 to i32
br label %73
73: ; preds = %71, %51
%74 = phi i32 [ %53, %51 ], [ %72, %71 ]
%75 = call i32 @memset(i8* %9, i32 0, i32 %55)
%76 = sub nsw i32 %52, %55
%77 = icmp slt i32 %55, 1
%78 = icmp slt i32 %76, 1
%79 = select i1 %77, i1 true, i1 %78
br i1 %79, label %80, label %51
80: ; preds = %73
%81 = sext i32 %74 to i64
%82 = getelementptr inbounds i8, i8* %1, i64 %81
store i8 0, i8* %82
%83 = call i32 @close(i32 %13)
ret void
}