#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__ {
  scalar_t__ s_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ caddr;
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ htons(int);
char *inet_ntoa(TYPE_1__);
int listen(int, int);
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  int ss = socket(AF_INET, SOCK_STREAM, 0);
  if (ss == -1) {
    printf("socket create : %m\n");
    exit(-1);
  }
  printf("create socket success......\n");
  struct sockaddr_in addr;
  addr.sin_family = AF_INET;
  addr.sin_port = htons(8686);
  addr.sin_addr.s_addr = 0;
  int r = bind(ss, (struct sockaddr *)&addr, sizeof(addr));
  if (r == -1) {
    printf("socket bind : %m\n");
    close(ss);
    return -1;
  }
  printf("bind socket success......\n");
  r = listen(ss, 20);
  if (r == -1) {
    printf("socket listen: %m\n");
    close(ss);
    return -1;
  }
  printf("listen socket success......\n");
  struct sockaddr_in caddr;
  socklen_t len;
  char buf[2048];
  len = sizeof(caddr);
  int cs = accept(ss, (struct sockaddr *)&caddr, &len);
  if (cs == -1) {
    printf("socket accept: %m\n");
    close(ss);
    return 0;
  }
  while (1) {
    char *ip2 = inet_ntoa(caddr.sin_addr);
    printf("%d===%s:,到此一遊!!!!！\n", cs, ip2, ntohs(caddr.sin_port));
    r = recv(cs, buf, sizeof(buf), 0);
    if (r <= 0) {
      printf("client brokn!\n");
      break;
    }
    if (r > 0) {
      buf[r] = 0;
      printf("===%s\n", buf);
    }
  }
  close(cs);
  close(ss);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x870,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
