#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 {
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ host;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int atoi(char *);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ htons(int);
scalar_t__ inet_aton(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int clientsock, portno;
  char buffer[256], hostaddr[24];
  struct sockaddr_in host;
  int n, x;
  if (argc != 3) {
    fprintf(stderr, "ERROR, the program should be called with the following "
                    "parameters: \nProgram_Name hostname port\n");
    exit(-1);
  }
  if (strcmp(argv[1], "localhost")) {
    strcpy(hostaddr, "127.0.0.1");
  } else {
    strcpy(hostaddr, argv[1]);
  }
  bzero(buffer, 256);
  printf("Enter in a message to send to the server");
  scanf("%s", buffer);
  clientsock = socket(AF_INET, SOCK_STREAM, 0);
  if (clientsock < 0)
    error("ERROR opening socket");
  bzero((char *)&host, sizeof(host));
  portno = atoi(argv[2]);
  if (portno == 0) {
    error("Conversion of port failed");
  }
  host.sin_family = AF_INET;
  host.sin_port = htons(portno);
  if (inet_aton(hostaddr, &host.sin_addr.s_addr) == 0) {
    error("ERROR, destination of the server must be an ip address");
  }
  if (connect(clientsock, (struct sockaddr *)&host, sizeof(host)) < 0) {
    error("ERROR on connect");
  }
  n = write(clientsock, buffer, strlen(buffer));
  if (n < 0)
    error("ERROR writing to socket");
  bzero(buffer, 256);
  n = read(clientsock, buffer, 255);
  if (n < 0)
    error("ERROR reading from socket");
  printf("Here is the message: %s\n", buffer);
  close(clientsock);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1252 <main+0x42>
mov    0x2d9e(%rip),%rax
mov    (%rax),%edi
lea    0xdbd(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0xffffffff,%edi
call   1110 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdff(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     1288 <main+0x78>
lea    -0x140(%rbp),%rdi
lea    0xdec(%rip),%rsi
call   1030 <strcpy@plt>
jmp    129c <main+0x8c>
lea    -0x140(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x120(%rbp),%rdi
mov    $0x100,%esi
call   10f0 <bzero@plt>
lea    0xdc0(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x120(%rbp),%rsi
lea    0xdd4(%rip),%rdi
call   10d0 <scanf@plt>
mov    0x2d13(%rip),%rax
mov    (%rax),%edi
mov    0x2cf2(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1300 <main+0xf0>
lea    0xda5(%rip),%rdi
call   10e0 <error@plt>
lea    -0x150(%rbp),%rdi
mov    $0xc,%esi
call   10f0 <bzero@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1337 <main+0x127>
lea    0xd83(%rip),%rdi
call   10e0 <error@plt>
mov    0x2caa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x148(%rbp)
mov    -0x18(%rbp),%edi
call   1060 <htons@plt>
mov    %eax,-0x14c(%rbp)
lea    -0x140(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   10c0 <inet_aton@plt>
cmp    $0x0,%rax
jne    137d <main+0x16d>
lea    0xd57(%rip),%rdi
call   10e0 <error@plt>
mov    -0x14(%rbp),%edi
lea    -0x150(%rbp),%rsi
mov    $0xc,%edx
call   1120 <connect@plt>
cmp    $0x0,%rax
jge    13a7 <main+0x197>
lea    0xd64(%rip),%rdi
call   10e0 <error@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x164(%rbp)
lea    -0x120(%rbp),%rax
mov    %rax,-0x160(%rbp)
lea    -0x120(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x164(%rbp),%edi
mov    -0x160(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    %eax,-0x154(%rbp)
cmpl   $0x0,-0x154(%rbp)
jge    13fd <main+0x1ed>
lea    0xd1f(%rip),%rdi
call   10e0 <error@plt>
lea    -0x120(%rbp),%rdi
mov    $0x100,%esi
call   10f0 <bzero@plt>
mov    -0x14(%rbp),%edi
lea    -0x120(%rbp),%rsi
mov    $0xff,%edx
call   1090 <read@plt>
mov    %eax,-0x154(%rbp)
cmpl   $0x0,-0x154(%rbp)
jge    1441 <main+0x231>
lea    0xcf3(%rip),%rdi
call   10e0 <error@plt>
lea    -0x120(%rbp),%rsi
lea    0xcfa(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
xor    %eax,%eax
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x138,%rsp
cmp    $0x3,%edi
jne    13ac <main+0x19c>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
lea    0xe2c(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1247 <main+0x37>
lea    0xe25(%rip),%rsi
jmp    124b <main+0x3b>
mov    0x8(%r14),%rsi
lea    0x10(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   10f0 <bzero@plt>
lea    0xe06(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe21(%rip),%rdi
mov    %rbx,%rsi
call   10d0 <scanf@plt>
mov    0x2d5d(%rip),%r15
mov    (%r15),%edi
mov    0x2d3b(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    12b0 <main+0xa0>
lea    0xdf5(%rip),%rdi
call   10e0 <error@plt>
mov    %rsp,%rdi
mov    $0xc,%esi
call   10f0 <bzero@plt>
mov    0x10(%r14),%rdi
call   1100 <atoi@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    12d8 <main+0xc8>
lea    0xde2(%rip),%rdi
call   10e0 <error@plt>
mov    (%r15),%eax
mov    %eax,0x8(%rsp)
mov    %ebp,%edi
call   1060 <htons@plt>
mov    %eax,0x4(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
call   10c0 <inet_aton@plt>
test   %rax,%rax
jne    1308 <main+0xf8>
lea    0xdcc(%rip),%rdi
call   10e0 <error@plt>
mov    %rsp,%rsi
mov    %ebx,%edi
mov    $0xc,%edx
call   1120 <connect@plt>
test   %rax,%rax
jns    1328 <main+0x118>
lea    0xde3(%rip),%rdi
call   10e0 <error@plt>
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
call   1050 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1040 <write@plt>
test   %eax,%eax
jns    1351 <main+0x141>
lea    0xdcb(%rip),%rdi
call   10e0 <error@plt>
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x100,%esi
call   10f0 <bzero@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0xff,%edx
call   1090 <read@plt>
test   %eax,%eax
jns    1382 <main+0x172>
lea    0xdb2(%rip),%rdi
call   10e0 <error@plt>
lea    0xdc0(%rip),%rdi
lea    0x30(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   1080 <close@plt>
xor    %eax,%eax
add    $0x138,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c25(%rip),%rax
mov    (%rax),%edi
lea    0xc44(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0xffffffff,%edi
call   1110 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [96 x i8] c"ERROR, the program should be called with the following parameters: \0AProgram_Name hostname port\0A\00"
@.str.1 = [10 x i8] c"localhost\00"
@.str.2 = [10 x i8] c"127.0.0.1\00"
@.str.3 = [41 x i8] c"Enter in a message to send to the server\00"
@.str.4 = [3 x i8] c"%s\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.5 = [21 x i8] c"ERROR opening socket\00"
@.str.6 = [26 x i8] c"Conversion of port failed\00"
@.str.7 = [55 x i8] c"ERROR, destination of the server must be an ip address\00"
@.str.8 = [17 x i8] c"ERROR on connect\00"
@.str.9 = [24 x i8] c"ERROR writing to socket\00"
@.str.10 = [26 x i8] c"ERROR reading from socket\00"
@.str.11 = [25 x i8] c"Here is the message: %s\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 [256 x i8]
%9 = alloca [24 x i8]
%10 = alloca %struct.sockaddr_in
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 3
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 -1)
unreachable
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = getelementptr inbounds [24 x i8], [24 x i8]* %9, i64 0, i64 0
%27 = call i32 @strcpy(i8* %26, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %34
28: ; preds = %19
%29 = getelementptr inbounds [24 x i8], [24 x i8]* %9, i64 0, i64 0
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 @strcpy(i8* %29, i8* %32)
br label %34
34: ; preds = %28, %25
%35 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%36 = call i32 @bzero(i8* %35, i32 256)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %38)
%40 = load i32, i32* @AF_INET
%41 = load i32, i32* @SOCK_STREAM
%42 = call i32 @socket(i32 %40, i32 %41, i32 0)
store i32 %42, i32* %6
%43 = load i32, i32* %6
%44 = icmp slt i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %34
%46 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
br label %47
47: ; preds = %45, %34
%48 = bitcast %struct.sockaddr_in* %10 to i8*
%49 = call i32 @bzero(i8* %48, i32 12)
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 2
%52 = load i8*, i8** %51
%53 = call i32 @atoi(i8* %52)
store i32 %53, i32* %7
%54 = load i32, i32* %7
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %47
%57 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
br label %58
58: ; preds = %56, %47
%59 = load i32, i32* @AF_INET
%60 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 2
store i32 %59, i32* %60
%61 = load i32, i32* %7
%62 = call i32 @htons(i32 %61)
%63 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 1
store i32 %62, i32* %63
%64 = getelementptr inbounds [24 x i8], [24 x i8]* %9, i64 0, i64 0
%65 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 0
%66 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %65, i32 0, i32 0
%67 = call i64 @inet_aton(i8* %64, i32* %66)
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %58
%70 = call i32 @error(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
br label %71
71: ; preds = %69, %58
%72 = load i32, i32* %6
%73 = bitcast %struct.sockaddr_in* %10 to %struct.sockaddr*
%74 = call i64 @connect(i32 %72, %struct.sockaddr* %73, i32 12)
%75 = icmp slt i64 %74, 0
br i1 %75, label %76, label %78
76: ; preds = %71
%77 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
br label %78
78: ; preds = %76, %71
%79 = load i32, i32* %6
%80 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%81 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%82 = call i32 @strlen(i8* %81)
%83 = call i32 @write(i32 %79, i8* %80, i32 %82)
store i32 %83, i32* %11
%84 = load i32, i32* %11
%85 = icmp slt i32 %84, 0
br i1 %85, label %86, label %88
86: ; preds = %78
%87 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
br label %88
88: ; preds = %86, %78
%89 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%90 = call i32 @bzero(i8* %89, i32 256)
%91 = load i32, i32* %6
%92 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%93 = call i32 @read(i32 %91, i8* %92, i32 255)
store i32 %93, i32* %11
%94 = load i32, i32* %11
%95 = icmp slt i32 %94, 0
br i1 %95, label %96, label %98
96: ; preds = %88
%97 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0))
br label %98
98: ; preds = %96, %88
%99 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0), i8* %99)
%101 = load i32, i32* %6
%102 = call i32 @close(i32 %101)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [96 x i8] c"ERROR, the program should be called with the following parameters: \0AProgram_Name hostname port\0A\00"
@.str.1 = [10 x i8] c"localhost\00"
@.str.2 = [10 x i8] c"127.0.0.1\00"
@.str.3 = [41 x i8] c"Enter in a message to send to the server\00"
@.str.4 = [3 x i8] c"%s\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.5 = [21 x i8] c"ERROR opening socket\00"
@.str.6 = [26 x i8] c"Conversion of port failed\00"
@.str.7 = [55 x i8] c"ERROR, destination of the server must be an ip address\00"
@.str.8 = [17 x i8] c"ERROR on connect\00"
@.str.9 = [24 x i8] c"ERROR writing to socket\00"
@.str.10 = [26 x i8] c"ERROR reading from socket\00"
@.str.11 = [25 x i8] c"Here is the message: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca [24 x i8]
%5 = alloca %struct.sockaddr_in
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [24 x i8], [24 x i8]* %4, i64 0, i64 0
%8 = bitcast %struct.sockaddr_in* %5 to i8*
%9 = icmp eq i32 %0, 3
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load i8*, i8** %15
br label %21
21: ; preds = %14, %19
%22 = phi i8* [ %20, %19 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %14 ]
%23 = call i32 @strcpy(i8* %7, i8* %22)
%24 = call i32 @bzero(i8* %6, i32 256)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %6)
%27 = load i32, i32* @AF_INET
%28 = load i32, i32* @SOCK_STREAM
%29 = call i32 @socket(i32 %27, i32 %28, i32 0)
%30 = icmp slt i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %21
%32 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
br label %33
33: ; preds = %31, %21
%34 = call i32 @bzero(i8* %8, i32 12)
%35 = getelementptr inbounds i8*, i8** %1, i64 2
%36 = load i8*, i8** %35
%37 = call i32 @atoi(i8* %36)
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %33
%40 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
br label %41
41: ; preds = %39, %33
%42 = load i32, i32* @AF_INET
%43 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 2
store i32 %42, i32* %43
%44 = call i32 @htons(i32 %37)
%45 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 1
store i32 %44, i32* %45
%46 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 0, i32 0
%47 = call i64 @inet_aton(i8* %7, i32* %46)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %41
%50 = call i32 @error(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
br label %51
51: ; preds = %49, %41
%52 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%53 = call i64 @connect(i32 %29, %struct.sockaddr* %52, i32 12)
%54 = icmp slt i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
br label %57
57: ; preds = %55, %51
%58 = call i32 @strlen(i8* %6)
%59 = call i32 @write(i32 %29, i8* %6, i32 %58)
%60 = icmp slt i32 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %57
%62 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
br label %63
63: ; preds = %61, %57
%64 = call i32 @bzero(i8* %6, i32 256)
%65 = call i32 @read(i32 %29, i8* %6, i32 255)
%66 = icmp slt i32 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %63
%68 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0))
br label %69
69: ; preds = %67, %63
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0), i8* %6)
%71 = call i32 @close(i32 %29)
ret i32 0
}