#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;
  int /*<<< orphan*/ ai_addrlen;
  struct addrinfo *ai_next;
  int /*<<< orphan*/ ai_flags;
  int /*<<< orphan*/ ai_socktype;
};
typedef int /*<<< orphan*/ hostbuf;
typedef int /*<<< orphan*/ hints;

/* Variables and functions */
scalar_t__ AF_INET;
scalar_t__ AF_INET6;
int /*<<< orphan*/ AI_NUMERICHOST;
int NI_MAXHOST;
int /*<<< orphan*/ NI_NAMEREQD;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, ...);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
char *gai_strerror(int);
int getaddrinfo(char const *, char *, struct addrinfo *, struct addrinfo **);
int getnameinfo(scalar_t__, int /*<<< orphan*/, char *, int, char *,
                int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ inet_ntop(scalar_t__, char const *, char *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strchr(char const *, char);
int main(int argc, char **argv) {
  char hostbuf[NI_MAXHOST];
  struct addrinfo hints;
  struct addrinfo *res0;
  struct addrinfo *res;
  const char *host;
  const char *addr;
  int err;
  if (argc != 2) {
    fprintf(stderr, "usage: %s ipaddres\n", argv[0]);
    exit(1);
  }
  host = argv[1];
  memset((char *)&hints, 0, sizeof(hints));
  hints.ai_family = (strchr(host, ':') ? AF_INET6 : AF_INET);
  hints.ai_socktype = SOCK_STREAM;
  hints.ai_flags |= AI_NUMERICHOST;
  if ((err = getaddrinfo(host, ((char *)0), &hints, &res0)) != 0) {
    fprintf(stderr, "getaddrinfo %s: %s\n", host, gai_strerror(err));
    exit(1);
  }
  for (res = res0; res != 0; res = res->ai_next) {
    err = getnameinfo(res->ai_addr, res->ai_addrlen, hostbuf, sizeof(hostbuf),
                      ((char *)0), 0, NI_NAMEREQD);
    if (err) {
      fprintf(stderr, "getnameinfo %s: %s\n", host, gai_strerror(err));
      exit(1);
    }
    printf("Hostname:\t%s\n", hostbuf);
    addr = (res->ai_family == AF_INET
                ? (char *)&((struct sockaddr_in *)res->ai_addr)->sin_addr
                : (char *)&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr);
    if (inet_ntop(res->ai_family, addr, hostbuf, sizeof(hostbuf)) == 0) {
      perror("inet_ntop:");
      exit(1);
    }
    printf("Address:\t%s\n", hostbuf);
  }
  freeaddrinfo(res0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2de0(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x80(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     122b <main+0x7b>
mov    0x2db6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xde6(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x60(%rbp)
lea    -0x48(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1070 <memset@plt>
mov    -0x60(%rbp),%rdi
mov    $0x3a,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     1275 <main+0xc5>
mov    0x2d6a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x88(%rbp)
jmp    1286 <main+0xd6>
mov    0x2d64(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    0x2d20(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    0x2d34(%rip),%rax
mov    (%rax),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x60(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x48(%rbp),%rdx
lea    -0x50(%rbp),%rcx
call   10c0 <getaddrinfo@plt>
mov    %eax,-0x6c(%rbp)
cmp    $0x0,%eax
je     1317 <main+0x167>
mov    0x2cec(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x94(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x6c(%rbp),%edi
call   1060 <gai_strerror@plt>
mov    -0x94(%rbp),%edi
mov    -0x90(%rbp),%rdx
mov    %rax,%rcx
lea    0xd0e(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     1469 <main+0x2b9>
mov    -0x78(%rbp),%rdx
mov    -0x80(%rbp),%rax
mov    -0x58(%rbp),%rcx
mov    0x8(%rcx),%rdi
mov    -0x58(%rbp),%rcx
mov    0x10(%rcx),%esi
mov    %eax,%ecx
mov    0x2ca6(%rip),%rax
mov    (%rax),%eax
xor    %r8d,%r8d
xor    %r9d,%r9d
sub    $0x10,%rsp
mov    %eax,(%rsp)
call   1080 <getnameinfo@plt>
add    $0x10,%rsp
mov    %eax,-0x6c(%rbp)
cmpl   $0x0,-0x6c(%rbp)
je     13b9 <main+0x209>
mov    0x2c4a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xa4(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x6c(%rbp),%edi
call   1060 <gai_strerror@plt>
mov    -0xa4(%rbp),%edi
mov    -0xa0(%rbp),%rdx
mov    %rax,%rcx
lea    0xc80(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x78(%rbp),%rsi
lea    0xc78(%rip),%rdi
call   1050 <printf@plt>
mov    -0x58(%rbp),%rax
mov    (%rax),%rax
mov    0x2c09(%rip),%rcx
cmp    (%rcx),%rax
jne    13f4 <main+0x244>
mov    -0x58(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0xb0(%rbp)
jmp    1403 <main+0x253>
mov    -0x58(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x78(%rbp),%rdx
mov    -0x80(%rbp),%rax
mov    -0xb0(%rbp),%rcx
mov    %rcx,-0x68(%rbp)
mov    -0x58(%rbp),%rcx
mov    (%rcx),%rdi
mov    -0x68(%rbp),%rsi
mov    %eax,%ecx
call   1030 <inet_ntop@plt>
cmp    $0x0,%rax
jne    1448 <main+0x298>
lea    0xc11(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x78(%rbp),%rsi
lea    0xc02(%rip),%rdi
call   1050 <printf@plt>
mov    -0x58(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x58(%rbp)
jmp    131f <main+0x16f>
mov    -0x50(%rbp),%rdi
call   10d0 <freeaddrinfo@plt>
xor    %edi,%edi
call   10b0 <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
mov    0x2de8(%rip),%rax
mov    (%rax),%r15d
mov    %rsp,%rbx
lea    0xf(%r15),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
cmp    $0x2,%edi
jne    1213 <main+0x63>
mov    0x8(%rsi),%r13
lea    -0x60(%rbp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1070 <memset@plt>
mov    %r13,%rdi
mov    $0x3a,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1237 <main+0x87>
mov    0x2dcf(%rip),%rax
jmp    123e <main+0x8e>
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xdda(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    0x2d92(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    0x2d6c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2d80(%rip),%rax
mov    (%rax),%eax
or     %eax,-0x40(%rbp)
lea    -0x30(%rbp),%rcx
mov    %r13,%rdi
xor    %esi,%esi
mov    %r12,%rdx
call   10c0 <getaddrinfo@plt>
test   %eax,%eax
jne    1282 <main+0xd2>
mov    -0x30(%rbp),%r14
test   %r14,%r14
jne    12b2 <main+0x102>
xor    %edi,%edi
jmp    1339 <main+0x189>
mov    0x2d37(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1060 <gai_strerror@plt>
lea    0xd7b(%rip),%rsi
mov    %ebx,%edi
mov    %r13,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    %r13,-0x38(%rbp)
lea    0xd7f(%rip),%r12
lea    0xd91(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x8(%r14),%rdi
mov    0x10(%r14),%esi
mov    0x2d11(%rip),%rax
mov    (%rax),%eax
sub    $0x8,%rsp
mov    %rbx,%rdx
mov    %r15d,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
call   1080 <getnameinfo@plt>
add    $0x10,%rsp
test   %eax,%eax
jne    1345 <main+0x195>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    (%r14),%rdi
mov    0x8(%r14),%rsi
mov    %rbx,%rdx
mov    %r15d,%ecx
call   1030 <inet_ntop@plt>
test   %rax,%rax
je     1367 <main+0x1b7>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    0x18(%r14),%r14
test   %r14,%r14
jne    12d0 <main+0x120>
mov    -0x30(%rbp),%rdi
call   10d0 <freeaddrinfo@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
mov    0x2c74(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1060 <gai_strerror@plt>
lea    0xccc(%rip),%rsi
mov    %ebx,%edi
mov    -0x38(%rbp),%rdx
jmp    129e <main+0xee>
lea    0xcdc(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i64, i64, i32, %struct.addrinfo*, i32, i32 }
%struct.sockaddr_in = type { i32 }
%struct.sockaddr_in6 = type { i32 }
@NI_MAXHOST = global i32 0
@stderr = global i32 0
@.str = [20 x i8] c"usage: %s ipaddres\0A\00"
@AF_INET6 = global i64 0
@AF_INET = global i64 0
@SOCK_STREAM = global i32 0
@AI_NUMERICHOST = global i32 0
@.str.1 = [20 x i8] c"getaddrinfo %s: %s\0A\00"
@NI_NAMEREQD = global i32 0
@.str.2 = [20 x i8] c"getnameinfo %s: %s\0A\00"
@.str.3 = [14 x i8] c"Hostname:\09%s\0A\00"
@.str.4 = [11 x i8] c"inet_ntop:\00"
@.str.5 = [13 x i8] c"Address:\09%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca %struct.addrinfo
%9 = alloca %struct.addrinfo*
%10 = alloca %struct.addrinfo*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* @NI_MAXHOST
%15 = zext i32 %14 to i64
%16 = call i8* @llvm.stacksave()
store i8* %16, i8** %6
%17 = alloca i8, i64 %15
store i64 %15, i64* %7
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 2
br i1 %19, label %20, label %27
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = call i32 @exit(i32 1)
unreachable
27: ; preds = %2
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
store i8* %30, i8** %11
%31 = bitcast %struct.addrinfo* %8 to i8*
%32 = call i32 @memset(i8* %31, i32 0, i32 40)
%33 = load i8*, i8** %11
%34 = call i64 @strchr(i8* %33, i8 signext 58)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %27
%37 = load i64, i64* @AF_INET6
br label %40
38: ; preds = %27
%39 = load i64, i64* @AF_INET
br label %40
40: ; preds = %38, %36
%41 = phi i64 [ %37, %36 ], [ %39, %38 ]
%42 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %8, i32 0, i32 0
store i64 %41, i64* %42
%43 = load i32, i32* @SOCK_STREAM
%44 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %8, i32 0, i32 5
store i32 %43, i32* %44
%45 = load i32, i32* @AI_NUMERICHOST
%46 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %8, i32 0, i32 4
%47 = load i32, i32* %46
%48 = or i32 %47, %45
store i32 %48, i32* %46
%49 = load i8*, i8** %11
%50 = call i32 @getaddrinfo(i8* %49, i8* null, %struct.addrinfo* %8, %struct.addrinfo** %9)
store i32 %50, i32* %13
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %59
52: ; preds = %40
%53 = load i32, i32* @stderr
%54 = load i8*, i8** %11
%55 = load i32, i32* %13
%56 = call i8* @gai_strerror(i32 %55)
%57 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %54, i8* %56)
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %40
%60 = load %struct.addrinfo*, %struct.addrinfo** %9
store %struct.addrinfo* %60, %struct.addrinfo** %10
br label %61
61: ; preds = %118, %59
%62 = load %struct.addrinfo*, %struct.addrinfo** %10
%63 = icmp ne %struct.addrinfo* %62, null
br i1 %63, label %64, label %122
64: ; preds = %61
%65 = load %struct.addrinfo*, %struct.addrinfo** %10
%66 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %65, i32 0, i32 1
%67 = load i64, i64* %66
%68 = load %struct.addrinfo*, %struct.addrinfo** %10
%69 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %68, i32 0, i32 2
%70 = load i32, i32* %69
%71 = trunc i64 %15 to i32
%72 = load i32, i32* @NI_NAMEREQD
%73 = call i32 @getnameinfo(i64 %67, i32 %70, i8* %17, i32 %71, i8* null, i32 0, i32 %72)
store i32 %73, i32* %13
%74 = load i32, i32* %13
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %83
76: ; preds = %64
%77 = load i32, i32* @stderr
%78 = load i8*, i8** %11
%79 = load i32, i32* %13
%80 = call i8* @gai_strerror(i32 %79)
%81 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %78, i8* %80)
%82 = call i32 @exit(i32 1)
unreachable
83: ; preds = %64
%84 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%85 = load %struct.addrinfo*, %struct.addrinfo** %10
%86 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %85, i32 0, i32 0
%87 = load i64, i64* %86
%88 = load i64, i64* @AF_INET
%89 = icmp eq i64 %87, %88
br i1 %89, label %90, label %97
90: ; preds = %83
%91 = load %struct.addrinfo*, %struct.addrinfo** %10
%92 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %91, i32 0, i32 1
%93 = load i64, i64* %92
%94 = inttoptr i64 %93 to %struct.sockaddr_in*
%95 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %94, i32 0, i32 0
%96 = bitcast i32* %95 to i8*
br label %104
97: ; preds = %83
%98 = load %struct.addrinfo*, %struct.addrinfo** %10
%99 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %98, i32 0, i32 1
%100 = load i64, i64* %99
%101 = inttoptr i64 %100 to %struct.sockaddr_in6*
%102 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %101, i32 0, i32 0
%103 = bitcast i32* %102 to i8*
br label %104
104: ; preds = %97, %90
%105 = phi i8* [ %96, %90 ], [ %103, %97 ]
store i8* %105, i8** %12
%106 = load %struct.addrinfo*, %struct.addrinfo** %10
%107 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %106, i32 0, i32 0
%108 = load i64, i64* %107
%109 = load i8*, i8** %12
%110 = trunc i64 %15 to i32
%111 = call i64 @inet_ntop(i64 %108, i8* %109, i8* %17, i32 %110)
%112 = icmp eq i64 %111, 0
br i1 %112, label %113, label %116
113: ; preds = %104
%114 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%115 = call i32 @exit(i32 1)
unreachable
116: ; preds = %104
%117 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %17)
br label %118
118: ; preds = %116
%119 = load %struct.addrinfo*, %struct.addrinfo** %10
%120 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %119, i32 0, i32 3
%121 = load %struct.addrinfo*, %struct.addrinfo** %120
store %struct.addrinfo* %121, %struct.addrinfo** %10
br label %61
122: ; preds = %61
%123 = load %struct.addrinfo*, %struct.addrinfo** %9
%124 = call i32 @freeaddrinfo(%struct.addrinfo* %123)
%125 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.addrinfo = type { i64, i64, i32, %struct.addrinfo*, i32, i32 }
@NI_MAXHOST = global i32 0
@stderr = global i32 0
@.str = [20 x i8] c"usage: %s ipaddres\0A\00"
@AF_INET6 = global i64 0
@AF_INET = global i64 0
@SOCK_STREAM = global i32 0
@AI_NUMERICHOST = global i32 0
@.str.1 = [20 x i8] c"getaddrinfo %s: %s\0A\00"
@NI_NAMEREQD = global i32 0
@.str.2 = [20 x i8] c"getnameinfo %s: %s\0A\00"
@.str.3 = [14 x i8] c"Hostname:\09%s\0A\00"
@.str.4 = [11 x i8] c"inet_ntop:\00"
@.str.5 = [13 x i8] c"Address:\09%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.addrinfo
%4 = alloca %struct.addrinfo*
%5 = load i32, i32* @NI_MAXHOST
%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 %16, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %1
%14 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @memset(i8* %8, i32 0, i32 40)
%20 = call i64 @strchr(i8* %18, i8 signext 58)
%21 = icmp eq i64 %20, 0
%22 = load i64, i64* @AF_INET6
%23 = load i64, i64* @AF_INET
%24 = select i1 %21, i64 %23, i64 %22
%25 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 0
store i64 %24, i64* %25
%26 = load i32, i32* @SOCK_STREAM
%27 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 5
store i32 %26, i32* %27
%28 = load i32, i32* @AI_NUMERICHOST
%29 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 4
%30 = load i32, i32* %29
%31 = or i32 %30, %28
store i32 %31, i32* %29
%32 = call i32 @getaddrinfo(i8* %18, i8* null, %struct.addrinfo* %3, %struct.addrinfo** %4)
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %16
%35 = load %struct.addrinfo*, %struct.addrinfo** %4
%36 = icmp eq %struct.addrinfo* %35, null
br i1 %36, label %74, label %42
37: ; preds = %16
%38 = load i32, i32* @stderr
%39 = call i8* @gai_strerror(i32 %32)
%40 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %18, i8* %39)
%41 = call i32 @exit(i32 1)
unreachable
42: ; preds = %34, %67
%43 = phi %struct.addrinfo* [ %70, %67 ], [ %35, %34 ]
%44 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %43, i64 0, i32 1
%45 = load i64, i64* %44
%46 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %43, i64 0, i32 2
%47 = load i32, i32* %46
%48 = load i32, i32* @NI_NAMEREQD
%49 = call i32 @getnameinfo(i64 %45, i32 %47, i8* %7, i32 %5, i8* null, i32 0, i32 %48)
%50 = icmp eq i32 %49, 0
br i1 %50, label %56, label %51
51: ; preds = %42
%52 = load i32, i32* @stderr
%53 = call i8* @gai_strerror(i32 %49)
%54 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %18, i8* %53)
%55 = call i32 @exit(i32 1)
unreachable
56: ; preds = %42
%57 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %7)
%58 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %43, i64 0, i32 0
%59 = load i64, i64* %44
%60 = inttoptr i64 %59 to i8*
%61 = load i64, i64* %58
%62 = call i64 @inet_ntop(i64 %61, i8* %60, i8* %7, i32 %5)
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %56
%65 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%66 = call i32 @exit(i32 1)
unreachable
67: ; preds = %56
%68 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %7)
%69 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %43, i64 0, i32 3
%70 = load %struct.addrinfo*, %struct.addrinfo** %69
%71 = icmp eq %struct.addrinfo* %70, null
br i1 %71, label %72, label %42
72: ; preds = %67
%73 = load %struct.addrinfo*, %struct.addrinfo** %4
br label %74
74: ; preds = %72, %34
%75 = phi %struct.addrinfo* [ %73, %72 ], [ null, %34 ]
%76 = call i32 @freeaddrinfo(%struct.addrinfo* %75)
%77 = call i32 @exit(i32 0)
unreachable
}