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

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ bzero(struct sockaddr_in *, int);
int close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
scalar_t__ inet_aton(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int recv(int, char *, int, int /*<<< orphan*/);
int send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char *argv[]) {
  struct sockaddr_in server_addr;
  int connfd;
  char buf[1024 + 1];
  int n;
  if (argc != 3) {
    perror("Please use 3 args\n");
    exit(1);
  }
  connfd = socket(AF_INET, SOCK_STREAM, 0);
  bzero(&server_addr, sizeof(server_addr));
  server_addr.sin_family = AF_INET;
  server_addr.sin_port = htons(atoi(argv[2]));
  if (inet_aton(argv[1], &server_addr.sin_addr) == 0) {
    perror("inet_aton.");
    exit(1);
  }
  if (connect(connfd, (struct sockaddr *)&server_addr, sizeof(server_addr)) <
      0) {
    perror("Connecting");
    exit(1);
  }
  while (1) {
    memset(buf, 0, 1024 + 1);
    printf("You would puts: ");
    fgets(buf, sizeof(buf), stdin);
    n = send(connfd, buf, strlen(buf), 0);
    if (n == -1) {
      perror("Send to Server");
      exit(1);
    }
    if (strcmp(buf, "exit\n") == 0) {
      break;
    }
    n = recv(connfd, buf, 1024, 0);
    if (n == -1) {
      perror("Receive from Server");
      exit(1);
    }
    if (strcmp(buf, "exit\n") == 0) {
      break;
    }
    if (n == 0) {
      perror("Note: Sorry,server closed.\n");
      exit(1);
    } else {
      buf[n] = '\0';
      printf("Server send to you: %s", buf);
    }
  }
  if (close(connfd) == -1) {
    perror("Close");
    exit(1);
  }
  puts("TCP Client has been closed");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1249 <main+0x39>
lea    0xdc6(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    0x2d98(%rip),%rax
mov    (%rax),%edi
mov    0x2d77(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0xc,%esi
call   10f0 <bzero@plt>
mov    0x2d6e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1060 <htons@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x20(%rbp),%rsi
call   10d0 <inet_aton@plt>
cmp    $0x0,%rax
jne    12c7 <main+0xb7>
lea    0xd5b(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0xc,%edx
call   1120 <connect@plt>
cmp    $0x0,%rax
jge    12f8 <main+0xe8>
lea    0xd35(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
jmp    12fd <main+0xed>
lea    -0x430(%rbp),%rdi
xor    %esi,%esi
mov    $0x401,%edx
call   1090 <memset@plt>
lea    0xd12(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x430(%rbp),%rdi
mov    0x2cb4(%rip),%rax
mov    (%rax),%edx
mov    $0x401,%esi
call   10b0 <fgets@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x444(%rbp)
lea    -0x430(%rbp),%rax
mov    %rax,-0x440(%rbp)
lea    -0x430(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x444(%rbp),%edi
mov    -0x440(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
mov    %eax,-0x434(%rbp)
cmpl   $0xffffffff,-0x434(%rbp)
jne    139a <main+0x18a>
lea    0xcaf(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    -0x430(%rbp),%rdi
lea    0xca1(%rip),%rsi
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
jne    13bc <main+0x1ac>
jmp    1469 <main+0x259>
mov    -0x24(%rbp),%edi
lea    -0x430(%rbp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x434(%rbp)
cmpl   $0xffffffff,-0x434(%rbp)
jne    13fb <main+0x1eb>
lea    0xc63(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    -0x430(%rbp),%rdi
lea    0xc40(%rip),%rsi
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
jne    141d <main+0x20d>
jmp    1469 <main+0x259>
cmpl   $0x0,-0x434(%rbp)
jne    1440 <main+0x230>
lea    0xc32(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
movslq -0x434(%rbp),%rax
movb   $0x0,-0x430(%rbp,%rax,1)
lea    -0x430(%rbp),%rsi
lea    0xc22(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    12fd <main+0xed>
mov    -0x24(%rbp),%edi
call   10a0 <close@plt>
cmp    $0xffffffff,%eax
jne    1490 <main+0x280>
lea    0xc15(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    0xc05(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
cmp    $0x3,%edi
jne    13ba <main+0x1aa>
mov    %rsi,%rbx
mov    0x2db4(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2d92(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,%r13d
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xc,%esi
call   10f0 <bzero@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    0x10(%rbx),%rdi
call   1100 <atoi@plt>
mov    %eax,%edi
call   1060 <htons@plt>
mov    %eax,0x4(%rsp)
mov    0x8(%rbx),%rdi
mov    %r14,%rsi
call   10d0 <inet_aton@plt>
test   %rax,%rax
je     13c3 <main+0x1b3>
mov    %rsp,%rsi
mov    %r13d,%edi
mov    $0xc,%edx
call   1120 <connect@plt>
test   %rax,%rax
js     13cc <main+0x1bc>
lea    0x10(%rsp),%rbx
lea    0xd7a(%rip),%r14
mov    0x2d2a(%rip),%r12
lea    0xd8c(%rip),%r15
nopl   (%rax)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x401,%edx
call   1090 <memset@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0x401,%esi
call   10b0 <fgets@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0xffffffff,%eax
je     1392 <main+0x182>
mov    %rbx,%rdi
mov    %r15,%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
je     1365 <main+0x155>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
je     139b <main+0x18b>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r15,%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
je     1365 <main+0x155>
test   %ebp,%ebp
je     13a4 <main+0x194>
movslq %ebp,%rax
movb   $0x0,0x10(%rsp,%rax,1)
lea    0xd29(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    12c0 <main+0xb0>
mov    %r13d,%edi
call   10a0 <close@plt>
cmp    $0xffffffff,%eax
je     13d5 <main+0x1c5>
lea    0xd23(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xca1(%rip),%rdi
jmp    13ab <main+0x19b>
lea    0xcad(%rip),%rdi
jmp    13ab <main+0x19b>
lea    0xcb8(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    0xc3f(%rip),%rdi
jmp    13ab <main+0x19b>
lea    0xc49(%rip),%rdi
jmp    13ab <main+0x19b>
lea    0xc4b(%rip),%rdi
jmp    13ab <main+0x19b>
lea    0xcba(%rip),%rdi
jmp    13ab <main+0x19b>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [19 x i8] c"Please use 3 args\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [11 x i8] c"inet_aton.\00"
@.str.2 = [11 x i8] c"Connecting\00"
@.str.3 = [17 x i8] c"You would puts: \00"
@stdin = global i32 0
@.str.4 = [15 x i8] c"Send to Server\00"
@.str.5 = [6 x i8] c"exit\0A\00"
@.str.6 = [20 x i8] c"Receive from Server\00"
@.str.7 = [28 x i8] c"Note: Sorry,server closed.\0A\00"
@.str.8 = [23 x i8] c"Server send to you: %s\00"
@.str.9 = [6 x i8] c"Close\00"
@.str.10 = [27 x i8] c"TCP Client has been closed\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sockaddr_in
%7 = alloca i32
%8 = alloca [1025 x i8]
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 3
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i32, i32* @AF_INET
%17 = load i32, i32* @SOCK_STREAM
%18 = call i32 @socket(i32 %16, i32 %17, i32 0)
store i32 %18, i32* %7
%19 = call i32 @bzero(%struct.sockaddr_in* %6, i32 12)
%20 = load i32, i32* @AF_INET
%21 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 2
store i32 %20, i32* %21
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @atoi(i8* %24)
%26 = call i32 @htons(i32 %25)
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 1
store i32 %26, i32* %27
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%32 = call i64 @inet_aton(i8* %30, i32* %31)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %15
%35 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%36 = call i32 @exit(i32 1)
unreachable
37: ; preds = %15
%38 = load i32, i32* %7
%39 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%40 = call i64 @connect(i32 %38, %struct.sockaddr* %39, i32 12)
%41 = icmp slt i64 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %37
%43 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%44 = call i32 @exit(i32 1)
unreachable
45: ; preds = %37
br label %46
46: ; preds = %45, %94
%47 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%48 = call i32 @memset(i8* %47, i32 0, i32 1025)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%50 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%51 = load i32, i32* @stdin
%52 = call i32 @fgets(i8* %50, i32 1025, i32 %51)
%53 = load i32, i32* %7
%54 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%55 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%56 = call i32 @strlen(i8* %55)
%57 = call i32 @send(i32 %53, i8* %54, i32 %56, i32 0)
store i32 %57, i32* %9
%58 = load i32, i32* %9
%59 = icmp eq i32 %58, -1
br i1 %59, label %60, label %63
60: ; preds = %46
%61 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%62 = call i32 @exit(i32 1)
unreachable
63: ; preds = %46
%64 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %68
67: ; preds = %63
br label %95
68: ; preds = %63
%69 = load i32, i32* %7
%70 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%71 = call i32 @recv(i32 %69, i8* %70, i32 1024, i32 0)
store i32 %71, i32* %9
%72 = load i32, i32* %9
%73 = icmp eq i32 %72, -1
br i1 %73, label %74, label %77
74: ; preds = %68
%75 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%76 = call i32 @exit(i32 1)
unreachable
77: ; preds = %68
%78 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%79 = call i64 @strcmp(i8* %78, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %82
81: ; preds = %77
br label %95
82: ; preds = %77
%83 = load i32, i32* %9
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %82
%86 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%87 = call i32 @exit(i32 1)
unreachable
88: ; preds = %82
%89 = load i32, i32* %9
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 %90
store i8 0, i8* %91
%92 = getelementptr inbounds [1025 x i8], [1025 x i8]* %8, i64 0, i64 0
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i8* %92)
br label %94
94: ; preds = %88
br label %46
95: ; preds = %81, %67
%96 = load i32, i32* %7
%97 = call i32 @close(i32 %96)
%98 = icmp eq i32 %97, -1
br i1 %98, label %99, label %102
99: ; preds = %95
%100 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%101 = call i32 @exit(i32 1)
unreachable
102: ; preds = %95
%103 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [19 x i8] c"Please use 3 args\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [11 x i8] c"inet_aton.\00"
@.str.2 = [11 x i8] c"Connecting\00"
@.str.3 = [17 x i8] c"You would puts: \00"
@stdin = global i32 0
@.str.4 = [15 x i8] c"Send to Server\00"
@.str.5 = [6 x i8] c"exit\0A\00"
@.str.6 = [20 x i8] c"Receive from Server\00"
@.str.7 = [28 x i8] c"Note: Sorry,server closed.\0A\00"
@.str.8 = [23 x i8] c"Server send to you: %s\00"
@.str.9 = [6 x i8] c"Close\00"
@.str.10 = [27 x i8] c"TCP Client has been closed\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [1025 x i8]
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = getelementptr inbounds [1025 x i8], [1025 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 3
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = load i32, i32* @AF_INET
%13 = load i32, i32* @SOCK_STREAM
%14 = tail call i32 @socket(i32 %12, i32 %13, i32 0)
%15 = call i32 @bzero(%struct.sockaddr_in* %3, i32 12)
%16 = load i32, i32* @AF_INET
%17 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %16, i32* %17
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = tail call i32 @htons(i32 %20)
%22 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i32 %21, i32* %22
%23 = getelementptr inbounds i8*, i8** %1, i64 1
%24 = load i8*, i8** %23
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
%26 = call i64 @inet_aton(i8* %24, i32* %25)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %11
%29 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %11
%32 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%33 = call i64 @connect(i32 %14, %struct.sockaddr* %32, i32 12)
%34 = icmp slt i64 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %31
%36 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%37 = call i32 @exit(i32 1)
unreachable
38: ; preds = %31, %66
%39 = call i32 @memset(i8* %6, i32 0, i32 1025)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%41 = load i32, i32* @stdin
%42 = call i32 @fgets(i8* %6, i32 1025, i32 %41)
%43 = call i32 @strlen(i8* %6)
%44 = call i32 @send(i32 %14, i8* %6, i32 %43, i32 0)
%45 = icmp eq i32 %44, -1
br i1 %45, label %46, label %49
46: ; preds = %38
%47 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %38
%50 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %70, label %52
52: ; preds = %49
%53 = call i32 @recv(i32 %14, i8* %6, i32 1024, i32 0)
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %58
55: ; preds = %52
%56 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%57 = call i32 @exit(i32 1)
unreachable
58: ; preds = %52
%59 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %70, label %61
61: ; preds = %58
%62 = icmp eq i32 %53, 0
br i1 %62, label %63, label %66
63: ; preds = %61
%64 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%65 = call i32 @exit(i32 1)
unreachable
66: ; preds = %61
%67 = sext i32 %53 to i64
%68 = getelementptr inbounds [1025 x i8], [1025 x i8]* %4, i64 0, i64 %67
store i8 0, i8* %68
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i8* %6)
br label %38
70: ; preds = %58, %49
%71 = call i32 @close(i32 %14)
%72 = icmp eq i32 %71, -1
br i1 %72, label %73, label %76
73: ; preds = %70
%74 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%75 = call i32 @exit(i32 1)
unreachable
76: ; preds = %70
%77 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0))
ret i32 0
}