#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;
  int /*<<< orphan*/ ai_flags;
};

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ AI_PASSIVE;
int /*<<< orphan*/ EXIT_FAILURE;
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 /*<<< 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*/ 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*/ sprintf(char *, char *, int);
int /*<<< orphan*/ stderr;
int setup_serv_con(int *sock_fd, int *port) {
  struct addrinfo hints, *servinfo, *p;
  int rv;
  int yes = 1;
  char port_char[5] = {0};
  memset(&hints, 0, sizeof hints);
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  hints.ai_flags = AI_PASSIVE;
  sprintf(port_char, "%d", *port);
  if ((rv = getaddrinfo(NULL, port_char, &hints, &servinfo)) != 0) {
    fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv));
    return -1;
  }
  for (p = servinfo; p != NULL; p = p->ai_next) {
    if ((*sock_fd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) ==
        -1) {
      perror("server: create socket");
      continue;
    }
    if (setsockopt(*sock_fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) ==
        -1) {
      close(*sock_fd);
      perror("setsockopt");
      exit(EXIT_FAILURE);
    }
    if (bind(*sock_fd, p->ai_addr, p->ai_addrlen) == -1) {
      close(*sock_fd);
      perror("server: bind");
      continue;
    }
    break;
  }
  if (p == NULL) {
    fprintf(stderr, "server: failed to bind\n");
    exit(EXIT_FAILURE);
  }
  freeaddrinfo(servinfo);
  return 0;
}


x86 assembly (clang, -O0):
<setup_serv_con>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x1,-0x58(%rbp)
lea    -0x5d(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1050 <memset@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
mov    0x2dda(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    0x2db6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    0x2dca(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
lea    -0x5d(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xdd4(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x5d(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    -0x40(%rbp),%rdx
lea    -0x48(%rbp),%rcx
call   10c0 <getaddrinfo@plt>
mov    %eax,-0x54(%rbp)
cmp    $0x0,%eax
je     1286 <setup_serv_con+0xc6>
mov    0x2d6f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    -0x54(%rbp),%edi
call   1040 <gai_strerror@plt>
mov    -0x64(%rbp),%edi
mov    %rax,%rdx
lea    0xd90(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13bb <setup_serv_con+0x1fb>
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     137b <setup_serv_con+0x1bb>
mov    -0x50(%rbp),%rax
mov    0x10(%rax),%edi
mov    -0x50(%rbp),%rax
mov    0xc(%rax),%esi
mov    -0x50(%rbp),%rax
mov    0x8(%rax),%edx
call   10e0 <socket@plt>
mov    -0x10(%rbp),%rcx
mov    %eax,(%rcx)
cmp    $0xffffffff,%eax
jne    12d3 <setup_serv_con+0x113>
lea    0xd4b(%rip),%rdi
call   1090 <perror@plt>
jmp    136a <setup_serv_con+0x1aa>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    0x2d08(%rip),%rax
mov    (%rax),%esi
mov    0x2cc7(%rip),%rax
mov    (%rax),%edx
lea    -0x58(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    1328 <setup_serv_con+0x168>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1060 <close@plt>
lea    0xd15(%rip),%rdi
call   1090 <perror@plt>
mov    0x2c97(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x50(%rbp),%rax
mov    (%rax),%edx
call   1080 <bind@plt>
cmp    $0xffffffff,%eax
jne    1365 <setup_serv_con+0x1a5>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1060 <close@plt>
lea    0xcda(%rip),%rdi
call   1090 <perror@plt>
jmp    136a <setup_serv_con+0x1aa>
jmp    137b <setup_serv_con+0x1bb>
mov    -0x50(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x50(%rbp)
jmp    128e <setup_serv_con+0xce>
cmpq   $0x0,-0x50(%rbp)
jne    13ab <setup_serv_con+0x1eb>
mov    0x2c3b(%rip),%rax
mov    (%rax),%edi
lea    0xcac(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2c14(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    -0x48(%rbp),%rdi
call   10d0 <freeaddrinfo@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_serv_con>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
mov    %rdi,%r15
movl   $0x1,0x14(%rsp)
movb   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x20(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
mov    0x2dd4(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x30(%rsp)
mov    0x2daf(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x2c(%rsp)
mov    0x2dc2(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x40(%rsp)
mov    (%rbx),%edx
lea    0xdd3(%rip),%rsi
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   10a0 <sprintf@plt>
lea    0x18(%rsp),%rcx
xor    %edi,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   10c0 <getaddrinfo@plt>
test   %eax,%eax
je     127d <setup_serv_con+0xbd>
mov    0x2d71(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1040 <gai_strerror@plt>
lea    0xd9c(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    132a <setup_serv_con+0x16a>
mov    0x18(%rsp),%rbx
test   %rbx,%rbx
je     1305 <setup_serv_con+0x145>
lea    0xd86(%rip),%r12
mov    0x2d53(%rip),%r13
mov    0x2d14(%rip),%rbp
lea    0x14(%rsp),%r14
mov    0x10(%rbx),%edi
mov    0x8(%rbx),%edx
mov    0xc(%rbx),%esi
call   10e0 <socket@plt>
mov    %eax,(%r15)
mov    %r12,%rdi
cmp    $0xffffffff,%eax
je     12f7 <setup_serv_con+0x137>
mov    0x0(%r13),%esi
mov    0x0(%rbp),%edx
mov    %eax,%edi
mov    %r14,%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    (%r15),%edi
cmp    $0xffffffff,%eax
je     1339 <setup_serv_con+0x179>
mov    (%rbx),%edx
mov    0x4(%rbx),%esi
call   1080 <bind@plt>
cmp    $0xffffffff,%eax
jne    131e <setup_serv_con+0x15e>
mov    (%r15),%edi
call   1060 <close@plt>
lea    0xd3e(%rip),%rdi
call   1090 <perror@plt>
mov    0x18(%rbx),%rbx
test   %rbx,%rbx
jne    12a1 <setup_serv_con+0xe1>
mov    0x2cbc(%rip),%rax
mov    (%rax),%edi
lea    0xd2d(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    134a <setup_serv_con+0x18a>
mov    0x18(%rsp),%rdi
call   10d0 <freeaddrinfo@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
call   1060 <close@plt>
lea    0xce5(%rip),%rdi
call   1090 <perror@plt>
mov    0x2c67(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>

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

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