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

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int /*<<< orphan*/ *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(struct sockaddr_in *, int);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int htons(int);
char *inet_ntoa(TYPE_1__);
scalar_t__ listen(int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
int main() {
  int serverSocket;
  struct sockaddr_in server_addr;
  struct sockaddr_in clientAddr;
  int addr_len = sizeof(clientAddr);
  int client;
  char buffer[200];
  int iDataNum;
  if ((serverSocket = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    perror("socket");
    return 1;
  }
  bzero(&server_addr, sizeof(server_addr));
  server_addr.sin_family = AF_INET;
  server_addr.sin_port = htons(5555);
  server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
  if (bind(serverSocket, (struct sockaddr *)&server_addr, sizeof(server_addr)) <
      0) {
    perror("connect");
    return 1;
  }
  if (listen(serverSocket, 5) < 0) {
    perror("listen");
    return 1;
  }
  while (1) {
    printf("Listening on port: %d\n", 5555);
    client = accept(serverSocket, (struct sockaddr *)&clientAddr,
                    (socklen_t *)&addr_len);
    if (client < 0) {
      perror("accept");
      break;
    }
    printf("\nrecv client data...n");
    printf("IP is %s\n", inet_ntoa(clientAddr.sin_addr));
    printf("Port is %d\n", htons(clientAddr.sin_port));
    while (1) {
      iDataNum = recv(client, buffer, 1024, 0);
      if (iDataNum < 0) {
        perror("recv");
        continue;
      }
      buffer[iDataNum] = '\0';
      if (strcmp(buffer, "quit") == 0)
        break;
      printf("%drecv data is %s\n", iDataNum, buffer);
      send(client, buffer, iDataNum, 0);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x2c(%rbp)
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
mov    0x2dd7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1226 <main+0x56>
lea    0xdeb(%rip),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    13f3 <main+0x223>
lea    -0x18(%rbp),%rdi
mov    $0xc,%esi
call   10d0 <bzero@plt>
mov    0x2dad(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0x15b3,%edi
call   1050 <htons@plt>
mov    %eax,-0x18(%rbp)
mov    0x2d8c(%rip),%rax
mov    (%rax),%edi
call   1080 <htonl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0xc,%edx
call   10b0 <bind@plt>
cmp    $0x0,%rax
jge    1291 <main+0xc1>
lea    0xd87(%rip),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    13f3 <main+0x223>
mov    -0x8(%rbp),%edi
mov    $0x5,%esi
call   10a0 <listen@plt>
cmp    $0x0,%rax
jge    12c0 <main+0xf0>
lea    0xd60(%rip),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    13f3 <main+0x223>
jmp    12c5 <main+0xf5>
lea    0xd4a(%rip),%rdi
mov    $0x15b3,%esi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x8(%rbp),%edi
lea    -0x28(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
call   10e0 <accept@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jge    1306 <main+0x136>
lea    0xd31(%rip),%rdi
call   10c0 <perror@plt>
jmp    13ec <main+0x21c>
lea    0xd27(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x24(%rbp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,%rsi
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x28(%rbp),%edi
call   1050 <htons@plt>
mov    %eax,%esi
lea    0xd16(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x30(%rbp),%edi
lea    -0x100(%rbp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x104(%rbp)
cmpl   $0x0,-0x104(%rbp)
jge    137f <main+0x1af>
lea    0xceb(%rip),%rdi
call   10c0 <perror@plt>
jmp    1345 <main+0x175>
movslq -0x104(%rbp),%rax
movb   $0x0,-0x100(%rbp,%rax,1)
lea    -0x100(%rbp),%rdi
lea    0xcc9(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    13b0 <main+0x1e0>
jmp    13e7 <main+0x217>
mov    -0x104(%rbp),%esi
lea    -0x100(%rbp),%rdx
lea    0xca6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x30(%rbp),%edi
lea    -0x100(%rbp),%rsi
mov    -0x104(%rbp),%edx
xor    %ecx,%ecx
call   1060 <send@plt>
jmp    1345 <main+0x175>
jmp    12c5 <main+0xf5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
movl   $0xc,0x8(%rsp)
mov    0x2df8(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2dd6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
test   %eax,%eax
jns    1210 <main+0x40>
lea    0xdf2(%rip),%rdi
jmp    1280 <main+0xb0>
mov    %eax,%ebx
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0xc,%esi
call   10d0 <bzero@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x28(%rsp)
mov    $0x15b3,%edi
call   1050 <htons@plt>
mov    %eax,0x20(%rsp)
mov    0x2da0(%rip),%rax
mov    (%rax),%edi
call   1080 <htonl@plt>
mov    %eax,0x24(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0xc,%edx
call   10b0 <bind@plt>
test   %rax,%rax
jns    1268 <main+0x98>
lea    0xda1(%rip),%rdi
jmp    1280 <main+0xb0>
mov    %ebx,%edi
mov    $0x5,%esi
call   10a0 <listen@plt>
test   %rax,%rax
jns    129c <main+0xcc>
lea    0xd8f(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd73(%rip),%rdi
mov    $0x15b3,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %ebx,0xc(%rsp)
mov    %ebx,%edi
call   10e0 <accept@plt>
test   %eax,%eax
jns    12d8 <main+0x108>
lea    0xd5e(%rip),%rdi
call   10c0 <perror@plt>
xor    %eax,%eax
jmp    128a <main+0xba>
mov    %eax,%r13d
lea    0x30(%rsp),%rbp
lea    0xd79(%rip),%r14
lea    0xd77(%rip),%r15
lea    0xd75(%rip),%r12
jmp    132d <main+0x15d>
nopw   0x0(%rax,%rax,1)
lea    0xd0f(%rip),%rdi
mov    $0x15b3,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   10e0 <accept@plt>
mov    %eax,%r13d
test   %eax,%eax
js     12c8 <main+0xf8>
lea    0xd00(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x14(%rsp),%edi
call   1040 <inet_ntoa@plt>
lea    0xcff(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x10(%rsp),%edi
call   1050 <htons@plt>
lea    0xcef(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1380 <main+0x1b0>
mov    %r14,%rdi
call   10c0 <perror@plt>
nopl   0x0(%rax,%rax,1)
mov    %r13d,%edi
mov    %rbp,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %eax,%eax
js     1370 <main+0x1a0>
mov    %eax,%ebx
mov    %eax,%eax
movb   $0x0,0x30(%rsp,%rax,1)
mov    %rbp,%rdi
mov    %r15,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1300 <main+0x130>
mov    %r12,%rdi
mov    %ebx,%esi
mov    %rbp,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %ebx,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
jmp    1380 <main+0x1b0>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"socket\00"
@INADDR_ANY = global i32 0
@.str.1 = [8 x i8] c"connect\00"
@.str.2 = [7 x i8] c"listen\00"
@.str.3 = [23 x i8] c"Listening on port: %d\0A\00"
@.str.4 = [7 x i8] c"accept\00"
@.str.5 = [22 x i8] c"\0Arecv client data...n\00"
@.str.6 = [10 x i8] c"IP is %s\0A\00"
@.str.7 = [12 x i8] c"Port is %d\0A\00"
@.str.8 = [5 x i8] c"recv\00"
@.str.9 = [5 x i8] c"quit\00"
@.str.10 = [19 x i8] c"%drecv data is %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca i32
%7 = alloca [200 x i8]
%8 = alloca i32
store i32 0, i32* %1
store i32 12, i32* %5
%9 = load i32, i32* @AF_INET
%10 = load i32, i32* @SOCK_STREAM
%11 = call i32 @socket(i32 %9, i32 %10, i32 0)
store i32 %11, i32* %2
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %84
15: ; preds = %0
%16 = call i32 @bzero(%struct.sockaddr_in* %3, i32 12)
%17 = load i32, i32* @AF_INET
%18 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 2
store i32 %17, i32* %18
%19 = call i32 @htons(i32 5555)
%20 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
store i32 %19, i32* %20
%21 = load i32, i32* @INADDR_ANY
%22 = call i32 @htonl(i32 %21)
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 1
%24 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %23, i32 0, i32 0
store i32 %22, i32* %24
%25 = load i32, i32* %2
%26 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%27 = call i64 @bind(i32 %25, %struct.sockaddr* %26, i32 12)
%28 = icmp slt i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %15
%30 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %84
31: ; preds = %15
%32 = load i32, i32* %2
%33 = call i64 @listen(i32 %32, i32 5)
%34 = icmp slt i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %84
37: ; preds = %31
br label %38
38: ; preds = %37, %82
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 5555)
%40 = load i32, i32* %2
%41 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%42 = call i32 @accept(i32 %40, %struct.sockaddr* %41, i32* %5)
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 = %38
%46 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %83
47: ; preds = %38
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%49 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 1
%50 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %49, i32 0, i32 0
%51 = load i32, i32* %50
%52 = call i8* @inet_ntoa(i32 %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* %52)
%54 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%55 = load i32, i32* %54
%56 = call i32 @htons(i32 %55)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %47, %64, %74
%59 = load i32, i32* %6
%60 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%61 = call i32 @recv(i32 %59, i8* %60, i32 1024, i32 0)
store i32 %61, i32* %8
%62 = load i32, i32* %8
%63 = icmp slt i32 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %58
%65 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %58
66: ; preds = %58
%67 = load i32, i32* %8
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 %68
store i8 0, i8* %69
%70 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%71 = call i64 @strcmp(i8* %70, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %74
73: ; preds = %66
br label %82
74: ; preds = %66
%75 = load i32, i32* %8
%76 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %75, i8* %76)
%78 = load i32, i32* %6
%79 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%80 = load i32, i32* %8
%81 = call i32 @send(i32 %78, i8* %79, i32 %80, i32 0)
br label %58
82: ; preds = %73
br label %38
83: ; preds = %45
store i32 0, i32* %1
br label %84
84: ; preds = %83, %35, %29, %13
%85 = load i32, i32* %1
ret i32 %85
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"socket\00"
@INADDR_ANY = global i32 0
@.str.1 = [8 x i8] c"connect\00"
@.str.2 = [7 x i8] c"listen\00"
@.str.3 = [23 x i8] c"Listening on port: %d\0A\00"
@.str.4 = [7 x i8] c"accept\00"
@.str.5 = [22 x i8] c"\0Arecv client data...n\00"
@.str.6 = [10 x i8] c"IP is %s\0A\00"
@.str.7 = [12 x i8] c"Port is %d\0A\00"
@.str.8 = [5 x i8] c"recv\00"
@.str.9 = [5 x i8] c"quit\00"
@.str.10 = [19 x i8] c"%drecv data is %s\0A\00"
define i32 @main() {
%1 = alloca %struct.sockaddr_in
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = alloca [200 x i8]
%5 = bitcast %struct.sockaddr_in* %1 to i8*
%6 = bitcast %struct.sockaddr_in* %2 to i8*
%7 = bitcast i32* %3 to i8*
store i32 12, i32* %3
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%9 = load i32, i32* @AF_INET
%10 = load i32, i32* @SOCK_STREAM
%11 = tail call i32 @socket(i32 %9, i32 %10, i32 0)
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %71
15: ; preds = %0
%16 = call i32 @bzero(%struct.sockaddr_in* %1, i32 12)
%17 = load i32, i32* @AF_INET
%18 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 2
store i32 %17, i32* %18
%19 = tail call i32 @htons(i32 5555)
%20 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0
store i32 %19, i32* %20
%21 = load i32, i32* @INADDR_ANY
%22 = tail call i32 @htonl(i32 %21)
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 1, i32 0
store i32 %22, i32* %23
%24 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%25 = call i64 @bind(i32 %11, %struct.sockaddr* %24, i32 12)
%26 = icmp slt i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %15
%28 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %71
29: ; preds = %15
%30 = call i64 @listen(i32 %11, i32 5)
%31 = icmp slt i64 %30, 0
br i1 %31, label %40, label %32
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 5555)
%34 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%35 = call i32 @accept(i32 %11, %struct.sockaddr* %34, i32* %3)
%36 = icmp slt i32 %35, 0
br i1 %36, label %46, label %37
37: ; preds = %32
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 1, i32 0
%39 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
br label %48
40: ; preds = %29
%41 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %71
42: ; preds = %63
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 5555)
%44 = call i32 @accept(i32 %11, %struct.sockaddr* %34, i32* %3)
%45 = icmp slt i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %42, %32
%47 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %71
48: ; preds = %37, %42
%49 = phi i32 [ %35, %37 ], [ %44, %42 ]
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%51 = load i32, i32* %38
%52 = call i8* @inet_ntoa(i32 %51)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* %52)
%54 = load i32, i32* %39
%55 = call i32 @htons(i32 %54)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %55)
br label %57
57: ; preds = %62, %48
%58 = call i32 @recv(i32 %49, i8* %8, i32 1024, i32 0)
%59 = icmp slt i32 %58, 0
br i1 %59, label %60, label %63
60: ; preds = %57
%61 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %62
62: ; preds = %60, %68
br label %57
63: ; preds = %57
%64 = zext i32 %58 to i64
%65 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 %64
store i8 0, i8* %65
%66 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %42, label %68
68: ; preds = %63
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %58, i8* %8)
%70 = call i32 @send(i32 %49, i8* %8, i32 %58, i32 0)
br label %62
71: ; preds = %46, %40, %27, %13
%72 = phi i32 [ 1, %13 ], [ 1, %27 ], [ 1, %40 ], [ 0, %46 ]
ret i32 %72
}