#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;
};
struct in_addr {
  int dummy;
};
struct hostent {
  char *h_name;
  scalar_t__ h_addr_list;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ servaddr;
typedef int /*<<< orphan*/ cliaddr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ herror(char *);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
char *inet_ntoa(struct in_addr);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int recv(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int i, listenfd, connfd, n;
  socklen_t clilen;
  char buf[4096];
  struct sockaddr_in cliaddr, servaddr;
  struct hostent *he;
  struct in_addr **addr_list;
  listenfd = socket(AF_INET, SOCK_STREAM, 0);
  if ((he = gethostbyname(argv[1])) == NULL) {
    herror("gethostbyname");
    return 2;
  }
  printf("Official name is: %s\n", he->h_name);
  printf("    IP addresses: ");
  addr_list = (struct in_addr **)he->h_addr_list;
  for (i = 0; addr_list[i] != NULL; i++) {
    printf("%s ", inet_ntoa(*addr_list[i]));
  }
  printf("\n");
  servaddr.sin_family = AF_INET;
  servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
  servaddr.sin_port = htons(3000);
  bind(listenfd, (struct sockaddr *)&servaddr, sizeof(servaddr));
  listen(listenfd, 8);
  printf("%s\n", "Server running...waiting for connections.");
  for (;;) {
    clilen = sizeof(cliaddr);
    connfd = accept(listenfd, (struct sockaddr *)&cliaddr, &clilen);
    printf("%s\n", "Received request...");
    while ((n = recv(connfd, buf, 4096, 0)) > 0) {
      printf("%s", "String received from and resent to the client:");
      puts(buf);
      send(connfd, buf, n, 0);
    }
    if (n < 0) {
      perror("Read error");
      exit(1);
    }
    close(connfd);
  }
  close(listenfd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1060,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2dc8(%rip),%rax
mov    (%rax),%edi
mov    0x2da7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10b0 <gethostbyname@plt>
mov    %rax,-0x1058(%rbp)
cmp    $0x0,%rax
jne    126d <main+0x6d>
lea    0xda6(%rip),%rdi
call   10c0 <herror@plt>
mov    $0x2,%eax
add    $0x1060,%rsp
pop    %rbp
ret
mov    -0x1058(%rbp),%rax
mov    (%rax),%rsi
lea    0xd90(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xd98(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x1058(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x1060(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x1060(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     12f7 <main+0xf7>
mov    -0x1060(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%edi
call   1050 <inet_ntoa@plt>
mov    %rax,%rsi
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12ac <main+0xac>
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x2cdc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1048(%rbp)
mov    0x2cc5(%rip),%rax
mov    (%rax),%edi
call   1090 <htonl@plt>
mov    %eax,-0x104c(%rbp)
mov    $0xbb8,%edi
call   1060 <htons@plt>
mov    %eax,-0x1050(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x1050(%rbp),%rsi
mov    $0xc,%edx
call   10e0 <bind@plt>
mov    -0x18(%rbp),%edi
mov    $0x8,%esi
call   10d0 <listen@plt>
lea    0xcc0(%rip),%rdi
lea    0xcd4(%rip),%rsi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0xc,-0x24(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x1040(%rbp),%rsi
lea    -0x24(%rbp),%rdx
call   1100 <accept@plt>
mov    %eax,-0x1c(%rbp)
lea    0xc8e(%rip),%rdi
lea    0xccc(%rip),%rsi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x1c(%rbp),%edi
lea    -0x1030(%rbp),%rsi
mov    $0x1000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jle    13fc <main+0x1fc>
lea    0xcb0(%rip),%rdi
lea    0xcac(%rip),%rsi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x1030(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x1c(%rbp),%edi
lea    -0x1030(%rbp),%rsi
mov    -0x20(%rbp),%edx
xor    %ecx,%ecx
call   1070 <send@plt>
jmp    13a0 <main+0x1a0>
cmpl   $0x0,-0x20(%rbp)
jge    141c <main+0x21c>
lea    0xc9e(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x1c(%rbp),%edi
call   10a0 <close@plt>
jmp    136e <main+0x16e>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1038,%rsp
mov    %rsi,%rbx
mov    0x2dbd(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2d9b(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,%r13d
mov    0x8(%rbx),%rdi
call   10c0 <gethostbyname@plt>
test   %rax,%rax
jne    1272 <main+0x62>
lea    0xdaa(%rip),%rdi
call   10d0 <herror@plt>
mov    $0x2,%eax
add    $0x1038,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rax,%rbx
mov    (%rax),%rsi
lea    0xd8f(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xd97(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x8(%rbx),%rbx
mov    (%rbx),%rax
test   %rax,%rax
je     12d0 <main+0xc0>
add    $0x8,%rbx
lea    0xd8c(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%rax),%edi
call   1060 <inet_ntoa@plt>
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    (%rbx),%rax
add    $0x8,%rbx
test   %rax,%rax
jne    12b0 <main+0xa0>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x18(%rsp)
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
call   10a0 <htonl@plt>
mov    %eax,0x14(%rsp)
mov    $0xbb8,%edi
call   1070 <htons@plt>
mov    %eax,0x10(%rsp)
lea    0x10(%rsp),%rsi
mov    %r13d,%edi
mov    $0xc,%edx
call   10f0 <bind@plt>
mov    %r13d,%edi
mov    $0x8,%esi
call   10e0 <listen@plt>
lea    0xd14(%rip),%rdi
call   1050 <puts@plt>
lea    0x30(%rsp),%rbx
lea    0xd41(%rip),%rbp
lea    0xd3d(%rip),%r14
nop
movl   $0xc,0xc(%rsp)
mov    %r13d,%edi
lea    0x20(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1110 <accept@plt>
mov    %eax,%r15d
lea    0xd01(%rip),%rdi
call   1050 <puts@plt>
nopl   0x0(%rax)
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0x1000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,%r12d
test   %eax,%eax
jle    13b0 <main+0x1a0>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %r12d,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
jmp    1370 <main+0x160>
test   %r12d,%r12d
js     13bf <main+0x1af>
mov    %r15d,%edi
call   10b0 <close@plt>
jmp    1340 <main+0x130>
lea    0xce5(%rip),%rdi
call   1100 <perror@plt>
mov    $0x1,%edi
call   1120 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i8*, i64 }
%struct.in_addr = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [14 x i8] c"gethostbyname\00"
@.str.1 = [22 x i8] c"Official name is: %s\0A\00"
@.str.2 = [19 x i8] c" IP addresses: \00"
@.str.3 = [4 x i8] c"%s \00"
@.str.4 = [2 x i8] c"\0A\00"
@INADDR_ANY = global i32 0
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [42 x i8] c"Server running...waiting for connections.\00"
@.str.7 = [20 x i8] c"Received request...\00"
@.str.8 = [3 x i8] c"%s\00"
@.str.9 = [47 x i8] c"String received from and resent to the client:\00"
@.str.10 = [11 x i8] c"Read error\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 i32
%10 = alloca i32
%11 = alloca [4096 x i8]
%12 = alloca %struct.sockaddr_in
%13 = alloca %struct.sockaddr_in
%14 = alloca %struct.hostent*
%15 = alloca %struct.in_addr**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* @AF_INET
%17 = load i32, i32* @SOCK_STREAM
%18 = call i32 @socket(i32 %16, i32 %17, i32 0)
store i32 %18, i32* %7
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call %struct.hostent* @gethostbyname(i8* %21)
store %struct.hostent* %22, %struct.hostent** %14
%23 = icmp eq %struct.hostent* %22, null
br i1 %23, label %24, label %26
24: ; preds = %2
%25 = call i32 @herror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 2
26: ; preds = %2
%27 = load %struct.hostent*, %struct.hostent** %14
%28 = getelementptr inbounds %struct.hostent, %struct.hostent* %27, i32 0, i32 0
%29 = load i8*, i8** %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%32 = load %struct.hostent*, %struct.hostent** %14
%33 = getelementptr inbounds %struct.hostent, %struct.hostent* %32, i32 0, i32 1
%34 = load i64, i64* %33
%35 = inttoptr i64 %34 to %struct.in_addr**
store %struct.in_addr** %35, %struct.in_addr*** %15
store i32 0, i32* %6
br label %36
36: ; preds = %53, %26
%37 = load %struct.in_addr**, %struct.in_addr*** %15
%38 = load i32, i32* %6
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds %struct.in_addr*, %struct.in_addr** %37, i64 %39
%41 = load %struct.in_addr*, %struct.in_addr** %40
%42 = icmp ne %struct.in_addr* %41, null
br i1 %42, label %43, label %56
43: ; preds = %36
%44 = load %struct.in_addr**, %struct.in_addr*** %15
%45 = load i32, i32* %6
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds %struct.in_addr*, %struct.in_addr** %44, i64 %46
%48 = load %struct.in_addr*, %struct.in_addr** %47
%49 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %48, i32 0, i32 0
%50 = load i32, i32* %49
%51 = call i8* @inet_ntoa(i32 %50)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %51)
br label %53
53: ; preds = %43
%54 = load i32, i32* %6
%55 = add nsw i32 %54, 1
store i32 %55, i32* %6
br label %36
56: ; preds = %36
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%58 = load i32, i32* @AF_INET
%59 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 2
store i32 %58, i32* %59
%60 = load i32, i32* @INADDR_ANY
%61 = call i32 @htonl(i32 %60)
%62 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 1
%63 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %62, i32 0, i32 0
store i32 %61, i32* %63
%64 = call i32 @htons(i32 3000)
%65 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 0
store i32 %64, i32* %65
%66 = load i32, i32* %7
%67 = bitcast %struct.sockaddr_in* %13 to %struct.sockaddr*
%68 = call i32 @bind(i32 %66, %struct.sockaddr* %67, i32 12)
%69 = load i32, i32* %7
%70 = call i32 @listen(i32 %69, i32 8)
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0))
br label %72
72: ; preds = %96, %56
store i32 12, i32* %10
%73 = load i32, i32* %7
%74 = bitcast %struct.sockaddr_in* %12 to %struct.sockaddr*
%75 = call i32 @accept(i32 %73, %struct.sockaddr* %74, i32* %10)
store i32 %75, i32* %8
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
br label %77
77: ; preds = %82, %72
%78 = load i32, i32* %8
%79 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%80 = call i32 @recv(i32 %78, i8* %79, i32 4096, i32 0)
store i32 %80, i32* %9
%81 = icmp sgt i32 %80, 0
br i1 %81, label %82, label %90
82: ; preds = %77
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0))
%84 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%85 = call i32 @puts(i8* %84)
%86 = load i32, i32* %8
%87 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%88 = load i32, i32* %9
%89 = call i32 @send(i32 %86, i8* %87, i32 %88, i32 0)
br label %77
90: ; preds = %77
%91 = load i32, i32* %9
%92 = icmp slt i32 %91, 0
br i1 %92, label %93, label %96
93: ; preds = %90
%94 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%95 = call i32 @exit(i32 1)
unreachable
96: ; preds = %90
%97 = load i32, i32* %8
%98 = call i32 @close(i32 %97)
br label %72
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i8*, i64 }
%struct.in_addr = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [14 x i8] c"gethostbyname\00"
@.str.1 = [22 x i8] c"Official name is: %s\0A\00"
@.str.2 = [19 x i8] c" IP addresses: \00"
@.str.3 = [4 x i8] c"%s \00"
@INADDR_ANY = global i32 0
@.str.6 = [42 x i8] c"Server running...waiting for connections.\00"
@.str.7 = [20 x i8] c"Received request...\00"
@.str.8 = [3 x i8] c"%s\00"
@.str.9 = [47 x i8] c"String received from and resent to the client:\00"
@.str.10 = [11 x i8] c"Read error\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca [4096 x i8]
%5 = alloca %struct.sockaddr_in
%6 = alloca %struct.sockaddr_in
%7 = bitcast i32* %3 to i8*
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%9 = bitcast %struct.sockaddr_in* %5 to i8*
%10 = bitcast %struct.sockaddr_in* %6 to i8*
%11 = load i32, i32* @AF_INET
%12 = load i32, i32* @SOCK_STREAM
%13 = tail call i32 @socket(i32 %11, i32 %12, i32 0)
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call %struct.hostent* @gethostbyname(i8* %15)
%17 = icmp eq %struct.hostent* %16, null
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = tail call i32 @herror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 2
20: ; preds = %2
%21 = getelementptr inbounds %struct.hostent, %struct.hostent* %16, i64 0, i32 0
%22 = load i8*, i8** %21
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%25 = getelementptr inbounds %struct.hostent, %struct.hostent* %16, i64 0, i32 1
%26 = load i64, i64* %25
%27 = inttoptr i64 %26 to %struct.in_addr**
%28 = load %struct.in_addr*, %struct.in_addr** %27
%29 = icmp eq %struct.in_addr* %28, null
br i1 %29, label %41, label %30
30: ; preds = %20, %30
%31 = phi i64 [ %37, %30 ], [ 0, %20 ]
%32 = phi %struct.in_addr* [ %39, %30 ], [ %28, %20 ]
%33 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %32, i64 0, i32 0
%34 = load i32, i32* %33
%35 = tail call i8* @inet_ntoa(i32 %34)
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %35)
%37 = add nuw i64 %31, 1
%38 = getelementptr inbounds %struct.in_addr*, %struct.in_addr** %27, i64 %37
%39 = load %struct.in_addr*, %struct.in_addr** %38
%40 = icmp eq %struct.in_addr* %39, null
br i1 %40, label %41, label %30
41: ; preds = %30, %20
%42 = tail call i32 @putchar(i32 10)
%43 = load i32, i32* @AF_INET
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 2
store i32 %43, i32* %44
%45 = load i32, i32* @INADDR_ANY
%46 = tail call i32 @htonl(i32 %45)
%47 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 1, i32 0
store i32 %46, i32* %47
%48 = tail call i32 @htons(i32 3000)
%49 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 0
store i32 %48, i32* %49
%50 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%51 = call i32 @bind(i32 %13, %struct.sockaddr* %50, i32 12)
%52 = call i32 @listen(i32 %13, i32 8)
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.6, i64 0, i64 0))
%54 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
br label %55
55: ; preds = %73, %41
store i32 12, i32* %3
%56 = call i32 @accept(i32 %13, %struct.sockaddr* %54, i32* %3)
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%58 = call i32 @recv(i32 %56, i8* %8, i32 4096, i32 0)
%59 = icmp sgt i32 %58, 0
br i1 %59, label %60, label %67
60: ; preds = %55, %60
%61 = phi i32 [ %65, %60 ], [ %58, %55 ]
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0))
%63 = call i32 @puts(i8* %8)
%64 = call i32 @send(i32 %56, i8* %8, i32 %61, i32 0)
%65 = call i32 @recv(i32 %56, i8* %8, i32 4096, i32 0)
%66 = icmp sgt i32 %65, 0
br i1 %66, label %60, label %67
67: ; preds = %60, %55
%68 = phi i32 [ %58, %55 ], [ %65, %60 ]
%69 = icmp slt i32 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%72 = call i32 @exit(i32 1)
unreachable
73: ; preds = %67
%74 = call i32 @close(i32 %56)
br label %55
}