#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 rtnl_link_stats {
  int tx_packets;
  int rx_packets;
  int tx_bytes;
  int rx_bytes;
};
struct ifaddrs {
  char *ifa_name;
  int /*<<< orphan*/ *ifa_data;
  TYPE_1__ *ifa_addr;
  struct ifaddrs *ifa_next;
};
struct TYPE_2__ {
  int sa_family;
};

/* Variables and functions */
int AF_INET;
int AF_INET6;
int AF_PACKET;
int /*<<< orphan*/ EXIT_FAILURE;
int NI_MAXHOST;
int /*<<< orphan*/ NI_NUMERICHOST;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(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 *, ...);
int /*<<< orphan*/ stdout;
int iface(void) {
  struct ifaddrs *ifaddr, *ifa;
  int family, s, n;
  char host[NI_MAXHOST];
  if (getifaddrs(&ifaddr) == -1) {
    perror("getifaddrs");
    exit(EXIT_FAILURE);
  }
  for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa->ifa_next, n++) {
    if (ifa->ifa_addr == NULL)
      continue;
    family = ifa->ifa_addr->sa_family;
    printf("%-8s %s (%d)\n", ifa->ifa_name,
           (family == AF_PACKET)  ? "AF_PACKET"
           : (family == AF_INET)  ? "AF_INET"
           : (family == AF_INET6) ? "AF_INET6"
                                  : "???",
           family);
    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("\t\taddress: <%s>\n", host);
    } else if (family == AF_PACKET && ifa->ifa_data != NULL) {
      struct rtnl_link_stats *stats = (struct rtnl_link_stats *)ifa->ifa_data;
      printf("\t\ttx_packets = %10u; rx_packets = %10u\n"
             "\t\ttx_bytes   = %10u; rx_bytes   = %10u\n",
             stats->tx_packets, stats->rx_packets, stats->tx_bytes,
             stats->rx_bytes);
    }
  }
  freeifaddrs(ifaddr);
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<iface>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x2e21(%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    -0x8(%rbp),%rdi
call   1070 <getifaddrs@plt>
cmp    $0xffffffff,%eax
jne    11e0 <iface+0x60>
lea    0xe33(%rip),%rdi
call   1090 <perror@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     13e6 <iface+0x266>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    120e <iface+0x8e>
jmp    13cc <iface+0x24c>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2da0(%rip),%rcx
cmp    (%rcx),%eax
jne    1248 <iface+0xc8>
lea    0xdda(%rip),%rax
mov    %rax,-0x50(%rbp)
jmp    1296 <iface+0x116>
mov    -0x14(%rbp),%eax
mov    0x2d96(%rip),%rcx
cmp    (%rcx),%eax
jne    126a <iface+0xea>
lea    0xdc2(%rip),%rax
mov    %rax,-0x58(%rbp)
jmp    128e <iface+0x10e>
mov    -0x14(%rbp),%edx
mov    0x2d6c(%rip),%rax
mov    (%rax),%esi
lea    0xdb7(%rip),%rax
lea    0xda7(%rip),%rcx
cmp    %esi,%edx
cmove  %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    0x2d2f(%rip),%rcx
cmp    (%rcx),%eax
je     12d3 <iface+0x153>
mov    -0x14(%rbp),%eax
mov    0x2d15(%rip),%rcx
cmp    (%rcx),%eax
jne    136b <iface+0x1eb>
mov    -0x40(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x14(%rbp),%ecx
mov    0x2cff(%rip),%rax
mov    (%rax),%esi
mov    $0x4,%eax
cmp    %esi,%ecx
cmove  %rax,%rax
mov    %eax,%esi
mov    0x2cb1(%rip),%rax
mov    (%rax),%ecx
mov    0x2cc0(%rip),%rax
mov    (%rax),%eax
xor    %r8d,%r8d
xor    %r9d,%r9d
sub    $0x10,%rsp
mov    %eax,(%rsp)
call   1050 <getnameinfo@plt>
add    $0x10,%rsp
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1354 <iface+0x1d4>
mov    -0x18(%rbp),%edi
call   1040 <gai_strerror@plt>
mov    %rax,%rsi
lea    0xcf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2c73(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x40(%rbp),%rsi
lea    0xcf3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13c7 <iface+0x247>
mov    -0x14(%rbp),%eax
mov    0x2c5b(%rip),%rcx
cmp    (%rcx),%eax
jne    13c2 <iface+0x242>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     13c2 <iface+0x242>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
mov    -0x38(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x38(%rbp),%rax
mov    0xc(%rax),%r8d
lea    0xca8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13c7 <iface+0x247>
jmp    13cc <iface+0x24c>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ef <iface+0x6f>
mov    -0x8(%rbp),%rdi
call   1080 <freeifaddrs@plt>
mov    0x2bc2(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iface>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsp,%rbx
mov    0x2e15(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r13
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
lea    -0x30(%rbp),%rdi
call   1070 <getifaddrs@plt>
cmp    $0xffffffff,%eax
je     1346 <iface+0x1c6>
mov    -0x30(%rbp),%r12
test   %r12,%r12
je     12f7 <iface+0x177>
mov    %rbx,-0x38(%rbp)
mov    0x2df8(%rip),%r15
mov    0x2e09(%rip),%r14
jmp    11fe <iface+0x7e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x18(%r12),%r12
test   %r12,%r12
je     12ed <iface+0x16d>
mov    0x10(%r12),%rax
test   %rax,%rax
je     11f0 <iface+0x70>
mov    (%rax),%ebx
lea    0xe08(%rip),%rdx
cmp    (%r15),%ebx
je     1240 <iface+0xc0>
lea    0xe06(%rip),%rdx
cmp    (%r14),%ebx
je     1240 <iface+0xc0>
lea    0xe02(%rip),%rdx
mov    0x2db0(%rip),%rax
cmp    (%rax),%ebx
je     1240 <iface+0xc0>
lea    0xdf9(%rip),%rdx
nopl   0x0(%rax,%rax,1)
mov    (%r12),%rsi
lea    0xdc0(%rip),%rdi
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
cmp    (%r14),%ebx
je     12a0 <iface+0x120>
mov    0x2d80(%rip),%rax
cmp    (%rax),%ebx
je     12a0 <iface+0x120>
cmp    (%r15),%ebx
jne    11f0 <iface+0x70>
mov    0x8(%r12),%rax
test   %rax,%rax
je     11f0 <iface+0x70>
mov    (%rax),%esi
mov    0x4(%rax),%edx
mov    0x8(%rax),%ecx
mov    0xc(%rax),%r8d
lea    0xdd9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11f0 <iface+0x70>
cs nopw 0x0(%rax,%rax,1)
mov    0x10(%r12),%rdi
mov    0x2d04(%rip),%rax
mov    (%rax),%ecx
mov    0x2d13(%rip),%rax
mov    (%rax),%eax
sub    $0x8,%rsp
mov    $0x4,%esi
mov    %r13,%rdx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rax
call   1050 <getnameinfo@plt>
add    $0x10,%rsp
test   %eax,%eax
jne    1320 <iface+0x1a0>
lea    0xd74(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11f0 <iface+0x70>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rbx
jmp    12f9 <iface+0x179>
xor    %edi,%edi
call   1080 <freeifaddrs@plt>
mov    0x2cb3(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    %rbx,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%edi
call   1040 <gai_strerror@plt>
lea    0xd0a(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2c81(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
lea    0xcb3(%rip),%rdi
call   1090 <perror@plt>
jmp    1338 <iface+0x1b8>

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

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