#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;
  scalar_t__ ai_addr;
  struct addrinfo *ai_next;
  int /*<<< orphan*/ ai_socktype;
};
typedef int /*<<< orphan*/ ip;
typedef int /*<<< orphan*/ hints;

/* Variables and functions */
scalar_t__ AF_INET;
scalar_t__ AF_INET6;
scalar_t__ AF_UNSPEC;
int INET6_ADDRSTRLEN;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
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*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ stderr;
int strlen(char *);
int main(int argc, char **argv) {
  int err;
  char ip[INET6_ADDRSTRLEN];
  struct addrinfo hints, *result, *ptr;
  if (argc != 2) {
    fprintf(stderr, "usage: %s host\n", argv[0]);
    return 1;
  } else if (strlen(argv[1]) < 3) {
    fputs("length of the hostname must be at least 3 characters.\n", stderr);
    return 2;
  }
  memset(&hints, 0, sizeof(hints));
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  if ((err = getaddrinfo(argv[1], 0, &hints, &result)) != 0) {
    fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(err));
    return 3;
  }
  printf("ip-adresses for host %s:\n", argv[1]);
  for (ptr = result; ptr != NULL; ptr = ptr->ai_next) {
    void *address;
    char *version;
    if (ptr->ai_family == AF_INET) {
      struct sockaddr_in *ipv4 = (struct sockaddr_in *)ptr->ai_addr;
      address = &(ipv4->sin_addr);
      version = "IPv4";
    } else if (ptr->ai_family == AF_INET6) {
      struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)ptr->ai_addr;
      address = &(ipv6->sin6_addr);
      version = "IPv6";
    } else {
      continue;
    }
    inet_ntop(ptr->ai_family, address, ip, sizeof(ip));
    printf("  %s: %s\n", version, ip);
  }
  freeaddrinfo(result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e38(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x90(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x20(%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,-0x28(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1218 <main+0x88>
mov    0x2dd0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe00(%rip),%rsi
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x5c(%rbp)
jmp    13f1 <main+0x261>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
cmp    $0x3,%eax
jge    1256 <main+0xc6>
mov    0x2d8b(%rip),%rax
mov    (%rax),%esi
lea    0xdd2(%rip),%rdi
call   1070 <fputs@plt>
movl   $0x2,-0x4(%rbp)
movl   $0x1,-0x5c(%rbp)
jmp    13f1 <main+0x261>
jmp    125b <main+0xcb>
lea    -0x48(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1080 <memset@plt>
mov    0x2d66(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
mov    0x2d38(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %esi,%esi
lea    -0x48(%rbp),%rdx
lea    -0x50(%rbp),%rcx
call   10a0 <getaddrinfo@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     12e7 <main+0x157>
mov    0x2d11(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x94(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <gai_strerror@plt>
mov    -0x94(%rbp),%edi
mov    %rax,%rdx
lea    0xd78(%rip),%rsi
call   1090 <fprintf@plt>
movl   $0x3,-0x4(%rbp)
movl   $0x1,-0x5c(%rbp)
jmp    13f1 <main+0x261>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     13da <main+0x24a>
mov    -0x58(%rbp),%rax
mov    (%rax),%rax
mov    0x2cc2(%rip),%rcx
cmp    (%rcx),%rax
jne    134b <main+0x1bb>
mov    -0x58(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    0xd30(%rip),%rax
mov    %rax,-0x70(%rbp)
jmp    1390 <main+0x200>
mov    -0x58(%rbp),%rax
mov    (%rax),%rax
mov    0x2c77(%rip),%rcx
cmp    (%rcx),%rax
jne    1386 <main+0x1f6>
mov    -0x58(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    0xcfa(%rip),%rax
mov    %rax,-0x70(%rbp)
jmp    138b <main+0x1fb>
jmp    13c9 <main+0x239>
jmp    1390 <main+0x200>
mov    -0x88(%rbp),%rdx
mov    -0x90(%rbp),%rax
mov    -0x58(%rbp),%rcx
mov    (%rcx),%rdi
mov    -0x68(%rbp),%rsi
mov    %eax,%ecx
call   1030 <inet_ntop@plt>
mov    -0x88(%rbp),%rdx
mov    -0x70(%rbp),%rsi
lea    0xcba(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x58(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x58(%rbp)
jmp    1305 <main+0x175>
mov    -0x50(%rbp),%rdi
call   10b0 <freeaddrinfo@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x5c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r15
mov    0x2e3d(%rip),%rax
mov    (%rax),%r14d
mov    %rsp,%r13
lea    0xf(%r14),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
cmp    $0x2,%edi
jne    11f2 <main+0x62>
mov    0x8(%r15),%rdi
call   1040 <strlen@plt>
cmp    $0x2,%eax
jg     1215 <main+0x85>
mov    0x2de7(%rip),%rax
mov    (%rax),%esi
lea    0xe2e(%rip),%rdi
call   1070 <fputs@plt>
mov    $0x2,%r15d
jmp    131a <main+0x18a>
mov    0x2dc7(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xdfb(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%r15d
jmp    131a <main+0x18a>
lea    -0x50(%rbp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1080 <memset@plt>
mov    0x2da9(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
mov    0x2d7b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    0x8(%r15),%rdi
lea    -0x30(%rbp),%rcx
xor    %esi,%esi
mov    %rbx,%rdx
call   10a0 <getaddrinfo@plt>
test   %eax,%eax
je     1284 <main+0xf4>
mov    0x2d61(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1060 <gai_strerror@plt>
lea    0xdd8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1090 <fprintf@plt>
mov    $0x3,%r15d
jmp    131a <main+0x18a>
mov    0x8(%r15),%rsi
lea    0xdc9(%rip),%rdi
xor    %r15d,%r15d
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x30(%rbp),%r12
test   %r12,%r12
je     1313 <main+0x183>
mov    0x2d37(%rip),%rax
mov    (%rax),%rax
jmp    12e8 <main+0x158>
xchg   %ax,%ax
mov    0x8(%r12),%rsi
mov    %r13,%rdx
mov    %r14d,%ecx
call   1030 <inet_ntop@plt>
lea    0xdb5(%rip),%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2d05(%rip),%rax
mov    (%rax),%rax
mov    0x10(%r12),%r12
test   %r12,%r12
je     130d <main+0x17d>
mov    (%r12),%rdi
lea    0xd7f(%rip),%rbx
cmp    %rax,%rdi
je     12b0 <main+0x120>
lea    0xd78(%rip),%rbx
mov    0x2cca(%rip),%rcx
cmp    (%rcx),%rdi
je     12b0 <main+0x120>
jmp    12de <main+0x14e>
mov    -0x30(%rbp),%rdi
jmp    1315 <main+0x185>
xor    %edi,%edi
call   10b0 <freeaddrinfo@plt>
mov    %r15d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.addrinfo = type { i64, i64, %struct.addrinfo*, i32 }
@INET6_ADDRSTRLEN = global i32 0
@stderr = global i32 0
@.str = [16 x i8] c"usage: %s host\0A\00"
@.str.1 = [55 x i8] c"length of the hostname must be at least 3 characters.\0A\00"
@AF_UNSPEC = global i64 0
@SOCK_STREAM = global i32 0
@.str.2 = [17 x i8] c"getaddrinfo: %s\0A\00"
@.str.3 = [26 x i8] c"ip-adresses for host %s:\0A\00"
@AF_INET = global i64 0
@.str.4 = [5 x i8] c"IPv4\00"
@AF_INET6 = global i64 0
@.str.5 = [5 x i8] c"IPv6\00"
@.str.6 = [10 x i8] c" %s: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.addrinfo
%4 = alloca %struct.addrinfo*
%5 = load i32, i32* @INET6_ADDRSTRLEN
%6 = zext i32 %5 to i64
%7 = alloca i8, i64 %6
%8 = bitcast %struct.addrinfo* %3 to i8*
%9 = bitcast %struct.addrinfo** %4 to i8*
%10 = icmp eq i32 %0, 2
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %1
%14 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %70
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32 @strlen(i8* %17)
%19 = icmp slt i32 %18, 3
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i32, i32* @stderr
%22 = tail call i32 @fputs(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0), i32 %21)
br label %70
23: ; preds = %15
%24 = call i32 @memset(%struct.addrinfo* %3, i32 0, i32 32)
%25 = load i64, i64* @AF_UNSPEC
%26 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 0
store i64 %25, i64* %26
%27 = load i32, i32* @SOCK_STREAM
%28 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 3
store i32 %27, i32* %28
%29 = load i8*, i8** %16
%30 = call i32 @getaddrinfo(i8* %29, i32 0, %struct.addrinfo* %3, %struct.addrinfo** %4)
%31 = icmp eq i32 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %23
%33 = load i32, i32* @stderr
%34 = call i8* @gai_strerror(i32 %30)
%35 = call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %34)
br label %70
36: ; preds = %23
%37 = load i8*, i8** %16
%38 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %37)
%39 = load %struct.addrinfo*, %struct.addrinfo** %4
%40 = icmp eq %struct.addrinfo* %39, null
br i1 %40, label %67, label %41
41: ; preds = %36
%42 = load i64, i64* @AF_INET
br label %43
43: ; preds = %41, %60
%44 = phi i64 [ %61, %60 ], [ %42, %41 ]
%45 = phi %struct.addrinfo* [ %63, %60 ], [ %39, %41 ]
%46 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %45, i64 0, i32 0
%47 = load i64, i64* %46
%48 = icmp eq i64 %47, %44
br i1 %48, label %52, label %49
49: ; preds = %43
%50 = load i64, i64* @AF_INET6
%51 = icmp eq i64 %47, %50
br i1 %51, label %52, label %60
52: ; preds = %49, %43
%53 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %43 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), %49 ]
%54 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %45, i64 0, i32 1
%55 = load i64, i64* %54
%56 = inttoptr i64 %55 to i8*
%57 = call i32 @inet_ntop(i64 %47, i8* %56, i8* %7, i32 %5)
%58 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* %53, i8* %7)
%59 = load i64, i64* @AF_INET
br label %60
60: ; preds = %49, %52
%61 = phi i64 [ %44, %49 ], [ %59, %52 ]
%62 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %45, i64 0, i32 2
%63 = load %struct.addrinfo*, %struct.addrinfo** %62
%64 = icmp eq %struct.addrinfo* %63, null
br i1 %64, label %65, label %43
65: ; preds = %60
%66 = load %struct.addrinfo*, %struct.addrinfo** %4
br label %67
67: ; preds = %65, %36
%68 = phi %struct.addrinfo* [ %66, %65 ], [ null, %36 ]
%69 = call i32 @freeaddrinfo(%struct.addrinfo* %68)
br label %70
70: ; preds = %67, %32, %20, %11
%71 = phi i32 [ 1, %11 ], [ 2, %20 ], [ 3, %32 ], [ 0, %67 ]
ret i32 %71
}