#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 in_addr {
  scalar_t__ s_addr;
  int /*<<< orphan*/ member_0;
};
struct sockaddr_in {
  struct in_addr sin_addr;
};
struct ifaddrs {
  int ifa_flags;
  TYPE_1__ *ifa_addr;
  struct ifaddrs *ifa_next;
};
struct TYPE_2__ {
  scalar_t__ sa_family;
};

/* Variables and functions */
scalar_t__ AF_INET;
int /*<<< orphan*/ freeifaddrs(struct ifaddrs *);
scalar_t__ getifaddrs(struct ifaddrs **);
int /*<<< orphan*/ getnameinfo(TYPE_1__ *, int, char *, int,
                               int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ *inet_ntop(scalar_t__, struct in_addr *, char *, int);
int ipAddressLevel(struct in_addr *, int);
scalar_t__ strcmp(char *, char *);
int getLocalHostIp(char *ip) {
  struct ifaddrs *ifaddrs = NULL;
  if (getifaddrs(&ifaddrs)) {
    return -1;
  }
  struct in_addr res = {0};
  int res_level = 0, tmp_level = 0;
  char ipBuf[64];
  struct ifaddrs *ifa;
  for (ifa = ifaddrs; NULL != ifa; ifa = ifa->ifa_next) {
    char hostname[1025];
    if (ifa->ifa_addr == NULL) {
      continue;
    }
    if (ifa->ifa_addr->sa_family == AF_INET) {
      if (!(ifa->ifa_flags & 0x1)) {
        continue;
      }
      if (ifa->ifa_flags & 0x8) {
        continue;
      }
      getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in), hostname, 1025,
                  NULL, 0, 0x00000002);
      struct in_addr *addr = &((struct sockaddr_in *)ifa->ifa_addr)->sin_addr;
      if (NULL == inet_ntop(AF_INET, addr, ipBuf, 16)) {
        continue;
      }
      int offset = strcmp(ipBuf, hostname) == 0 ? 0 : 1;
      if (0 == res.s_addr) {
        res = *addr;
        res_level = ipAddressLevel(&res, offset);
      } else if (res_level < (tmp_level = ipAddressLevel(addr, offset))) {
        res = *addr;
        res_level = tmp_level;
      }
    }
  }
  freeifaddrs(ifaddrs);
  if (0 == res.s_addr) {
    return -1;
  } else {
    return NULL == inet_ntop(AF_INET, &res, ip, 16) ? -1 : 0;
  }
}


