#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 {
  TYPE_1__ *ifa_addr;
  struct ifaddrs *ifa_next;
};
struct TYPE_2__ {
  int sa_family;
};

/* Variables and functions */
int AF_INET;
int NI_MAXHOST;
int /*<<< orphan*/ NI_NUMERICHOST;
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 *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *strdup(char *);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
char *getIpAddress() {
  struct ifaddrs *ifaddr, *ifa;
  int family, s, n;
  char host[NI_MAXHOST];
  char addr[50];
  char *ret;
  if (getifaddrs(&ifaddr) == -1) {
    perror("getifaddrs");
    return NULL;
  }
  for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa->ifa_next, n++) {
    if (ifa->ifa_addr == NULL)
      continue;
    family = ifa->ifa_addr->sa_family;
    if (family == AF_INET) {
      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));
        return NULL;
      }
      if (strncmp("127.0.0.1", host, 9) == 0) {
        sprintf(addr, "%s", host);
        break;
      }
    }
  }
  freeifaddrs(ifaddr);
  n = strlen(addr);
  for (int i = 0; i < n; i++) {
    if (addr[i] == '.')
      addr[i] = ',';
  }
  ret = strdup(addr);
  return ret;
}


x86 assembly (clang, -O0):
<getIpAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x2e1e(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%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,-0x38(%rbp)
lea    -0x10(%rbp),%rdi
call   1080 <getifaddrs@plt>
cmp    $0xffffffff,%eax
jne    120c <getIpAddress+0x6c>
lea    0xe0d(%rip),%rdi
call   10a0 <perror@plt>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x7c(%rbp)
jmp    13b2 <getIpAddress+0x212>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1340 <getIpAddress+0x1a0>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1239 <getIpAddress+0x99>
jmp    1326 <getIpAddress+0x186>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2d99(%rip),%rcx
cmp    (%rcx),%eax
jne    1321 <getIpAddress+0x181>
mov    -0x88(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x1c(%rbp),%ecx
mov    0x2d79(%rip),%rax
mov    (%rax),%esi
mov    $0x4,%eax
cmp    %esi,%ecx
cmove  %rax,%rax
mov    %eax,%esi
mov    0x2d4b(%rip),%rax
mov    (%rax),%ecx
mov    0x2d4a(%rip),%rax
mov    (%rax),%eax
xor    %r8d,%r8d
xor    %r9d,%r9d
sub    $0x10,%rsp
mov    %eax,(%rsp)
call   1070 <getnameinfo@plt>
add    $0x10,%rsp
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     12de <getIpAddress+0x13e>
mov    -0x20(%rbp),%edi
call   1060 <gai_strerror@plt>
mov    %rax,%rsi
lea    0xd46(%rip),%rdi
call   1050 <printf@plt>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x7c(%rbp)
jmp    13b2 <getIpAddress+0x212>
mov    -0x88(%rbp),%rsi
lea    0xd39(%rip),%rdi
mov    $0x9,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    131c <getIpAddress+0x17c>
mov    -0x88(%rbp),%rdx
lea    -0x70(%rbp),%rdi
lea    0xd1d(%rip),%rsi
call   10b0 <sprintf@plt>
jmp    1340 <getIpAddress+0x1a0>
jmp    1321 <getIpAddress+0x181>
jmp    1326 <getIpAddress+0x186>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    121b <getIpAddress+0x7b>
mov    -0x10(%rbp),%rdi
call   1090 <freeifaddrs@plt>
lea    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1396 <getIpAddress+0x1f6>
movslq -0x80(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x2e,%eax
jne    1383 <getIpAddress+0x1e3>
movslq -0x80(%rbp),%rax
movb   $0x2c,-0x70(%rbp,%rax,1)
jmp    1388 <getIpAddress+0x1e8>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    135c <getIpAddress+0x1bc>
lea    -0x70(%rbp),%rdi
call   10c0 <strdup@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x7c(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIpAddress>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsp,%rbx
mov    0x2e15(%rip),%r12
mov    (%r12),%eax
mov    %rsp,%r13
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
lea    -0x70(%rbp),%rdi
call   1090 <getifaddrs@plt>
cmp    $0xffffffff,%eax
je     14a5 <getIpAddress+0x305>
mov    %rbx,-0x68(%rbp)
mov    -0x70(%rbp),%rbx
test   %rbx,%rbx
je     126a <getIpAddress+0xca>
mov    0x2df2(%rip),%r15
lea    0xe48(%rip),%r14
jmp    1209 <getIpAddress+0x69>
nop
mov    0x8(%rbx),%rbx
test   %rbx,%rbx
je     126a <getIpAddress+0xca>
mov    (%rbx),%rdi
test   %rdi,%rdi
je     1200 <getIpAddress+0x60>
mov    (%rdi),%eax
cmp    (%r15),%eax
jne    1200 <getIpAddress+0x60>
mov    (%r12),%ecx
mov    0x2db5(%rip),%rax
mov    (%rax),%eax
sub    $0x8,%rsp
mov    $0x4,%esi
mov    %r13,%rdx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
call   1080 <getnameinfo@plt>
add    $0x10,%rsp
test   %eax,%eax
jne    1487 <getIpAddress+0x2e7>
mov    %r14,%rdi
mov    %r13,%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1200 <getIpAddress+0x60>
lea    -0x60(%rbp),%rdi
mov    %r13,%rsi
call   1040 <strcpy@plt>
mov    -0x70(%rbp),%rdi
call   10a0 <freeifaddrs@plt>
lea    -0x60(%rbp),%rdi
call   1050 <strlen@plt>
test   %eax,%eax
mov    -0x68(%rbp),%rbx
jle    144d <getIpAddress+0x2ad>
mov    %eax,%ecx
cmp    $0x10,%eax
jae    1296 <getIpAddress+0xf6>
xor    %eax,%eax
jmp    1479 <getIpAddress+0x2d9>
mov    %ecx,%eax
and    $0xfffffff0,%eax
xor    %edx,%edx
movdqa 0xd5b(%rip),%xmm0
movdqa 0xd63(%rip),%xmm1
jmp    12bd <getIpAddress+0x11d>
nop
add    $0x10,%rdx
cmp    %rdx,%rax
je     1448 <getIpAddress+0x2a8>
movq   -0x60(%rbp,%rdx,1),%xmm3
movdqa %xmm3,%xmm2
pcmpeqb %xmm0,%xmm2
movd   %xmm2,%esi
test   $0x1,%sil
je     12da <getIpAddress+0x13a>
movb   $0x2c,-0x60(%rbp,%rdx,1)
movdqa %xmm2,%xmm4
pslld  $0x8,%xmm4
movd   %xmm4,%esi
shr    $0x10,%esi
test   $0x1,%sil
je     12f5 <getIpAddress+0x155>
movb   $0x2c,-0x5f(%rbp,%rdx,1)
pshuflw $0x55,%xmm3,%xmm4
pcmpeqb %xmm0,%xmm4
pextrw $0x2,%xmm4,%esi
test   $0x1,%sil
je     130e <getIpAddress+0x16e>
movb   $0x2c,-0x5e(%rbp,%rdx,1)
movdqa %xmm2,%xmm4
psllq  $0x18,%xmm4
pextrw $0x3,%xmm4,%esi
test   $0x1,%sil
je     1327 <getIpAddress+0x187>
movb   $0x2c,-0x5d(%rbp,%rdx,1)
pshufd $0x55,%xmm3,%xmm3
pcmpeqb %xmm1,%xmm3
pextrw $0x4,%xmm3,%esi
test   $0x1,%sil
je     1340 <getIpAddress+0x1a0>
movb   $0x2c,-0x5c(%rbp,%rdx,1)
movdqa %xmm2,%xmm3
pslldq $0x5,%xmm3
pextrw $0x5,%xmm3,%esi
test   $0x1,%sil
je     1359 <getIpAddress+0x1b9>
movb   $0x2c,-0x5b(%rbp,%rdx,1)
pextrw $0x3,%xmm2,%esi
test   $0x1,%sil
je     1369 <getIpAddress+0x1c9>
movb   $0x2c,-0x5a(%rbp,%rdx,1)
pslldq $0x7,%xmm2
pextrw $0x7,%xmm2,%esi
test   $0x1,%sil
je     137e <getIpAddress+0x1de>
movb   $0x2c,-0x59(%rbp,%rdx,1)
movq   -0x58(%rbp,%rdx,1),%xmm3
movdqa %xmm3,%xmm2
pcmpeqb %xmm0,%xmm2
movd   %xmm2,%esi
test   $0x1,%sil
je     139b <getIpAddress+0x1fb>
movb   $0x2c,-0x58(%rbp,%rdx,1)
movdqa %xmm2,%xmm4
pslld  $0x8,%xmm4
movd   %xmm4,%esi
shr    $0x10,%esi
test   $0x1,%sil
je     13b6 <getIpAddress+0x216>
movb   $0x2c,-0x57(%rbp,%rdx,1)
pshuflw $0x55,%xmm3,%xmm4
pcmpeqb %xmm0,%xmm4
pextrw $0x2,%xmm4,%esi
test   $0x1,%sil
je     13cf <getIpAddress+0x22f>
movb   $0x2c,-0x56(%rbp,%rdx,1)
movdqa %xmm2,%xmm4
psllq  $0x18,%xmm4
pextrw $0x3,%xmm4,%esi
test   $0x1,%sil
je     13e8 <getIpAddress+0x248>
movb   $0x2c,-0x55(%rbp,%rdx,1)
pshufd $0x55,%xmm3,%xmm3
pcmpeqb %xmm1,%xmm3
pextrw $0x4,%xmm3,%esi
test   $0x1,%sil
je     1401 <getIpAddress+0x261>
movb   $0x2c,-0x54(%rbp,%rdx,1)
movdqa %xmm2,%xmm3
pslldq $0x5,%xmm3
pextrw $0x5,%xmm3,%esi
test   $0x1,%sil
je     141a <getIpAddress+0x27a>
movb   $0x2c,-0x53(%rbp,%rdx,1)
pextrw $0x3,%xmm2,%esi
test   $0x1,%sil
je     142a <getIpAddress+0x28a>
movb   $0x2c,-0x52(%rbp,%rdx,1)
pslldq $0x7,%xmm2
pextrw $0x7,%xmm2,%esi
test   $0x1,%sil
je     12b0 <getIpAddress+0x110>
movb   $0x2c,-0x51(%rbp,%rdx,1)
jmp    12b0 <getIpAddress+0x110>
cmp    %rcx,%rax
jne    1479 <getIpAddress+0x2d9>
lea    -0x60(%rbp),%rdi
call   10c0 <strdup@plt>
mov    %rbx,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
cmp    %rax,%rcx
je     144d <getIpAddress+0x2ad>
cmpb   $0x2e,-0x60(%rbp,%rax,1)
jne    1470 <getIpAddress+0x2d0>
movb   $0x2c,-0x60(%rbp,%rax,1)
jmp    1470 <getIpAddress+0x2d0>
mov    %eax,%edi
call   1070 <gai_strerror@plt>
lea    0xb96(%rip),%rdi
mov    %rax,%rsi
call   1060 <printf@plt>
xor    %eax,%eax
mov    -0x68(%rbp),%rbx
jmp    1456 <getIpAddress+0x2b6>
lea    0xb74(%rip),%rdi
call   10b0 <perror@plt>
xor    %eax,%eax
jmp    1456 <getIpAddress+0x2b6>

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

LLVM IR (-O2):
%struct.ifaddrs = type { %struct.TYPE_2__*, %struct.ifaddrs* }
%struct.TYPE_2__ = type { i32 }
@NI_MAXHOST = global i32 0
@.str = [11 x i8] c"getifaddrs\00"
@AF_INET = global i32 0
@NI_NUMERICHOST = global i32 0
@.str.1 = [26 x i8] c"getnameinfo() failed: %s\0A\00"
@.str.2 = [10 x i8] c"127.0.0.1\00"
define noalias i8* @getIpAddress() {
%1 = alloca %struct.ifaddrs*
%2 = alloca [50 x i8]
%3 = bitcast %struct.ifaddrs** %1 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 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%9 = call i32 @getifaddrs(%struct.ifaddrs** %1)
%10 = icmp eq i32 %9, -1
br i1 %10, label %14, label %11
11: ; preds = %0
%12 = load %struct.ifaddrs*, %struct.ifaddrs** %1
%13 = icmp eq %struct.ifaddrs* %12, null
br i1 %13, label %43, label %16
14: ; preds = %0
%15 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %159
16: ; preds = %11, %39
%17 = phi %struct.ifaddrs* [ %41, %39 ], [ %12, %11 ]
%18 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %17, i64 0, i32 0
%19 = load %struct.TYPE_2__*, %struct.TYPE_2__** %18
%20 = icmp eq %struct.TYPE_2__* %19, null
br i1 %20, label %39, label %21
21: ; preds = %16
%22 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %19, i64 0, i32 0
%23 = load i32, i32* %22
%24 = load i32, i32* @AF_INET
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %39
26: ; preds = %21
%27 = load i32, i32* @NI_MAXHOST
%28 = load i32, i32* @NI_NUMERICHOST
%29 = call i32 @getnameinfo(%struct.TYPE_2__* %19, i32 4, i8* %7, i32 %27, i32* null, i32 0, i32 %28)
%30 = icmp eq i32 %29, 0
br i1 %30, label %34, label %31
31: ; preds = %26
%32 = call i8* @gai_strerror(i32 %29)
%33 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %32)
br label %159
34: ; preds = %26
%35 = call i64 @strncmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %7, i32 9)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i8* @strcpy(i8* %8, i8* %7)
br label %43
39: ; preds = %21, %34, %16
%40 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %17, i64 0, i32 1
%41 = load %struct.ifaddrs*, %struct.ifaddrs** %40
%42 = icmp eq %struct.ifaddrs* %41, null
br i1 %42, label %43, label %16
43: ; preds = %39, %11, %37
%44 = load %struct.ifaddrs*, %struct.ifaddrs** %1
%45 = call i32 @freeifaddrs(%struct.ifaddrs* %44)
%46 = call i32 @strlen(i8* %8)
%47 = icmp sgt i32 %46, 0
br i1 %47, label %48, label %148
48: ; preds = %43
%49 = zext i32 %46 to i64
%50 = icmp ult i32 %46, 16
br i1 %50, label %146, label %51
51: ; preds = %48
%52 = and i64 %49, 4294967280
br label %53
53: ; preds = %141, %51
%54 = phi i64 [ 0, %51 ], [ %142, %141 ]
%55 = or i64 %54, 8
%56 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %54
%57 = bitcast i8* %56 to <8 x i8>*
%58 = load <8 x i8>, <8 x i8>* %57
%59 = getelementptr inbounds i8, i8* %56, i64 8
%60 = bitcast i8* %59 to <8 x i8>*
%61 = load <8 x i8>, <8 x i8>* %60
%62 = icmp eq <8 x i8> %58, <i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46>
%63 = icmp eq <8 x i8> %61, <i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46>
%64 = extractelement <8 x i1> %62, i64 0
br i1 %64, label %65, label %67
65: ; preds = %53
%66 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %54
store i8 44, i8* %66
br label %67
67: ; preds = %65, %53
%68 = extractelement <8 x i1> %62, i64 1
br i1 %68, label %69, label %72
69: ; preds = %67
%70 = or i64 %54, 1
%71 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %70
store i8 44, i8* %71
br label %72
72: ; preds = %69, %67
%73 = extractelement <8 x i1> %62, i64 2
br i1 %73, label %74, label %77
74: ; preds = %72
%75 = or i64 %54, 2
%76 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %75
store i8 44, i8* %76
br label %77
77: ; preds = %74, %72
%78 = extractelement <8 x i1> %62, i64 3
br i1 %78, label %79, label %82
79: ; preds = %77
%80 = or i64 %54, 3
%81 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %80
store i8 44, i8* %81
br label %82
82: ; preds = %79, %77
%83 = extractelement <8 x i1> %62, i64 4
br i1 %83, label %84, label %87
84: ; preds = %82
%85 = or i64 %54, 4
%86 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %85
store i8 44, i8* %86
br label %87
87: ; preds = %84, %82
%88 = extractelement <8 x i1> %62, i64 5
br i1 %88, label %89, label %92
89: ; preds = %87
%90 = or i64 %54, 5
%91 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %90
store i8 44, i8* %91
br label %92
92: ; preds = %89, %87
%93 = extractelement <8 x i1> %62, i64 6
br i1 %93, label %94, label %97
94: ; preds = %92
%95 = or i64 %54, 6
%96 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %95
store i8 44, i8* %96
br label %97
97: ; preds = %94, %92
%98 = extractelement <8 x i1> %62, i64 7
br i1 %98, label %99, label %102
99: ; preds = %97
%100 = or i64 %54, 7
%101 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %100
store i8 44, i8* %101
br label %102
102: ; preds = %99, %97
%103 = extractelement <8 x i1> %63, i64 0
br i1 %103, label %104, label %106
104: ; preds = %102
%105 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %55
store i8 44, i8* %105
br label %106
106: ; preds = %104, %102
%107 = extractelement <8 x i1> %63, i64 1
br i1 %107, label %108, label %111
108: ; preds = %106
%109 = or i64 %54, 9
%110 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %109
store i8 44, i8* %110
br label %111
111: ; preds = %108, %106
%112 = extractelement <8 x i1> %63, i64 2
br i1 %112, label %113, label %116
113: ; preds = %111
%114 = or i64 %54, 10
%115 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %114
store i8 44, i8* %115
br label %116
116: ; preds = %113, %111
%117 = extractelement <8 x i1> %63, i64 3
br i1 %117, label %118, label %121
118: ; preds = %116
%119 = or i64 %54, 11
%120 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %119
store i8 44, i8* %120
br label %121
121: ; preds = %118, %116
%122 = extractelement <8 x i1> %63, i64 4
br i1 %122, label %123, label %126
123: ; preds = %121
%124 = or i64 %54, 12
%125 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %124
store i8 44, i8* %125
br label %126
126: ; preds = %123, %121
%127 = extractelement <8 x i1> %63, i64 5
br i1 %127, label %128, label %131
128: ; preds = %126
%129 = or i64 %54, 13
%130 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %129
store i8 44, i8* %130
br label %131
131: ; preds = %128, %126
%132 = extractelement <8 x i1> %63, i64 6
br i1 %132, label %133, label %136
133: ; preds = %131
%134 = or i64 %54, 14
%135 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %134
store i8 44, i8* %135
br label %136
136: ; preds = %133, %131
%137 = extractelement <8 x i1> %63, i64 7
br i1 %137, label %138, label %141
138: ; preds = %136
%139 = or i64 %54, 15
%140 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %139
store i8 44, i8* %140
br label %141
141: ; preds = %138, %136
%142 = add nuw i64 %54, 16
%143 = icmp eq i64 %142, %52
br i1 %143, label %144, label %53
144: ; preds = %141
%145 = icmp eq i64 %52, %49
br i1 %145, label %148, label %146
146: ; preds = %48, %144
%147 = phi i64 [ 0, %48 ], [ %52, %144 ]
br label %150
148: ; preds = %156, %144, %43
%149 = call i8* @strdup(i8* %8)
br label %159
150: ; preds = %146, %156
%151 = phi i64 [ %157, %156 ], [ %147, %146 ]
%152 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %151
%153 = load i8, i8* %152
%154 = icmp eq i8 %153, 46
br i1 %154, label %155, label %156
155: ; preds = %150
store i8 44, i8* %152
br label %156
156: ; preds = %150, %155
%157 = add nuw nsw i64 %151, 1
%158 = icmp eq i64 %157, %49
br i1 %158, label %148, label %150
159: ; preds = %148, %31, %14
%160 = phi i8* [ null, %14 ], [ null, %31 ], [ %149, %148 ]
ret i8* %160
}