#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 sockaddr {
  int dummy;
};
struct addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  scalar_t__ 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 INET6_ADDRSTRLEN;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
char *gai_strerror(int);
int /*<<< orphan*/ get_in_addr(struct sockaddr *);
int getaddrinfo(char const *, char const *, struct addrinfo *,
                struct addrinfo **);
int /*<<< orphan*/ inet_ntop(int /*<<< orphan*/, int /*<<< orphan*/, char *,
                             int);
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int connect_socket(const char *hostname, const char *servname, int *sockfd) {
  int retv;
  struct addrinfo hints, *servinfo, *p;
  memset(&hints, 0, sizeof hints);
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  hints.ai_flags = AI_PASSIVE;
  if ((retv = getaddrinfo(hostname, servname, &hints, &servinfo))) {
    fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(retv));
    return 1;
  }
  for (p = servinfo; p; p = p->ai_next) {
    char s[INET6_ADDRSTRLEN];
    inet_ntop(p->ai_family, get_in_addr((struct sockaddr *)p->ai_addr), s,
              sizeof s);
    printf("connecting to %s\n", s);
    if ((*sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) < 0) {
      perror("server: socket");
      continue;
    }
    if (connect(*sockfd, p->ai_addr, p->ai_addrlen) < 0) {
      close(*sockfd);
      perror("client: connect");
      continue;
    }
    break;
  }
  if (!p) {
    fprintf(stderr, "client: failed to connect\n");
    return 2;
  }
  freeaddrinfo(servinfo);
  return 0;
}


