#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;
};
typedef int /*<<< orphan*/ addr_server;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
unsigned int send(int, char *, unsigned int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
unsigned int strlen(char *);
int main(int argc, char *argv[]) {
  int sock;
  struct sockaddr_in addr_server;
  unsigned short port_server;
  char echostr[1500];
  unsigned int echolen;
  char buf[1500];
  unsigned int buflen;
  int readlen, totalreadlen;
  if (argc != 3) {
    printf("Usage: a.out [SERVERIP] [SERVERPORT]\n");
    exit(1);
  }
  if ((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
    printf("socket() error\n");
    exit(1);
  }
  memset(&addr_server, 0, sizeof(addr_server));
  addr_server.sin_family = AF_INET;
  addr_server.sin_addr.s_addr = inet_addr(argv[1]);
  addr_server.sin_port = htons(atoi(argv[2]));
  if (connect(sock, (struct sockaddr *)&addr_server, sizeof(addr_server)) < 0) {
    printf("connect() error\n");
    exit(1);
  }
  while (1) {
    printf("Echo string: ");
    scanf("%s", echostr);
    if (strcmp(echostr, "exit") == 0) {
      break;
    }
    echolen = strlen(echostr);
    if (send(sock, echostr, echolen, 0) != echolen) {
      printf("send() error\n");
      exit(1);
    }
    totalreadlen = 0;
    printf("Echoed: ");
    while (totalreadlen < echolen) {
      if ((readlen = recv(sock, buf, 1500 - 1, 0)) <= 0) {
        printf("recv() error\n");
        exit(1);
      }
      totalreadlen = totalreadlen + readlen;
      buf[readlen] = '\0';
      printf("%s", buf);
    }
    printf("\n");
  }
  close(sock);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xbf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     121b <main+0x3b>
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
mov    0x2da5(%rip),%rax
mov    (%rax),%esi
mov    0x2dac(%rip),%rax
mov    (%rax),%edx
call   1100 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    125f <main+0x7f>
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1080 <memset@plt>
mov    0x2d72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <inet_addr@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,%edi
call   1050 <htons@plt>
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0xc,%edx
call   10f0 <connect@plt>
cmp    $0x0,%rax
jge    12d5 <main+0xf5>
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
jmp    12da <main+0xfa>
lea    0xd66(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x600(%rbp),%rsi
lea    0xd5f(%rip),%rdi
call   10c0 <scanf@plt>
lea    -0x600(%rbp),%rdi
lea    0xd4f(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    131d <main+0x13d>
jmp    141f <main+0x23f>
lea    -0x600(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x604(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x600(%rbp),%rsi
mov    -0x604(%rbp),%edx
xor    %ecx,%ecx
call   1060 <send@plt>
cmp    -0x604(%rbp),%eax
je     136a <main+0x18a>
lea    0xd04(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movl   $0x0,-0xbec(%rbp)
lea    0xcf0(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0xbec(%rbp),%eax
cmp    -0x604(%rbp),%eax
jae    140c <main+0x22c>
mov    -0x14(%rbp),%edi
lea    -0xbe0(%rbp),%rsi
mov    $0x5db,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0xbe8(%rbp)
cmp    $0x0,%eax
jg     13d1 <main+0x1f1>
lea    0xcb4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0xbec(%rbp),%eax
add    -0xbe8(%rbp),%eax
mov    %eax,-0xbec(%rbp)
movslq -0xbe8(%rbp),%rax
movb   $0x0,-0xbe0(%rbp,%rax,1)
lea    -0xbe0(%rbp),%rsi
lea    0xc55(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1382 <main+0x1a2>
lea    0xc11(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    12da <main+0xfa>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
xor    %eax,%eax
add    $0xbf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xbd8,%rsp
cmp    $0x3,%edi
jne    13df <main+0x1df>
mov    %rsi,%rbp
mov    0x2da4(%rip),%rax
mov    (%rax),%edi
mov    0x2da3(%rip),%rax
mov    (%rax),%esi
mov    0x2daa(%rip),%rax
mov    (%rax),%edx
call   1120 <socket@plt>
test   %eax,%eax
js     13e8 <main+0x1e8>
mov    %eax,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10a0 <memset@plt>
mov    0x2d88(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    0x8(%rbp),%rdi
call   10c0 <inet_addr@plt>
mov    %eax,0x4(%rsp)
mov    0x10(%rbp),%rdi
call   10f0 <atoi@plt>
mov    %eax,%edi
call   1070 <htons@plt>
mov    %eax,(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0xc,%edx
call   1110 <connect@plt>
test   %rax,%rax
js     13f1 <main+0x1f1>
lea    0xd5b(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xd5b(%rip),%rdi
lea    0x5f0(%rsp),%rbp
mov    %rbp,%rsi
call   10e0 <scanf@plt>
lea    0xd47(%rip),%rsi
mov    %rbp,%rdi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     13a5 <main+0x1a5>
lea    0x5f0(%rsp),%r14
lea    0xd24(%rip),%r13
lea    0x10(%rsp),%r15
jmp    1337 <main+0x137>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xcef(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   10e0 <scanf@plt>
mov    %r14,%rdi
lea    0xce4(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     13a5 <main+0x1a5>
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %eax,%r12d
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
cmp    %r12d,%eax
jne    13d6 <main+0x1d6>
lea    0xcb6(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
test   %r12d,%r12d
je     1300 <main+0x100>
xor    %ebp,%ebp
xchg   %ax,%ax
mov    %ebx,%edi
mov    %r15,%rsi
mov    $0x5db,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %eax,%eax
jle    13c0 <main+0x1c0>
add    %eax,%ebp
mov    %eax,%eax
movb   $0x0,0x10(%rsp,%rax,1)
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
cmp    %r12d,%ebp
jb     1370 <main+0x170>
jmp    1300 <main+0x100>
mov    %ebx,%edi
call   10b0 <close@plt>
xor    %eax,%eax
add    $0xbd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc58(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xc4f(%rip),%rdi
jmp    13c7 <main+0x1c7>
lea    0xc72(%rip),%rdi
jmp    13c7 <main+0x1c7>
lea    0xc5a(%rip),%rdi
jmp    13c7 <main+0x1c7>
lea    0xc41(%rip),%rdi
jmp    13c7 <main+0x1c7>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [38 x i8] c"Usage: a.out [SERVERIP] [SERVERPORT]\0A\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str.1 = [16 x i8] c"socket() error\0A\00"
@AF_INET = global i32 0
@.str.2 = [17 x i8] c"connect() error\0A\00"
@.str.3 = [14 x i8] c"Echo string: \00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [5 x i8] c"exit\00"
@.str.6 = [14 x i8] c"send() error\0A\00"
@.str.7 = [9 x i8] c"Echoed: \00"
@.str.8 = [14 x i8] c"recv() error\0A\00"
@.str.9 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.sockaddr_in
%8 = alloca i16
%9 = alloca [1500 x i8]
%10 = alloca i32
%11 = alloca [1500 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 3
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %2
%21 = load i32, i32* @PF_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* %6
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %20
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %20
%30 = call i32 @memset(%struct.sockaddr_in* %7, i32 0, i32 12)
%31 = load i32, i32* @AF_INET
%32 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 2
store i32 %31, i32* %32
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @inet_addr(i8* %35)
%37 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
%38 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %37, i32 0, i32 0
store i32 %36, i32* %38
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 2
%41 = load i8*, i8** %40
%42 = call i32 @atoi(i8* %41)
%43 = call i32 @htons(i32 %42)
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
store i32 %43, i32* %44
%45 = load i32, i32* %6
%46 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%47 = call i64 @connect(i32 %45, %struct.sockaddr* %46, i32 12)
%48 = icmp slt i64 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %29
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%51 = call i32 @exit(i32 1)
unreachable
52: ; preds = %29
br label %53
53: ; preds = %52, %96
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%55 = getelementptr inbounds [1500 x i8], [1500 x i8]* %9, i64 0, i64 0
%56 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %55)
%57 = getelementptr inbounds [1500 x i8], [1500 x i8]* %9, i64 0, i64 0
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %61
60: ; preds = %53
br label %98
61: ; preds = %53
%62 = getelementptr inbounds [1500 x i8], [1500 x i8]* %9, i64 0, i64 0
%63 = call i32 @strlen(i8* %62)
store i32 %63, i32* %10
%64 = load i32, i32* %6
%65 = getelementptr inbounds [1500 x i8], [1500 x i8]* %9, i64 0, i64 0
%66 = load i32, i32* %10
%67 = call i32 @send(i32 %64, i8* %65, i32 %66, i32 0)
%68 = load i32, i32* %10
%69 = icmp ne i32 %67, %68
br i1 %69, label %70, label %73
70: ; preds = %61
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%72 = call i32 @exit(i32 1)
unreachable
73: ; preds = %61
store i32 0, i32* %14
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %75
75: ; preds = %87, %73
%76 = load i32, i32* %14
%77 = load i32, i32* %10
%78 = icmp ult i32 %76, %77
br i1 %78, label %79, label %96
79: ; preds = %75
%80 = load i32, i32* %6
%81 = getelementptr inbounds [1500 x i8], [1500 x i8]* %11, i64 0, i64 0
%82 = call i32 @recv(i32 %80, i8* %81, i32 1499, i32 0)
store i32 %82, i32* %13
%83 = icmp sle i32 %82, 0
br i1 %83, label %84, label %87
84: ; preds = %79
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%86 = call i32 @exit(i32 1)
unreachable
87: ; preds = %79
%88 = load i32, i32* %14
%89 = load i32, i32* %13
%90 = add nsw i32 %88, %89
store i32 %90, i32* %14
%91 = load i32, i32* %13
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [1500 x i8], [1500 x i8]* %11, i64 0, i64 %92
store i8 0, i8* %93
%94 = getelementptr inbounds [1500 x i8], [1500 x i8]* %11, i64 0, i64 0
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %94)
br label %75
96: ; preds = %75
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %53
98: ; preds = %60
%99 = load i32, i32* %6
%100 = call i32 @close(i32 %99)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@AF_INET = global i32 0
@.str.3 = [14 x i8] c"Echo string: \00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [5 x i8] c"exit\00"
@.str.7 = [9 x i8] c"Echoed: \00"
@str = [13 x i8] c"recv() error\00"
@str.10 = [13 x i8] c"send() error\00"
@str.11 = [16 x i8] c"connect() error\00"
@str.12 = [15 x i8] c"socket() error\00"
@str.13 = [37 x i8] c"Usage: a.out [SERVERIP] [SERVERPORT]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [1500 x i8]
%5 = alloca [1500 x i8]
%6 = bitcast %struct.sockaddr_in* %3 to i8*
%7 = getelementptr inbounds [1500 x i8], [1500 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [1500 x i8], [1500 x i8]* %5, i64 0, i64 0
%9 = icmp eq i32 %0, 3
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.13, i64 0, i64 0))
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i32, i32* @PF_INET
%15 = load i32, i32* @SOCK_STREAM
%16 = load i32, i32* @IPPROTO_TCP
%17 = tail call i32 @socket(i32 %14, i32 %15, i32 %16)
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.12, i64 0, i64 0))
%21 = tail call i32 @exit(i32 1)
unreachable
22: ; preds = %13
%23 = call i32 @memset(%struct.sockaddr_in* %3, i32 0, i32 12)
%24 = load i32, i32* @AF_INET
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %24, i32* %25
%26 = getelementptr inbounds i8*, i8** %1, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @inet_addr(i8* %27)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
store i32 %28, i32* %29
%30 = getelementptr inbounds i8*, i8** %1, i64 2
%31 = load i8*, i8** %30
%32 = call i32 @atoi(i8* %31)
%33 = call i32 @htons(i32 %32)
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %33, i32* %34
%35 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%36 = call i64 @connect(i32 %17, %struct.sockaddr* %35, i32 12)
%37 = icmp slt i64 %36, 0
br i1 %37, label %43, label %38
38: ; preds = %22
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %7)
%41 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %75, label %46
43: ; preds = %22
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.11, i64 0, i64 0))
%45 = call i32 @exit(i32 1)
unreachable
46: ; preds = %38, %69
%47 = call i32 @strlen(i8* %7)
%48 = call i32 @send(i32 %17, i8* %7, i32 %47, i32 0)
%49 = icmp eq i32 %48, %47
br i1 %49, label %53, label %50
50: ; preds = %46
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.10, i64 0, i64 0))
%52 = call i32 @exit(i32 1)
unreachable
53: ; preds = %46
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%55 = icmp eq i32 %47, 0
br i1 %55, label %69, label %56
56: ; preds = %53, %63
%57 = phi i32 [ %64, %63 ], [ 0, %53 ]
%58 = call i32 @recv(i32 %17, i8* %8, i32 1499, i32 0)
%59 = icmp slt i32 %58, 1
br i1 %59, label %60, label %63
60: ; preds = %56
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%62 = call i32 @exit(i32 1)
unreachable
63: ; preds = %56
%64 = add nsw i32 %58, %57
%65 = zext i32 %58 to i64
%66 = getelementptr inbounds [1500 x i8], [1500 x i8]* %5, i64 0, i64 %65
store i8 0, i8* %66
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %8)
%68 = icmp ult i32 %64, %47
br i1 %68, label %56, label %69
69: ; preds = %63, %53
%70 = call i32 @putchar(i32 10)
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%72 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %7)
%73 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %46
75: ; preds = %69, %38
%76 = call i32 @close(i32 %17)
ret i32 0
}