#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 pid_t;
typedef int /*<<< orphan*/ peeraddr;
typedef int /*<<< orphan*/ on;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SOMAXCONN;
int /*<<< orphan*/ SO_REUSEADDR;
int accept(int, struct sockaddr *, int *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ do_recv(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
char *inet_ntoa(TYPE_1__);
scalar_t__ listen(int, int /*<<< orphan*/);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *, int);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) {
  int listenfd;
  if ((listenfd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
    do {
      perror("socket");
      exit(EXIT_FAILURE);
    } while (0);
  }
  struct sockaddr_in servaddr;
  memset(&servaddr, 0, sizeof(servaddr));
  servaddr.sin_family = AF_INET;
  servaddr.sin_port = htons(5188);
  servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
  int on = 1;
  if (setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0) {
    do {
      perror("setsockopt");
      exit(EXIT_FAILURE);
    } while (0);
  }
  if (bind(listenfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0) {
    do {
      perror("bind");
      exit(EXIT_FAILURE);
    } while (0);
  }
  if (listen(listenfd, SOMAXCONN) < 0) {
    do {
      perror("listen");
      exit(EXIT_FAILURE);
    } while (0);
  }
  struct sockaddr_in peeraddr;
  socklen_t peerlen = sizeof(peeraddr);
  int conn;
  pid_t pid;
  while (1) {
    if ((conn = accept(listenfd, (struct sockaddr *)&peeraddr, &peerlen)) < 0) {
      do {
        perror("accept");
        exit(EXIT_FAILURE);
      } while (0);
    }
    printf("ip = %s, port = %d\n", inet_ntoa(peeraddr.sin_addr),
           ntohs(peeraddr.sin_port));
    pid = fork();
    if (pid == -1) {
      do {
        perror("fork");
        exit(EXIT_FAILURE);
      } while (0);
    } else if (pid == 0) {
      close(listenfd);
      do_recv(conn);
      exit(EXIT_SUCCESS);
    } else {
      close(conn);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2d9a(%rip),%rax
mov    (%rax),%edi
mov    0x2d99(%rip),%rax
mov    (%rax),%esi
mov    0x2da8(%rip),%rax
mov    (%rax),%edx
call   1120 <socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    125a <main+0x5a>
jmp    1240 <main+0x40>
lea    0xdb9(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2d55(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1080 <memset@plt>
mov    0x2d6f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0x1444,%edi
call   1050 <htons@plt>
mov    %eax,-0x18(%rbp)
mov    0x2d4e(%rip),%rax
mov    (%rax),%edi
call   1070 <htonl@plt>
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2d43(%rip),%rax
mov    (%rax),%esi
mov    0x2cea(%rip),%rax
mov    (%rax),%edx
lea    -0x1c(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0x0,%rax
jge    12e8 <main+0xe8>
jmp    12ce <main+0xce>
lea    0xd32(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2cc7(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0xc,%edx
call   10c0 <bind@plt>
cmp    $0x0,%rax
jge    1322 <main+0x122>
jmp    1308 <main+0x108>
lea    0xd03(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2c8d(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    -0x8(%rbp),%edi
mov    0x2c94(%rip),%rax
mov    (%rax),%esi
call   10a0 <listen@plt>
cmp    $0x0,%rax
jge    135c <main+0x15c>
jmp    1342 <main+0x142>
lea    0xcce(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2c53(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
movl   $0xc,-0x2c(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x28(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
call   10f0 <accept@plt>
mov    %eax,-0x30(%rbp)
cmp    $0x0,%eax
jge    139e <main+0x19e>
jmp    1384 <main+0x184>
lea    0xc93(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2c11(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    -0x24(%rbp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%edi
call   10b0 <ntohs@plt>
mov    -0x40(%rbp),%rsi
mov    %eax,%edx
lea    0xc66(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1110 <fork@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jne    13f7 <main+0x1f7>
jmp    13dd <main+0x1dd>
lea    0xc55(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2bb8(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
cmpl   $0x0,-0x34(%rbp)
jne    141f <main+0x21f>
mov    -0x8(%rbp),%edi
call   1090 <close@plt>
mov    -0x30(%rbp),%edi
call   10e0 <do_recv@plt>
mov    0x2b88(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
mov    -0x30(%rbp),%edi
call   1090 <close@plt>
jmp    142c <main+0x22c>
jmp    1363 <main+0x163>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0x2d9b(%rip),%rax
mov    (%rax),%edi
mov    0x2d9a(%rip),%rax
mov    (%rax),%esi
mov    0x2da9(%rip),%rax
mov    (%rax),%edx
call   1120 <socket@plt>
test   %eax,%eax
jns    123e <main+0x3e>
lea    0xdc7(%rip),%rdi
jmp    13aa <main+0x1aa>
mov    %eax,%r14d
lea    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1080 <memset@plt>
mov    0x2d87(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
mov    $0x1444,%edi
call   1050 <htons@plt>
mov    %eax,0x8(%rsp)
mov    0x2d64(%rip),%rax
mov    (%rax),%edi
call   1070 <htonl@plt>
mov    %eax,0xc(%rsp)
movl   $0x1,0x4(%rsp)
mov    0x2d5a(%rip),%rax
mov    (%rax),%esi
mov    0x2d01(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %r14d,%edi
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
test   %rax,%rax
jns    12bd <main+0xbd>
lea    0xd4f(%rip),%rdi
jmp    13aa <main+0x1aa>
lea    0x8(%rsp),%rsi
mov    %r14d,%edi
mov    $0xc,%edx
call   10c0 <bind@plt>
test   %rax,%rax
jns    12e0 <main+0xe0>
lea    0xd37(%rip),%rdi
jmp    13aa <main+0x1aa>
mov    0x2cd9(%rip),%rax
mov    (%rax),%esi
mov    %r14d,%edi
call   10a0 <listen@plt>
test   %rax,%rax
jns    1302 <main+0x102>
lea    0xd1a(%rip),%rdi
jmp    13aa <main+0x1aa>
movl   $0xc,(%rsp)
lea    0x18(%rsp),%rsi
mov    %rsp,%rdx
mov    %r14d,%edi
call   10f0 <accept@plt>
test   %eax,%eax
js     137d <main+0x17d>
mov    %eax,%ebp
lea    0xcff(%rip),%r15
lea    0x18(%rsp),%r12
mov    %rsp,%r13
xchg   %ax,%ax
mov    0x1c(%rsp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,%rbx
mov    0x18(%rsp),%edi
call   10b0 <ntohs@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1060 <printf@plt>
xor    %eax,%eax
call   1110 <fork@plt>
test   %eax,%eax
je     1386 <main+0x186>
cmp    $0xffffffff,%eax
je     13a3 <main+0x1a3>
mov    %ebp,%edi
call   1090 <close@plt>
mov    %r14d,%edi
mov    %r12,%rsi
mov    %r13,%rdx
call   10f0 <accept@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1330 <main+0x130>
lea    0xc9a(%rip),%rdi
jmp    13aa <main+0x1aa>
mov    %r14d,%edi
call   1090 <close@plt>
mov    %ebp,%edi
call   10e0 <do_recv@plt>
mov    0x2c04(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
lea    0xc8f(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2bf2(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%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
@.str = [7 x i8] c"socket\00"
@EXIT_FAILURE = global i32 0
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [11 x i8] c"setsockopt\00"
@.str.2 = [5 x i8] c"bind\00"
@SOMAXCONN = global i32 0
@.str.3 = [7 x i8] c"listen\00"
@.str.4 = [7 x i8] c"accept\00"
@.str.5 = [20 x i8] c"ip = %s, port = %d\0A\00"
@.str.6 = [5 x i8] c"fork\00"
@EXIT_SUCCESS = global i32 0
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 i32
%8 = alloca i32
store i32 0, i32* %1
%9 = load i32, i32* @PF_INET
%10 = load i32, i32* @SOCK_STREAM
%11 = load i32, i32* @IPPROTO_TCP
%12 = call i32 @socket(i32 %9, i32 %10, i32 %11)
store i32 %12, i32* %2
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %0
br label %15
15: ; preds = %14
%16 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; No predecessors!
br label %20
20: ; preds = %19, %0
%21 = call i32 @memset(%struct.sockaddr_in* %3, i32 0, i32 12)
%22 = load i32, i32* @AF_INET
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 2
store i32 %22, i32* %23
%24 = call i32 @htons(i32 5188)
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
store i32 %24, i32* %25
%26 = load i32, i32* @INADDR_ANY
%27 = call i32 @htonl(i32 %26)
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 1
%29 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %28, i32 0, i32 0
store i32 %27, i32* %29
store i32 1, i32* %4
%30 = load i32, i32* %2
%31 = load i32, i32* @SOL_SOCKET
%32 = load i32, i32* @SO_REUSEADDR
%33 = call i64 @setsockopt(i32 %30, i32 %31, i32 %32, i32* %4, i32 4)
%34 = icmp slt i64 %33, 0
br i1 %34, label %35, label %41
35: ; preds = %20
br label %36
36: ; preds = %35
%37 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%38 = load i32, i32* @EXIT_FAILURE
%39 = call i32 @exit(i32 %38)
unreachable
40: ; No predecessors!
br label %41
41: ; preds = %40, %20
%42 = load i32, i32* %2
%43 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%44 = call i64 @bind(i32 %42, %struct.sockaddr* %43, i32 12)
%45 = icmp slt i64 %44, 0
br i1 %45, label %46, label %52
46: ; preds = %41
br label %47
47: ; preds = %46
%48 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%49 = load i32, i32* @EXIT_FAILURE
%50 = call i32 @exit(i32 %49)
unreachable
51: ; No predecessors!
br label %52
52: ; preds = %51, %41
%53 = load i32, i32* %2
%54 = load i32, i32* @SOMAXCONN
%55 = call i64 @listen(i32 %53, i32 %54)
%56 = icmp slt i64 %55, 0
br i1 %56, label %57, label %63
57: ; preds = %52
br label %58
58: ; preds = %57
%59 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%60 = load i32, i32* @EXIT_FAILURE
%61 = call i32 @exit(i32 %60)
unreachable
62: ; No predecessors!
br label %63
63: ; preds = %62, %52
store i32 12, i32* %6
br label %64
64: ; preds = %63, %107
%65 = load i32, i32* %2
%66 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%67 = call i32 @accept(i32 %65, %struct.sockaddr* %66, i32* %6)
store i32 %67, i32* %7
%68 = icmp slt i32 %67, 0
br i1 %68, label %69, label %75
69: ; preds = %64
br label %70
70: ; preds = %69
%71 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%72 = load i32, i32* @EXIT_FAILURE
%73 = call i32 @exit(i32 %72)
unreachable
74: ; No predecessors!
br label %75
75: ; preds = %74, %64
%76 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i32 0, i32 1
%77 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %76, i32 0, i32 0
%78 = load i32, i32* %77
%79 = call i8* @inet_ntoa(i32 %78)
%80 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i32 0, i32 0
%81 = load i32, i32* %80
%82 = call i32 @ntohs(i32 %81)
%83 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* %79, i32 %82)
%84 = call i32 (...) @fork()
store i32 %84, i32* %8
%85 = load i32, i32* %8
%86 = icmp eq i32 %85, -1
br i1 %86, label %87, label %93
87: ; preds = %75
br label %88
88: ; preds = %87
%89 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%90 = load i32, i32* @EXIT_FAILURE
%91 = call i32 @exit(i32 %90)
unreachable
92: ; No predecessors!
br label %107
93: ; preds = %75
%94 = load i32, i32* %8
%95 = icmp eq i32 %94, 0
br i1 %95, label %96, label %103
96: ; preds = %93
%97 = load i32, i32* %2
%98 = call i32 @close(i32 %97)
%99 = load i32, i32* %7
%100 = call i32 @do_recv(i32 %99)
%101 = load i32, i32* @EXIT_SUCCESS
%102 = call i32 @exit(i32 %101)
unreachable
103: ; preds = %93
%104 = load i32, i32* %7
%105 = call i32 @close(i32 %104)
br label %106
106: ; preds = %103
br label %107
107: ; preds = %106, %92
br label %64
}

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
@.str = [7 x i8] c"socket\00"
@EXIT_FAILURE = global i32 0
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.1 = [11 x i8] c"setsockopt\00"
@.str.2 = [5 x i8] c"bind\00"
@SOMAXCONN = global i32 0
@.str.3 = [7 x i8] c"listen\00"
@.str.4 = [7 x i8] c"accept\00"
@.str.5 = [20 x i8] c"ip = %s, port = %d\0A\00"
@.str.6 = [5 x i8] c"fork\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca %struct.sockaddr_in
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = load i32, i32* @PF_INET
%6 = load i32, i32* @SOCK_STREAM
%7 = load i32, i32* @IPPROTO_TCP
%8 = tail call i32 @socket(i32 %5, i32 %6, i32 %7)
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %0
%15 = bitcast %struct.sockaddr_in* %1 to i8*
%16 = call i32 @memset(%struct.sockaddr_in* %1, i32 0, 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 = call i32 @htons(i32 5188)
%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 = 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 i32* %2 to i8*
store i32 1, i32* %2
%25 = load i32, i32* @SOL_SOCKET
%26 = load i32, i32* @SO_REUSEADDR
%27 = call i64 @setsockopt(i32 %8, i32 %25, i32 %26, i32* %2, i32 4)
%28 = icmp slt i64 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %14
%30 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%31 = load i32, i32* @EXIT_FAILURE
%32 = call i32 @exit(i32 %31)
unreachable
33: ; preds = %14
%34 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%35 = call i64 @bind(i32 %8, %struct.sockaddr* %34, i32 12)
%36 = icmp slt i64 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %33
%38 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%39 = load i32, i32* @EXIT_FAILURE
%40 = call i32 @exit(i32 %39)
unreachable
41: ; preds = %33
%42 = load i32, i32* @SOMAXCONN
%43 = call i64 @listen(i32 %8, i32 %42)
%44 = icmp slt i64 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %41
%46 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%47 = load i32, i32* @EXIT_FAILURE
%48 = call i32 @exit(i32 %47)
unreachable
49: ; preds = %41
%50 = bitcast %struct.sockaddr_in* %3 to i8*
%51 = bitcast i32* %4 to i8*
store i32 12, i32* %4
%52 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%53 = call i32 @accept(i32 %8, %struct.sockaddr* %52, i32* %4)
%54 = icmp slt i32 %53, 0
br i1 %54, label %58, label %55
55: ; preds = %49
%56 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
%57 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
br label %62
58: ; preds = %79, %49
%59 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%60 = load i32, i32* @EXIT_FAILURE
%61 = call i32 @exit(i32 %60)
unreachable
62: ; preds = %55, %79
%63 = phi i32 [ %53, %55 ], [ %81, %79 ]
%64 = load i32, i32* %56
%65 = call i8* @inet_ntoa(i32 %64)
%66 = load i32, i32* %57
%67 = call i32 @ntohs(i32 %66)
%68 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* %65, i32 %67)
%69 = call i32 (...) @fork()
switch i32 %69, label %79 [
i32 -1, label %70
i32 0, label %74
]
70: ; preds = %62
%71 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%72 = load i32, i32* @EXIT_FAILURE
%73 = call i32 @exit(i32 %72)
unreachable
74: ; preds = %62
%75 = call i32 @close(i32 %8)
%76 = call i32 @do_recv(i32 %63)
%77 = load i32, i32* @EXIT_SUCCESS
%78 = call i32 @exit(i32 %77)
unreachable
79: ; preds = %62
%80 = call i32 @close(i32 %63)
%81 = call i32 @accept(i32 %8, %struct.sockaddr* %52, i32* %4)
%82 = icmp slt i32 %81, 0
br i1 %82, label %58, label %62
}