#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*/ serv_addr;
typedef int /*<<< orphan*/ cli_addr;

/* 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(char *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int strcmp(char *, char *);
int write(int, char *, int);
int main(int argc, char *argv[]) {
  int sockfd, newsockfd, portno;
  socklen_t clilen;
  char buffer[256];
  char end_string[256];
  end_string[0] = 'e';
  end_string[1] = 'n';
  end_string[2] = 'd';
  end_string[3] = '\0';
  struct sockaddr_in serv_addr, cli_addr;
  int n;
  if (argc < 2) {
    fprintf(stderr, "ERROR, no port provided\n");
    exit(1);
  }
  sockfd = socket(AF_INET, SOCK_STREAM, 0);
  if (sockfd < 0)
    error("ERROR opening socket");
  bzero((char *)&serv_addr, sizeof(serv_addr));
  portno = atoi(argv[1]);
  serv_addr.sin_family = AF_INET;
  serv_addr.sin_addr.s_addr = INADDR_ANY;
  serv_addr.sin_port = htons(portno);
  if (bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0)
    error("ERROR on binding");
  listen(sockfd, 5);
  clilen = sizeof(cli_addr);
  do {
    newsockfd = accept(sockfd, (struct sockaddr *)&cli_addr, &clilen);
    if (newsockfd < 0)
      error("ERROR on accept");
    bzero(buffer, 256);
    n = read(newsockfd, buffer, 255);
    if (n < 0)
      error("ERROR reading from socket");
    printf("Here is the message: %s\n", buffer);
    printf("Here is the message: %s\n", buffer);
    printf("Here is the message: %s\n", buffer);
    printf("Here is the message: %s\n", buffer);
    printf("Here is the message: %s\n", buffer);
    printf("Here is the comparison: %d\n", strcmp(buffer, end_string));
    n = write(newsockfd, "I got your message", 18);
    if (n < 0)
      error("ERROR writing to socket");
    close(newsockfd);
  } while (strcmp(buffer, end_string) != 0);
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x250,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x65,-0x220(%rbp)
movb   $0x6e,-0x21f(%rbp)
movb   $0x64,-0x21e(%rbp)
movb   $0x0,-0x21d(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    124e <main+0x5e>
mov    0x2d9a(%rip),%rax
mov    (%rax),%edi
lea    0xdc1(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    0x2d93(%rip),%rax
mov    (%rax),%edi
mov    0x2d6a(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1280 <main+0x90>
lea    0xd9e(%rip),%rdi
call   10c0 <error@plt>
lea    -0x230(%rbp),%rdi
mov    $0xc,%esi
call   10d0 <bzero@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2d40(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x228(%rbp)
mov    0x2d29(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x22c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <htons@plt>
mov    %eax,-0x230(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x230(%rbp),%rsi
mov    $0xc,%edx
call   10b0 <bind@plt>
cmp    $0x0,%rax
jge    12f7 <main+0x107>
lea    0xd3c(%rip),%rdi
call   10c0 <error@plt>
mov    -0x14(%rbp),%edi
mov    $0x5,%esi
call   10a0 <listen@plt>
movl   $0xc,-0x20(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x240(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   10e0 <accept@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1337 <main+0x147>
lea    0xd0d(%rip),%rdi
call   10c0 <error@plt>
lea    -0x120(%rbp),%rdi
mov    $0x100,%esi
call   10d0 <bzero@plt>
mov    -0x18(%rbp),%edi
lea    -0x120(%rbp),%rsi
mov    $0xff,%edx
call   1070 <read@plt>
mov    %eax,-0x244(%rbp)
cmpl   $0x0,-0x244(%rbp)
jge    137b <main+0x18b>
lea    0xcd9(%rip),%rdi
call   10c0 <error@plt>
lea    -0x120(%rbp),%rsi
lea    0xce0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x120(%rbp),%rsi
lea    0xccb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x120(%rbp),%rsi
lea    0xcb6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x120(%rbp),%rsi
lea    0xca1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x120(%rbp),%rsi
lea    0xc8c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x120(%rbp),%rdi
lea    -0x220(%rbp),%rsi
call   1080 <strcmp@plt>
mov    %eax,%esi
lea    0xc82(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%edi
lea    0xc8d(%rip),%rsi
mov    $0x12,%edx
call   1030 <write@plt>
mov    %eax,-0x244(%rbp)
cmpl   $0x0,-0x244(%rbp)
jge    143a <main+0x24a>
lea    0xc7c(%rip),%rdi
call   10c0 <error@plt>
mov    -0x18(%rbp),%edi
call   1060 <close@plt>
lea    -0x120(%rbp),%rdi
lea    -0x220(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    130b <main+0x11b>
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
xor    %eax,%eax
add    $0x250,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x238,%rsp
movl   $0x646e65,0x30(%rsp)
cmp    $0x1,%edi
jle    13dc <main+0x1ec>
mov    %rsi,%rbx
mov    0x2dcc(%rip),%r15
mov    (%r15),%edi
mov    0x2da2(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1241 <main+0x51>
lea    0xddd(%rip),%rdi
call   10c0 <error@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0xc,%esi
call   10d0 <bzero@plt>
mov    0x8(%rbx),%rdi
call   10f0 <atoi@plt>
mov    (%r15),%ecx
mov    %ecx,0x18(%rsp)
mov    0x2d76(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,0x14(%rsp)
mov    %eax,%edi
call   1040 <htons@plt>
mov    %eax,0x10(%rsp)
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0xc,%edx
call   10b0 <bind@plt>
test   %rax,%rax
jns    129b <main+0xab>
lea    0xd98(%rip),%rdi
call   10c0 <error@plt>
mov    %ebp,%edi
mov    $0x5,%esi
call   10a0 <listen@plt>
movl   $0xc,0xc(%rsp)
lea    0x130(%rsp),%rbx
lea    0xdab(%rip),%r12
lea    0x30(%rsp),%r13
lea    0xdd4(%rip),%r15
jmp    12eb <main+0xfb>
nopl   0x0(%rax)
mov    %r14d,%edi
call   1060 <close@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
je     13c1 <main+0x1d1>
mov    %ebp,%edi
lea    0x20(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   10e0 <accept@plt>
mov    %eax,%r14d
test   %eax,%eax
jns    130f <main+0x11f>
lea    0xd35(%rip),%rdi
call   10c0 <error@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   10d0 <bzero@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0xff,%edx
call   1070 <read@plt>
test   %eax,%eax
jns    133c <main+0x14c>
lea    0xd18(%rip),%rdi
call   10c0 <error@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1080 <strcmp@plt>
lea    0xcf3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14d,%edi
mov    %r15,%rsi
mov    $0x12,%edx
call   1030 <write@plt>
test   %eax,%eax
jns    12d0 <main+0xe0>
lea    0xcfa(%rip),%rdi
call   10c0 <error@plt>
jmp    12d0 <main+0xe0>
mov    %ebp,%edi
call   1060 <close@plt>
xor    %eax,%eax
add    $0x238,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2bed(%rip),%rax
mov    (%rax),%edi
lea    0xc14(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%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 }
@stderr = global i32 0
@.str = [25 x i8] c"ERROR, no port provided\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [21 x i8] c"ERROR opening socket\00"
@INADDR_ANY = global i32 0
@.str.2 = [17 x i8] c"ERROR on binding\00"
@.str.3 = [16 x i8] c"ERROR on accept\00"
@.str.4 = [26 x i8] c"ERROR reading from socket\00"
@.str.5 = [25 x i8] c"Here is the message: %s\0A\00"
@.str.6 = [28 x i8] c"Here is the comparison: %d\0A\00"
@.str.7 = [19 x i8] c"I got your message\00"
@.str.8 = [24 x i8] c"ERROR writing to socket\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 [256 x i8]
%11 = alloca [256 x i8]
%12 = alloca %struct.sockaddr_in
%13 = alloca %struct.sockaddr_in
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
store i8 101, i8* %15
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 1
store i8 110, i8* %16
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 2
store i8 100, i8* %17
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 3
store i8 0, i8* %18
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 2
br i1 %20, label %21, label %25
21: ; preds = %2
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %2
%26 = load i32, i32* @AF_INET
%27 = load i32, i32* @SOCK_STREAM
%28 = call i32 @socket(i32 %26, i32 %27, i32 0)
store i32 %28, i32* %6
%29 = load i32, i32* %6
%30 = icmp slt i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %25
%32 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %33
33: ; preds = %31, %25
%34 = bitcast %struct.sockaddr_in* %12 to i8*
%35 = call i32 @bzero(i8* %34, i32 12)
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i32 @atoi(i8* %38)
store i32 %39, i32* %8
%40 = load i32, i32* @AF_INET
%41 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 2
store i32 %40, i32* %41
%42 = load i32, i32* @INADDR_ANY
%43 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 1
%44 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %43, i32 0, i32 0
store i32 %42, i32* %44
%45 = load i32, i32* %8
%46 = call i32 @htons(i32 %45)
%47 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 0
store i32 %46, i32* %47
%48 = load i32, i32* %6
%49 = bitcast %struct.sockaddr_in* %12 to %struct.sockaddr*
%50 = call i64 @bind(i32 %48, %struct.sockaddr* %49, i32 12)
%51 = icmp slt i64 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %33
%53 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %54
54: ; preds = %52, %33
%55 = load i32, i32* %6
%56 = call i32 @listen(i32 %55, i32 5)
store i32 12, i32* %9
br label %57
57: ; preds = %99, %54
%58 = load i32, i32* %6
%59 = bitcast %struct.sockaddr_in* %13 to %struct.sockaddr*
%60 = call i32 @accept(i32 %58, %struct.sockaddr* %59, i32* %9)
store i32 %60, i32* %7
%61 = load i32, i32* %7
%62 = icmp slt i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %57
%64 = call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %65
65: ; preds = %63, %57
%66 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%67 = call i32 @bzero(i8* %66, i32 256)
%68 = load i32, i32* %7
%69 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%70 = call i32 @read(i32 %68, i8* %69, i32 255)
store i32 %70, i32* %14
%71 = load i32, i32* %14
%72 = icmp slt i32 %71, 0
br i1 %72, label %73, label %75
73: ; preds = %65
%74 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
br label %75
75: ; preds = %73, %65
%76 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %76)
%78 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %78)
%80 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %80)
%82 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %82)
%84 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %84)
%86 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%87 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%88 = call i32 @strcmp(i8* %86, i8* %87)
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 %88)
%90 = load i32, i32* %7
%91 = call i32 @write(i32 %90, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 18)
store i32 %91, i32* %14
%92 = load i32, i32* %14
%93 = icmp slt i32 %92, 0
br i1 %93, label %94, label %96
94: ; preds = %75
%95 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
br label %96
96: ; preds = %94, %75
%97 = load i32, i32* %7
%98 = call i32 @close(i32 %97)
br label %99
99: ; preds = %96
%100 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%101 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%102 = call i32 @strcmp(i8* %100, i8* %101)
%103 = icmp ne i32 %102, 0
br i1 %103, label %57, label %104
104: ; preds = %99
%105 = load i32, i32* %6
%106 = call i32 @close(i32 %105)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [25 x i8] c"ERROR, no port provided\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [21 x i8] c"ERROR opening socket\00"
@INADDR_ANY = global i32 0
@.str.2 = [17 x i8] c"ERROR on binding\00"
@.str.3 = [16 x i8] c"ERROR on accept\00"
@.str.4 = [26 x i8] c"ERROR reading from socket\00"
@.str.5 = [25 x i8] c"Here is the message: %s\0A\00"
@.str.6 = [28 x i8] c"Here is the comparison: %d\0A\00"
@.str.7 = [19 x i8] c"I got your message\00"
@.str.8 = [24 x i8] c"ERROR writing to socket\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
%6 = alloca %struct.sockaddr_in
%7 = alloca %struct.sockaddr_in
%8 = bitcast i32* %3 to i8*
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
store i8 101, i8* %10
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 1
store i8 110, i8* %11
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 2
store i8 100, i8* %12
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 3
store i8 0, i8* %13
%14 = bitcast %struct.sockaddr_in* %6 to i8*
%15 = bitcast %struct.sockaddr_in* %7 to i8*
%16 = icmp slt i32 %0, 2
br i1 %16, label %17, label %21
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = tail call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%20 = tail call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = load i32, i32* @AF_INET
%23 = load i32, i32* @SOCK_STREAM
%24 = tail call i32 @socket(i32 %22, i32 %23, i32 0)
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = tail call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %21
%29 = call i32 @bzero(i8* %14, i32 12)
%30 = getelementptr inbounds i8*, i8** %1, i64 1
%31 = load i8*, i8** %30
%32 = tail call i32 @atoi(i8* %31)
%33 = load i32, i32* @AF_INET
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 2
store i32 %33, i32* %34
%35 = load i32, i32* @INADDR_ANY
%36 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 1, i32 0
store i32 %35, i32* %36
%37 = tail call i32 @htons(i32 %32)
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 0
store i32 %37, i32* %38
%39 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%40 = call i64 @bind(i32 %24, %struct.sockaddr* %39, i32 12)
%41 = icmp slt i64 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %28
%43 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %44
44: ; preds = %42, %28
%45 = call i32 @listen(i32 %24, i32 5)
store i32 12, i32* %3
%46 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
br label %47
47: ; preds = %70, %44
%48 = call i32 @accept(i32 %24, %struct.sockaddr* %46, i32* %3)
%49 = icmp slt i32 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %47
%51 = call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %52
52: ; preds = %50, %47
%53 = call i32 @bzero(i8* %9, i32 256)
%54 = call i32 @read(i32 %48, i8* %9, i32 255)
%55 = icmp slt i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %52
%57 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
br label %58
58: ; preds = %56, %52
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%64 = call i32 @strcmp(i8* %9, i8* %10)
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 %64)
%66 = call i32 @write(i32 %48, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 18)
%67 = icmp slt i32 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %58
%69 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
br label %70
70: ; preds = %68, %58
%71 = call i32 @close(i32 %48)
%72 = call i32 @strcmp(i8* %9, i8* %10)
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %47
74: ; preds = %70
%75 = call i32 @close(i32 %24)
ret i32 0
}