#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 */
struct addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ ai_addr;
  int /*<<< orphan*/ ai_protocol;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
  struct addrinfo *ai_next;
};

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int bind(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int fcntl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
char *gai_strerror(int);
int getaddrinfo(char const *, char const *, struct addrinfo *,
                struct addrinfo **);
int listen(int, int);
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void setup_port(const char *host_ip, int *sockfd, const char *port) {
  struct addrinfo hints;
  struct addrinfo *servinfo;
  struct addrinfo *p;
  int yes = 1;
  int rv;
  memset(&hints, 0, sizeof hints);
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  if ((rv = getaddrinfo(host_ip, port, &hints, &servinfo)) != 0) {
    fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv));
    exit(-1);
  }
  for (p = servinfo; p != NULL; p = p->ai_next) {
    if ((*sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) ==
        -1) {
      perror("server: socket");
      continue;
    }
    if (setsockopt(*sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) ==
        -1) {
      perror("setsockopt");
      exit(-1);
    }
    if (bind(*sockfd, p->ai_addr, p->ai_addrlen) == -1) {
      close(*sockfd);
      perror("server: bind");
      continue;
    }
    break;
  }
  if (p == NULL) {
    fprintf(stderr, "server: failed to bind\n");
    return;
  }
  freeaddrinfo(servinfo);
  int flags = fcntl(*sockfd, F_GETFL, 0);
  fcntl(*sockfd, F_SETFL, flags | O_NONBLOCK);
  if (listen(*sockfd, 10) == -1) {
    perror("listen");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<setup_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x4c(%rbp)
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
mov    0x2dd6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    0x2daa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   10d0 <getaddrinfo@plt>
mov    %eax,-0x50(%rbp)
cmp    $0x0,%eax
je     1266 <setup_port+0x96>
mov    0x2d8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    -0x50(%rbp),%edi
call   1050 <gai_strerror@plt>
mov    -0x58(%rbp),%edi
mov    %rax,%rdx
lea    0xdab(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     134c <setup_port+0x17c>
mov    -0x48(%rbp),%rax
mov    0x10(%rax),%edi
mov    -0x48(%rbp),%rax
mov    0xc(%rax),%esi
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%edx
call   10f0 <socket@plt>
mov    -0x10(%rbp),%rcx
mov    %eax,(%rcx)
cmp    $0xffffffff,%eax
jne    12b3 <setup_port+0xe3>
lea    0xd68(%rip),%rdi
call   10b0 <perror@plt>
jmp    133b <setup_port+0x16b>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    0x2d28(%rip),%rax
mov    (%rax),%esi
mov    0x2cdf(%rip),%rax
mov    (%rax),%edx
lea    -0x4c(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    12f9 <setup_port+0x129>
lea    0xd36(%rip),%rdi
call   10b0 <perror@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x48(%rbp),%rax
mov    (%rax),%edx
call   10a0 <bind@plt>
cmp    $0xffffffff,%eax
jne    1336 <setup_port+0x166>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1070 <close@plt>
lea    0xcff(%rip),%rdi
call   10b0 <perror@plt>
jmp    133b <setup_port+0x16b>
jmp    134c <setup_port+0x17c>
mov    -0x48(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x48(%rbp)
jmp    126e <setup_port+0x9e>
cmpq   $0x0,-0x48(%rbp)
jne    1373 <setup_port+0x1a3>
mov    0x2c6a(%rip),%rax
mov    (%rax),%edi
lea    0xcd1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    13e4 <setup_port+0x214>
mov    -0x40(%rbp),%rdi
call   10e0 <freeaddrinfo@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    0x2c27(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <fcntl@plt>
mov    %eax,-0x54(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    0x2c1e(%rip),%rax
mov    (%rax),%esi
mov    -0x54(%rbp),%edx
mov    0x2c32(%rip),%rax
or     (%rax),%edx
call   1040 <fcntl@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0xa,%esi
call   1090 <listen@plt>
cmp    $0xffffffff,%eax
jne    13e4 <setup_port+0x214>
lea    0xc7b(%rip),%rdi
call   10b0 <perror@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_port>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdx,%r14
mov    %rsi,%r13
mov    %rdi,%r15
movl   $0x1,0xc(%rsp)
lea    0x18(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
mov    0x2dce(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x28(%rsp)
mov    0x2da1(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x24(%rsp)
lea    0x10(%rsp),%rcx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   10d0 <getaddrinfo@plt>
test   %eax,%eax
jne    134a <setup_port+0x17a>
mov    0x10(%rsp),%rbx
test   %rbx,%rbx
je     12cb <setup_port+0xfb>
lea    0xdc4(%rip),%r15
mov    0x2d94(%rip),%r12
mov    0x2d4d(%rip),%rbp
lea    0xc(%rsp),%r14
mov    0x10(%rbx),%edi
mov    0x8(%rbx),%edx
mov    0xc(%rbx),%esi
call   10f0 <socket@plt>
mov    %eax,0x0(%r13)
mov    %r15,%rdi
cmp    $0xffffffff,%eax
je     12bd <setup_port+0xed>
mov    (%r12),%esi
mov    0x0(%rbp),%edx
mov    %eax,%edi
mov    %r14,%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
je     1341 <setup_port+0x171>
mov    0x0(%r13),%edi
mov    (%rbx),%edx
mov    0x4(%rbx),%esi
call   10a0 <bind@plt>
cmp    $0xffffffff,%eax
jne    12e4 <setup_port+0x114>
mov    0x0(%r13),%edi
call   1070 <close@plt>
lea    0xd6e(%rip),%rdi
call   10b0 <perror@plt>
mov    0x18(%rbx),%rbx
test   %rbx,%rbx
jne    1260 <setup_port+0x90>
mov    0x2cf6(%rip),%rax
mov    (%rax),%edi
lea    0xd5d(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1332 <setup_port+0x162>
mov    0x10(%rsp),%rdi
call   10e0 <freeaddrinfo@plt>
mov    0x0(%r13),%edi
mov    0x2cb7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <fcntl@plt>
mov    0x0(%r13),%edi
mov    0x2cb3(%rip),%rcx
mov    (%rcx),%esi
mov    0x2cca(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%edx
call   1040 <fcntl@plt>
mov    0x0(%r13),%edi
mov    $0xa,%esi
call   1090 <listen@plt>
cmp    $0xffffffff,%eax
je     1377 <setup_port+0x1a7>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcd8(%rip),%rdi
jmp    137e <setup_port+0x1ae>
mov    0x2c77(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1050 <gai_strerror@plt>
lea    0xc9f(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
lea    0xcd2(%rip),%rdi
call   10b0 <perror@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32, i32, i32, i32, %struct.addrinfo* }
@AF_UNSPEC = global i32 0
@SOCK_STREAM = global i32 0
@stderr = global i32 0
@.str = [17 x i8] c"getaddrinfo: %s\0A\00"
@.str.1 = [15 x i8] c"server: socket\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.2 = [11 x i8] c"setsockopt\00"
@.str.3 = [13 x i8] c"server: bind\00"
@.str.4 = [24 x i8] c"server: failed to bind\0A\00"
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@.str.5 = [7 x i8] c"listen\00"
define void @setup_port(i8* %0, i32* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca %struct.addrinfo
%8 = alloca %struct.addrinfo*
%9 = alloca %struct.addrinfo*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
store i32 1, i32* %10
%13 = call i32 @memset(%struct.addrinfo* %7, i32 0, i32 32)
%14 = load i32, i32* @AF_UNSPEC
%15 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %7, i32 0, i32 4
store i32 %14, i32* %15
%16 = load i32, i32* @SOCK_STREAM
%17 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %7, i32 0, i32 3
store i32 %16, i32* %17
%18 = load i8*, i8** %4
%19 = load i8*, i8** %6
%20 = call i32 @getaddrinfo(i8* %18, i8* %19, %struct.addrinfo* %7, %struct.addrinfo** %8)
store i32 %20, i32* %11
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %28
22: ; preds = %3
%23 = load i32, i32* @stderr
%24 = load i32, i32* %11
%25 = call i8* @gai_strerror(i32 %24)
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %25)
%27 = call i32 @exit(i32 -1)
unreachable
28: ; preds = %3
%29 = load %struct.addrinfo*, %struct.addrinfo** %8
store %struct.addrinfo* %29, %struct.addrinfo** %9
br label %30
30: ; preds = %75, %28
%31 = load %struct.addrinfo*, %struct.addrinfo** %9
%32 = icmp ne %struct.addrinfo* %31, null
br i1 %32, label %33, label %79
33: ; preds = %30
%34 = load %struct.addrinfo*, %struct.addrinfo** %9
%35 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %34, i32 0, i32 4
%36 = load i32, i32* %35
%37 = load %struct.addrinfo*, %struct.addrinfo** %9
%38 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %37, i32 0, i32 3
%39 = load i32, i32* %38
%40 = load %struct.addrinfo*, %struct.addrinfo** %9
%41 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %40, i32 0, i32 2
%42 = load i32, i32* %41
%43 = call i32 @socket(i32 %36, i32 %39, i32 %42)
%44 = load i32*, i32** %5
store i32 %43, i32* %44
%45 = icmp eq i32 %43, -1
br i1 %45, label %46, label %48
46: ; preds = %33
%47 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %75
48: ; preds = %33
%49 = load i32*, i32** %5
%50 = load i32, i32* %49
%51 = load i32, i32* @SOL_SOCKET
%52 = load i32, i32* @SO_REUSEADDR
%53 = call i32 @setsockopt(i32 %50, i32 %51, i32 %52, i32* %10, i32 4)
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %58
55: ; preds = %48
%56 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%57 = call i32 @exit(i32 -1)
unreachable
58: ; preds = %48
%59 = load i32*, i32** %5
%60 = load i32, i32* %59
%61 = load %struct.addrinfo*, %struct.addrinfo** %9
%62 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %61, i32 0, i32 1
%63 = load i32, i32* %62
%64 = load %struct.addrinfo*, %struct.addrinfo** %9
%65 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %64, i32 0, i32 0
%66 = load i32, i32* %65
%67 = call i32 @bind(i32 %60, i32 %63, i32 %66)
%68 = icmp eq i32 %67, -1
br i1 %68, label %69, label %74
69: ; preds = %58
%70 = load i32*, i32** %5
%71 = load i32, i32* %70
%72 = call i32 @close(i32 %71)
%73 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %75
74: ; preds = %58
br label %79
75: ; preds = %69, %46
%76 = load %struct.addrinfo*, %struct.addrinfo** %9
%77 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %76, i32 0, i32 5
%78 = load %struct.addrinfo*, %struct.addrinfo** %77
store %struct.addrinfo* %78, %struct.addrinfo** %9
br label %30
79: ; preds = %74, %30
%80 = load %struct.addrinfo*, %struct.addrinfo** %9
%81 = icmp eq %struct.addrinfo* %80, null
br i1 %81, label %82, label %85
82: ; preds = %79
%83 = load i32, i32* @stderr
%84 = call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %106
85: ; preds = %79
%86 = load %struct.addrinfo*, %struct.addrinfo** %8
%87 = call i32 @freeaddrinfo(%struct.addrinfo* %86)
%88 = load i32*, i32** %5
%89 = load i32, i32* %88
%90 = load i32, i32* @F_GETFL
%91 = call i32 @fcntl(i32 %89, i32 %90, i32 0)
store i32 %91, i32* %12
%92 = load i32*, i32** %5
%93 = load i32, i32* %92
%94 = load i32, i32* @F_SETFL
%95 = load i32, i32* %12
%96 = load i32, i32* @O_NONBLOCK
%97 = or i32 %95, %96
%98 = call i32 @fcntl(i32 %93, i32 %94, i32 %97)
%99 = load i32*, i32** %5
%100 = load i32, i32* %99
%101 = call i32 @listen(i32 %100, i32 10)
%102 = icmp eq i32 %101, -1
br i1 %102, label %103, label %106
103: ; preds = %85
%104 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%105 = call i32 @exit(i32 -1)
unreachable
106: ; preds = %82, %85
ret void
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32, i32, i32, i32, %struct.addrinfo* }
@AF_UNSPEC = global i32 0
@SOCK_STREAM = global i32 0
@stderr = global i32 0
@.str = [17 x i8] c"getaddrinfo: %s\0A\00"
@.str.1 = [15 x i8] c"server: socket\00"
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@.str.2 = [11 x i8] c"setsockopt\00"
@.str.3 = [13 x i8] c"server: bind\00"
@.str.4 = [24 x i8] c"server: failed to bind\0A\00"
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@.str.5 = [7 x i8] c"listen\00"
define void @setup_port(i8* %0, i32* nocapture %1, i8* %2) {
%4 = alloca %struct.addrinfo
%5 = alloca %struct.addrinfo*
%6 = alloca i32
%7 = bitcast %struct.addrinfo* %4 to i8*
%8 = bitcast %struct.addrinfo** %5 to i8*
%9 = bitcast i32* %6 to i8*
store i32 1, i32* %6
%10 = call i32 @memset(%struct.addrinfo* %4, i32 0, i32 32)
%11 = load i32, i32* @AF_UNSPEC
%12 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %4, i64 0, i32 4
store i32 %11, i32* %12
%13 = load i32, i32* @SOCK_STREAM
%14 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %4, i64 0, i32 3
store i32 %13, i32* %14
%15 = call i32 @getaddrinfo(i8* %0, i8* %2, %struct.addrinfo* %4, %struct.addrinfo** %5)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %3
%18 = load %struct.addrinfo*, %struct.addrinfo** %5
%19 = icmp eq %struct.addrinfo* %18, null
br i1 %19, label %60, label %25
20: ; preds = %3
%21 = load i32, i32* @stderr
%22 = call i8* @gai_strerror(i32 %15)
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = call i32 @exit(i32 -1)
unreachable
25: ; preds = %17, %54
%26 = phi %struct.addrinfo* [ %58, %54 ], [ %18, %17 ]
%27 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %26, i64 0, i32 4
%28 = load i32, i32* %27
%29 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %26, i64 0, i32 3
%30 = load i32, i32* %29
%31 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %26, i64 0, i32 2
%32 = load i32, i32* %31
%33 = call i32 @socket(i32 %28, i32 %30, i32 %32)
store i32 %33, i32* %1
%34 = icmp eq i32 %33, -1
br i1 %34, label %54, label %35
35: ; preds = %25
%36 = load i32, i32* @SOL_SOCKET
%37 = load i32, i32* @SO_REUSEADDR
%38 = call i32 @setsockopt(i32 %33, i32 %36, i32 %37, i32* %6, i32 4)
%39 = icmp eq i32 %38, -1
br i1 %39, label %40, label %43
40: ; preds = %35
%41 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%42 = call i32 @exit(i32 -1)
unreachable
43: ; preds = %35
%44 = load i32, i32* %1
%45 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %26, i64 0, i32 1
%46 = load i32, i32* %45
%47 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %26, i64 0, i32 0
%48 = load i32, i32* %47
%49 = call i32 @bind(i32 %44, i32 %46, i32 %48)
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %63
51: ; preds = %43
%52 = load i32, i32* %1
%53 = call i32 @close(i32 %52)
br label %54
54: ; preds = %25, %51
%55 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), %51 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), %25 ]
%56 = call i32 @perror(i8* %55)
%57 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %26, i64 0, i32 5
%58 = load %struct.addrinfo*, %struct.addrinfo** %57
%59 = icmp eq %struct.addrinfo* %58, null
br i1 %59, label %60, label %25
60: ; preds = %54, %17
%61 = load i32, i32* @stderr
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %80
63: ; preds = %43
%64 = load %struct.addrinfo*, %struct.addrinfo** %5
%65 = call i32 @freeaddrinfo(%struct.addrinfo* %64)
%66 = load i32, i32* %1
%67 = load i32, i32* @F_GETFL
%68 = call i32 @fcntl(i32 %66, i32 %67, i32 0)
%69 = load i32, i32* %1
%70 = load i32, i32* @F_SETFL
%71 = load i32, i32* @O_NONBLOCK
%72 = or i32 %71, %68
%73 = call i32 @fcntl(i32 %69, i32 %70, i32 %72)
%74 = load i32, i32* %1
%75 = call i32 @listen(i32 %74, i32 10)
%76 = icmp eq i32 %75, -1
br i1 %76, label %77, label %80
77: ; preds = %63
%78 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%79 = call i32 @exit(i32 -1)
unreachable
80: ; preds = %63, %60
ret void
}