x86 assembly (clang, -O0):
<connect_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x58(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1070 <memset@plt>
mov    0x2dea(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    0x2dc6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2dda(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x58(%rbp),%rdx
lea    -0x60(%rbp),%rcx
call   10c0 <getaddrinfo@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     1260 <connect_socket+0xa0>
mov    0x2d95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x80(%rbp)
mov    -0x24(%rbp),%edi
call   1060 <gai_strerror@plt>
mov    -0x80(%rbp),%edi
mov    %rax,%rdx
lea    0xdb3(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13e8 <connect_socket+0x228>
mov    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
je     13aa <connect_socket+0x1ea>
mov    0x2d6e(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x90(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x88(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x78(%rbp)
mov    -0x68(%rbp),%rax
mov    0x18(%rax),%eax
mov    %eax,-0x94(%rbp)
mov    -0x68(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <get_in_addr@plt>
mov    -0x94(%rbp),%edi
mov    -0x88(%rbp),%rdx
mov    %eax,%esi
mov    -0x90(%rbp),%rax
mov    %eax,%ecx
call   1030 <inet_ntop@plt>
mov    -0x88(%rbp),%rsi
lea    0xd23(%rip),%rdi
call   1050 <printf@plt>
mov    -0x68(%rbp),%rax
mov    0x18(%rax),%edi
mov    -0x68(%rbp),%rax
mov    0x14(%rax),%esi
mov    -0x68(%rbp),%rax
mov    0x10(%rax),%edx
call   10e0 <socket@plt>
mov    -0x20(%rbp),%rcx
mov    %eax,(%rcx)
cmp    $0x0,%eax
jge    1334 <connect_socket+0x174>
lea    0xd00(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x4,-0x7c(%rbp)
jmp    1381 <connect_socket+0x1c1>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
mov    -0x68(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x68(%rbp),%rax
mov    (%rax),%edx
call   10b0 <connect@plt>
cmp    $0x0,%rax
jge    137a <connect_socket+0x1ba>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1080 <close@plt>
lea    0xcc9(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x4,-0x7c(%rbp)
jmp    1381 <connect_socket+0x1c1>
movl   $0x2,-0x7c(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,%rsp
mov    -0x7c(%rbp),%eax
sub    $0x2,%eax
je     13aa <connect_socket+0x1ea>
jmp    1399 <connect_socket+0x1d9>
mov    -0x68(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x68(%rbp)
jmp    1268 <connect_socket+0xa8>
cmpq   $0x0,-0x68(%rbp)
jne    13d8 <connect_socket+0x218>
mov    0x2c0c(%rip),%rax
mov    (%rax),%edi
lea    0xc7d(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    13e8 <connect_socket+0x228>
mov    -0x60(%rbp),%rdi
call   10d0 <freeaddrinfo@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connect_socket>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
lea    -0x68(%rbp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1070 <memset@plt>
mov    0x2de4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
mov    0x2dc0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    0x2dd4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
lea    -0x38(%rbp),%rcx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   10c0 <getaddrinfo@plt>
test   %eax,%eax
je     1254 <connect_socket+0x94>
mov    0x2d9a(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1060 <gai_strerror@plt>
lea    0xdc2(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%eax
jmp    1333 <connect_socket+0x173>
mov    -0x38(%rbp),%r14
test   %r14,%r14
je     1306 <connect_socket+0x146>
mov    %rsp,-0x30(%rbp)
mov    0x2d7c(%rip),%rax
mov    (%rax),%r12d
mov    %rsp,%rbx
mov    %r12,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x18(%r14),%r13d
mov    0x8(%r14),%rdi
call   1040 <get_in_addr@plt>
mov    %r13d,%edi
mov    %eax,%esi
mov    %rbx,%rdx
mov    %r12d,%ecx
call   1030 <inet_ntop@plt>
lea    0xd6a(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    0x18(%r14),%edi
mov    0x10(%r14),%edx
mov    0x14(%r14),%esi
call   10e0 <socket@plt>
mov    %eax,(%r15)
lea    0xd59(%rip),%rdi
test   %eax,%eax
js     12f0 <connect_socket+0x130>
mov    0x8(%r14),%rsi
mov    (%r14),%edx
mov    %eax,%edi
call   10b0 <connect@plt>
test   %rax,%rax
jns    1324 <connect_socket+0x164>
mov    (%r15),%edi
call   1080 <close@plt>
lea    0xd42(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x30(%rbp),%rsp
mov    0x20(%r14),%r14
test   %r14,%r14
jne    1261 <connect_socket+0xa1>
mov    0x2cbb(%rip),%rax
mov    (%rax),%edi
lea    0xd2c(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x2,%eax
jmp    1333 <connect_socket+0x173>
mov    -0x30(%rbp),%rsp
mov    -0x38(%rbp),%rdi
call   10d0 <freeaddrinfo@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.addrinfo = type { i32, i64, i32, i32, i32, %struct.addrinfo*, i32 }
%struct.sockaddr = type { i32 }
@AF_UNSPEC = global i32 0
@SOCK_STREAM = global i32 0
@AI_PASSIVE = global i32 0
@stderr = global i32 0
@.str = [17 x i8] c"getaddrinfo: %s\0A\00"
@INET6_ADDRSTRLEN = global i32 0
@.str.1 = [18 x i8] c"connecting to %s\0A\00"
@.str.2 = [15 x i8] c"server: socket\00"
@.str.3 = [16 x i8] c"client: connect\00"
@.str.4 = [27 x i8] c"client: failed to connect\0A\00"
define i32 @connect_socket(i8* %0, i8* %1, i32* nocapture %2) {
%4 = alloca %struct.addrinfo
%5 = alloca %struct.addrinfo*
%6 = bitcast %struct.addrinfo* %4 to i8*
%7 = bitcast %struct.addrinfo** %5 to i8*
%8 = call i32 @memset(%struct.addrinfo* %4, i32 0, i32 48)
%9 = load i32, i32* @AF_UNSPEC
%10 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %4, i64 0, i32 4
store i32 %9, i32* %10
%11 = load i32, i32* @SOCK_STREAM
%12 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %4, i64 0, i32 3
store i32 %11, i32* %12
%13 = load i32, i32* @AI_PASSIVE
%14 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %4, i64 0, i32 6
store i32 %13, i32* %14
%15 = call i32 @getaddrinfo(i8* %0, i8* %1, %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 %24
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)
br label %66
24: ; preds = %17, %54
%25 = phi %struct.addrinfo* [ %58, %54 ], [ %18, %17 ]
%26 = load i32, i32* @INET6_ADDRSTRLEN
%27 = zext i32 %26 to i64
%28 = call i8* @llvm.stacksave()
%29 = alloca i8, i64 %27
%30 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %25, i64 0, i32 4
%31 = load i32, i32* %30
%32 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %25, i64 0, i32 1
%33 = load i64, i64* %32
%34 = inttoptr i64 %33 to %struct.sockaddr*
%35 = call i32 @get_in_addr(%struct.sockaddr* %34)
%36 = call i32 @inet_ntop(i32 %31, i32 %35, i8* %29, i32 %26)
%37 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %29)
%38 = load i32, i32* %30
%39 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %25, i64 0, i32 3
%40 = load i32, i32* %39
%41 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %25, i64 0, i32 2
%42 = load i32, i32* %41
%43 = call i32 @socket(i32 %38, i32 %40, i32 %42)
store i32 %43, i32* %2
%44 = icmp slt i32 %43, 0
br i1 %44, label %54, label %45
45: ; preds = %24
%46 = load i64, i64* %32
%47 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %25, i64 0, i32 0
%48 = load i32, i32* %47
%49 = call i64 @connect(i32 %43, i64 %46, i32 %48)
%50 = icmp slt i64 %49, 0
br i1 %50, label %51, label %63
51: ; preds = %45
%52 = load i32, i32* %2
%53 = call i32 @close(i32 %52)
br label %54
54: ; preds = %24, %51
%55 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), %51 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), %24 ]
%56 = call i32 @perror(i8* %55)
%57 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %25, i64 0, i32 5
%58 = load %struct.addrinfo*, %struct.addrinfo** %57
%59 = icmp eq %struct.addrinfo* %58, null
br i1 %59, label %60, label %24
60: ; preds = %54, %17
%61 = load i32, i32* @stderr
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br label %66
63: ; preds = %45
%64 = load %struct.addrinfo*, %struct.addrinfo** %5
%65 = call i32 @freeaddrinfo(%struct.addrinfo* %64)
br label %66
66: ; preds = %63, %60, %20
%67 = phi i32 [ 1, %20 ], [ 0, %63 ], [ 2, %60 ]
ret i32 %67
}