#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_in6 {
  int /*<<< orphan*/ sin6_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};
struct addrinfo {
  scalar_t__ ai_family;
  char *ai_canonname;
  scalar_t__ ai_addr;
  struct addrinfo *ai_next;
  int /*<<< orphan*/ ai_flags;
  scalar_t__ ai_socktype;
};

/* Variables and functions */
scalar_t__ AF_INET;
scalar_t__ AF_INET6;
scalar_t__ AF_UNSPEC;
int /*<<< orphan*/ AI_CANONNAME;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int INET6_ADDRSTRLEN;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
char *gai_strerror(int);
int getaddrinfo(char *, int /*<<< orphan*/ *, struct addrinfo *,
                struct addrinfo **);
int /*<<< orphan*/ inet_ntop(scalar_t__, void *, char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc < 2) {
    fprintf(stderr, "Usage: getaddrinfo <host or IP>\n");
    exit(EXIT_FAILURE);
  }
  int ret;
  struct addrinfo *res, *p, hints;
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = 0;
  hints.ai_flags = AI_CANONNAME;
  if ((ret = getaddrinfo(argv[1], NULL, &hints, &res))) {
    fprintf(stderr, "Error getaddrinfo: %s\n", gai_strerror(ret));
    exit(EXIT_FAILURE);
  }
  printf("Host: %s\n", res->ai_canonname);
  char addr[INET6_ADDRSTRLEN];
  for (p = res; p != NULL; p = p->ai_next) {
    void *ptr = NULL;
    if (p->ai_family == AF_INET) {
      struct sockaddr_in *in = (struct sockaddr_in *)p->ai_addr;
      ptr = &(in->sin_addr);
      printf("IPv4: ");
    } else if (p->ai_family == AF_INET6) {
      struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)p->ai_addr;
      ptr = &(in6->sin6_addr);
      printf("IPv6: ");
    }
    if (!inet_ntop(p->ai_family, ptr, addr, INET6_ADDRSTRLEN)) {
      perror("inet_ntop");
      exit(EXIT_FAILURE);
    }
    printf("%s\n", addr);
  }
  freeaddrinfo(res);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11c8 <main+0x48>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