x86 assembly (clang, -O0):
<getLocalHostIp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4a0,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1070 <getifaddrs@plt>
cmp    $0x0,%rax
je     11a6 <getLocalHostIp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    13c1 <getLocalHostIp+0x251>
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x78(%rbp)
xor    %eax,%eax
cmp    -0x78(%rbp),%rax
je     136d <getLocalHostIp+0x1fd>
mov    -0x78(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    11ec <getLocalHostIp+0x7c>
jmp    135c <getLocalHostIp+0x1ec>
mov    -0x78(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    0x2dea(%rip),%rcx
cmp    (%rcx),%rax
jne    1357 <getLocalHostIp+0x1e7>
mov    -0x78(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    121e <getLocalHostIp+0xae>
jmp    135c <getLocalHostIp+0x1ec>
mov    -0x78(%rbp),%rax
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1235 <getLocalHostIp+0xc5>
jmp    135c <getLocalHostIp+0x1ec>
mov    -0x78(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x480(%rbp),%rdx
mov    $0x10,%esi
mov    $0x401,%ecx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
movl   $0x2,(%rsp)
call   1050 <getnameinfo@plt>
mov    -0x78(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x488(%rbp)
mov    0x2d70(%rip),%rax
mov    (%rax),%rdi
mov    -0x488(%rbp),%rsi
lea    -0x70(%rbp),%rdx
mov    $0x10,%ecx
call   1030 <inet_ntop@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    12a3 <getLocalHostIp+0x133>
jmp    135c <getLocalHostIp+0x1ec>
lea    -0x70(%rbp),%rdi
lea    -0x480(%rbp),%rsi
call   1060 <strcmp@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x48c(%rbp)
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
jne    1303 <getLocalHostIp+0x193>
mov    -0x488(%rbp),%rax
mov    (%rax),%rcx
mov    %rcx,-0x28(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x48c(%rbp),%esi
lea    -0x28(%rbp),%rdi
call   1090 <ipAddressLevel@plt>
mov    %eax,-0x2c(%rbp)
jmp    1352 <getLocalHostIp+0x1e2>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x490(%rbp)
mov    -0x488(%rbp),%rdi
mov    -0x48c(%rbp),%esi
call   1090 <ipAddressLevel@plt>
mov    %eax,%ecx
mov    -0x490(%rbp),%eax
mov    %ecx,-0x30(%rbp)
cmp    %ecx,%eax
jge    134d <getLocalHostIp+0x1dd>
mov    -0x488(%rbp),%rax
mov    (%rax),%rcx
mov    %rcx,-0x28(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    1352 <getLocalHostIp+0x1e2>
jmp    1357 <getLocalHostIp+0x1e7>
jmp    135c <getLocalHostIp+0x1ec>
mov    -0x78(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x78(%rbp)
jmp    11cc <getLocalHostIp+0x5c>
mov    -0x18(%rbp),%rdi
call   1080 <freeifaddrs@plt>
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
jne    138e <getLocalHostIp+0x21e>
movl   $0xffffffff,-0x4(%rbp)
jmp    13c1 <getLocalHostIp+0x251>
mov    0x2c53(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rdx
lea    -0x28(%rbp),%rsi
mov    $0x10,%ecx
call   1030 <inet_ntop@plt>
mov    %rax,%rsi
xor    %eax,%eax
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLocalHostIp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x478,%rsp
mov    %rdi,%rbp
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1060 <getifaddrs@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    12c6 <getLocalHostIp+0x166>
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
mov    0x8(%rsp),%r13
xor    %ebx,%ebx
test   %r13,%r13
je     128d <getLocalHostIp+0x12d>
mov    %rbp,0x28(%rsp)
mov    0x2e2c(%rip),%r14
lea    0x70(%rsp),%r15
lea    0x30(%rsp),%r12
jmp    11ed <getLocalHostIp+0x8d>
movups 0x0(%rbp),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
call   1080 <ipAddressLevel@plt>
mov    %eax,%ebx
nopl   (%rax)
mov    0x10(%r13),%r13
test   %r13,%r13
je     1283 <getLocalHostIp+0x123>
mov    0x8(%r13),%rdi
test   %rdi,%rdi
je     11e0 <getLocalHostIp+0x80>
mov    (%rdi),%rax
cmp    (%r14),%rax
jne    11e0 <getLocalHostIp+0x80>
mov    0x0(%r13),%eax
and    $0x9,%eax
cmp    $0x1,%eax
jne    11e0 <getLocalHostIp+0x80>
movl   $0x2,(%rsp)
mov    $0x10,%esi
mov    %r15,%rdx
mov    $0x401,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <getnameinfo@plt>
mov    0x8(%r13),%rbp
mov    (%r14),%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
mov    $0x10,%ecx
call   1030 <inet_ntop@plt>
test   %rax,%rax
je     11e0 <getLocalHostIp+0x80>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
xor    %esi,%esi
test   %rax,%rax
setne  %sil
cmpq   $0x0,0x10(%rsp)
je     11c8 <getLocalHostIp+0x68>
mov    %rbp,%rdi
call   1080 <ipAddressLevel@plt>
cmp    %eax,%ebx
jge    11e0 <getLocalHostIp+0x80>
movups 0x0(%rbp),%xmm0
movaps %xmm0,0x10(%rsp)
jmp    11db <getLocalHostIp+0x7b>
mov    0x8(%rsp),%rbx
mov    0x28(%rsp),%rbp
mov    %rbx,%rdi
call   1070 <freeifaddrs@plt>
cmpq   $0x0,0x10(%rsp)
je     12c1 <getLocalHostIp+0x161>
mov    0x2d44(%rip),%rax
mov    (%rax),%rdi
lea    0x10(%rsp),%rsi
mov    %rbp,%rdx
mov    $0x10,%ecx
call   1030 <inet_ntop@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
jmp    12c6 <getLocalHostIp+0x166>
mov    $0xffffffff,%eax
add    $0x478,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ifaddrs = type { i32, %struct.TYPE_2__*, %struct.ifaddrs* }
%struct.TYPE_2__ = type { i64 }
%struct.in_addr = type { i64, i32 }
%struct.sockaddr_in = type { %struct.in_addr }
@AF_INET = global i64 0
define i32 @getLocalHostIp(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.ifaddrs*
%5 = alloca %struct.in_addr
%6 = alloca i32
%7 = alloca i32
%8 = alloca [64 x i8]
%9 = alloca %struct.ifaddrs*
%10 = alloca [1025 x i8]
%11 = alloca %struct.in_addr*
%12 = alloca i32
store i8* %0, i8** %3
store %struct.ifaddrs* null, %struct.ifaddrs** %4
%13 = call i64 @getifaddrs(%struct.ifaddrs** %4)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %1
store i32 -1, i32* %2
br label %115
16: ; preds = %1
%17 = bitcast %struct.in_addr* %5 to i8*
store i32 0, i32* %6
store i32 0, i32* %7
%18 = load %struct.ifaddrs*, %struct.ifaddrs** %4
store %struct.ifaddrs* %18, %struct.ifaddrs** %9
br label %19
19: ; preds = %97, %16
%20 = load %struct.ifaddrs*, %struct.ifaddrs** %9
%21 = icmp ne %struct.ifaddrs* null, %20
br i1 %21, label %22, label %101
22: ; preds = %19
%23 = load %struct.ifaddrs*, %struct.ifaddrs** %9
%24 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %23, i32 0, i32 1
%25 = load %struct.TYPE_2__*, %struct.TYPE_2__** %24
%26 = icmp eq %struct.TYPE_2__* %25, null
br i1 %26, label %27, label %28
27: ; preds = %22
br label %97
28: ; preds = %22
%29 = load %struct.ifaddrs*, %struct.ifaddrs** %9
%30 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %29, i32 0, i32 1
%31 = load %struct.TYPE_2__*, %struct.TYPE_2__** %30
%32 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %31, i32 0, i32 0
%33 = load i64, i64* %32
%34 = load i64, i64* @AF_INET
%35 = icmp eq i64 %33, %34
br i1 %35, label %36, label %96
36: ; preds = %28
%37 = load %struct.ifaddrs*, %struct.ifaddrs** %9
%38 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %37, i32 0, i32 0
%39 = load i32, i32* %38
%40 = and i32 %39, 1
%41 = icmp ne i32 %40, 0
br i1 %41, label %43, label %42
42: ; preds = %36
br label %97
43: ; preds = %36
%44 = load %struct.ifaddrs*, %struct.ifaddrs** %9
%45 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %44, i32 0, i32 0
%46 = load i32, i32* %45
%47 = and i32 %46, 8
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %50
49: ; preds = %43
br label %97
50: ; preds = %43
%51 = load %struct.ifaddrs*, %struct.ifaddrs** %9
%52 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %51, i32 0, i32 1
%53 = load %struct.TYPE_2__*, %struct.TYPE_2__** %52
%54 = getelementptr inbounds [1025 x i8], [1025 x i8]* %10, i64 0, i64 0
%55 = call i32 @getnameinfo(%struct.TYPE_2__* %53, i32 16, i8* %54, i32 1025, i32* null, i32 0, i32 2)
%56 = load %struct.ifaddrs*, %struct.ifaddrs** %9
%57 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %56, i32 0, i32 1
%58 = load %struct.TYPE_2__*, %struct.TYPE_2__** %57
%59 = bitcast %struct.TYPE_2__* %58 to %struct.sockaddr_in*
%60 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %59, i32 0, i32 0
store %struct.in_addr* %60, %struct.in_addr** %11
%61 = load i64, i64* @AF_INET
%62 = load %struct.in_addr*, %struct.in_addr** %11
%63 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%64 = call i32* @inet_ntop(i64 %61, %struct.in_addr* %62, i8* %63, i32 16)
%65 = icmp eq i32* null, %64
br i1 %65, label %66, label %67
66: ; preds = %50
br label %97
67: ; preds = %50
%68 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%69 = getelementptr inbounds [1025 x i8], [1025 x i8]* %10, i64 0, i64 0
%70 = call i64 @strcmp(i8* %68, i8* %69)
%71 = icmp eq i64 %70, 0
%72 = zext i1 %71 to i64
%73 = select i1 %71, i32 0, i32 1
store i32 %73, i32* %12
%74 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %5, i32 0, i32 0
%75 = load i64, i64* %74
%76 = icmp eq i64 0, %75
br i1 %76, label %77, label %83
77: ; preds = %67
%78 = load %struct.in_addr*, %struct.in_addr** %11
%79 = bitcast %struct.in_addr* %5 to i8*
%80 = bitcast %struct.in_addr* %78 to i8*
%81 = load i32, i32* %12
%82 = call i32 @ipAddressLevel(%struct.in_addr* %5, i32 %81)
store i32 %82, i32* %6
br label %95
83: ; preds = %67
%84 = load i32, i32* %6
%85 = load %struct.in_addr*, %struct.in_addr** %11
%86 = load i32, i32* %12
%87 = call i32 @ipAddressLevel(%struct.in_addr* %85, i32 %86)
store i32 %87, i32* %7
%88 = icmp slt i32 %84, %87
br i1 %88, label %89, label %94
89: ; preds = %83
%90 = load %struct.in_addr*, %struct.in_addr** %11
%91 = bitcast %struct.in_addr* %5 to i8*
%92 = bitcast %struct.in_addr* %90 to i8*
%93 = load i32, i32* %7
store i32 %93, i32* %6
br label %94
94: ; preds = %89, %83
br label %95
95: ; preds = %94, %77
br label %96
96: ; preds = %95, %28
br label %97
97: ; preds = %96, %66, %49, %42, %27
%98 = load %struct.ifaddrs*, %struct.ifaddrs** %9
%99 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %98, i32 0, i32 2
%100 = load %struct.ifaddrs*, %struct.ifaddrs** %99
store %struct.ifaddrs* %100, %struct.ifaddrs** %9
br label %19
101: ; preds = %19
%102 = load %struct.ifaddrs*, %struct.ifaddrs** %4
%103 = call i32 @freeifaddrs(%struct.ifaddrs* %102)
%104 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %5, i32 0, i32 0
%105 = load i64, i64* %104
%106 = icmp eq i64 0, %105
br i1 %106, label %107, label %108
107: ; preds = %101
store i32 -1, i32* %2
br label %115
108: ; preds = %101
%109 = load i64, i64* @AF_INET
%110 = load i8*, i8** %3
%111 = call i32* @inet_ntop(i64 %109, %struct.in_addr* %5, i8* %110, i32 16)
%112 = icmp eq i32* null, %111
%113 = zext i1 %112 to i64
%114 = select i1 %112, i32 -1, i32 0
store i32 %114, i32* %2
br label %115
115: ; preds = %108, %107, %15
%116 = load i32, i32* %2
ret i32 %116
}

LLVM IR (-O2):
%struct.ifaddrs = type { i32, %struct.TYPE_2__*, %struct.ifaddrs* }
%struct.TYPE_2__ = type { i64 }
%struct.in_addr = type { i64, i32 }
%struct.sockaddr_in = type { %struct.in_addr }
@AF_INET = global i64 0
define i32 @getLocalHostIp(i8* %0) {
%2 = alloca %struct.ifaddrs*
%3 = alloca %struct.in_addr
%4 = alloca [64 x i8]
%5 = alloca [1025 x i8]
%6 = bitcast %struct.ifaddrs** %2 to i8*
store %struct.ifaddrs* null, %struct.ifaddrs** %2
%7 = call i64 @getifaddrs(%struct.ifaddrs** %2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %75
9: ; preds = %1
%10 = bitcast %struct.in_addr* %3 to i8*
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%12 = load %struct.ifaddrs*, %struct.ifaddrs** %2
%13 = icmp eq %struct.ifaddrs* %12, null
br i1 %13, label %62, label %14
14: ; preds = %9
%15 = getelementptr inbounds [1025 x i8], [1025 x i8]* %5, i64 0, i64 0
%16 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i64 0, i32 0
br label %17
17: ; preds = %14, %55
%18 = phi %struct.ifaddrs* [ %12, %14 ], [ %58, %55 ]
%19 = phi i32 [ 0, %14 ], [ %56, %55 ]
%20 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %18, i64 0, i32 1
%21 = load %struct.TYPE_2__*, %struct.TYPE_2__** %20
%22 = icmp eq %struct.TYPE_2__* %21, null
br i1 %22, label %55, label %23
23: ; preds = %17
%24 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %21, i64 0, i32 0
%25 = load i64, i64* %24
%26 = load i64, i64* @AF_INET
%27 = icmp eq i64 %25, %26
br i1 %27, label %28, label %55
28: ; preds = %23
%29 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %18, i64 0, i32 0
%30 = load i32, i32* %29
%31 = and i32 %30, 9
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %55
33: ; preds = %28
%34 = call i32 @getnameinfo(%struct.TYPE_2__* %21, i32 16, i8* %15, i32 1025, i32* null, i32 0, i32 2)
%35 = bitcast %struct.TYPE_2__** %20 to %struct.sockaddr_in**
%36 = load %struct.sockaddr_in*, %struct.sockaddr_in** %35
%37 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %36, i64 0, i32 0
%38 = load i64, i64* @AF_INET
%39 = call i32* @inet_ntop(i64 %38, %struct.in_addr* %37, i8* %11, i32 16)
%40 = icmp eq i32* %39, null
br i1 %40, label %55, label %41
41: ; preds = %33
%42 = call i64 @strcmp(i8* %11, i8* %15)
%43 = icmp ne i64 %42, 0
%44 = zext i1 %43 to i32
%45 = load i64, i64* %16
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %41
%48 = bitcast %struct.sockaddr_in* %36 to i8*
%49 = call i32 @ipAddressLevel(%struct.in_addr* %3, i32 %44)
br label %55
50: ; preds = %41
%51 = call i32 @ipAddressLevel(%struct.in_addr* %37, i32 %44)
%52 = icmp slt i32 %19, %51
br i1 %52, label %53, label %55
53: ; preds = %50
%54 = bitcast %struct.sockaddr_in* %36 to i8*
br label %55
55: ; preds = %33, %50, %53, %47, %23, %28, %17
%56 = phi i32 [ %19, %17 ], [ %19, %28 ], [ %19, %23 ], [ %19, %33 ], [ %49, %47 ], [ %51, %53 ], [ %19, %50 ]
%57 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %18, i64 0, i32 2
%58 = load %struct.ifaddrs*, %struct.ifaddrs** %57
%59 = icmp eq %struct.ifaddrs* %58, null
br i1 %59, label %60, label %17
60: ; preds = %55
%61 = load %struct.ifaddrs*, %struct.ifaddrs** %2
br label %62
62: ; preds = %60, %9
%63 = phi %struct.ifaddrs* [ %61, %60 ], [ null, %9 ]
%64 = call i32 @freeifaddrs(%struct.ifaddrs* %63)
%65 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i64 0, i32 0
%66 = load i64, i64* %65
%67 = icmp eq i64 %66, 0
br i1 %67, label %73, label %68
68: ; preds = %62
%69 = load i64, i64* @AF_INET
%70 = call i32* @inet_ntop(i64 %69, %struct.in_addr* %3, i8* %0, i32 16)
%71 = icmp eq i32* %70, null
%72 = sext i1 %71 to i32
br label %73
73: ; preds = %62, %68
%74 = phi i32 [ %72, %68 ], [ -1, %62 ]
br label %75
75: ; preds = %1, %73
%76 = phi i32 [ %74, %73 ], [ -1, %1 ]
ret i32 %76
}