#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 */
typedef int /*<<< orphan*/ text;
struct sockaddr_storage {
  int dummy;
};
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
struct addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ ai_addr;
  scalar_t__ ai_protocol;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
  struct addrinfo *ai_next;
  scalar_t__ ai_flags;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ EXIT_FAILURE;
int NI_MAXHOST;
int NI_MAXSERV;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int *);
scalar_t__ bind(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
char *gai_strerror(int);
int getaddrinfo(int /*<<< orphan*/ *, char *, struct addrinfo *,
                struct addrinfo **);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
int /*<<< orphan*/ stderr;
int write(int, char const *, int);
int main(int argc, char *argv[]) {
  struct addrinfo hints;
  struct addrinfo *result, *rp;
  int sfd, s;
  struct sockaddr_storage peer_addr;
  socklen_t peer_addr_len;
  ssize_t nread;
  char buf[500];
  if (argc != 2) {
    fprintf(stderr, "Usage: %s port\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  memset(&hints, 0, sizeof(struct addrinfo));
  hints.ai_family = AF_INET;
  hints.ai_socktype = SOCK_STREAM;
  hints.ai_flags = 0;
  hints.ai_protocol = 0;
  s = getaddrinfo(NULL, "9090", &hints, &result);
  if (s != 0) {
    fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(s));
    exit(EXIT_FAILURE);
  }
  for (rp = result; rp != NULL; rp = rp->ai_next) {
    sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
    if (sfd == -1)
      continue;
    if (bind(sfd, rp->ai_addr, rp->ai_addrlen) == 0)
      break;
    close(sfd);
  }
  if (rp == NULL) {
    fprintf(stderr, "Could not bind\n");
    exit(EXIT_FAILURE);
  }
  freeaddrinfo(result);
  const char text[] = "Hello world";
  char host[NI_MAXHOST], service[NI_MAXSERV];
  struct sockaddr_in clientname;
  int size = 0;
  while (1) {
    listen(sfd, 1024);
    int new = accept(sfd, (struct sockaddr *)&clientname, &size);
    printf("Send %d bytes\n", write(new, text, sizeof(text)));
    close(new);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     121f <main+0x4f>
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdf6(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
mov    0x2db2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    0x2d86(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x30(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xdae(%rip),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   10d0 <getaddrinfo@plt>
mov    %eax,-0x50(%rbp)
cmpl   $0x0,-0x50(%rbp)
je     12b8 <main+0xe8>
mov    0x2d4d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x29c(%rbp)
mov    -0x50(%rbp),%edi
call   1050 <gai_strerror@plt>
mov    -0x29c(%rbp),%edi
mov    %rax,%rdx
lea    0xd72(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2d0f(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     1335 <main+0x165>
mov    -0x48(%rbp),%rax
mov    0x14(%rax),%edi
mov    -0x48(%rbp),%rax
mov    0x10(%rax),%esi
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%rdx
call   10f0 <socket@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0xffffffff,-0x4c(%rbp)
jne    12f8 <main+0x128>
jmp    1324 <main+0x154>
mov    -0x4c(%rbp),%edi
mov    -0x48(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x48(%rbp),%rax
mov    (%rax),%edx
call   10a0 <bind@plt>
cmp    $0x0,%rax
jne    131c <main+0x14c>
jmp    1335 <main+0x165>
mov    -0x4c(%rbp),%edi
call   1070 <close@plt>
mov    -0x48(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x48(%rbp)
jmp    12c0 <main+0xf0>
cmpq   $0x0,-0x48(%rbp)
jne    1365 <main+0x195>
mov    0x2c89(%rip),%rax
mov    (%rax),%edi
lea    0xcd6(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2c62(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x40(%rbp),%rdi
call   10e0 <freeaddrinfo@plt>
mov    0xcc1(%rip),%rax
mov    %rax,-0x26c(%rbp)
mov    0xcbc(%rip),%eax
mov    %eax,-0x264(%rbp)
mov    0x2c29(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x278(%rbp)
mov    %rax,-0x280(%rbp)
mov    0x2c37(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x288(%rbp)
movl   $0x0,-0x294(%rbp)
jmp    13c1 <main+0x1f1>
mov    -0x4c(%rbp),%edi
mov    $0x400,%esi
call   1090 <listen@plt>
mov    -0x4c(%rbp),%edi
lea    -0x290(%rbp),%rsi
lea    -0x294(%rbp),%rdx
call   10b0 <accept@plt>
mov    %eax,-0x298(%rbp)
mov    -0x298(%rbp),%edi
lea    -0x26c(%rbp),%rsi
mov    $0xc,%edx
call   1030 <write@plt>
mov    %eax,%esi
lea    0xc38(%rip),%rdi
call   1040 <printf@plt>
mov    -0x298(%rbp),%edi
call   1070 <close@plt>
jmp    13bc <main+0x1ec>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
cmp    $0x2,%edi
jne    1332 <main+0x162>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
mov    0x2de6(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x44(%rsp)
mov    0x2dc1(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x40(%rsp)
movq   $0x0,0x50(%rsp)
movq   $0x0,0x38(%rsp)
lea    0xde2(%rip),%rsi
lea    0x10(%rsp),%rcx
xor    %edi,%edi
mov    %rbx,%rdx
call   10d0 <getaddrinfo@plt>
test   %eax,%eax
jne    1347 <main+0x177>
mov    0x10(%rsp),%rbp
jmp    1254 <main+0x84>
nopl   0x0(%rax)
mov    0x18(%rbp),%rbp
test   %rbp,%rbp
je     130d <main+0x13d>
mov    0x14(%rbp),%edi
mov    0x10(%rbp),%esi
mov    0x8(%rbp),%rdx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
je     1250 <main+0x80>
mov    %eax,%ebx
mov    0x0(%rbp),%edx
mov    0x4(%rbp),%esi
mov    %eax,%edi
call   10a0 <bind@plt>
test   %rax,%rax
je     128e <main+0xbe>
mov    %ebx,%edi
call   1070 <close@plt>
jmp    1250 <main+0x80>
mov    0x10(%rsp),%rdi
call   10e0 <freeaddrinfo@plt>
movabs $0x6f77206f6c6c6548,%rax
20 77 6f
mov    %rax,0x20(%rsp)
movl   $0x646c72,0x28(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x18(%rsp),%r14
lea    0xc(%rsp),%r15
lea    0x20(%rsp),%r12
lea    0xd75(%rip),%r13
nopl   (%rax)
mov    %ebx,%edi
mov    $0x400,%esi
call   1090 <listen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   10b0 <accept@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %r12,%rsi
mov    $0xc,%edx
call   1030 <write@plt>
mov    %r13,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebp,%edi
call   1070 <close@plt>
jmp    12d0 <main+0x100>
mov    0x2cc4(%rip),%rax
mov    (%rax),%edi
lea    0xd09(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x2c9d(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    0x2c9f(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xcbb(%rip),%rsi
jmp    1363 <main+0x193>
mov    0x2c8a(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1050 <gai_strerror@plt>
lea    0xcb7(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1324 <main+0x154>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32, i64, i32, i32, %struct.addrinfo*, i64 }
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [16 x i8] c"Usage: %s port\0A\00"
@EXIT_FAILURE = global i32 0
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [5 x i8] c"9090\00"
@.str.2 = [17 x i8] c"getaddrinfo: %s\0A\00"
@.str.3 = [16 x i8] c"Could not bind\0A\00"
@__const.main.text = [12 x i8] c"Hello world\00"
@NI_MAXHOST = global i32 0
@NI_MAXSERV = global i32 0
@.str.4 = [15 x i8] c"Send %d bytes\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.addrinfo
%7 = alloca %struct.addrinfo*
%8 = alloca %struct.addrinfo*
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.sockaddr_storage
%12 = alloca i32
%13 = alloca i32
%14 = alloca [500 x i8]
%15 = alloca [12 x i8]
%16 = alloca i8*
%17 = alloca i64
%18 = alloca i64
%19 = alloca %struct.sockaddr_in
%20 = alloca i32
%21 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%22 = load i32, i32* %4
%23 = icmp ne i32 %22, 2
br i1 %23, label %24, label %32
24: ; preds = %2
%25 = load i32, i32* @stderr
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 0
%28 = load i8*, i8** %27
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %28)
%30 = load i32, i32* @EXIT_FAILURE
%31 = call i32 @exit(i32 %30)
unreachable
32: ; preds = %2
%33 = call i32 @memset(%struct.addrinfo* %6, i32 0, i32 40)
%34 = load i32, i32* @AF_INET
%35 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 4
store i32 %34, i32* %35
%36 = load i32, i32* @SOCK_STREAM
%37 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 3
store i32 %36, i32* %37
%38 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 6
store i64 0, i64* %38
%39 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 2
store i64 0, i64* %39
%40 = call i32 @getaddrinfo(i32* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.addrinfo* %6, %struct.addrinfo** %7)
store i32 %40, i32* %10
%41 = load i32, i32* %10
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %50
43: ; preds = %32
%44 = load i32, i32* @stderr
%45 = load i32, i32* %10
%46 = call i8* @gai_strerror(i32 %45)
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %46)
%48 = load i32, i32* @EXIT_FAILURE
%49 = call i32 @exit(i32 %48)
unreachable
50: ; preds = %32
%51 = load %struct.addrinfo*, %struct.addrinfo** %7
store %struct.addrinfo* %51, %struct.addrinfo** %8
br label %52
52: ; preds = %83, %50
%53 = load %struct.addrinfo*, %struct.addrinfo** %8
%54 = icmp ne %struct.addrinfo* %53, null
br i1 %54, label %55, label %87
55: ; preds = %52
%56 = load %struct.addrinfo*, %struct.addrinfo** %8
%57 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %56, i32 0, i32 4
%58 = load i32, i32* %57
%59 = load %struct.addrinfo*, %struct.addrinfo** %8
%60 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %59, i32 0, i32 3
%61 = load i32, i32* %60
%62 = load %struct.addrinfo*, %struct.addrinfo** %8
%63 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %62, i32 0, i32 2
%64 = load i64, i64* %63
%65 = call i32 @socket(i32 %58, i32 %61, i64 %64)
store i32 %65, i32* %9
%66 = load i32, i32* %9
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %69
68: ; preds = %55
br label %83
69: ; preds = %55
%70 = load i32, i32* %9
%71 = load %struct.addrinfo*, %struct.addrinfo** %8
%72 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %71, i32 0, i32 1
%73 = load i32, i32* %72
%74 = load %struct.addrinfo*, %struct.addrinfo** %8
%75 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %74, i32 0, i32 0
%76 = load i32, i32* %75
%77 = call i64 @bind(i32 %70, i32 %73, i32 %76)
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %80
79: ; preds = %69
br label %87
80: ; preds = %69
%81 = load i32, i32* %9
%82 = call i32 @close(i32 %81)
br label %83
83: ; preds = %80, %68
%84 = load %struct.addrinfo*, %struct.addrinfo** %8
%85 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %84, i32 0, i32 5
%86 = load %struct.addrinfo*, %struct.addrinfo** %85
store %struct.addrinfo* %86, %struct.addrinfo** %8
br label %52
87: ; preds = %79, %52
%88 = load %struct.addrinfo*, %struct.addrinfo** %8
%89 = icmp eq %struct.addrinfo* %88, null
br i1 %89, label %90, label %95
90: ; preds = %87
%91 = load i32, i32* @stderr
%92 = call i32 (i32, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%93 = load i32, i32* @EXIT_FAILURE
%94 = call i32 @exit(i32 %93)
unreachable
95: ; preds = %87
%96 = load %struct.addrinfo*, %struct.addrinfo** %7
%97 = call i32 @freeaddrinfo(%struct.addrinfo* %96)
%98 = bitcast [12 x i8]* %15 to i8*
%99 = load i32, i32* @NI_MAXHOST
%100 = zext i32 %99 to i64
%101 = call i8* @llvm.stacksave()
store i8* %101, i8** %16
%102 = alloca i8, i64 %100
store i64 %100, i64* %17
%103 = load i32, i32* @NI_MAXSERV
%104 = zext i32 %103 to i64
%105 = alloca i8, i64 %104
store i64 %104, i64* %18
store i32 0, i32* %20
br label %106
106: ; preds = %107, %95
br label %107
107: ; preds = %106
%108 = load i32, i32* %9
%109 = call i32 @listen(i32 %108, i32 1024)
%110 = load i32, i32* %9
%111 = bitcast %struct.sockaddr_in* %19 to %struct.sockaddr*
%112 = call i32 @accept(i32 %110, %struct.sockaddr* %111, i32* %20)
store i32 %112, i32* %21
%113 = load i32, i32* %21
%114 = getelementptr inbounds [12 x i8], [12 x i8]* %15, i64 0, i64 0
%115 = call i32 @write(i32 %113, i8* %114, i32 12)
%116 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %115)
%117 = load i32, i32* %21
%118 = call i32 @close(i32 %117)
br label %106
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32, i64, i32, i32, %struct.addrinfo*, i64 }
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [16 x i8] c"Usage: %s port\0A\00"
@EXIT_FAILURE = global i32 0
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [5 x i8] c"9090\00"
@.str.2 = [17 x i8] c"getaddrinfo: %s\0A\00"
@.str.3 = [16 x i8] c"Could not bind\0A\00"
@__const.main.text = [12 x i8] c"Hello world\00"
@NI_MAXHOST = global i32 0
@NI_MAXSERV = global i32 0
@.str.4 = [15 x i8] c"Send %d bytes\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.addrinfo
%4 = alloca %struct.addrinfo*
%5 = alloca [12 x i8]
%6 = alloca %struct.sockaddr_in
%7 = alloca i32
%8 = bitcast %struct.addrinfo* %3 to i8*
%9 = bitcast %struct.addrinfo** %4 to i8*
%10 = icmp eq i32 %0, 2
br i1 %10, label %17, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %1
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @EXIT_FAILURE
%16 = tail call i32 @exit(i32 %15)
unreachable
17: ; preds = %2
%18 = call i32 @memset(%struct.addrinfo* %3, i32 0, i32 40)
%19 = load i32, i32* @AF_INET
%20 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 4
store i32 %19, i32* %20
%21 = load i32, i32* @SOCK_STREAM
%22 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 3
store i32 %21, i32* %22
%23 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 6
store i64 0, i64* %23
%24 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 2
store i64 0, i64* %24
%25 = call i32 @getaddrinfo(i32* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.addrinfo* %3, %struct.addrinfo** %4)
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %17
%28 = load %struct.addrinfo*, %struct.addrinfo** %4
%29 = icmp eq %struct.addrinfo* %28, null
br i1 %29, label %59, label %36
30: ; preds = %17
%31 = load i32, i32* @stderr
%32 = call i8* @gai_strerror(i32 %25)
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %32)
%34 = load i32, i32* @EXIT_FAILURE
%35 = call i32 @exit(i32 %34)
unreachable
36: ; preds = %27, %55
%37 = phi %struct.addrinfo* [ %57, %55 ], [ %28, %27 ]
%38 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %37, i64 0, i32 4
%39 = load i32, i32* %38
%40 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %37, i64 0, i32 3
%41 = load i32, i32* %40
%42 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %37, i64 0, i32 2
%43 = load i64, i64* %42
%44 = call i32 @socket(i32 %39, i32 %41, i64 %43)
%45 = icmp eq i32 %44, -1
br i1 %45, label %55, label %46
46: ; preds = %36
%47 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %37, i64 0, i32 1
%48 = load i32, i32* %47
%49 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %37, i64 0, i32 0
%50 = load i32, i32* %49
%51 = call i64 @bind(i32 %44, i32 %48, i32 %50)
%52 = icmp eq i64 %51, 0
br i1 %52, label %64, label %53
53: ; preds = %46
%54 = call i32 @close(i32 %44)
br label %55
55: ; preds = %36, %53
%56 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %37, i64 0, i32 5
%57 = load %struct.addrinfo*, %struct.addrinfo** %56
%58 = icmp eq %struct.addrinfo* %57, null
br i1 %58, label %59, label %36
59: ; preds = %55, %27
%60 = load i32, i32* @stderr
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%62 = load i32, i32* @EXIT_FAILURE
%63 = call i32 @exit(i32 %62)
unreachable
64: ; preds = %46
%65 = load %struct.addrinfo*, %struct.addrinfo** %4
%66 = call i32 @freeaddrinfo(%struct.addrinfo* %65)
%67 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%68 = bitcast %struct.sockaddr_in* %6 to i8*
%69 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%70 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
br label %71
71: ; preds = %71, %64
%72 = call i32 @listen(i32 %44, i32 1024)
%73 = call i32 @accept(i32 %44, %struct.sockaddr* %70, i32* %7)
%74 = call i32 @write(i32 %73, i8* %67, i32 12)
%75 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %74)
%76 = call i32 @close(i32 %73)
br label %71
}