#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_zero;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ atoi(char *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fe(char *);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ inet_addr(char *);
char *inet_ntoa(TYPE_1__);
int listen(int, int);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, char, int);
int ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int strlen(char *);
int main(int argc, char *argv[]) {
  if (argc < 4) {
    printf("USAGE: %s %s %s %s\n", argv[0], "[bind IP]", "[Listen port]",
           "[CX response to send]");
    exit(0);
  }
  int fd, cx_fd;
  struct sockaddr_in h_addr, c_addr;
  socklen_t s_size;
  int r_len = 1, y = 1;
  char buf[1024];
  h_addr.sin_family = AF_INET;
  h_addr.sin_addr.s_addr = inet_addr(argv[1]);
  h_addr.sin_port = htons(atoi(argv[2]));
  memset(&(h_addr.sin_zero), '\0', 8);
  if ((fd = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
    fe("Create socket failed!");
  }
  if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &y, sizeof(int)) == -1) {
    fe("Set socket option SO_REUSEADDR!");
  }
  if (bind(fd, (struct sockaddr *)&h_addr, sizeof(struct sockaddr)) == -1) {
    char tmp[1000];
    snprintf(tmp, sizeof tmp, "Couldn't bind socket to %s:%s !", argv[1],
             argv[2]);
    fe(tmp);
  }
  if (listen(fd, 5) == -1) {
    fe("Listening on socket!");
  }
  while (1) {
    s_size = sizeof(struct sockaddr_in);
    cx_fd = accept(fd, (struct sockaddr *)&c_addr, &s_size);
    if (cx_fd == -1) {
      fe("On client connect!");
    }
    printf("Server: Inbound CX From: %s:%d\n", inet_ntoa(c_addr.sin_addr),
           ntohs(c_addr.sin_port));
    send(cx_fd, argv[3], strlen(argv[3]), 0);
    send(cx_fd, "\n", 1, 0);
    close(cx_fd);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x860,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1274 <main+0x54>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdaf(%rip),%rdi
lea    0xdbc(%rip),%rdx
lea    0xdbf(%rip),%rcx
lea    0xdc6(%rip),%r8
mov    $0x0,%al
call   1080 <printf@plt>
xor    %edi,%edi
call   1130 <exit@plt>
movl   $0x1,-0x40(%rbp)
movl   $0x1,-0x44(%rbp)
mov    0x2d57(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <inet_addr@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1120 <atoi@plt>
mov    %eax,%edi
call   1060 <htons@plt>
mov    %eax,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   10a0 <memset@plt>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
mov    0x2cf7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1140 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    12fa <main+0xda>
lea    0xd4d(%rip),%rdi
call   10d0 <fe@plt>
mov    -0x14(%rbp),%edi
mov    0x2ce4(%rip),%rax
mov    (%rax),%esi
mov    0x2cb3(%rip),%rax
mov    (%rax),%edx
lea    -0x44(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    1333 <main+0x113>
lea    0xd2a(%rip),%rdi
call   10d0 <fe@plt>
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0x4,%edx
call   1100 <bind@plt>
cmp    $0xffffffff,%eax
jne    1381 <main+0x161>
lea    -0x840(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%r8
mov    $0x3e8,%esi
lea    0xd08(%rip),%rdx
call   1090 <snprintf@plt>
lea    -0x840(%rbp),%rdi
call   10d0 <fe@plt>
mov    -0x14(%rbp),%edi
mov    $0x5,%esi
call   10e0 <listen@plt>
cmp    $0xffffffff,%eax
jne    13a3 <main+0x183>
lea    0xcfa(%rip),%rdi
call   10d0 <fe@plt>
jmp    13a8 <main+0x188>
movl   $0x10,-0x3c(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x38(%rbp),%rsi
lea    -0x3c(%rbp),%rdx
call   1110 <accept@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    13d8 <main+0x1b8>
lea    0xcda(%rip),%rdi
call   10d0 <fe@plt>
mov    -0x34(%rbp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,-0x858(%rbp)
mov    -0x38(%rbp),%edi
call   10f0 <ntohs@plt>
mov    -0x858(%rbp),%rsi
mov    %eax,%edx
lea    0xcc1(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x84c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x848(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <strlen@plt>
mov    -0x84c(%rbp),%edi
mov    -0x848(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
mov    -0x18(%rbp),%edi
lea    0xc93(%rip),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
mov    -0x18(%rbp),%edi
call   10b0 <close@plt>
jmp    13a8 <main+0x188>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%rbp
cmp    $0x3,%edi
jle    13e0 <main+0x1c0>
movl   $0x1,0x8(%rsp)
mov    0x2d94(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x1c(%rsp)
mov    0x8(%rbp),%rdi
call   10c0 <inet_addr@plt>
mov    %eax,0x14(%rsp)
mov    0x10(%rbp),%rdi
call   1120 <atoi@plt>
mov    %eax,%edi
call   1060 <htons@plt>
mov    %eax,0x10(%rsp)
lea    0x18(%rsp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   10a0 <memset@plt>
mov    0x2d3d(%rip),%rax
mov    (%rax),%edi
mov    0x2d3c(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1140 <socket@plt>
mov    %eax,%r13d
cmp    $0xffffffff,%eax
jne    12b1 <main+0x91>
lea    0xd96(%rip),%rdi
call   10d0 <fe@plt>
mov    0x2d30(%rip),%rax
mov    (%rax),%esi
mov    0x2cff(%rip),%rax
mov    (%rax),%edx
lea    0x8(%rsp),%rcx
mov    %r13d,%edi
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    12e7 <main+0xc7>
lea    0xd76(%rip),%rdi
call   10d0 <fe@plt>
lea    0x10(%rsp),%rsi
mov    %r13d,%edi
mov    $0x4,%edx
call   1100 <bind@plt>
cmp    $0xffffffff,%eax
jne    1327 <main+0x107>
mov    0x8(%rbp),%rcx
mov    0x10(%rbp),%r8
lea    0xd6b(%rip),%rdx
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1090 <snprintf@plt>
mov    %rbx,%rdi
call   10d0 <fe@plt>
mov    %r13d,%edi
mov    $0x5,%esi
call   10e0 <listen@plt>
cmp    $0xffffffff,%eax
jne    1345 <main+0x125>
lea    0xd58(%rip),%rdi
call   10d0 <fe@plt>
lea    0xd92(%rip),%r12
jmp    13ad <main+0x18d>
xchg   %ax,%ax
mov    0x24(%rsp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,%r15
mov    0x20(%rsp),%edi
call   10f0 <ntohs@plt>
lea    0xd54(%rip),%rdi
mov    %r15,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x18(%rbp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
mov    %r14d,%edi
mov    %r12,%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
mov    %r14d,%edi
call   10b0 <close@plt>
movl   $0x10,0xc(%rsp)
mov    %r13d,%edi
lea    0x20(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1110 <accept@plt>
mov    %eax,%r14d
cmp    $0xffffffff,%eax
jne    1350 <main+0x130>
lea    0xcd7(%rip),%rdi
call   10d0 <fe@plt>
jmp    1350 <main+0x130>
mov    0x0(%rbp),%rsi
lea    0xc15(%rip),%rdi
lea    0xc22(%rip),%rdx
lea    0xc25(%rip),%rcx
lea    0xc2c(%rip),%r8
xor    %eax,%eax
call   1080 <printf@plt>
xor    %edi,%edi
call   1130 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [20 x i8] c"USAGE: %s %s %s %s\0A\00"
@.str.1 = [10 x i8] c"[bind IP]\00"
@.str.2 = [14 x i8] c"[Listen port]\00"
@.str.3 = [22 x i8] c"[CX response to send]\00"
@AF_INET = global i32 0
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.4 = [22 x i8] c"Create socket failed!\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.5 = [32 x i8] c"Set socket option SO_REUSEADDR!\00"
@.str.6 = [32 x i8] c"Couldn't bind socket to %s:%s !\00"
@.str.7 = [21 x i8] c"Listening on socket!\00"
@.str.8 = [19 x i8] c"On client connect!\00"
@.str.9 = [32 x i8] c"Server: Inbound CX From: %s:%d\0A\00"
@.str.10 = [2 x i8] c"\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 i32
%13 = alloca [1024 x i8]
%14 = alloca [1000 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 4
br i1 %16, label %17, label %23
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %20, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 @exit(i32 0)
unreachable
23: ; preds = %2
store i32 1, i32* %11
store i32 1, i32* %12
%24 = load i32, i32* @AF_INET
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 3
store i32 %24, i32* %25
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @inet_addr(i8* %28)
%30 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
%31 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %30, i32 0, i32 0
store i32 %29, i32* %31
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
%36 = call i32 @htons(i32 %35)
%37 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
store i32 %36, i32* %37
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
%39 = call i32 @memset(i32* %38, i8 signext 0, i32 8)
%40 = load i32, i32* @PF_INET
%41 = load i32, i32* @SOCK_STREAM
%42 = call i32 @socket(i32 %40, i32 %41, i32 0)
store i32 %42, i32* %6
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %46
44: ; preds = %23
%45 = call i32 @fe(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %46
46: ; preds = %44, %23
%47 = load i32, i32* %6
%48 = load i32, i32* @SOL_SOCKET
%49 = load i32, i32* @SO_REUSEADDR
%50 = call i32 @setsockopt(i32 %47, i32 %48, i32 %49, i32* %12, i32 4)
%51 = icmp eq i32 %50, -1
br i1 %51, label %52, label %54
52: ; preds = %46
%53 = call i32 @fe(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
br label %54
54: ; preds = %52, %46
%55 = load i32, i32* %6
%56 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%57 = call i32 @bind(i32 %55, %struct.sockaddr* %56, i32 4)
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %70
59: ; preds = %54
%60 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 1
%63 = load i8*, i8** %62
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 2
%66 = load i8*, i8** %65
%67 = call i32 @snprintf(i8* %60, i32 1000, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i8* %63, i8* %66)
%68 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%69 = call i32 @fe(i8* %68)
br label %70
70: ; preds = %59, %54
%71 = load i32, i32* %6
%72 = call i32 @listen(i32 %71, i32 5)
%73 = icmp eq i32 %72, -1
br i1 %73, label %74, label %76
74: ; preds = %70
%75 = call i32 @fe(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %76
76: ; preds = %74, %70
br label %77
77: ; preds = %76, %85
store i32 16, i32* %10
%78 = load i32, i32* %6
%79 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%80 = call i32 @accept(i32 %78, %struct.sockaddr* %79, i32* %10)
store i32 %80, i32* %7
%81 = load i32, i32* %7
%82 = icmp eq i32 %81, -1
br i1 %82, label %83, label %85
83: ; preds = %77
%84 = call i32 @fe(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %85
85: ; preds = %83, %77
%86 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 1
%87 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %86, i32 0, i32 0
%88 = load i32, i32* %87
%89 = call i8* @inet_ntoa(i32 %88)
%90 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
%91 = load i32, i32* %90
%92 = call i32 @ntohs(i32 %91)
%93 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* %89, i32 %92)
%94 = load i32, i32* %7
%95 = load i8**, i8*** %5
%96 = getelementptr inbounds i8*, i8** %95, i64 3
%97 = load i8*, i8** %96
%98 = load i8**, i8*** %5
%99 = getelementptr inbounds i8*, i8** %98, i64 3
%100 = load i8*, i8** %99
%101 = call i32 @strlen(i8* %100)
%102 = call i32 @send(i32 %94, i8* %97, i32 %101, i32 0)
%103 = load i32, i32* %7
%104 = call i32 @send(i32 %103, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32 1, i32 0)
%105 = load i32, i32* %7
%106 = call i32 @close(i32 %105)
br label %77
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [20 x i8] c"USAGE: %s %s %s %s\0A\00"
@.str.1 = [10 x i8] c"[bind IP]\00"
@.str.2 = [14 x i8] c"[Listen port]\00"
@.str.3 = [22 x i8] c"[CX response to send]\00"
@AF_INET = global i32 0
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.4 = [22 x i8] c"Create socket failed!\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.5 = [32 x i8] c"Set socket option SO_REUSEADDR!\00"
@.str.6 = [32 x i8] c"Couldn't bind socket to %s:%s !\00"
@.str.7 = [21 x i8] c"Listening on socket!\00"
@.str.8 = [19 x i8] c"On client connect!\00"
@.str.9 = [32 x i8] c"Server: Inbound CX From: %s:%d\0A\00"
@.str.10 = [2 x i8] c"\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 i32
%7 = alloca [1000 x i8]
%8 = icmp slt i32 %0, 4
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %1
%11 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call i32 @exit(i32 0)
unreachable
13: ; preds = %2
%14 = bitcast %struct.sockaddr_in* %3 to i8*
%15 = bitcast %struct.sockaddr_in* %4 to i8*
%16 = bitcast i32* %5 to i8*
%17 = bitcast i32* %6 to i8*
store i32 1, i32* %6
%18 = load i32, i32* @AF_INET
%19 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 3
store i32 %18, i32* %19
%20 = getelementptr inbounds i8*, i8** %1, i64 1
%21 = load i8*, i8** %20
%22 = tail call i32 @inet_addr(i8* %21)
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
store i32 %22, i32* %23
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = tail call i32 @atoi(i8* %25)
%27 = tail call i32 @htons(i32 %26)
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %27, i32* %28
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
%30 = call i32 @memset(i32* %29, i8 signext 0, i32 8)
%31 = load i32, i32* @PF_INET
%32 = load i32, i32* @SOCK_STREAM
%33 = call i32 @socket(i32 %31, i32 %32, i32 0)
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %37
35: ; preds = %13
%36 = call i32 @fe(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %37
37: ; preds = %35, %13
%38 = load i32, i32* @SOL_SOCKET
%39 = load i32, i32* @SO_REUSEADDR
%40 = call i32 @setsockopt(i32 %33, i32 %38, i32 %39, i32* %6, i32 4)
%41 = icmp eq i32 %40, -1
br i1 %41, label %42, label %44
42: ; preds = %37
%43 = call i32 @fe(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
br label %44
44: ; preds = %42, %37
%45 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%46 = call i32 @bind(i32 %33, %struct.sockaddr* %45, i32 4)
%47 = icmp eq i32 %46, -1
br i1 %47, label %48, label %54
48: ; preds = %44
%49 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%50 = load i8*, i8** %20
%51 = load i8*, i8** %24
%52 = call i32 @snprintf(i8* %49, i32 1000, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i8* %50, i8* %51)
%53 = call i32 @fe(i8* %49)
br label %54
54: ; preds = %48, %44
%55 = call i32 @listen(i32 %33, i32 5)
%56 = icmp eq i32 %55, -1
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = call i32 @fe(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %59
59: ; preds = %57, %54
%60 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%61 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1, i32 0
%62 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
%63 = getelementptr inbounds i8*, i8** %1, i64 3
br label %64
64: ; preds = %69, %59
store i32 16, i32* %5
%65 = call i32 @accept(i32 %33, %struct.sockaddr* %60, i32* %5)
%66 = icmp eq i32 %65, -1
br i1 %66, label %67, label %69
67: ; preds = %64
%68 = call i32 @fe(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %69
69: ; preds = %67, %64
%70 = load i32, i32* %61
%71 = call i8* @inet_ntoa(i32 %70)
%72 = load i32, i32* %62
%73 = call i32 @ntohs(i32 %72)
%74 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* %71, i32 %73)
%75 = load i8*, i8** %63
%76 = call i32 @strlen(i8* %75)
%77 = call i32 @send(i32 %65, i8* %75, i32 %76, i32 0)
%78 = call i32 @send(i32 %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32 1, i32 0)
%79 = call i32 @close(i32 %65)
br label %64
}