#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 in_addr {
  int dummy;
};
struct hostent {
  char *h_name;
  scalar_t__ h_addr_list;
};
typedef int /*<<< orphan*/ servaddr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ herror(char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
char *inet_ntoa(struct in_addr);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ recv(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  int sockfd;
  int i;
  struct sockaddr_in servaddr;
  struct hostent *he;
  struct in_addr **addr_list;
  char sendline[4096], recvline[4096];
  if (argc != 2) {
    perror("Usage: TCPClient <IP address of the server");
    exit(1);
  }
  if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    perror("Problem in creating the socket");
    exit(2);
  }
  if ((he = gethostbyname(argv[1])) == NULL) {
    herror("gethostbyname");
    return 2;
  }
  printf("Machine name: %s\n", he->h_name);
  addr_list = (struct in_addr **)he->h_addr_list;
  printf("IP address: %s \n", inet_ntoa(*addr_list[0]));
  memset(&servaddr, 0, sizeof(servaddr));
  servaddr.sin_family = AF_INET;
  servaddr.sin_addr.s_addr = inet_addr(inet_ntoa(*addr_list[0]));
  servaddr.sin_port = htons(3000);
  if (connect(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0) {
    perror("Problem in connecting to the server");
    exit(3);
  }
  while (fgets(sendline, 4096, stdin) != NULL) {
    send(sockfd, sendline, strlen(sendline), 0);
    if (recv(sockfd, recvline, 4096, 0) == 0) {
      perror("The server terminated prematurely");
      exit(4);
    }
    printf("%s", "String received from the server: ");
    fputs(recvline, stdout);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2050,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1239 <main+0x39>
lea    0xdd6(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
mov    0x2d87(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1274 <main+0x74>
lea    0xdc6(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x2,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <gethostbyname@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    12a9 <main+0xa9>
lea    0xdb4(%rip),%rdi
call   10e0 <herror@plt>
mov    $0x2,%eax
add    $0x2050,%rsp
pop    %rbp
ret
mov    -0x30(%rbp),%rax
mov    (%rax),%rsi
lea    0xda1(%rip),%rdi
call   1080 <printf@plt>
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,%rsi
lea    0xd8a(%rip),%rdi
call   1080 <printf@plt>
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10a0 <memset@plt>
mov    0x2cec(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,%rdi
call   10c0 <inet_addr@plt>
mov    %eax,-0x24(%rbp)
mov    $0xbb8,%edi
call   1060 <htons@plt>
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0xc,%edx
call   1110 <connect@plt>
cmp    $0x0,%rax
jge    1358 <main+0x158>
lea    0xd32(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x3,%edi
call   1100 <exit@plt>
jmp    135d <main+0x15d>
lea    -0x1040(%rbp),%rdi
mov    0x2c75(%rip),%rax
mov    (%rax),%edx
mov    $0x1000,%esi
call   10b0 <fgets@plt>
cmp    $0x0,%rax
je     141d <main+0x21d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x204c(%rbp)
lea    -0x1040(%rbp),%rax
mov    %rax,-0x2048(%rbp)
lea    -0x1040(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x204c(%rbp),%edi
mov    -0x2048(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
mov    -0x14(%rbp),%edi
lea    -0x2040(%rbp),%rsi
mov    $0x1000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0x0,%rax
jne    13f0 <main+0x1f0>
lea    0xcbe(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x4,%edi
call   1100 <exit@plt>
lea    0xcca(%rip),%rdi
lea    0xcc6(%rip),%rsi
call   1080 <printf@plt>
lea    -0x2040(%rbp),%rdi
mov    0x2bb7(%rip),%rax
mov    (%rax),%esi
call   1090 <fputs@plt>
jmp    135d <main+0x15d>
xor    %edi,%edi
call   1100 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2018,%rsp
cmp    $0x2,%edi
jne    126a <main+0x6a>
mov    %rsi,%rbx
mov    0x2dc8(%rip),%r15
mov    (%r15),%edi
mov    0x2da6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
test   %eax,%eax
js     1280 <main+0x80>
mov    %eax,%ebp
mov    0x8(%rbx),%rdi
call   10d0 <gethostbyname@plt>
test   %rax,%rax
jne    1296 <main+0x96>
lea    0xdfc(%rip),%rdi
call   10e0 <herror@plt>
mov    $0x2,%eax
add    $0x2018,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd8f(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xda4(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x2,%edi
call   1100 <exit@plt>
mov    %rax,%rbx
mov    (%rax),%rsi
lea    0xdb5(%rip),%rdi
call   1080 <printf@plt>
mov    0x8(%rbx),%rbx
mov    (%rbx),%rax
mov    (%rax),%edi
call   1040 <inet_ntoa@plt>
lea    0xdad(%rip),%rdi
mov    %rax,%rsi
call   1080 <printf@plt>
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10a0 <memset@plt>
mov    (%r15),%eax
mov    %eax,0x8(%rsp)
mov    (%rbx),%rax
mov    (%rax),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,%rdi
call   10c0 <inet_addr@plt>
mov    %eax,0x4(%rsp)
mov    $0xbb8,%edi
call   1060 <htons@plt>
mov    %eax,(%rsp)
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0xc,%edx
call   1110 <connect@plt>
test   %rax,%rax
jns    132b <main+0x12b>
lea    0xd5f(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x3,%edi
call   1100 <exit@plt>
mov    0x2cae(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%rdi
mov    $0x1000,%esi
call   10b0 <fgets@plt>
test   %rax,%rax
je     13c6 <main+0x1c6>
lea    0x10(%rsp),%r14
lea    0x1010(%rsp),%r15
lea    0xd65(%rip),%r12
lea    0xd61(%rip),%r13
mov    0x2c5e(%rip),%rbx
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0x1000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %rax,%rax
je     13cd <main+0x1cd>
mov    %r12,%rdi
mov    %r13,%rsi
call   1080 <printf@plt>
mov    (%rbx),%esi
mov    %r15,%rdi
call   1090 <fputs@plt>
mov    0x2c2e(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
mov    $0x1000,%esi
call   10b0 <fgets@plt>
test   %rax,%rax
jne    136a <main+0x16a>
xor    %edi,%edi
call   1100 <exit@plt>
lea    0xccb(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x4,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i8*, i64 }
%struct.in_addr = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [43 x i8] c"Usage: TCPClient <IP address of the server\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [31 x i8] c"Problem in creating the socket\00"
@.str.2 = [14 x i8] c"gethostbyname\00"
@.str.3 = [18 x i8] c"Machine name: %s\0A\00"
@.str.4 = [17 x i8] c"IP address: %s \0A\00"
@.str.5 = [36 x i8] c"Problem in connecting to the server\00"
@stdin = global i32 0
@.str.6 = [34 x i8] c"The server terminated prematurely\00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [34 x i8] c"String received from the server: \00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.sockaddr_in
%9 = alloca %struct.hostent*
%10 = alloca %struct.in_addr**
%11 = alloca [4096 x i8]
%12 = alloca [4096 x i8]
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, 2
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = call i32 @perror(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = load i32, i32* @AF_INET
%20 = load i32, i32* @SOCK_STREAM
%21 = call i32 @socket(i32 %19, i32 %20, i32 0)
store i32 %21, i32* %6
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%25 = call i32 @exit(i32 2)
unreachable
26: ; preds = %18
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call %struct.hostent* @gethostbyname(i8* %29)
store %struct.hostent* %30, %struct.hostent** %9
%31 = icmp eq %struct.hostent* %30, null
br i1 %31, label %32, label %34
32: ; preds = %26
%33 = call i32 @herror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret i32 2
34: ; preds = %26
%35 = load %struct.hostent*, %struct.hostent** %9
%36 = getelementptr inbounds %struct.hostent, %struct.hostent* %35, i32 0, i32 0
%37 = load i8*, i8** %36
%38 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %37)
%39 = load %struct.hostent*, %struct.hostent** %9
%40 = getelementptr inbounds %struct.hostent, %struct.hostent* %39, i32 0, i32 1
%41 = load i64, i64* %40
%42 = inttoptr i64 %41 to %struct.in_addr**
store %struct.in_addr** %42, %struct.in_addr*** %10
%43 = load %struct.in_addr**, %struct.in_addr*** %10
%44 = getelementptr inbounds %struct.in_addr*, %struct.in_addr** %43, i64 0
%45 = load %struct.in_addr*, %struct.in_addr** %44
%46 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %45, i32 0, i32 0
%47 = load i32, i32* %46
%48 = call i8* @inet_ntoa(i32 %47)
%49 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %48)
%50 = call i32 @memset(%struct.sockaddr_in* %8, i32 0, i32 12)
%51 = load i32, i32* @AF_INET
%52 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
store i32 %51, i32* %52
%53 = load %struct.in_addr**, %struct.in_addr*** %10
%54 = getelementptr inbounds %struct.in_addr*, %struct.in_addr** %53, i64 0
%55 = load %struct.in_addr*, %struct.in_addr** %54
%56 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %55, i32 0, i32 0
%57 = load i32, i32* %56
%58 = call i8* @inet_ntoa(i32 %57)
%59 = call i32 @inet_addr(i8* %58)
%60 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
%61 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %60, i32 0, i32 0
store i32 %59, i32* %61
%62 = call i32 @htons(i32 3000)
%63 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
store i32 %62, i32* %63
%64 = load i32, i32* %6
%65 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%66 = call i64 @connect(i32 %64, %struct.sockaddr* %65, i32 12)
%67 = icmp slt i64 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %34
%69 = call i32 @perror(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
%70 = call i32 @exit(i32 3)
unreachable
71: ; preds = %34
br label %72
72: ; preds = %90, %71
%73 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%74 = load i32, i32* @stdin
%75 = call i32* @fgets(i8* %73, i32 4096, i32 %74)
%76 = icmp ne i32* %75, null
br i1 %76, label %77, label %95
77: ; preds = %72
%78 = load i32, i32* %6
%79 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%80 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%81 = call i32 @strlen(i8* %80)
%82 = call i32 @send(i32 %78, i8* %79, i32 %81, i32 0)
%83 = load i32, i32* %6
%84 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%85 = call i64 @recv(i32 %83, i8* %84, i32 4096, i32 0)
%86 = icmp eq i64 %85, 0
br i1 %86, label %87, label %90
87: ; preds = %77
%88 = call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0))
%89 = call i32 @exit(i32 4)
unreachable
90: ; preds = %77
%91 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
%92 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%93 = load i32, i32* @stdout
%94 = call i32 @fputs(i8* %92, i32 %93)
br label %72
95: ; preds = %72
%96 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i8*, i64 }
%struct.in_addr = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [43 x i8] c"Usage: TCPClient <IP address of the server\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [31 x i8] c"Problem in creating the socket\00"
@.str.2 = [14 x i8] c"gethostbyname\00"
@.str.3 = [18 x i8] c"Machine name: %s\0A\00"
@.str.4 = [17 x i8] c"IP address: %s \0A\00"
@.str.5 = [36 x i8] c"Problem in connecting to the server\00"
@stdin = global i32 0
@.str.6 = [34 x i8] c"The server terminated prematurely\00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [34 x i8] c"String received from the server: \00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [4096 x i8]
%5 = alloca [4096 x i8]
%6 = bitcast %struct.sockaddr_in* %3 to i8*
%7 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%9 = icmp eq i32 %0, 2
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = tail call i32 @perror(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i32, i32* @AF_INET
%15 = load i32, i32* @SOCK_STREAM
%16 = tail call i32 @socket(i32 %14, i32 %15, i32 0)
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = tail call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%20 = tail call i32 @exit(i32 2)
unreachable
21: ; preds = %13
%22 = getelementptr inbounds i8*, i8** %1, i64 1
%23 = load i8*, i8** %22
%24 = tail call %struct.hostent* @gethostbyname(i8* %23)
%25 = icmp eq %struct.hostent* %24, null
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = tail call i32 @herror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret i32 2
28: ; preds = %21
%29 = getelementptr inbounds %struct.hostent, %struct.hostent* %24, i64 0, i32 0
%30 = load i8*, i8** %29
%31 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %30)
%32 = getelementptr inbounds %struct.hostent, %struct.hostent* %24, i64 0, i32 1
%33 = load i64, i64* %32
%34 = inttoptr i64 %33 to %struct.in_addr**
%35 = load %struct.in_addr*, %struct.in_addr** %34
%36 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %35, i64 0, i32 0
%37 = load i32, i32* %36
%38 = tail call i8* @inet_ntoa(i32 %37)
%39 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %38)
%40 = call i32 @memset(%struct.sockaddr_in* %3, i32 0, i32 12)
%41 = load i32, i32* @AF_INET
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %41, i32* %42
%43 = load %struct.in_addr*, %struct.in_addr** %34
%44 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %43, i64 0, i32 0
%45 = load i32, i32* %44
%46 = call i8* @inet_ntoa(i32 %45)
%47 = call i32 @inet_addr(i8* %46)
%48 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
store i32 %47, i32* %48
%49 = call i32 @htons(i32 3000)
%50 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %49, i32* %50
%51 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%52 = call i64 @connect(i32 %16, %struct.sockaddr* %51, i32 12)
%53 = icmp slt i64 %52, 0
br i1 %53, label %58, label %54
54: ; preds = %28
%55 = load i32, i32* @stdin
%56 = call i32* @fgets(i8* %7, i32 4096, i32 %55)
%57 = icmp eq i32* %56, null
br i1 %57, label %76, label %61
58: ; preds = %28
%59 = call i32 @perror(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
%60 = call i32 @exit(i32 3)
unreachable
61: ; preds = %54, %69
%62 = call i32 @strlen(i8* %7)
%63 = call i32 @send(i32 %16, i8* %7, i32 %62, i32 0)
%64 = call i64 @recv(i32 %16, i8* %8, i32 4096, i32 0)
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %69
66: ; preds = %61
%67 = call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0))
%68 = call i32 @exit(i32 4)
unreachable
69: ; preds = %61
%70 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
%71 = load i32, i32* @stdout
%72 = call i32 @fputs(i8* %8, i32 %71)
%73 = load i32, i32* @stdin
%74 = call i32* @fgets(i8* %7, i32 4096, i32 %73)
%75 = icmp eq i32* %74, null
br i1 %75, label %76, label %61
76: ; preds = %69, %54
%77 = call i32 @exit(i32 0)
unreachable
}