mov    0x2e06(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10d0 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1200 <main+0x50>
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2dd3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0x21ee,%edi
call   1050 <htons@plt>
mov    %eax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x18,%edx
call   10a0 <bind@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    126f <main+0xbf>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%edi
call   1070 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ea <main+0x23a>
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x14,%esi
call   1080 <listen@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    12b9 <main+0x109>
lea    0xdc0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%edi
call   1070 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ea <main+0x23a>
lea    0xdb1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x18,-0x44(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x40(%rbp),%rsi
lea    -0x44(%rbp),%rdx
call   10b0 <accept@plt>
mov    %eax,-0x854(%rbp)
cmpl   $0xffffffff,-0x854(%rbp)
jne    1313 <main+0x163>
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%edi
call   1070 <close@plt>
movl   $0x0,-0x4(%rbp)
jmp    13ea <main+0x23a>
jmp    1318 <main+0x168>
mov    -0x38(%rbp),%rdi
call   1040 <inet_ntoa@plt>
mov    %rax,-0x860(%rbp)
mov    -0x854(%rbp),%eax
mov    %eax,-0x86c(%rbp)
mov    -0x860(%rbp),%rax
mov    %rax,-0x868(%rbp)
mov    -0x40(%rbp),%edi
call   1090 <ntohs@plt>
mov    -0x86c(%rbp),%esi
mov    -0x868(%rbp),%rdx
mov    %eax,%ecx
lea    0xd41(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x854(%rbp),%edi
lea    -0x850(%rbp),%rsi
mov    $0x800,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jg     13a0 <main+0x1f0>
lea    0xd2b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13d0 <main+0x220>
cmpl   $0x0,-0x24(%rbp)
jle    13cb <main+0x21b>
movslq -0x24(%rbp),%rax
movb   $0x0,-0x850(%rbp,%rax,1)
lea    -0x850(%rbp),%rsi
lea    0xd0a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1318 <main+0x168>
mov    -0x854(%rbp),%edi
call   1070 <close@plt>
mov    -0x8(%rbp),%edi
call   1070 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x870,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x848,%rsp
mov    0x2e10(%rip),%rbx
mov    (%rbx),%edi
mov    0x2df7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
cmp    $0xffffffff,%eax
je     13a5 <main+0x1e5>
mov    %eax,%r14d
lea    0xe74(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%eax
mov    %eax,0x38(%rsp)
mov    $0x21ee,%edi
call   1060 <htons@plt>
mov    %eax,0x28(%rsp)
movq   $0x0,0x30(%rsp)
lea    0x28(%rsp),%rsi
mov    %r14d,%edi
mov    $0x18,%edx
call   10b0 <bind@plt>
cmp    $0xffffffff,%eax
je     1355 <main+0x195>
lea    0xe4c(%rip),%rdi
call   1040 <puts@plt>
mov    %r14d,%edi
mov    $0x14,%esi
call   1090 <listen@plt>
cmp    $0xffffffff,%eax
je     135e <main+0x19e>
lea    0xe44(%rip),%rdi
call   1040 <puts@plt>
movl   $0x18,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %r14d,%edi
call   10c0 <accept@plt>
cmp    $0xffffffff,%eax
je     137b <main+0x1bb>
mov    %eax,%ebp
mov    0x18(%rsp),%rdi
call   1050 <inet_ntoa@plt>
mov    %rax,%rbx
mov    0x10(%rsp),%edi
call   10a0 <ntohs@plt>
lea    0xda2(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x40(%rsp),%rsi
mov    %ebp,%edi
mov    $0x800,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %eax,%eax
jle    1340 <main+0x180>
lea    0xd94(%rip),%r15
lea    0x40(%rsp),%r13
lea    0xd6a(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%eax
movb   $0x0,0x40(%rsp,%rax,1)
mov    %r15,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x18(%rsp),%rdi
call   1050 <inet_ntoa@plt>
mov    %rax,%rbx
mov    0x10(%rsp),%edi
call   10a0 <ntohs@plt>
mov    %r12,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebp,%edi
mov    %r13,%rsi
mov    $0x800,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %eax,%eax
jg     12f0 <main+0x130>
lea    0xd7c(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
call   1080 <close@plt>
jmp    1389 <main+0x1c9>
lea    0xcb8(%rip),%rdi
jmp    1365 <main+0x1a5>
lea    0xcc1(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14d,%edi
call   1080 <close@plt>
mov    $0xffffffff,%eax
jmp    1393 <main+0x1d3>
lea    0xcb7(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14d,%edi
call   1080 <close@plt>
xor    %eax,%eax
add    $0x848,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc54(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i64 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [20 x i8] c"socket create : %m\0A\00"
@.str.1 = [29 x i8] c"create socket success......\0A\00"
@.str.2 = [18 x i8] c"socket bind : %m\0A\00"
@.str.3 = [27 x i8] c"bind socket success......\0A\00"
@.str.4 = [19 x i8] c"socket listen: %m\0A\00"
@.str.5 = [29 x i8] c"listen socket success......\0A\00"
@.str.6 = [19 x i8] c"socket accept: %m\0A\00"
@.str.7 = [30 x i8] c"%d===%s:,\E5\88\B0\E6\AD\A4\E4\B8\80\E9\81\8A!!!!\EF\BC\81\0A\00"
@.str.8 = [15 x i8] c"client brokn!\0A\00"
@.str.9 = [7 x i8] c"===%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca %struct.sockaddr_in
%6 = alloca i32
%7 = alloca [2048 x i8]
%8 = alloca i32
%9 = alloca i8*
store i32 0, i32* %1
%10 = load i32, i32* @AF_INET
%11 = load i32, i32* @SOCK_STREAM
%12 = call i32 @socket(i32 %10, i32 %11, i32 0)
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %18
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%20 = load i32, i32* @AF_INET
%21 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 2
store i32 %20, i32* %21
%22 = call i32 @htons(i32 8686)
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
store i32 %22, i32* %23
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 1
%25 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %24, i32 0, i32 0
store i64 0, i64* %25
%26 = load i32, i32* %2
%27 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%28 = call i32 @bind(i32 %26, %struct.sockaddr* %27, i32 24)
store i32 %28, i32* %4
%29 = load i32, i32* %4
%30 = icmp eq i32 %29, -1
br i1 %30, label %31, label %35
31: ; preds = %18
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%33 = load i32, i32* %2
%34 = call i32 @close(i32 %33)
store i32 -1, i32* %1
br label %90
35: ; preds = %18
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%37 = load i32, i32* %2
%38 = call i32 @listen(i32 %37, i32 20)
store i32 %38, i32* %4
%39 = load i32, i32* %4
%40 = icmp eq i32 %39, -1
br i1 %40, label %41, label %45
41: ; preds = %35
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%43 = load i32, i32* %2
%44 = call i32 @close(i32 %43)
store i32 -1, i32* %1
br label %90
45: ; preds = %35
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
store i32 24, i32* %6
%47 = load i32, i32* %2
%48 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%49 = call i32 @accept(i32 %47, %struct.sockaddr* %48, i32* %6)
store i32 %49, i32* %8
%50 = load i32, i32* %8
%51 = icmp eq i32 %50, -1
br i1 %51, label %52, label %56
52: ; preds = %45
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%54 = load i32, i32* %2
%55 = call i32 @close(i32 %54)
store i32 0, i32* %1
br label %90
56: ; preds = %45
br label %57
57: ; preds = %56, %84
%58 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i32 0, i32 1
%59 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %58, i32 0, i32 0
%60 = load i64, i64* %59
%61 = call i8* @inet_ntoa(i64 %60)
store i8* %61, i8** %9
%62 = load i32, i32* %8
%63 = load i8*, i8** %9
%64 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i32 0, i32 0
%65 = load i32, i32* %64
%66 = call i32 @ntohs(i32 %65)
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %62, i8* %63, i32 %66)
%68 = load i32, i32* %8
%69 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%70 = call i32 @recv(i32 %68, i8* %69, i32 2048, i32 0)
store i32 %70, i32* %4
%71 = load i32, i32* %4
%72 = icmp sle i32 %71, 0
br i1 %72, label %73, label %75
73: ; preds = %57
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
br label %85
75: ; preds = %57
%76 = load i32, i32* %4
%77 = icmp sgt i32 %76, 0
br i1 %77, label %78, label %84
78: ; preds = %75
%79 = load i32, i32* %4
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 %80
store i8 0, i8* %81
%82 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %82)
br label %84
84: ; preds = %78, %75
br label %57
85: ; preds = %73
%86 = load i32, i32* %8
%87 = call i32 @close(i32 %86)
%88 = load i32, i32* %2
%89 = call i32 @close(i32 %88)
store i32 0, i32* %1
br label %90
90: ; preds = %85, %52, %41, %31
%91 = load i32, i32* %1
ret i32 %91
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i64 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [20 x i8] c"socket create : %m\0A\00"
@.str.2 = [18 x i8] c"socket bind : %m\0A\00"
@.str.4 = [19 x i8] c"socket listen: %m\0A\00"
@.str.6 = [19 x i8] c"socket accept: %m\0A\00"
@.str.7 = [30 x i8] c"%d===%s:,\E5\88\B0\E6\AD\A4\E4\B8\80\E9\81\8A!!!!\EF\BC\81\0A\00"
@.str.9 = [7 x i8] c"===%s\0A\00"
@str = [28 x i8] c"create socket success......\00"
@str.10 = [26 x i8] c"bind socket success......\00"
@str.11 = [28 x i8] c"listen socket success......\00"
@str.12 = [14 x i8] c"client brokn!\00"
define i32 @main() {
%1 = alloca %struct.sockaddr_in
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = alloca [2048 x i8]
%5 = load i32, i32* @AF_INET
%6 = load i32, i32* @SOCK_STREAM
%7 = tail call i32 @socket(i32 %5, i32 %6, i32 0)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 -1)
unreachable
12: ; preds = %0
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%14 = bitcast %struct.sockaddr_in* %1 to i8*
%15 = load i32, i32* @AF_INET
%16 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 2
store i32 %15, i32* %16
%17 = tail call i32 @htons(i32 8686)
%18 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0
store i32 %17, i32* %18
%19 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 1, i32 0
store i64 0, i64* %19
%20 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%21 = call i32 @bind(i32 %7, %struct.sockaddr* %20, i32 24)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %26
23: ; preds = %12
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%25 = call i32 @close(i32 %7)
br label %70
26: ; preds = %12
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.10, i64 0, i64 0))
%28 = call i32 @listen(i32 %7, i32 20)
%29 = icmp eq i32 %28, -1
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32 @close(i32 %7)
br label %70
33: ; preds = %26
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.11, i64 0, i64 0))
%35 = bitcast %struct.sockaddr_in* %2 to i8*
%36 = bitcast i32* %3 to i8*
%37 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
store i32 24, i32* %3
%38 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%39 = call i32 @accept(i32 %7, %struct.sockaddr* %38, i32* %3)
%40 = icmp eq i32 %39, -1
br i1 %40, label %51, label %41
41: ; preds = %33
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 1, i32 0
%43 = load i64, i64* %42
%44 = call i8* @inet_ntoa(i64 %43)
%45 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
%46 = load i32, i32* %45
%47 = call i32 @ntohs(i32 %46)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %39, i8* %44, i32 %47)
%49 = call i32 @recv(i32 %39, i8* %37, i32 2048, i32 0)
%50 = icmp slt i32 %49, 1
br i1 %50, label %65, label %53
51: ; preds = %33
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %68
53: ; preds = %41, %53
%54 = phi i32 [ %63, %53 ], [ %49, %41 ]
%55 = zext i32 %54 to i64
%56 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 %55
store i8 0, i8* %56
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %37)
%58 = load i64, i64* %42
%59 = call i8* @inet_ntoa(i64 %58)
%60 = load i32, i32* %45
%61 = call i32 @ntohs(i32 %60)
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %39, i8* %59, i32 %61)
%63 = call i32 @recv(i32 %39, i8* %37, i32 2048, i32 0)
%64 = icmp slt i32 %63, 1
br i1 %64, label %65, label %53
65: ; preds = %53, %41
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.12, i64 0, i64 0))
%67 = call i32 @close(i32 %39)
br label %68
68: ; preds = %65, %51
%69 = call i32 @close(i32 %7)
br label %70
70: ; preds = %68, %30, %23
%71 = phi i32 [ -1, %23 ], [ -1, %30 ], [ 0, %68 ]
ret i32 %71
}