#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 socklen_t;
typedef int /*<<< orphan*/ servAddr;
typedef int /*<<< orphan*/ cliAddr;
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int *);
int atoi(char *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(struct sockaddr_in *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
char *inet_ntoa(TYPE_1__);
scalar_t__ listen(int, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int 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 argc, char *argv[]) {
  int SERVER_PORT = 6666;
  if (argc > 2)
    printf("param err:\nUsage: %s port | %s\n", argv[0], argv[0]);
  if (argc == 2)
    SERVER_PORT = atoi(argv[1]);
  int servSocket, cliSocket;
  struct sockaddr_in servAddr, cliAddr;
  socklen_t addrLen = sizeof(cliAddr);
  char buffer[200];
  if ((servSocket = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    printf("socket err");
    exit(1);
  }
  bzero(&servAddr, sizeof(servAddr));
  servAddr.sin_family = AF_INET;
  servAddr.sin_port = htons(SERVER_PORT);
  servAddr.sin_addr.s_addr = htonl(INADDR_ANY);
  if (bind(servSocket, (struct sockaddr *)&servAddr, sizeof(servAddr)) < 0) {
    printf("bind err");
    exit(1);
  }
  printf("Listen Port: %d\nListening ...\n", SERVER_PORT);
  if (listen(servSocket, 5) < 0) {
    printf("listen err");
    exit(1);
  }
  while (1) {
    if ((cliSocket =
             accept(servSocket, (struct sockaddr *)&cliAddr, &addrLen)) < 0) {
      printf("accept err");
      exit(1);
    }
    printf("\nConnect from %s:%d\n", inet_ntoa(cliAddr.sin_addr),
           ntohs(cliAddr.sin_port));
    while (1) {
      int num = recv(cliSocket, buffer, sizeof(buffer), 0);
      if (num < 0) {
        printf("recv err");
        continue;
      } else if (num == 0) {
        printf("\nDisconnect %s:%d\n", inet_ntoa(cliAddr.sin_addr),
               ntohs(cliAddr.sin_port));
        break;
      } else {
        printf("Recv: %s\nlength: %d\n\n", buffer, num);
      }
      memset(buffer, 0, 200);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1a0a,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1226 <main+0x46>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1240 <main+0x60>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x14(%rbp)
movl   $0xc,-0x3c(%rbp)
mov    0x2d9a(%rip),%rax
mov    (%rax),%edi
mov    0x2d79(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1284 <main+0xa4>
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    -0x28(%rbp),%rdi
mov    $0xc,%esi
call   10c0 <bzero@plt>
mov    0x2d4f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <htons@plt>
mov    %eax,-0x28(%rbp)
mov    0x2d30(%rip),%rax
mov    (%rax),%edi
call   1070 <htonl@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0xc,%edx
call   10b0 <bind@plt>
cmp    $0x0,%rax
jge    12ed <main+0x10d>
lea    0xd4f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x14(%rbp),%esi
lea    0xd3d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%edi
mov    $0x5,%esi
call   1090 <listen@plt>
cmp    $0x0,%rax
jge    132d <main+0x14d>
lea    0xd37(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
jmp    1332 <main+0x152>
mov    -0x18(%rbp),%edi
lea    -0x38(%rbp),%rsi
lea    -0x3c(%rbp),%rdx
call   10d0 <accept@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    1366 <main+0x186>
lea    0xd09(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x34(%rbp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,-0x120(%rbp)
mov    -0x38(%rbp),%edi
call   10a0 <ntohs@plt>
mov    -0x120(%rbp),%rsi
mov    %eax,%edx
lea    0xcdc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x1c(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0xc8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x0,-0x114(%rbp)
jge    13d0 <main+0x1f0>
lea    0xcba(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1394 <main+0x1b4>
cmpl   $0x0,-0x114(%rbp)
jne    1410 <main+0x230>
mov    -0x34(%rbp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,-0x128(%rbp)
mov    -0x38(%rbp),%edi
call   10a0 <ntohs@plt>
mov    -0x128(%rbp),%rsi
mov    %eax,%edx
lea    0xc83(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1448 <main+0x268>
lea    -0x110(%rbp),%rsi
mov    -0x114(%rbp),%edx
lea    0xc76(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1430 <main+0x250>
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1080 <memset@plt>
jmp    1394 <main+0x1b4>
jmp    1332 <main+0x152>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
cmp    $0x3,%edi
jl     1211 <main+0x31>
mov    (%rsi),%rdx
lea    0xe00(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1a0a,%ebx
jmp    1226 <main+0x46>
mov    $0x1a0a,%ebx
cmp    $0x2,%edi
jne    1226 <main+0x46>
mov    0x8(%rsi),%rdi
call   10e0 <atoi@plt>
mov    %eax,%ebx
movl   $0xc,0xc(%rsp)
mov    0x2db3(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2d91(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
test   %eax,%eax
jns    1258 <main+0x78>
lea    0xdcd(%rip),%rdi
jmp    12f7 <main+0x117>
mov    %eax,%r15d
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0xc,%esi
call   10c0 <bzero@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x28(%rsp)
mov    %ebx,%edi
call   1050 <htons@plt>
mov    %eax,0x20(%rsp)
mov    0x2d5a(%rip),%rax
mov    (%rax),%edi
call   1070 <htonl@plt>
mov    %eax,0x24(%rsp)
mov    %r15d,%edi
mov    %r14,%rsi
mov    $0xc,%edx
call   10b0 <bind@plt>
test   %rax,%rax
jns    12af <main+0xcf>
lea    0xd7e(%rip),%rdi
jmp    12f7 <main+0x117>
lea    0xd7e(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15d,%edi
mov    $0x5,%esi
call   1090 <listen@plt>
test   %rax,%rax
jns    12da <main+0xfa>
lea    0xd7b(%rip),%rdi
jmp    12f7 <main+0x117>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %r15d,%edi
call   10d0 <accept@plt>
test   %eax,%eax
jns    1308 <main+0x128>
lea    0xd67(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    %eax,%r13d
lea    0x30(%rsp),%rbx
lea    0xd67(%rip),%rbp
lea    0xd7c(%rip),%r12
jmp    1361 <main+0x181>
mov    0x14(%rsp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,%r14
mov    0x10(%rsp),%edi
call   10a0 <ntohs@plt>
lea    0xd4b(%rip),%rdi
mov    %r14,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15d,%edi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   10d0 <accept@plt>
mov    %eax,%r13d
test   %eax,%eax
js     12f0 <main+0x110>
mov    0x14(%rsp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,%r14
mov    0x10(%rsp),%edi
call   10a0 <ntohs@plt>
lea    0xcec(%rip),%rdi
mov    %r14,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    139a <main+0x1ba>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0xc8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %eax,%eax
js     1390 <main+0x1b0>
je     1320 <main+0x140>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1080 <memset@plt>
jmp    139a <main+0x1ba>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [32 x i8] c"param err:\0AUsage: %s port | %s\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [11 x i8] c"socket err\00"
@INADDR_ANY = global i32 0
@.str.2 = [9 x i8] c"bind err\00"
@.str.3 = [31 x i8] c"Listen Port: %d\0AListening ...\0A\00"
@.str.4 = [11 x i8] c"listen err\00"
@.str.5 = [11 x i8] c"accept err\00"
@.str.6 = [21 x i8] c"\0AConnect from %s:%d\0A\00"
@.str.7 = [9 x i8] c"recv err\00"
@.str.8 = [19 x i8] c"\0ADisconnect %s:%d\0A\00"
@.str.9 = [22 x i8] c"Recv: %s\0Alength: %d\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.sockaddr_in
%10 = alloca %struct.sockaddr_in
%11 = alloca i32
%12 = alloca [200 x i8]
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 6666, i32* %6
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 2
br i1 %15, label %16, label %24
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %19, i8* %22)
br label %24
24: ; preds = %16, %2
%25 = load i32, i32* %4
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %32
27: ; preds = %24
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32 @atoi(i8* %30)
store i32 %31, i32* %6
br label %32
32: ; preds = %27, %24
store i32 12, i32* %11
%33 = load i32, i32* @AF_INET
%34 = load i32, i32* @SOCK_STREAM
%35 = call i32 @socket(i32 %33, i32 %34, i32 0)
store i32 %35, i32* %7
%36 = icmp slt i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%39 = call i32 @exit(i32 1)
unreachable
40: ; preds = %32
%41 = call i32 @bzero(%struct.sockaddr_in* %9, i32 12)
%42 = load i32, i32* @AF_INET
%43 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 2
store i32 %42, i32* %43
%44 = load i32, i32* %6
%45 = call i32 @htons(i32 %44)
%46 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
store i32 %45, i32* %46
%47 = load i32, i32* @INADDR_ANY
%48 = call i32 @htonl(i32 %47)
%49 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 1
%50 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %49, i32 0, i32 0
store i32 %48, i32* %50
%51 = load i32, i32* %7
%52 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%53 = call i64 @bind(i32 %51, %struct.sockaddr* %52, i32 12)
%54 = icmp slt i64 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %40
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%57 = call i32 @exit(i32 1)
unreachable
58: ; preds = %40
%59 = load i32, i32* %6
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %59)
%61 = load i32, i32* %7
%62 = call i64 @listen(i32 %61, i32 5)
%63 = icmp slt i64 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %58
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%66 = call i32 @exit(i32 1)
unreachable
67: ; preds = %58
br label %68
68: ; preds = %67, %113
%69 = load i32, i32* %7
%70 = bitcast %struct.sockaddr_in* %10 to %struct.sockaddr*
%71 = call i32 @accept(i32 %69, %struct.sockaddr* %70, i32* %11)
store i32 %71, i32* %8
%72 = icmp slt i32 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %68
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%75 = call i32 @exit(i32 1)
unreachable
76: ; preds = %68
%77 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 1
%78 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %77, i32 0, i32 0
%79 = load i32, i32* %78
%80 = call i8* @inet_ntoa(i32 %79)
%81 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 0
%82 = load i32, i32* %81
%83 = call i32 @ntohs(i32 %82)
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %80, i32 %83)
br label %85
85: ; preds = %76, %91, %110
%86 = load i32, i32* %8
%87 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%88 = call i32 @recv(i32 %86, i8* %87, i32 200, i32 0)
store i32 %88, i32* %13
%89 = load i32, i32* %13
%90 = icmp slt i32 %89, 0
br i1 %90, label %91, label %93
91: ; preds = %85
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %85
93: ; preds = %85
%94 = load i32, i32* %13
%95 = icmp eq i32 %94, 0
br i1 %95, label %96, label %105
96: ; preds = %93
%97 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 1
%98 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %97, i32 0, i32 0
%99 = load i32, i32* %98
%100 = call i8* @inet_ntoa(i32 %99)
%101 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 0
%102 = load i32, i32* %101
%103 = call i32 @ntohs(i32 %102)
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* %100, i32 %103)
br label %113
105: ; preds = %93
%106 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%107 = load i32, i32* %13
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i8* %106, i32 %107)
br label %109
109: ; preds = %105
br label %110
110: ; preds = %109
%111 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%112 = call i32 @memset(i8* %111, i32 0, i32 200)
br label %85
113: ; preds = %96
br label %68
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [32 x i8] c"param err:\0AUsage: %s port | %s\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [11 x i8] c"socket err\00"
@INADDR_ANY = global i32 0
@.str.2 = [9 x i8] c"bind err\00"
@.str.3 = [31 x i8] c"Listen Port: %d\0AListening ...\0A\00"
@.str.4 = [11 x i8] c"listen err\00"
@.str.5 = [11 x i8] c"accept err\00"
@.str.6 = [21 x i8] c"\0AConnect from %s:%d\0A\00"
@.str.7 = [9 x i8] c"recv err\00"
@.str.8 = [19 x i8] c"\0ADisconnect %s:%d\0A\00"
@.str.9 = [22 x i8] c"Recv: %s\0Alength: %d\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca [200 x i8]
%7 = icmp sgt i32 %0, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %9)
br label %17
11: ; preds = %2
%12 = icmp eq i32 %0, 2
br i1 %12, label %13, label %17
13: ; preds = %11
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i32 @atoi(i8* %15)
br label %17
17: ; preds = %8, %13, %11
%18 = phi i32 [ %16, %13 ], [ 6666, %11 ], [ 6666, %8 ]
%19 = bitcast %struct.sockaddr_in* %3 to i8*
%20 = bitcast %struct.sockaddr_in* %4 to i8*
%21 = bitcast i32* %5 to i8*
store i32 12, i32* %5
%22 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%23 = load i32, i32* @AF_INET
%24 = load i32, i32* @SOCK_STREAM
%25 = tail call i32 @socket(i32 %23, i32 %24, i32 0)
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %17
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%29 = tail call i32 @exit(i32 1)
unreachable
30: ; preds = %17
%31 = call i32 @bzero(%struct.sockaddr_in* %3, i32 12)
%32 = load i32, i32* @AF_INET
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %32, i32* %33
%34 = tail call i32 @htons(i32 %18)
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %34, i32* %35
%36 = load i32, i32* @INADDR_ANY
%37 = tail call i32 @htonl(i32 %36)
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
store i32 %37, i32* %38
%39 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%40 = call i64 @bind(i32 %25, %struct.sockaddr* %39, i32 12)
%41 = icmp slt i64 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %30
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%44 = call i32 @exit(i32 1)
unreachable
45: ; preds = %30
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%47 = call i64 @listen(i32 %25, i32 5)
%48 = icmp slt i64 %47, 0
br i1 %48, label %56, label %49
49: ; preds = %45
%50 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%51 = call i32 @accept(i32 %25, %struct.sockaddr* %50, i32* %5)
%52 = icmp slt i32 %51, 0
br i1 %52, label %59, label %53
53: ; preds = %49
%54 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1, i32 0
%55 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
br label %62
56: ; preds = %45
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %76, %49
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%61 = call i32 @exit(i32 1)
unreachable
62: ; preds = %53, %76
%63 = phi i32 [ %51, %53 ], [ %82, %76 ]
%64 = load i32, i32* %54
%65 = call i8* @inet_ntoa(i32 %64)
%66 = load i32, i32* %55
%67 = call i32 @ntohs(i32 %66)
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %65, i32 %67)
br label %69
69: ; preds = %87, %62
%70 = call i32 @recv(i32 %63, i8* %22, i32 200, i32 0)
%71 = icmp slt i32 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %87
74: ; preds = %69
%75 = icmp eq i32 %70, 0
br i1 %75, label %76, label %84
76: ; preds = %74
%77 = load i32, i32* %54
%78 = call i8* @inet_ntoa(i32 %77)
%79 = load i32, i32* %55
%80 = call i32 @ntohs(i32 %79)
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* %78, i32 %80)
%82 = call i32 @accept(i32 %25, %struct.sockaddr* %50, i32* %5)
%83 = icmp slt i32 %82, 0
br i1 %83, label %59, label %62
84: ; preds = %74
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i8* %22, i32 %70)
%86 = call i32 @memset(i8* %22, i32 0, i32 200)
br label %87
87: ; preds = %84, %72
br label %69
}