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

/* Variables and functions */
scalar_t__ AF_INET;
scalar_t__ AF_INET6;
scalar_t__ AF_UNSPEC;
int /*<<< orphan*/ AI_PASSIVE;
int /*<<< orphan*/ EXIT_FAILURE;
int NI_MAXHOST;
int /*<<< orphan*/ NI_NUMERICHOST;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
char *gai_strerror(int);
int getaddrinfo(char *, int /*<<< orphan*/ *, struct addrinfo *,
                struct addrinfo **);
int getnameinfo(int /*<<< orphan*/, int /*<<< orphan*/, char *, int,
                int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc != 2) {
    fprintf(stderr, "usage: %s google.com\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  struct addrinfo hints, *res;
  memset(&hints, 0, sizeof hints);
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  hints.ai_flags = AI_PASSIVE;
  int status = getaddrinfo(argv[1], NULL, &hints, &res);
  if (status != 0) {
    fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(status));
    exit(EXIT_FAILURE);
  }
  printf("IP addresses for %s:\n\n", argv[1]);
  for (struct addrinfo *p = res; p != NULL; p = p->ai_next) {
    char *ipver = NULL;
    if (p->ai_family == AF_INET)
      ipver = "IPv4";
    else if (p->ai_family == AF_INET6)
      ipver = "IPv6";
    else
      ipver = "IPv?";
    char buffer[NI_MAXHOST];
    int err = getnameinfo(p->ai_addr, p->ai_addrlen, buffer, NI_MAXHOST, NULL,
                          0, NI_NUMERICHOST);
    if (err != 0)
      fprintf(stderr, "Error in getnameinfo: %s\n", gai_strerror(err));
    else
      printf("  %s: %s\n", ipver, buffer);
  }
  freeaddrinfo(res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11cd <main+0x4d>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe46(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2de2(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1050 <memset@plt>
mov    0x2df4(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    0x2dc6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2dea(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x30(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1090 <getaddrinfo@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     125d <main+0xdd>
mov    0x2d90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x68(%rbp)
mov    -0x3c(%rbp),%edi
call   1040 <gai_strerror@plt>
mov    -0x68(%rbp),%edi
mov    %rax,%rdx
lea    0xdcc(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2d52(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     13b4 <main+0x234>
movq   $0x0,-0x50(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%rax
mov    0x2d44(%rip),%rcx
cmp    (%rcx),%rax
jne    12b5 <main+0x135>
lea    0xd92(%rip),%rax
mov    %rax,-0x50(%rbp)
jmp    12ec <main+0x16c>
mov    -0x48(%rbp),%rax
mov    (%rax),%rax
mov    0x2d0d(%rip),%rcx
cmp    (%rcx),%rax
jne    12dc <main+0x15c>
lea    0xd70(%rip),%rax
mov    %rax,-0x50(%rbp)
jmp    12e7 <main+0x167>
lea    0xd65(%rip),%rax
mov    %rax,-0x50(%rbp)
jmp    12ec <main+0x16c>
mov    0x2cad(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x70(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x60(%rbp)
mov    -0x48(%rbp),%rax
mov    0xc(%rax),%edi
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%esi
mov    0x2c73(%rip),%rax
mov    (%rax),%ecx
mov    0x2c7a(%rip),%rax
mov    (%rax),%eax
xor    %r8d,%r8d
xor    %r9d,%r9d
sub    $0x10,%rsp
mov    %eax,(%rsp)
call   1060 <getnameinfo@plt>
add    $0x10,%rsp
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
je     1386 <main+0x206>
mov    0x2c5e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x74(%rbp)
mov    -0x64(%rbp),%edi
call   1040 <gai_strerror@plt>
mov    -0x74(%rbp),%edi
mov    %rax,%rdx
lea    0xcd1(%rip),%rsi
call   1070 <fprintf@plt>
jmp    139c <main+0x21c>
mov    -0x70(%rbp),%rdx
mov    -0x50(%rbp),%rsi
lea    0xcd2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x58(%rbp),%rax
mov    %rax,%rsp
mov    -0x48(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x48(%rbp)
jmp    127b <main+0xfb>
mov    -0x38(%rbp),%rdi
call   10a0 <freeaddrinfo@plt>
xor    %eax,%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    $0x38,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1313 <main+0x193>
lea    -0x58(%rbp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1050 <memset@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
mov    0x2df3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2e17(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    0x8(%rbx),%rdi
lea    -0x30(%rbp),%rcx
xor    %esi,%esi
mov    %r14,%rdx
call   1090 <getaddrinfo@plt>
test   %eax,%eax
jne    1328 <main+0x1a8>
mov    0x8(%rbx),%rsi
lea    0xe2c(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x30(%rbp),%r12
test   %r12,%r12
jne    1266 <main+0xe6>
jmp    12fa <main+0x17a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %r14,%r13
lea    0xe1e(%rip),%rsi
lea    0xe12(%rip),%rax
cmove  %rax,%rsi
cmp    %r15,%r13
lea    0xdff(%rip),%rax
cmove  %rax,%rsi
lea    0xe1d(%rip),%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsp
mov    0x10(%r12),%r12
test   %r12,%r12
je     12f6 <main+0x176>
mov    %rsp,-0x38(%rbp)
mov    (%r12),%r13
mov    0x2d6b(%rip),%rax
mov    (%rax),%r15
mov    0x2d51(%rip),%rax
mov    (%rax),%r14
mov    0x2d17(%rip),%rcx
mov    (%rcx),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x8(%r12),%esi
mov    0xc(%r12),%edi
mov    (%rcx),%ecx
mov    0x2d01(%rip),%rax
mov    (%rax),%eax
sub    $0x8,%rsp
mov    %rbx,%rdx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
call   1060 <getnameinfo@plt>
add    $0x10,%rsp
test   %eax,%eax
je     1220 <main+0xa0>
mov    0x2ce9(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1040 <gai_strerror@plt>
mov    %ebx,%edi
lea    0xd64(%rip),%rsi
mov    %rax,%rdx
call   1070 <fprintf@plt>
jmp    1254 <main+0xd4>
mov    -0x30(%rbp),%rbx
mov    %rbx,%rdi
call   10a0 <freeaddrinfo@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2ca6(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xcda(%rip),%rsi
jmp    1344 <main+0x1c4>
mov    0x2c91(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1040 <gai_strerror@plt>
lea    0xcd7(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1070 <fprintf@plt>
mov    0x2c58(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

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

LLVM IR (-O2):
%struct.addrinfo = type { i64, i32, i32, %struct.addrinfo*, i32, i32 }
@stderr = global i32 0
@.str = [22 x i8] c"usage: %s google.com\0A\00"
@EXIT_FAILURE = global i32 0
@AF_UNSPEC = global i64 0
@SOCK_STREAM = global i32 0
@AI_PASSIVE = global i32 0
@.str.1 = [17 x i8] c"getaddrinfo: %s\0A\00"
@.str.2 = [23 x i8] c"IP addresses for %s:\0A\0A\00"
@AF_INET = global i64 0
@.str.3 = [5 x i8] c"IPv4\00"
@AF_INET6 = global i64 0
@.str.4 = [5 x i8] c"IPv6\00"
@.str.5 = [5 x i8] c"IPv?\00"
@NI_MAXHOST = global i32 0
@NI_NUMERICHOST = global i32 0
@.str.6 = [26 x i8] c"Error in getnameinfo: %s\0A\00"
@.str.7 = [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 = icmp eq i32 %0, 2
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %2
%13 = bitcast %struct.addrinfo* %3 to i8*
%14 = bitcast %struct.addrinfo** %4 to i8*
%15 = call i32 @memset(%struct.addrinfo* %3, i32 0, i32 32)
%16 = load i64, i64* @AF_UNSPEC
%17 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 0
store i64 %16, i64* %17
%18 = load i32, i32* @SOCK_STREAM
%19 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 5
store i32 %18, i32* %19
%20 = load i32, i32* @AI_PASSIVE
%21 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 4
store i32 %20, i32* %21
%22 = getelementptr inbounds i8*, i8** %1, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @getaddrinfo(i8* %23, i32* null, %struct.addrinfo* %3, %struct.addrinfo** %4)
%25 = icmp eq i32 %24, 0
br i1 %25, label %32, label %26
26: ; preds = %12
%27 = load i32, i32* @stderr
%28 = call i8* @gai_strerror(i32 %24)
%29 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %28)
%30 = load i32, i32* @EXIT_FAILURE
%31 = call i32 @exit(i32 %30)
unreachable
32: ; preds = %12
%33 = load i8*, i8** %22
%34 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %33)
%35 = load %struct.addrinfo*, %struct.addrinfo** %4
%36 = icmp eq %struct.addrinfo* %35, null
br i1 %36, label %39, label %42
37: ; preds = %70
%38 = load %struct.addrinfo*, %struct.addrinfo** %4
br label %39
39: ; preds = %37, %32
%40 = phi %struct.addrinfo* [ %38, %37 ], [ null, %32 ]
%41 = call i32 @freeaddrinfo(%struct.addrinfo* %40)
ret i32 0
42: ; preds = %32, %70
%43 = phi %struct.addrinfo* [ %72, %70 ], [ %35, %32 ]
%44 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %43, i64 0, i32 0
%45 = load i64, i64* %44
%46 = load i64, i64* @AF_INET
%47 = load i64, i64* @AF_INET6
%48 = load i32, i32* @NI_MAXHOST
%49 = zext i32 %48 to i64
%50 = call i8* @llvm.stacksave()
%51 = alloca i8, i64 %49
%52 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %43, i64 0, i32 2
%53 = load i32, i32* %52
%54 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %43, i64 0, i32 1
%55 = load i32, i32* %54
%56 = load i32, i32* @NI_MAXHOST
%57 = load i32, i32* @NI_NUMERICHOST
%58 = call i32 @getnameinfo(i32 %53, i32 %55, i8* %51, i32 %56, i32* null, i32 0, i32 %57)
%59 = icmp eq i32 %58, 0
br i1 %59, label %64, label %60
60: ; preds = %42
%61 = load i32, i32* @stderr
%62 = call i8* @gai_strerror(i32 %58)
%63 = call i32 @fprintf(i32 %61, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %62)
br label %70
64: ; preds = %42
%65 = icmp eq i64 %45, %46
%66 = icmp eq i64 %45, %47
%67 = select i1 %66, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0)
%68 = select i1 %65, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %67
%69 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %68, i8* %51)
br label %70
70: ; preds = %64, %60
%71 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %43, i64 0, i32 3
%72 = load %struct.addrinfo*, %struct.addrinfo** %71
%73 = icmp eq %struct.addrinfo* %72, null
br i1 %73, label %37, label %42
}