#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 */

/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct hostent {
  int /*<<< orphan*/ h_length;
  scalar_t__ h_addr;
};
typedef int /*<<< orphan*/ server;
typedef int /*<<< orphan*/ buff;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(struct sockaddr_in *, int);
int close(int);
int /*<<< orphan*/ exit(int);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ htons(int);
int listen(int, int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int read(int, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int strcmp(char *, char *);
int write(int, char *, int);
main(int argc, char *argv[]) {
  int passive_socket, socket_to_client, procid_tmp, msglength, n;
  struct sockaddr_in server, client;
  struct hostent *hp;
  char buff[512];
  char msg[] = "hello";
  if (argc < 3) {
    printf("no server host specified at command line: <server1 localhost "
           "port#>\n");
    exit(1);
  }
  if ((passive_socket = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    printf("server cannot create passive socket.\n");
    exit(1);
  }
  bzero(&server, sizeof(server));
  server.sin_family = AF_INET;
  hp = gethostbyname(argv[1]);
  memcpy((unsigned char *)&server.sin_addr, (unsigned char *)hp->h_addr,
         hp->h_length);
  server.sin_port = htons((int)argv[2]);
  if ((n = bind(passive_socket, (struct sockaddr *)&server, sizeof(server))) ==
      -1) {
    printf("Server failed to bind.\n");
    exit(1);
  }
  if ((n = listen(passive_socket, 5)) == -1) {
    printf("Server failed to listen.\n");
    exit(1);
  }
  if ((socket_to_client = accept(passive_socket, NULL, NULL)) == -1) {
    printf("Server failed to accept.\n");
    exit(1);
  }
  if ((n = read(socket_to_client, buff, sizeof(buff))) <= 0) {
    printf("SERVER: problem with read.\n");
    exit(1);
  }
  n = strcmp(msg, buff);
  if (n != 0) {
    printf("SERVER: received string from client, but no match.\n");
    exit(1);
  } else {
    printf("SERVER: received string from client, and match.\n");
  }
  if ((n = write(socket_to_client, buff, sizeof(buff))) <= 0) {
    printf("SERVER: problem with write.\n");
    exit(1);
  } else {
    printf("SERVER: write to client succeeded.\n");
  }
  printf("SERVER: closing connected socket and exiting program.\n");
  if ((n = close(socket_to_client)) != 0) {
    printf("SERVER: problem with close.\n");
    exit(1);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x260,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe01(%rip),%eax
mov    %eax,-0x256(%rbp)
mov    0xdf8(%rip),%ax
mov    %ax,-0x252(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1233 <main+0x53>
lea    0xde2(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
mov    0x2d95(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    126e <main+0x8e>
lea    0xdec(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    -0x30(%rbp),%rdi
mov    $0xc,%esi
call   10d0 <bzero@plt>
mov    0x2d65(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <gethostbyname@plt>
mov    %rax,-0x48(%rbp)
lea    -0x30(%rbp),%rdi
add    $0x4,%rdi
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x48(%rbp),%rax
mov    (%rax),%edx
call   10a0 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %eax,%edi
call   1040 <htons@plt>
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0xc,%edx
call   10c0 <bind@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffffff,%eax
jne    12f9 <main+0x119>
lea    0xd87(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x14(%rbp),%edi
mov    $0x5,%esi
call   10b0 <listen@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffffff,%eax
jne    1328 <main+0x148>
lea    0xd70(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x14(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   10e0 <accept@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    1359 <main+0x179>
lea    0xd59(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x18(%rbp),%edi
lea    -0x250(%rbp),%rsi
mov    $0x200,%edx
call   1070 <read@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
jg     138f <main+0x1af>
lea    0xd3d(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    -0x256(%rbp),%rdi
lea    -0x250(%rbp),%rsi
call   1080 <strcmp@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     13c5 <main+0x1e5>
lea    0xd23(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xd41(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%edi
lea    -0x250(%rbp),%rsi
mov    $0x200,%edx
call   1030 <write@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
jg     1407 <main+0x227>
lea    0xd46(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xd4d(%rip),%rdi
call   1050 <printf@plt>
lea    0xd65(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%edi
call   1060 <close@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     1449 <main+0x269>
lea    0xd7c(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x218,%rsp
cmp    $0x2,%edi
jg     11ee <main+0x1e>
lea    0xf9a(%rip),%rdi
jmp    134a <main+0x17a>
mov    %rsi,%rbx
mov    0x2df0(%rip),%r15
mov    (%r15),%edi
mov    0x2dd6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
test   %eax,%eax
jns    121b <main+0x4b>
lea    0xf48(%rip),%rdi
jmp    134a <main+0x17a>
mov    %eax,%ebp
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xc,%esi
call   10c0 <bzero@plt>
mov    (%r15),%eax
mov    %eax,0x8(%rsp)
mov    0x8(%rbx),%rdi
call   1080 <gethostbyname@plt>
lea    0x4(%rsp),%rdi
mov    0x8(%rax),%rsi
mov    (%rax),%edx
call   1090 <memcpy@plt>
mov    0x10(%rbx),%edi
call   1050 <htons@plt>
mov    %eax,(%rsp)
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0xc,%edx
call   10b0 <bind@plt>
cmp    $0xffffffff,%eax
jne    1278 <main+0xa8>
lea    0xed4(%rip),%rdi
jmp    134a <main+0x17a>
mov    %ebp,%edi
mov    $0x5,%esi
call   10a0 <listen@plt>
cmp    $0xffffffff,%eax
jne    1295 <main+0xc5>
lea    0xe9e(%rip),%rdi
jmp    134a <main+0x17a>
mov    %ebp,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10d0 <accept@plt>
cmp    $0xffffffff,%eax
jne    12b1 <main+0xe1>
lea    0xe69(%rip),%rdi
jmp    134a <main+0x17a>
mov    %eax,%ebx
lea    0x10(%rsp),%rsi
mov    %eax,%edi
mov    $0x200,%edx
call   1070 <read@plt>
test   %eax,%eax
jg     12d1 <main+0x101>
lea    0xe2b(%rip),%rdi
jmp    134a <main+0x17a>
mov    $0x6c6c6568,%eax
xor    0x10(%rsp),%eax
movzwl 0x14(%rsp),%ecx
xor    $0x6f,%ecx
or     %eax,%ecx
jne    1310 <main+0x140>
lea    0xd19(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rsi
mov    %ebx,%edi
mov    $0x200,%edx
call   1040 <write@plt>
test   %eax,%eax
jg     1319 <main+0x149>
lea    0xd9d(%rip),%rdi
jmp    134a <main+0x17a>
lea    0xdb0(%rip),%rdi
jmp    134a <main+0x17a>
lea    0xd16(%rip),%rdi
call   1030 <puts@plt>
lea    0xd2d(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1060 <close@plt>
test   %eax,%eax
jne    1343 <main+0x173>
xor    %edi,%edi
call   10e0 <exit@plt>
lea    0xd45(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.hostent = type { i32, i64 }
%struct.sockaddr = type { i32 }
@__const.main.msg = [6 x i8] c"hello\00"
@.str = [69 x i8] c"no server host specified at command line: <server1 localhost port#>\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [38 x i8] c"server cannot create passive socket.\0A\00"
@.str.2 = [24 x i8] c"Server failed to bind.\0A\00"
@.str.3 = [26 x i8] c"Server failed to listen.\0A\00"
@.str.4 = [26 x i8] c"Server failed to accept.\0A\00"
@.str.5 = [28 x i8] c"SERVER: problem with read.\0A\00"
@.str.6 = [52 x i8] c"SERVER: received string from client, but no match.\0A\00"
@.str.7 = [49 x i8] c"SERVER: received string from client, and match.\0A\00"
@.str.8 = [29 x i8] c"SERVER: problem with write.\0A\00"
@.str.9 = [36 x i8] c"SERVER: write to client succeeded.\0A\00"
@.str.10 = [55 x i8] c"SERVER: closing connected socket and exiting program.\0A\00"
@.str.11 = [29 x i8] c"SERVER: problem with close.\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 i32
%10 = alloca i32
%11 = alloca %struct.sockaddr_in
%12 = alloca %struct.sockaddr_in
%13 = alloca %struct.hostent*
%14 = alloca [512 x i8]
%15 = alloca [6 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = bitcast [6 x i8]* %15 to i8*
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 3
br i1 %18, label %19, label %22
19: ; preds = %2
%20 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %2
%23 = load i32, i32* @AF_INET
%24 = load i32, i32* @SOCK_STREAM
%25 = call i32 @socket(i32 %23, i32 %24, i32 0)
store i32 %25, i32* %6
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %22
%28 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %22
%31 = call i32 @bzero(%struct.sockaddr_in* %11, i32 12)
%32 = load i32, i32* @AF_INET
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 2
store i32 %32, i32* %33
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = call %struct.hostent* @gethostbyname(i8* %36)
store %struct.hostent* %37, %struct.hostent** %13
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 1
%39 = bitcast i32* %38 to i8*
%40 = load %struct.hostent*, %struct.hostent** %13
%41 = getelementptr inbounds %struct.hostent, %struct.hostent* %40, i32 0, i32 1
%42 = load i64, i64* %41
%43 = inttoptr i64 %42 to i8*
%44 = load %struct.hostent*, %struct.hostent** %13
%45 = getelementptr inbounds %struct.hostent, %struct.hostent* %44, i32 0, i32 0
%46 = load i32, i32* %45
%47 = call i32 @memcpy(i8* %39, i8* %43, i32 %46)
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 2
%50 = load i8*, i8** %49
%51 = ptrtoint i8* %50 to i32
%52 = call i32 @htons(i32 %51)
%53 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
store i32 %52, i32* %53
%54 = load i32, i32* %6
%55 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%56 = call i32 @bind(i32 %54, %struct.sockaddr* %55, i32 12)
store i32 %56, i32* %10
%57 = icmp eq i32 %56, -1
br i1 %57, label %58, label %61
58: ; preds = %30
%59 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%60 = call i32 @exit(i32 1)
unreachable
61: ; preds = %30
%62 = load i32, i32* %6
%63 = call i32 @listen(i32 %62, i32 5)
store i32 %63, i32* %10
%64 = icmp eq i32 %63, -1
br i1 %64, label %65, label %68
65: ; preds = %61
%66 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%67 = call i32 @exit(i32 1)
unreachable
68: ; preds = %61
%69 = load i32, i32* %6
%70 = call i32 @accept(i32 %69, i32* null, i32* null)
store i32 %70, i32* %7
%71 = icmp eq i32 %70, -1
br i1 %71, label %72, label %75
72: ; preds = %68
%73 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%74 = call i32 @exit(i32 1)
unreachable
75: ; preds = %68
%76 = load i32, i32* %7
%77 = getelementptr inbounds [512 x i8], [512 x i8]* %14, i64 0, i64 0
%78 = call i32 @read(i32 %76, i8* %77, i32 512)
store i32 %78, i32* %10
%79 = icmp sle i32 %78, 0
br i1 %79, label %80, label %83
80: ; preds = %75
%81 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%82 = call i32 @exit(i32 1)
unreachable
83: ; preds = %75
%84 = getelementptr inbounds [6 x i8], [6 x i8]* %15, i64 0, i64 0
%85 = getelementptr inbounds [512 x i8], [512 x i8]* %14, i64 0, i64 0
%86 = call i32 @strcmp(i8* %84, i8* %85)
store i32 %86, i32* %10
%87 = load i32, i32* %10
%88 = icmp ne i32 %87, 0
br i1 %88, label %89, label %92
89: ; preds = %83
%90 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.6, i64 0, i64 0))
%91 = call i32 @exit(i32 1)
unreachable
92: ; preds = %83
%93 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0))
br label %94
94: ; preds = %92
%95 = load i32, i32* %7
%96 = getelementptr inbounds [512 x i8], [512 x i8]* %14, i64 0, i64 0
%97 = call i32 @write(i32 %95, i8* %96, i32 512)
store i32 %97, i32* %10
%98 = icmp sle i32 %97, 0
br i1 %98, label %99, label %102
99: ; preds = %94
%100 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0))
%101 = call i32 @exit(i32 1)
unreachable
102: ; preds = %94
%103 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0))
br label %104
104: ; preds = %102
%105 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i64 0, i64 0))
%106 = load i32, i32* %7
%107 = call i32 @close(i32 %106)
store i32 %107, i32* %10
%108 = icmp ne i32 %107, 0
br i1 %108, label %109, label %112
109: ; preds = %104
%110 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
%111 = call i32 @exit(i32 1)
unreachable
112: ; preds = %104
%113 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.hostent = type { i32, i64 }
%struct.sockaddr = type { i32 }
@__const.main.msg = [6 x i8] c"hello\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@str = [48 x i8] c"SERVER: received string from client, and match.\00"
@str.12 = [35 x i8] c"SERVER: write to client succeeded.\00"
@str.13 = [54 x i8] c"SERVER: closing connected socket and exiting program.\00"
@str.14 = [28 x i8] c"SERVER: problem with close.\00"
@str.15 = [28 x i8] c"SERVER: problem with write.\00"
@str.16 = [51 x i8] c"SERVER: received string from client, but no match.\00"
@str.17 = [27 x i8] c"SERVER: problem with read.\00"
@str.18 = [25 x i8] c"Server failed to accept.\00"
@str.19 = [25 x i8] c"Server failed to listen.\00"
@str.20 = [23 x i8] c"Server failed to bind.\00"
@str.21 = [37 x i8] c"server cannot create passive socket.\00"
@str.22 = [68 x i8] c"no server host specified at command line: <server1 localhost port#>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [512 x i8]
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%7 = icmp slt i32 %0, 3
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.22, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = load i32, i32* @AF_INET
%13 = load i32, i32* @SOCK_STREAM
%14 = tail call i32 @socket(i32 %12, i32 %13, i32 0)
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.21, i64 0, i64 0))
%18 = tail call i32 @exit(i32 1)
unreachable
19: ; preds = %11
%20 = call i32 @bzero(%struct.sockaddr_in* %3, i32 12)
%21 = load i32, i32* @AF_INET
%22 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %21, i32* %22
%23 = getelementptr inbounds i8*, i8** %1, i64 1
%24 = load i8*, i8** %23
%25 = tail call %struct.hostent* @gethostbyname(i8* %24)
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
%27 = bitcast i32* %26 to i8*
%28 = getelementptr inbounds %struct.hostent, %struct.hostent* %25, i64 0, i32 1
%29 = load i64, i64* %28
%30 = inttoptr i64 %29 to i8*
%31 = getelementptr inbounds %struct.hostent, %struct.hostent* %25, i64 0, i32 0
%32 = load i32, i32* %31
%33 = call i32 @memcpy(i8* %27, i8* %30, i32 %32)
%34 = getelementptr inbounds i8*, i8** %1, i64 2
%35 = load i8*, i8** %34
%36 = ptrtoint i8* %35 to i64
%37 = trunc i64 %36 to i32
%38 = call i32 @htons(i32 %37)
%39 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %38, i32* %39
%40 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%41 = call i32 @bind(i32 %14, %struct.sockaddr* %40, i32 12)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %46
43: ; preds = %19
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.20, i64 0, i64 0))
%45 = call i32 @exit(i32 1)
unreachable
46: ; preds = %19
%47 = call i32 @listen(i32 %14, i32 5)
%48 = icmp eq i32 %47, -1
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.19, i64 0, i64 0))
%51 = call i32 @exit(i32 1)
unreachable
52: ; preds = %46
%53 = call i32 @accept(i32 %14, i32* null, i32* null)
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %58
55: ; preds = %52
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.18, i64 0, i64 0))
%57 = call i32 @exit(i32 1)
unreachable
58: ; preds = %52
%59 = call i32 @read(i32 %53, i8* %6, i32 512)
%60 = icmp slt i32 %59, 1
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.17, i64 0, i64 0))
%63 = call i32 @exit(i32 1)
unreachable
64: ; preds = %58
%65 = call i32 @bcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @__const.main.msg, i64 0, i64 0), i8* dereferenceable(6) %6, i64 6)
%66 = icmp eq i32 %65, 0
br i1 %66, label %70, label %67
67: ; preds = %64
%68 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.16, i64 0, i64 0))
%69 = call i32 @exit(i32 1)
unreachable
70: ; preds = %64
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%72 = call i32 @write(i32 %53, i8* %6, i32 512)
%73 = icmp slt i32 %72, 1
br i1 %73, label %74, label %77
74: ; preds = %70
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.15, i64 0, i64 0))
%76 = call i32 @exit(i32 1)
unreachable
77: ; preds = %70
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.12, i64 0, i64 0))
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.13, i64 0, i64 0))
%80 = call i32 @close(i32 %53)
%81 = icmp eq i32 %80, 0
br i1 %81, label %85, label %82
82: ; preds = %77
%83 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.14, i64 0, i64 0))
%84 = call i32 @exit(i32 1)
unreachable
85: ; preds = %77
%86 = call i32 @exit(i32 0)
unreachable
}