#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 {
  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 atoi(char *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(struct sockaddr_in *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
char *inet_ntoa(TYPE_1__);
int listen(int, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int sockfd, new_fd;
  struct sockaddr_in server_addr;
  struct sockaddr_in client_addr;
  int sin_size, portnumber;
  char hello[] = "Hello! Are You Fine?\n";
  if (argc != 2) {
    fprintf(stderr, "Usage:%s portnumber\a\n", argv[0]);
    exit(1);
  }
  if ((portnumber = atoi(argv[1])) < 0) {
    fprintf(stderr, "Usage:%s portnumber\a\n", argv[0]);
    exit(1);
  }
  if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
    fprintf(stderr, "Socket error:%s\n\a", strerror(errno));
    exit(1);
  }
  bzero(&server_addr, sizeof(struct sockaddr_in));
  server_addr.sin_family = AF_INET;
  server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
  server_addr.sin_port = htons(portnumber);
  if (bind(sockfd, (struct sockaddr *)(&server_addr),
           sizeof(struct sockaddr)) == -1) {
    fprintf(stderr, "Bind error:%s\n\a", strerror(errno));
    exit(1);
  }
  if (listen(sockfd, 5) == -1) {
    fprintf(stderr, "Listen error:%s\n\a", strerror(errno));
    exit(1);
  }
  while (1) {
    sin_size = sizeof(struct sockaddr_in);
    if ((new_fd = accept(sockfd, (struct sockaddr *)(&client_addr),
                         &sin_size)) == -1) {
      fprintf(stderr, "Accept error:%s\n\a", strerror(errno));
      exit(1);
    }
    fprintf(stderr, "Server get connection from %s\n",
            inet_ntoa(client_addr.sin_addr));
    if (write(new_fd, hello, strlen(hello)) == -1) {
      fprintf(stderr, "Write Error:%s\n", strerror(errno));
      exit(1);
    }
    close(new_fd);
  }
  close(sockfd);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xdf0(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xded(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xdeb(%rip),%eax
mov    %eax,-0x50(%rbp)
mov    0xde5(%rip),%ax
mov    %ax,-0x4c(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1263 <main+0x73>
mov    0x2d8c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdc2(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x40(%rbp)
cmp    $0x0,%eax
jge    12a2 <main+0xb2>
mov    0x2d4d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd83(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    0x2d3f(%rip),%rax
mov    (%rax),%edi
mov    0x2d16(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    12fd <main+0x10d>
mov    0x2d02(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    0x2ce6(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x64(%rbp),%edi
mov    %rax,%rdx
lea    0xd3e(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    -0x28(%rbp),%rdi
mov    $0xc,%esi
call   10c0 <bzero@plt>
mov    0x2cd6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2cc2(%rip),%rax
mov    (%rax),%edi
call   1070 <htonl@plt>
mov    %eax,-0x28(%rbp)
mov    -0x40(%rbp),%edi
call   1060 <htons@plt>
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0x4,%edx
call   10b0 <bind@plt>
cmp    $0xffffffff,%eax
jne    1383 <main+0x193>
mov    0x2c7c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x68(%rbp)
mov    0x2c60(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x68(%rbp),%edi
mov    %rax,%rdx
lea    0xcca(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x14(%rbp),%edi
mov    $0x5,%esi
call   10a0 <listen@plt>
cmp    $0xffffffff,%eax
jne    13cf <main+0x1df>
mov    0x2c30(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
mov    0x2c14(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x6c(%rbp),%edi
mov    %rax,%rdx
lea    0xc8e(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
jmp    13d4 <main+0x1e4>
movl   $0xc,-0x3c(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x38(%rbp),%rsi
lea    -0x3c(%rbp),%rdx
call   10d0 <accept@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    142d <main+0x23d>
mov    0x2bd2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x70(%rbp)
mov    0x2bb6(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x70(%rbp),%edi
mov    %rax,%rdx
lea    0xc42(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    0x2b9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x80(%rbp)
mov    -0x38(%rbp),%edi
call   1040 <inet_ntoa@plt>
mov    -0x80(%rbp),%edi
mov    %rax,%rdx
lea    0xc24(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x7c(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    -0x60(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x7c(%rbp),%edi
mov    -0x78(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    14bd <main+0x2cd>
mov    0x2b48(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x84(%rbp)
mov    0x2b29(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x84(%rbp),%edi
mov    %rax,%rdx
lea    0xbe3(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x18(%rbp),%edi
call   1080 <close@plt>
jmp    13d4 <main+0x1e4>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbp
movaps 0xdf8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movabs $0xa3f656e694620,%rax
mov    %rax,0x3e(%rsp)
cmp    $0x2,%edi
jne    122e <main+0x3e>
mov    0x8(%rbp),%rdi
call   10e0 <atoi@plt>
test   %eax,%eax
jns    1247 <main+0x57>
mov    0x2d9b(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%rdx
lea    0xdd4(%rip),%rsi
jmp    1415 <main+0x225>
mov    %eax,%ebx
mov    0x2d98(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2d6e(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
cmp    $0xffffffff,%eax
jne    128b <main+0x9b>
mov    0x2d61(%rip),%rax
mov    (%rax),%ebx
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
lea    0xda6(%rip),%rsi
jmp    1410 <main+0x220>
mov    %eax,%r13d
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0xc,%esi
call   10c0 <bzero@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x18(%rsp)
mov    0x2d32(%rip),%rax
mov    (%rax),%edi
call   1070 <htonl@plt>
mov    %eax,0x10(%rsp)
mov    %ebx,%edi
call   1060 <htons@plt>
mov    %eax,0x14(%rsp)
mov    %r13d,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   10b0 <bind@plt>
cmp    $0xffffffff,%eax
jne    12fc <main+0x10c>
mov    0x2cf0(%rip),%rax
mov    (%rax),%ebx
mov    0x2cd7(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
lea    0xd47(%rip),%rsi
jmp    1410 <main+0x220>
mov    %r13d,%edi
mov    $0x5,%esi
call   10a0 <listen@plt>
cmp    $0xffffffff,%eax
jne    1331 <main+0x141>
mov    0x2cbb(%rip),%rax
mov    (%rax),%ebx
mov    0x2ca2(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
lea    0xd22(%rip),%rsi
jmp    1410 <main+0x220>
movl   $0xc,0xc(%rsp)
lea    0x20(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %r13d,%edi
call   10d0 <accept@plt>
cmp    $0xffffffff,%eax
je     13d2 <main+0x1e2>
mov    %eax,%ebp
lea    0x30(%rsp),%rbx
lea    0x20(%rsp),%r15
lea    0xc(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x2c59(%rip),%rax
mov    (%rax),%r14d
mov    0x20(%rsp),%edi
call   1040 <inet_ntoa@plt>
mov    %r14d,%edi
lea    0xce5(%rip),%rsi
mov    %rax,%rdx
call   1090 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     13f2 <main+0x202>
mov    %ebp,%edi
call   1080 <close@plt>
movl   $0xc,0xc(%rsp)
mov    %r13d,%edi
mov    %r15,%rsi
mov    %r12,%rdx
call   10d0 <accept@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1370 <main+0x180>
mov    0x2bf7(%rip),%rax
mov    (%rax),%ebx
mov    0x2bde(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
lea    0xc70(%rip),%rsi
jmp    1410 <main+0x220>
mov    0x2bd7(%rip),%rax
mov    (%rax),%ebx
mov    0x2bbe(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
lea    0xc81(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@__const.main.hello = [22 x i8] c"Hello! Are You Fine?\0A\00"
@stderr = global i32 0
@.str = [22 x i8] c"Usage:%s portnumber\07\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [18 x i8] c"Socket error:%s\0A\07\00"
@errno = global i32 0
@INADDR_ANY = global i32 0
@.str.2 = [16 x i8] c"Bind error:%s\0A\07\00"
@.str.3 = [18 x i8] c"Listen error:%s\0A\07\00"
@.str.4 = [18 x i8] c"Accept error:%s\0A\07\00"
@.str.5 = [31 x i8] c"Server get connection from %s\0A\00"
@.str.6 = [16 x i8] c"Write Error:%s\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 i32
%12 = alloca [22 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = bitcast [22 x i8]* %12 to i8*
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 2
br i1 %15, label %16, label %23
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
store i32 %27, i32* %11
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %36
29: ; preds = %23
%30 = load i32, i32* @stderr
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 0
%33 = load i8*, i8** %32
%34 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %33)
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %23
%37 = load i32, i32* @AF_INET
%38 = load i32, i32* @SOCK_STREAM
%39 = call i32 @socket(i32 %37, i32 %38, i32 0)
store i32 %39, i32* %6
%40 = icmp eq i32 %39, -1
br i1 %40, label %41, label %47
41: ; preds = %36
%42 = load i32, i32* @stderr
%43 = load i32, i32* @errno
%44 = call i8* @strerror(i32 %43)
%45 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %44)
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %36
%48 = call i32 @bzero(%struct.sockaddr_in* %8, i32 12)
%49 = load i32, i32* @AF_INET
%50 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
store i32 %49, i32* %50
%51 = load i32, i32* @INADDR_ANY
%52 = call i32 @htonl(i32 %51)
%53 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
%54 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %53, i32 0, i32 0
store i32 %52, i32* %54
%55 = load i32, i32* %11
%56 = call i32 @htons(i32 %55)
%57 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
store i32 %56, i32* %57
%58 = load i32, i32* %6
%59 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%60 = call i32 @bind(i32 %58, %struct.sockaddr* %59, i32 4)
%61 = icmp eq i32 %60, -1
br i1 %61, label %62, label %68
62: ; preds = %47
%63 = load i32, i32* @stderr
%64 = load i32, i32* @errno
%65 = call i8* @strerror(i32 %64)
%66 = call i32 @fprintf(i32 %63, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %65)
%67 = call i32 @exit(i32 1)
unreachable
68: ; preds = %47
%69 = load i32, i32* %6
%70 = call i32 @listen(i32 %69, i32 5)
%71 = icmp eq i32 %70, -1
br i1 %71, label %72, label %78
72: ; preds = %68
%73 = load i32, i32* @stderr
%74 = load i32, i32* @errno
%75 = call i8* @strerror(i32 %74)
%76 = call i32 @fprintf(i32 %73, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %75)
%77 = call i32 @exit(i32 1)
unreachable
78: ; preds = %68
br label %79
79: ; preds = %78, %109
store i32 12, i32* %10
%80 = load i32, i32* %6
%81 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%82 = call i32 @accept(i32 %80, %struct.sockaddr* %81, i32* %10)
store i32 %82, i32* %7
%83 = icmp eq i32 %82, -1
br i1 %83, label %84, label %90
84: ; preds = %79
%85 = load i32, i32* @stderr
%86 = load i32, i32* @errno
%87 = call i8* @strerror(i32 %86)
%88 = call i32 @fprintf(i32 %85, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %87)
%89 = call i32 @exit(i32 1)
unreachable
90: ; preds = %79
%91 = load i32, i32* @stderr
%92 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
%93 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %92, i32 0, i32 0
%94 = load i32, i32* %93
%95 = call i8* @inet_ntoa(i32 %94)
%96 = call i32 @fprintf(i32 %91, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8* %95)
%97 = load i32, i32* %7
%98 = getelementptr inbounds [22 x i8], [22 x i8]* %12, i64 0, i64 0
%99 = getelementptr inbounds [22 x i8], [22 x i8]* %12, i64 0, i64 0
%100 = call i32 @strlen(i8* %99)
%101 = call i32 @write(i32 %97, i8* %98, i32 %100)
%102 = icmp eq i32 %101, -1
br i1 %102, label %103, label %109
103: ; preds = %90
%104 = load i32, i32* @stderr
%105 = load i32, i32* @errno
%106 = call i8* @strerror(i32 %105)
%107 = call i32 @fprintf(i32 %104, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %106)
%108 = call i32 @exit(i32 1)
unreachable
109: ; preds = %90
%110 = load i32, i32* %7
%111 = call i32 @close(i32 %110)
br label %79
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@__const.main.hello = [22 x i8] c"Hello! Are You Fine?\0A\00"
@stderr = global i32 0
@.str = [22 x i8] c"Usage:%s portnumber\07\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [18 x i8] c"Socket error:%s\0A\07\00"
@errno = global i32 0
@INADDR_ANY = global i32 0
@.str.2 = [16 x i8] c"Bind error:%s\0A\07\00"
@.str.3 = [18 x i8] c"Listen error:%s\0A\07\00"
@.str.4 = [18 x i8] c"Accept error:%s\0A\07\00"
@.str.5 = [31 x i8] c"Server get connection from %s\0A\00"
@.str.6 = [16 x i8] c"Write Error:%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca [22 x i8]
%7 = bitcast %struct.sockaddr_in* %3 to i8*
%8 = bitcast %struct.sockaddr_in* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = getelementptr inbounds [22 x i8], [22 x i8]* %6, i64 0, i64 0
%11 = icmp eq i32 %0, 2
br i1 %11, label %17, label %12
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %1
%15 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %17
%23 = load i32, i32* @stderr
%24 = load i8*, i8** %1
%25 = tail call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = tail call i32 @exit(i32 1)
unreachable
27: ; preds = %17
%28 = load i32, i32* @AF_INET
%29 = load i32, i32* @SOCK_STREAM
%30 = tail call i32 @socket(i32 %28, i32 %29, i32 0)
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %38
32: ; preds = %27
%33 = load i32, i32* @stderr
%34 = load i32, i32* @errno
%35 = tail call i8* @strerror(i32 %34)
%36 = tail call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %35)
%37 = tail call i32 @exit(i32 1)
unreachable
38: ; preds = %27
%39 = call i32 @bzero(%struct.sockaddr_in* %3, i32 12)
%40 = load i32, i32* @AF_INET
%41 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %40, i32* %41
%42 = load i32, i32* @INADDR_ANY
%43 = tail call i32 @htonl(i32 %42)
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0, i32 0
store i32 %43, i32* %44
%45 = tail call i32 @htons(i32 %20)
%46 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i32 %45, i32* %46
%47 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%48 = call i32 @bind(i32 %30, %struct.sockaddr* %47, i32 4)
%49 = icmp eq i32 %48, -1
br i1 %49, label %50, label %56
50: ; preds = %38
%51 = load i32, i32* @stderr
%52 = load i32, i32* @errno
%53 = call i8* @strerror(i32 %52)
%54 = call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %53)
%55 = call i32 @exit(i32 1)
unreachable
56: ; preds = %38
%57 = call i32 @listen(i32 %30, i32 5)
%58 = icmp eq i32 %57, -1
br i1 %58, label %65, label %59
59: ; preds = %56
%60 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
store i32 12, i32* %5
%61 = call i32 @accept(i32 %30, %struct.sockaddr* %60, i32* %5)
%62 = icmp eq i32 %61, -1
br i1 %62, label %71, label %63
63: ; preds = %59
%64 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0, i32 0
br label %77
65: ; preds = %56
%66 = load i32, i32* @stderr
%67 = load i32, i32* @errno
%68 = call i8* @strerror(i32 %67)
%69 = call i32 @fprintf(i32 %66, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %68)
%70 = call i32 @exit(i32 1)
unreachable
71: ; preds = %92, %59
%72 = load i32, i32* @stderr
%73 = load i32, i32* @errno
%74 = call i8* @strerror(i32 %73)
%75 = call i32 @fprintf(i32 %72, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %74)
%76 = call i32 @exit(i32 1)
unreachable
77: ; preds = %63, %92
%78 = phi i32 [ %61, %63 ], [ %94, %92 ]
%79 = load i32, i32* @stderr
%80 = load i32, i32* %64
%81 = call i8* @inet_ntoa(i32 %80)
%82 = call i32 @fprintf(i32 %79, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8* %81)
%83 = call i32 @strlen(i8* %10)
%84 = call i32 @write(i32 %78, i8* %10, i32 %83)
%85 = icmp eq i32 %84, -1
br i1 %85, label %86, label %92
86: ; preds = %77
%87 = load i32, i32* @stderr
%88 = load i32, i32* @errno
%89 = call i8* @strerror(i32 %88)
%90 = call i32 @fprintf(i32 %87, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %89)
%91 = call i32 @exit(i32 1)
unreachable
92: ; preds = %77
%93 = call i32 @close(i32 %78)
store i32 12, i32* %5
%94 = call i32 @accept(i32 %30, %struct.sockaddr* %60, i32* %5)
%95 = icmp eq i32 %94, -1
br i1 %95, label %71, label %77
}