lea    0xe4d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2def(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    0x2e09(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
movq   $0x0,-0x30(%rbp)
mov    0x2deb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x58(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1090 <getaddrinfo@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     124b <main+0xcb>
mov    0x2da2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x84(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <gai_strerror@plt>
mov    -0x84(%rbp),%edi
mov    %rax,%rdx
lea    0xdeb(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2d6c(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdde(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2d80(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x90(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x68(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1390 <main+0x210>
movq   $0x0,-0x70(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    0x2d27(%rip),%rcx
cmp    (%rcx),%rax
jne    12e9 <main+0x169>
mov    -0x28(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x70(%rbp)
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1327 <main+0x1a7>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    0x2cd1(%rip),%rcx
cmp    (%rcx),%rax
jne    1322 <main+0x1a2>
mov    -0x28(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,-0x70(%rbp)
lea    0xd2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1327 <main+0x1a7>
mov    -0x90(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
mov    -0x70(%rbp),%rsi
mov    0x2ca8(%rip),%rax
mov    (%rax),%ecx
call   1030 <inet_ntop@plt>
cmp    $0x0,%eax
jne    136a <main+0x1ea>
lea    0xcf9(%rip),%rdi
call   1070 <perror@plt>
mov    0x2c4d(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x90(%rbp),%rsi
lea    0xcbc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    1298 <main+0x118>
mov    -0x20(%rbp),%rdi
call   10a0 <freeaddrinfo@plt>
mov    0x2c08(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
cmp    $0x1,%edi
jg     11c2 <main+0x32>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edi
lea    0xe4a(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    12fa <main+0x16a>
mov    0x2e0f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
movq   $0x0,-0x38(%rbp)
mov    0x2df1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    0x8(%rsi),%rdi
lea    -0x60(%rbp),%rdx
lea    -0x30(%rbp),%rcx
xor    %esi,%esi
call   10a0 <getaddrinfo@plt>
test   %eax,%eax
jne    12c9 <main+0x139>
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe2a(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2dc9(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r15
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    -0x30(%rbp),%rbx
test   %rbx,%rbx
je     12b3 <main+0x123>
mov    0x2d9e(%rip),%r13
lea    0xdf9(%rip),%r12
nopl   0x0(%rax)
mov    (%rbx),%rax
mov    %r12,%rdi
cmp    0x0(%r13),%rax
je     126f <main+0xdf>
lea    0xde6(%rip),%rdi
mov    0x2d5e(%rip),%rcx
cmp    (%rcx),%rax
jne    1280 <main+0xf0>
mov    0x10(%rbx),%r14
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1283 <main+0xf3>
nopl   0x0(%rax)
xor    %r14d,%r14d
mov    (%rbx),%rdi
mov    0x2d5b(%rip),%rax
mov    (%rax),%ecx
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <inet_ntop@plt>
test   %eax,%eax
je     12ee <main+0x15e>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    0x18(%rbx),%rbx
test   %rbx,%rbx
jne    1250 <main+0xc0>
mov    -0x30(%rbp),%r14
mov    %r14,%rdi
call   10b0 <freeaddrinfo@plt>
mov    0x2ce6(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    0x2ce8(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1060 <gai_strerror@plt>
lea    0xd41(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    12fa <main+0x16a>
lea    0xd5b(%rip),%rdi
call   1080 <perror@plt>
mov    0x2caf(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i64, i8*, i64, %struct.addrinfo*, i32, i64 }
%struct.sockaddr_in = type { i32 }
%struct.sockaddr_in6 = type { i32 }
@stderr = global i32 0
@.str = [33 x i8] c"Usage: getaddrinfo <host or IP>\0A\00"
@EXIT_FAILURE = global i32 0
@AF_UNSPEC = global i64 0
@AI_CANONNAME = global i32 0
@.str.1 = [23 x i8] c"Error getaddrinfo: %s\0A\00"
@.str.2 = [10 x i8] c"Host: %s\0A\00"
@INET6_ADDRSTRLEN = global i32 0
@AF_INET = global i64 0
@.str.3 = [7 x i8] c"IPv4: \00"
@AF_INET6 = global i64 0
@.str.4 = [7 x i8] c"IPv6: \00"
@.str.5 = [10 x i8] c"inet_ntop\00"
@.str.6 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.addrinfo*
%8 = alloca %struct.addrinfo*
%9 = alloca %struct.addrinfo
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca %struct.sockaddr_in*
%14 = alloca %struct.sockaddr_in6*
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, 2
br i1 %16, label %17, label %22
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%20 = load i32, i32* @EXIT_FAILURE
%21 = call i32 @exit(i32 %20)
unreachable
22: ; preds = %2
%23 = load i64, i64* @AF_UNSPEC
%24 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %9, i32 0, i32 0
store i64 %23, i64* %24
%25 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %9, i32 0, i32 5
store i64 0, i64* %25
%26 = load i32, i32* @AI_CANONNAME
%27 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %9, i32 0, i32 4
store i32 %26, i32* %27
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32 @getaddrinfo(i8* %30, i32* null, %struct.addrinfo* %9, %struct.addrinfo** %7)
store i32 %31, i32* %6
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %40
33: ; preds = %22
%34 = load i32, i32* @stderr
%35 = load i32, i32* %6
%36 = call i8* @gai_strerror(i32 %35)
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %36)
%38 = load i32, i32* @EXIT_FAILURE
%39 = call i32 @exit(i32 %38)
unreachable
40: ; preds = %22
%41 = load %struct.addrinfo*, %struct.addrinfo** %7
%42 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %41, i32 0, i32 1
%43 = load i8*, i8** %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %43)
%45 = load i32, i32* @INET6_ADDRSTRLEN
%46 = zext i32 %45 to i64
%47 = call i8* @llvm.stacksave()
store i8* %47, i8** %10
%48 = alloca i8, i64 %46
store i64 %46, i64* %11
%49 = load %struct.addrinfo*, %struct.addrinfo** %7
store %struct.addrinfo* %49, %struct.addrinfo** %8
br label %50
50: ; preds = %98, %40
%51 = load %struct.addrinfo*, %struct.addrinfo** %8
%52 = icmp ne %struct.addrinfo* %51, null
br i1 %52, label %53, label %102
53: ; preds = %50
store i8* null, i8** %12
%54 = load %struct.addrinfo*, %struct.addrinfo** %8
%55 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %54, i32 0, i32 0
%56 = load i64, i64* %55
%57 = load i64, i64* @AF_INET
%58 = icmp eq i64 %56, %57
br i1 %58, label %59, label %68
59: ; preds = %53
%60 = load %struct.addrinfo*, %struct.addrinfo** %8
%61 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %60, i32 0, i32 2
%62 = load i64, i64* %61
%63 = inttoptr i64 %62 to %struct.sockaddr_in*
store %struct.sockaddr_in* %63, %struct.sockaddr_in** %13
%64 = load %struct.sockaddr_in*, %struct.sockaddr_in** %13
%65 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %64, i32 0, i32 0
%66 = bitcast i32* %65 to i8*
store i8* %66, i8** %12
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %84
68: ; preds = %53
%69 = load %struct.addrinfo*, %struct.addrinfo** %8
%70 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %69, i32 0, i32 0
%71 = load i64, i64* %70
%72 = load i64, i64* @AF_INET6
%73 = icmp eq i64 %71, %72
br i1 %73, label %74, label %83
74: ; preds = %68
%75 = load %struct.addrinfo*, %struct.addrinfo** %8
%76 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %75, i32 0, i32 2
%77 = load i64, i64* %76
%78 = inttoptr i64 %77 to %struct.sockaddr_in6*
store %struct.sockaddr_in6* %78, %struct.sockaddr_in6** %14
%79 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %14
%80 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %79, i32 0, i32 0
%81 = bitcast i32* %80 to i8*
store i8* %81, i8** %12
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %83
83: ; preds = %74, %68
br label %84
84: ; preds = %83, %59
%85 = load %struct.addrinfo*, %struct.addrinfo** %8
%86 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %85, i32 0, i32 0
%87 = load i64, i64* %86
%88 = load i8*, i8** %12
%89 = load i32, i32* @INET6_ADDRSTRLEN
%90 = call i32 @inet_ntop(i64 %87, i8* %88, i8* %48, i32 %89)
%91 = icmp ne i32 %90, 0
br i1 %91, label %96, label %92
92: ; preds = %84
%93 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%94 = load i32, i32* @EXIT_FAILURE
%95 = call i32 @exit(i32 %94)
unreachable
96: ; preds = %84
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %48)
br label %98
98: ; preds = %96
%99 = load %struct.addrinfo*, %struct.addrinfo** %8
%100 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %99, i32 0, i32 3
%101 = load %struct.addrinfo*, %struct.addrinfo** %100
store %struct.addrinfo* %101, %struct.addrinfo** %8
br label %50
102: ; preds = %50
%103 = load %struct.addrinfo*, %struct.addrinfo** %7
%104 = call i32 @freeaddrinfo(%struct.addrinfo* %103)
%105 = load i32, i32* @EXIT_SUCCESS
%106 = call i32 @exit(i32 %105)
unreachable
}

LLVM IR (-O2):
%struct.addrinfo = type { i64, i8*, i64, %struct.addrinfo*, i32, i64 }
@stderr = global i32 0
@.str = [33 x i8] c"Usage: getaddrinfo <host or IP>\0A\00"
@EXIT_FAILURE = global i32 0
@AF_UNSPEC = global i64 0
@AI_CANONNAME = global i32 0
@.str.1 = [23 x i8] c"Error getaddrinfo: %s\0A\00"
@.str.2 = [10 x i8] c"Host: %s\0A\00"
@INET6_ADDRSTRLEN = global i32 0
@AF_INET = global i64 0
@.str.3 = [7 x i8] c"IPv4: \00"
@AF_INET6 = global i64 0
@.str.4 = [7 x i8] c"IPv6: \00"
@.str.5 = [10 x i8] c"inet_ntop\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.addrinfo*
%4 = alloca %struct.addrinfo
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
%12 = bitcast %struct.addrinfo** %3 to i8*
%13 = bitcast %struct.addrinfo* %4 to i8*
%14 = load i64, i64* @AF_UNSPEC
%15 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %4, i64 0, i32 0
store i64 %14, i64* %15
%16 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %4, i64 0, i32 5
store i64 0, i64* %16
%17 = load i32, i32* @AI_CANONNAME
%18 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %4, i64 0, i32 4
store i32 %17, i32* %18
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @getaddrinfo(i8* %20, i32* null, %struct.addrinfo* %4, %struct.addrinfo** %3)
%22 = icmp eq i32 %21, 0
br i1 %22, label %29, label %23
23: ; preds = %11
%24 = load i32, i32* @stderr
%25 = call i8* @gai_strerror(i32 %21)
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %25)
%27 = load i32, i32* @EXIT_FAILURE
%28 = call i32 @exit(i32 %27)
unreachable
29: ; preds = %11
%30 = load %struct.addrinfo*, %struct.addrinfo** %3
%31 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %30, i64 0, i32 1
%32 = load i8*, i8** %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %32)
%34 = load i32, i32* @INET6_ADDRSTRLEN
%35 = zext i32 %34 to i64
%36 = alloca i8, i64 %35
%37 = load %struct.addrinfo*, %struct.addrinfo** %3
%38 = icmp eq %struct.addrinfo* %37, null
br i1 %38, label %71, label %39
39: ; preds = %29, %64
%40 = phi %struct.addrinfo* [ %67, %64 ], [ %37, %29 ]
%41 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %40, i64 0, i32 0
%42 = load i64, i64* %41
%43 = load i64, i64* @AF_INET
%44 = icmp eq i64 %42, %43
br i1 %44, label %48, label %45
45: ; preds = %39
%46 = load i64, i64* @AF_INET6
%47 = icmp eq i64 %42, %46
br i1 %47, label %48, label %54
48: ; preds = %45, %39
%49 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %39 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), %45 ]
%50 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %40, i64 0, i32 2
%51 = load i64, i64* %50
%52 = inttoptr i64 %51 to i8*
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %49)
br label %54
54: ; preds = %48, %45
%55 = phi i8* [ null, %45 ], [ %52, %48 ]
%56 = load i64, i64* %41
%57 = load i32, i32* @INET6_ADDRSTRLEN
%58 = call i32 @inet_ntop(i64 %56, i8* %55, i8* %36, i32 %57)
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %64
60: ; preds = %54
%61 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%62 = load i32, i32* @EXIT_FAILURE
%63 = call i32 @exit(i32 %62)
unreachable
64: ; preds = %54
%65 = call i32 @puts(i8* %36)
%66 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %40, i64 0, i32 3
%67 = load %struct.addrinfo*, %struct.addrinfo** %66
%68 = icmp eq %struct.addrinfo* %67, null
br i1 %68, label %69, label %39
69: ; preds = %64
%70 = load %struct.addrinfo*, %struct.addrinfo** %3
br label %71
71: ; preds = %69, %29
%72 = phi %struct.addrinfo* [ %70, %69 ], [ null, %29 ]
%73 = call i32 @freeaddrinfo(%struct.addrinfo* %72)
%74 = load i32, i32* @EXIT_SUCCESS
%75 = call i32 @exit(i32 %74)
unreachable
}