#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct sockaddr_in6 {
  int dummy;
};
struct sockaddr_in {
  int dummy;
};
struct ifaddrs {
  char *ifa_name;
  TYPE_1__ *ifa_addr;
  struct ifaddrs *ifa_next;
};
struct TYPE_2__ {
  int sa_family;
};

/* Variables and functions */
int AF_INET;
int AF_INET6;
int /*<<< orphan*/ EXIT_FAILURE;
int NI_MAXHOST;
int /*<<< orphan*/ NI_NUMERICHOST;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ freeifaddrs(struct ifaddrs *);
char *gai_strerror(int);
int getifaddrs(struct ifaddrs **);
int getnameinfo(TYPE_1__ *, int, char *, int, int /*<<< orphan*/ *,
                int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ *strstr(char *, char *);
void get_ip(char *dirIP) {
  struct ifaddrs *ifaddr, *ifa;
  int family, s;
  char host[NI_MAXHOST];
  if (getifaddrs(&ifaddr) == -1) {
    perror("getifaddrs");
    exit(EXIT_FAILURE);
  }
  for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
    family = ifa->ifa_addr->sa_family;
    printf("%s  address family: %d%s\n", ifa->ifa_name, family,
           (family == 17)         ? " (AF_PACKET)"
           : (family == AF_INET)  ? " (AF_INET)"
           : (family == AF_INET6) ? " (AF_INET6)"
                                  : "");
    if (family == AF_INET || family == AF_INET6) {
      s = getnameinfo(ifa->ifa_addr,
                      (family == AF_INET) ? sizeof(struct sockaddr_in)
                                          : sizeof(struct sockaddr_in6),
                      host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
      if (s != 0) {
        printf("getnameinfo() failed: %s\n", gai_strerror(s));
        exit(EXIT_FAILURE);
      }
      printf("\taddress: <%s>\n", host);
      strcpy(dirIP, host);
      if ((strcmp(dirIP, "127.0.0.1") != 0) &&
          (strcmp(dirIP, "0.0.0.0") != 0) &&
          (strstr(dirIP, "169.254.") == NULL)) {
        freeifaddrs(ifaddr);
        return;
      }
    }
  }
  freeifaddrs(ifaddr);
}


x86 assembly (clang, -O0):
<get_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e0d(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
lea    -0x10(%rbp),%rdi
call   1080 <getifaddrs@plt>
cmp    $0xffffffff,%eax
jne    1204 <get_ip+0x64>
lea    0xe0f(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     13f8 <get_ip+0x258>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x11,-0x1c(%rbp)
jne    124f <get_ip+0xaf>
lea    0xddf(%rip),%rax
mov    %rax,-0x58(%rbp)
jmp    129d <get_ip+0xfd>
mov    -0x1c(%rbp),%eax
mov    0x2d8f(%rip),%rcx
cmp    (%rcx),%eax
jne    1271 <get_ip+0xd1>
lea    0xdca(%rip),%rax
mov    %rax,-0x60(%rbp)
jmp    1295 <get_ip+0xf5>
mov    -0x1c(%rbp),%edx
mov    0x2d65(%rip),%rax
mov    (%rax),%esi
lea    0xdee(%rip),%rax
lea    0xdb2(%rip),%rcx
cmp    %esi,%edx
cmove  %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x44(%rbp),%edx
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rcx
lea    0xd5c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    0x2d28(%rip),%rcx
cmp    (%rcx),%eax
je     12da <get_ip+0x13a>
mov    -0x1c(%rbp),%eax
mov    0x2d0e(%rip),%rcx
cmp    (%rcx),%eax
jne    13e2 <get_ip+0x242>
mov    -0x40(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x1c(%rbp),%ecx
mov    0x2cf8(%rip),%rax
mov    (%rax),%esi
mov    $0x4,%eax
cmp    %esi,%ecx
cmove  %rax,%rax
mov    %eax,%esi
mov    0x2cba(%rip),%rax
mov    (%rax),%ecx
mov    0x2cc1(%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,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     135b <get_ip+0x1bb>
mov    -0x20(%rbp),%edi
call   1050 <gai_strerror@plt>
mov    %rax,%rsi
lea    0xd03(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2c74(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    -0x40(%rbp),%rsi
lea    0xcfd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rsi
mov    -0x8(%rbp),%rdi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xcee(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     13dd <get_ip+0x23d>
mov    -0x8(%rbp),%rdi
lea    0xcde(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     13dd <get_ip+0x23d>
mov    -0x8(%rbp),%rdi
lea    0xccc(%rip),%rsi
call   10c0 <strstr@plt>
cmp    $0x0,%rax
jne    13dd <get_ip+0x23d>
mov    -0x10(%rbp),%rdi
call   1090 <freeifaddrs@plt>
movl   $0x1,-0x34(%rbp)
jmp    1408 <get_ip+0x268>
jmp    13e2 <get_ip+0x242>
jmp    13e7 <get_ip+0x247>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    120c <get_ip+0x6c>
mov    -0x10(%rbp),%rdi
call   1090 <freeifaddrs@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ip>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r14
mov    %rsp,%r15
mov    0x2e02(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    -0x30(%rbp),%rdi
call   1080 <getifaddrs@plt>
cmp    $0xffffffff,%eax
je     135d <get_ip+0x1bd>
mov    -0x30(%rbp),%r13
test   %r13,%r13
je     131e <get_ip+0x17e>
mov    %r15,-0x38(%rbp)
mov    0x2ded(%rip),%r15
jmp    120d <get_ip+0x6d>
nopl   (%rax)
mov    0x10(%r13),%r13
test   %r13,%r13
je     1314 <get_ip+0x174>
mov    0x8(%r13),%rax
mov    (%rax),%r12d
lea    0xe0a(%rip),%rcx
cmp    $0x11,%r12d
je     1250 <get_ip+0xb0>
lea    0xe0a(%rip),%rcx
cmp    (%r15),%r12d
je     1250 <get_ip+0xb0>
lea    0xe09(%rip),%rcx
mov    0x2da5(%rip),%rax
cmp    (%rax),%r12d
je     1250 <get_ip+0xb0>
lea    0xe2b(%rip),%rcx
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13),%rsi
lea    0xdb0(%rip),%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    (%r15),%r12d
je     1276 <get_ip+0xd6>
mov    0x2d6f(%rip),%rax
cmp    (%rax),%r12d
jne    1200 <get_ip+0x60>
mov    0x8(%r13),%rdi
mov    0x2d3f(%rip),%rax
mov    (%rax),%ecx
mov    0x2d46(%rip),%rax
mov    (%rax),%eax
sub    $0x8,%rsp
mov    $0x4,%esi
mov    %rbx,%rdx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
call   1060 <getnameinfo@plt>
add    $0x10,%rsp
test   %eax,%eax
jne    1337 <get_ip+0x197>
lea    0xdac(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
lea    0xd9d(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1200 <get_ip+0x60>
mov    %r14,%rdi
lea    0xd8f(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1200 <get_ip+0x60>
mov    %r14,%rdi
lea    0xd7f(%rip),%rsi
call   10c0 <strstr@plt>
test   %rax,%rax
jne    1200 <get_ip+0x60>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%r15
jmp    1320 <get_ip+0x180>
xor    %edi,%edi
call   1090 <freeifaddrs@plt>
mov    %r15,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%edi
call   1050 <gai_strerror@plt>
lea    0xd04(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2c72(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
lea    0xc9c(%rip),%rdi
call   10a0 <perror@plt>
jmp    134f <get_ip+0x1af>

LLVM IR (-O0):
%struct.ifaddrs = type { i8*, %struct.TYPE_2__*, %struct.ifaddrs* }
%struct.TYPE_2__ = type { i32 }
@NI_MAXHOST = global i32 0
@.str = [11 x i8] c"getifaddrs\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [26 x i8] c"%s address family: %d%s\0A\00"
@.str.2 = [13 x i8] c" (AF_PACKET)\00"
@AF_INET = global i32 0
@.str.3 = [11 x i8] c" (AF_INET)\00"
@AF_INET6 = global i32 0
@.str.4 = [12 x i8] c" (AF_INET6)\00"
@.str.5 = [1 x i8] zeroinitializer
@NI_NUMERICHOST = global i32 0
@.str.6 = [26 x i8] c"getnameinfo() failed: %s\0A\00"
@.str.7 = [16 x i8] c"\09address: <%s>\0A\00"
@.str.8 = [10 x i8] c"127.0.0.1\00"
@.str.9 = [8 x i8] c"0.0.0.0\00"
@.str.10 = [9 x i8] c"169.254.\00"
define void @get_ip(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.ifaddrs*
%4 = alloca %struct.ifaddrs*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
store i8* %0, i8** %2
%10 = load i32, i32* @NI_MAXHOST
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %7
%13 = alloca i8, i64 %11
store i64 %11, i64* %8
%14 = call i32 @getifaddrs(%struct.ifaddrs** %3)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %1
%17 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %1
%21 = load %struct.ifaddrs*, %struct.ifaddrs** %3
store %struct.ifaddrs* %21, %struct.ifaddrs** %4
br label %22
22: ; preds = %102, %20
%23 = load %struct.ifaddrs*, %struct.ifaddrs** %4
%24 = icmp ne %struct.ifaddrs* %23, null
br i1 %24, label %25, label %106
25: ; preds = %22
%26 = load %struct.ifaddrs*, %struct.ifaddrs** %4
%27 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %26, i32 0, i32 1
%28 = load %struct.TYPE_2__*, %struct.TYPE_2__** %27
%29 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %28, i32 0, i32 0
%30 = load i32, i32* %29
store i32 %30, i32* %5
%31 = load %struct.ifaddrs*, %struct.ifaddrs** %4
%32 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %31, i32 0, i32 0
%33 = load i8*, i8** %32
%34 = load i32, i32* %5
%35 = load i32, i32* %5
%36 = icmp eq i32 %35, 17
br i1 %36, label %37, label %38
37: ; preds = %25
br label %51
38: ; preds = %25
%39 = load i32, i32* %5
%40 = load i32, i32* @AF_INET
%41 = icmp eq i32 %39, %40
br i1 %41, label %42, label %43
42: ; preds = %38
br label %49
43: ; preds = %38
%44 = load i32, i32* %5
%45 = load i32, i32* @AF_INET6
%46 = icmp eq i32 %44, %45
%47 = zext i1 %46 to i64
%48 = select i1 %46, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0)
br label %49
49: ; preds = %43, %42
%50 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), %42 ], [ %48, %43 ]
br label %51
51: ; preds = %49, %37
%52 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), %37 ], [ %50, %49 ]
%53 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %33, i32 %34, i8* %52)
%54 = load i32, i32* %5
%55 = load i32, i32* @AF_INET
%56 = icmp eq i32 %54, %55
br i1 %56, label %61, label %57
57: ; preds = %51
%58 = load i32, i32* %5
%59 = load i32, i32* @AF_INET6
%60 = icmp eq i32 %58, %59
br i1 %60, label %61, label %101
61: ; preds = %57, %51
%62 = load %struct.ifaddrs*, %struct.ifaddrs** %4
%63 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %62, i32 0, i32 1
%64 = load %struct.TYPE_2__*, %struct.TYPE_2__** %63
%65 = load i32, i32* %5
%66 = load i32, i32* @AF_INET
%67 = icmp eq i32 %65, %66
%68 = zext i1 %67 to i64
%69 = select i1 %67, i64 4, i64 4
%70 = trunc i64 %69 to i32
%71 = load i32, i32* @NI_MAXHOST
%72 = load i32, i32* @NI_NUMERICHOST
%73 = call i32 @getnameinfo(%struct.TYPE_2__* %64, i32 %70, i8* %13, i32 %71, i32* null, i32 0, i32 %72)
store i32 %73, i32* %6
%74 = load i32, i32* %6
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %82
76: ; preds = %61
%77 = load i32, i32* %6
%78 = call i8* @gai_strerror(i32 %77)
%79 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %78)
%80 = load i32, i32* @EXIT_FAILURE
%81 = call i32 @exit(i32 %80)
unreachable
82: ; preds = %61
%83 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %13)
%84 = load i8*, i8** %2
%85 = call i32 @strcpy(i8* %84, i8* %13)
%86 = load i8*, i8** %2
%87 = call i64 @strcmp(i8* %86, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%88 = icmp ne i64 %87, 0
br i1 %88, label %89, label %100
89: ; preds = %82
%90 = load i8*, i8** %2
%91 = call i64 @strcmp(i8* %90, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%92 = icmp ne i64 %91, 0
br i1 %92, label %93, label %100
93: ; preds = %89
%94 = load i8*, i8** %2
%95 = call i32* @strstr(i8* %94, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%96 = icmp eq i32* %95, null
br i1 %96, label %97, label %100
97: ; preds = %93
%98 = load %struct.ifaddrs*, %struct.ifaddrs** %3
%99 = call i32 @freeifaddrs(%struct.ifaddrs* %98)
store i32 1, i32* %9
br label %109
100: ; preds = %93, %89, %82
br label %101
101: ; preds = %100, %57
br label %102
102: ; preds = %101
%103 = load %struct.ifaddrs*, %struct.ifaddrs** %4
%104 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %103, i32 0, i32 2
%105 = load %struct.ifaddrs*, %struct.ifaddrs** %104
store %struct.ifaddrs* %105, %struct.ifaddrs** %4
br label %22
106: ; preds = %22
%107 = load %struct.ifaddrs*, %struct.ifaddrs** %3
%108 = call i32 @freeifaddrs(%struct.ifaddrs* %107)
store i32 0, i32* %9
br label %109
109: ; preds = %106, %97
%110 = load i8*, i8** %7
%111 = load i32, i32* %9
switch i32 %111, label %113 [
i32 0, label %112
i32 1, label %112
]
112: ; preds = %109, %109
ret void
113: ; preds = %109
unreachable
}

LLVM IR (-O2):
%struct.ifaddrs = type { i8*, %struct.TYPE_2__*, %struct.ifaddrs* }
%struct.TYPE_2__ = type { i32 }
@NI_MAXHOST = global i32 0
@.str = [11 x i8] c"getifaddrs\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [26 x i8] c"%s address family: %d%s\0A\00"
@.str.2 = [13 x i8] c" (AF_PACKET)\00"
@AF_INET = global i32 0
@.str.3 = [11 x i8] c" (AF_INET)\00"
@AF_INET6 = global i32 0
@.str.4 = [12 x i8] c" (AF_INET6)\00"
@.str.5 = [1 x i8] zeroinitializer
@NI_NUMERICHOST = global i32 0
@.str.6 = [26 x i8] c"getnameinfo() failed: %s\0A\00"
@.str.7 = [16 x i8] c"\09address: <%s>\0A\00"
@.str.8 = [10 x i8] c"127.0.0.1\00"
@.str.9 = [8 x i8] c"0.0.0.0\00"
@.str.10 = [9 x i8] c"169.254.\00"
define void @get_ip(i8* %0) {
%2 = alloca %struct.ifaddrs*
%3 = bitcast %struct.ifaddrs** %2 to i8*
%4 = load i32, i32* @NI_MAXHOST
%5 = zext i32 %4 to i64
%6 = tail call i8* @llvm.stacksave()
%7 = alloca i8, i64 %5
%8 = call i32 @getifaddrs(%struct.ifaddrs** %2)
%9 = icmp eq i32 %8, -1
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = load %struct.ifaddrs*, %struct.ifaddrs** %2
%12 = icmp eq %struct.ifaddrs* %11, null
br i1 %12, label %71, label %17
13: ; preds = %1
%14 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %10, %65
%18 = phi %struct.ifaddrs* [ %67, %65 ], [ %11, %10 ]
%19 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %18, i64 0, i32 1
%20 = load %struct.TYPE_2__*, %struct.TYPE_2__** %19
%21 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %20, i64 0, i32 0
%22 = load i32, i32* %21
%23 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %18, i64 0, i32 0
%24 = load i8*, i8** %23
%25 = icmp eq i32 %22, 17
br i1 %25, label %33, label %26
26: ; preds = %17
%27 = load i32, i32* @AF_INET
%28 = icmp eq i32 %22, %27
br i1 %28, label %33, label %29
29: ; preds = %26
%30 = load i32, i32* @AF_INET6
%31 = icmp eq i32 %22, %30
%32 = select i1 %31, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0)
br label %33
33: ; preds = %29, %26, %17
%34 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), %17 ], [ %32, %29 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), %26 ]
%35 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %24, i32 %22, i8* %34)
%36 = load i32, i32* @AF_INET
%37 = icmp eq i32 %22, %36
%38 = load i32, i32* @AF_INET6
%39 = icmp eq i32 %22, %38
%40 = select i1 %37, i1 true, i1 %39
br i1 %40, label %41, label %65
41: ; preds = %33
%42 = load %struct.TYPE_2__*, %struct.TYPE_2__** %19
%43 = load i32, i32* @NI_MAXHOST
%44 = load i32, i32* @NI_NUMERICHOST
%45 = call i32 @getnameinfo(%struct.TYPE_2__* %42, i32 4, i8* %7, i32 %43, i32* null, i32 0, i32 %44)
%46 = icmp eq i32 %45, 0
br i1 %46, label %52, label %47
47: ; preds = %41
%48 = call i8* @gai_strerror(i32 %45)
%49 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %48)
%50 = load i32, i32* @EXIT_FAILURE
%51 = call i32 @exit(i32 %50)
unreachable
52: ; preds = %41
%53 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %7)
%54 = call i32 @strcpy(i8* %0, i8* %7)
%55 = call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %65, label %57
57: ; preds = %52
%58 = call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %65, label %60
60: ; preds = %57
%61 = call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%62 = icmp eq i32* %61, null
br i1 %62, label %63, label %65
63: ; preds = %60
%64 = load %struct.ifaddrs*, %struct.ifaddrs** %2
br label %71
65: ; preds = %33, %60, %57, %52
%66 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %18, i64 0, i32 2
%67 = load %struct.ifaddrs*, %struct.ifaddrs** %66
%68 = icmp eq %struct.ifaddrs* %67, null
br i1 %68, label %69, label %17
69: ; preds = %65
%70 = load %struct.ifaddrs*, %struct.ifaddrs** %2
br label %71
71: ; preds = %10, %69, %63
%72 = phi %struct.ifaddrs* [ %64, %63 ], [ %70, %69 ], [ null, %10 ]
%73 = call i32 @freeifaddrs(%struct.ifaddrs* %72)
ret void
}