#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_in {
  int /*<<< orphan*/ sin_port;
};
struct TYPE_2__ {
  scalar_t__ sa_family;
};
struct ifreq {
  int ifr_flags;
  TYPE_1__ ifr_addr;
};
struct ifconf {
  int ifc_len;
  char *ifc_buf;
  struct ifreq *ifc_req;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
scalar_t__ AF_INET;
int BUFSIZ;
int IFF_LOOPBACK;
int IFF_UP;
int /*<<< orphan*/ PMAPPORT;
int /*<<< orphan*/ SIOCGIFCONF;
int /*<<< orphan*/ SIOCGIFFLAGS;
int /*<<< orphan*/ SOCK_DGRAM;
char *_(char *);
int /*<<< orphan*/ __close(int);
scalar_t__ __ioctl(int, int /*<<< orphan*/, char *);
int __socket(scalar_t__, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void get_myaddress(struct sockaddr_in *addr) {
  int s;
  char buf[BUFSIZ];
  struct ifconf ifc;
  struct ifreq ifreq, *ifr;
  int len, loopback = 0;
  if ((s = __socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
    perror("get_myaddress: socket");
    exit(1);
  }
  ifc.ifc_len = sizeof(buf);
  ifc.ifc_buf = buf;
  if (__ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) {
    perror(_("get_myaddress: ioctl (get interface configuration)"));
    exit(1);
  }
again:
  ifr = ifc.ifc_req;
  for (len = ifc.ifc_len; len; len -= sizeof ifreq) {
    ifreq = *ifr;
    if (__ioctl(s, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
      perror("get_myaddress: ioctl");
      exit(1);
    }
    if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET) &&
        (!(ifreq.ifr_flags & IFF_LOOPBACK) ||
         (loopback == 1 && (ifreq.ifr_flags & IFF_LOOPBACK)))) {
      *addr = *((struct sockaddr_in *)&ifr->ifr_addr);
      addr->sin_port = htons(PMAPPORT);
      __close(s);
      return;
    }
    ifr++;
  }
  if (loopback == 0) {
    loopback = 1;
    goto again;
  }
  __close(s);
}


x86 assembly (clang, -O0):
<get_myaddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e2d(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x70(%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,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x58(%rbp)
mov    0x2e26(%rip),%rax
mov    (%rax),%rdi
mov    0x2e0c(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1080 <__socket@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    11ef <get_myaddress+0x7f>
lea    0xe20(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x68(%rbp),%rax
mov    -0x70(%rbp),%rcx
mov    %ecx,-0x38(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2da0(%rip),%rax
mov    (%rax),%esi
lea    -0x38(%rbp),%rdx
call   1040 <__ioctl@plt>
cmp    $0x0,%rax
jge    123b <get_myaddress+0xcb>
lea    0xdf2(%rip),%rdi
call   1050 <_@plt>
mov    %rax,%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
jmp    1240 <get_myaddress+0xd0>
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
je     1354 <get_myaddress+0x1e4>
mov    -0x50(%rbp),%rax
mov    (%rax),%rcx
mov    %rcx,-0x48(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2d4b(%rip),%rax
mov    (%rax),%esi
lea    -0x48(%rbp),%rdx
call   1040 <__ioctl@plt>
cmp    $0x0,%rax
jge    12a0 <get_myaddress+0x130>
lea    0xdb8(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x48(%rbp),%eax
mov    0x2d2e(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1338 <get_myaddress+0x1c8>
mov    -0x50(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2d1c(%rip),%rcx
cmp    (%rcx),%rax
jne    1338 <get_myaddress+0x1c8>
mov    -0x48(%rbp),%eax
mov    0x2d21(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1301 <get_myaddress+0x191>
cmpl   $0x1,-0x58(%rbp)
jne    1338 <get_myaddress+0x1c8>
mov    -0x48(%rbp),%eax
mov    0x2d02(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1338 <get_myaddress+0x1c8>
mov    -0x8(%rbp),%rax
mov    -0x50(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    %ecx,(%rax)
mov    0x2cb3(%rip),%rax
mov    (%rax),%edi
call   1030 <htons@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edi
call   1070 <__close@plt>
movl   $0x1,-0x5c(%rbp)
jmp    1379 <get_myaddress+0x209>
mov    -0x50(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x50(%rbp)
movslq -0x54(%rbp),%rax
sub    $0x10,%rax
mov    %eax,-0x54(%rbp)
jmp    124e <get_myaddress+0xde>
cmpl   $0x0,-0x58(%rbp)
jne    136a <get_myaddress+0x1fa>
movl   $0x1,-0x58(%rbp)
jmp    1240 <get_myaddress+0xd0>
mov    -0xc(%rbp),%edi
call   1070 <__close@plt>
movl   $0x0,-0x5c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_myaddress>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%r15
mov    0x2e25(%rip),%rax
mov    (%rax),%r14d
mov    %rsp,%rbx
lea    0xf(%r14),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x2e3a(%rip),%rax
mov    (%rax),%rdi
mov    0x2e20(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1080 <__socket@plt>
test   %eax,%eax
js     1308 <get_myaddress+0x198>
mov    %eax,%r13d
mov    %r14d,-0x58(%rbp)
mov    %rbx,-0x50(%rbp)
mov    0x2dd5(%rip),%rax
mov    (%rax),%esi
lea    -0x58(%rbp),%rdx
mov    %r13d,%edi
call   1040 <__ioctl@plt>
test   %rax,%rax
js     1311 <get_myaddress+0x1a1>
mov    %r15,-0x60(%rbp)
mov    -0x58(%rbp),%r14d
test   %r14d,%r14d
je     12db <get_myaddress+0x16b>
mov    -0x48(%rbp),%rbx
add    $0x8,%rbx
lea    -0x40(%rbp),%r15
mov    0x2dca(%rip),%r12
jmp    121a <get_myaddress+0xaa>
add    $0x10,%rbx
add    $0xfffffff0,%r14d
je     1264 <get_myaddress+0xf4>
movups -0x8(%rbx),%xmm0
movaps %xmm0,-0x40(%rbp)
mov    0x2d97(%rip),%rax
mov    (%rax),%esi
mov    %r13d,%edi
mov    %r15,%rdx
call   1040 <__ioctl@plt>
test   %rax,%rax
js     12f2 <get_myaddress+0x182>
mov    -0x40(%rbp),%eax
test   %eax,(%r12)
je     1210 <get_myaddress+0xa0>
mov    (%rbx),%rcx
mov    0x2d8e(%rip),%rdx
cmp    (%rdx),%rcx
jne    1210 <get_myaddress+0xa0>
mov    0x2d9a(%rip),%rcx
test   %eax,(%rcx)
jne    1210 <get_myaddress+0xa0>
jmp    12c3 <get_myaddress+0x153>
mov    -0x58(%rbp),%r14d
test   %r14d,%r14d
je     12db <get_myaddress+0x16b>
mov    -0x48(%rbp),%rbx
add    $0x8,%rbx
lea    -0x40(%rbp),%r15
jmp    128a <get_myaddress+0x11a>
nopl   0x0(%rax,%rax,1)
add    $0x10,%rbx
add    $0xfffffff0,%r14d
je     12db <get_myaddress+0x16b>
movups -0x8(%rbx),%xmm0
movaps %xmm0,-0x40(%rbp)
mov    0x2d27(%rip),%rax
mov    (%rax),%esi
mov    %r13d,%edi
mov    %r15,%rdx
call   1040 <__ioctl@plt>
test   %rax,%rax
js     12f2 <get_myaddress+0x182>
mov    (%r12),%eax
test   %eax,-0x40(%rbp)
je     1280 <get_myaddress+0x110>
mov    (%rbx),%rax
mov    0x2d22(%rip),%rcx
cmp    (%rcx),%rax
jne    1280 <get_myaddress+0x110>
mov    (%rbx),%eax
mov    -0x60(%rbp),%rbx
mov    %eax,(%rbx)
mov    0x2cf6(%rip),%rax
mov    (%rax),%edi
call   1030 <htons@plt>
mov    %eax,(%rbx)
mov    %r13d,%edi
call   1070 <__close@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd50(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
lea    0xcf1(%rip),%rdi
jmp    12f9 <get_myaddress+0x189>
lea    0xcfe(%rip),%rdi
call   1050 <_@plt>
mov    %rax,%rdi
jmp    12f9 <get_myaddress+0x189>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.ifconf = type { i32, i8*, %struct.ifreq* }
%struct.ifreq = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64 }
@BUFSIZ = global i32 0
@AF_INET = global i64 0
@SOCK_DGRAM = global i32 0
@.str = [22 x i8] c"get_myaddress: socket\00"
@SIOCGIFCONF = global i32 0
@.str.1 = [51 x i8] c"get_myaddress: ioctl (get interface configuration)\00"
@SIOCGIFFLAGS = global i32 0
@.str.2 = [21 x i8] c"get_myaddress: ioctl\00"
@IFF_UP = global i32 0
@IFF_LOOPBACK = global i32 0
@PMAPPORT = global i32 0
define void @get_myaddress(%struct.sockaddr_in* %0) {
%2 = alloca %struct.sockaddr_in*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca %struct.ifconf
%7 = alloca %struct.ifreq
%8 = alloca %struct.ifreq*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %2
%12 = load i32, i32* @BUFSIZ
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %4
%15 = alloca i8, i64 %13
store i64 %13, i64* %5
store i32 0, i32* %10
%16 = load i64, i64* @AF_INET
%17 = load i32, i32* @SOCK_DGRAM
%18 = call i32 @__socket(i64 %16, i32 %17, i32 0)
store i32 %18, i32* %3
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %1
%21 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %1
%24 = trunc i64 %13 to i32
%25 = getelementptr inbounds %struct.ifconf, %struct.ifconf* %6, i32 0, i32 0
store i32 %24, i32* %25
%26 = getelementptr inbounds %struct.ifconf, %struct.ifconf* %6, i32 0, i32 1
store i8* %15, i8** %26
%27 = load i32, i32* %3
%28 = load i32, i32* @SIOCGIFCONF
%29 = bitcast %struct.ifconf* %6 to i8*
%30 = call i64 @__ioctl(i32 %27, i32 %28, i8* %29)
%31 = icmp slt i64 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %23
%33 = call i8* @_(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%34 = call i32 @perror(i8* %33)
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %23
br label %37
37: ; preds = %109, %36
%38 = getelementptr inbounds %struct.ifconf, %struct.ifconf* %6, i32 0, i32 2
%39 = load %struct.ifreq*, %struct.ifreq** %38
store %struct.ifreq* %39, %struct.ifreq** %8
%40 = getelementptr inbounds %struct.ifconf, %struct.ifconf* %6, i32 0, i32 0
%41 = load i32, i32* %40
store i32 %41, i32* %9
br label %42
42: ; preds = %101, %37
%43 = load i32, i32* %9
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %106
45: ; preds = %42
%46 = load %struct.ifreq*, %struct.ifreq** %8
%47 = bitcast %struct.ifreq* %7 to i8*
%48 = bitcast %struct.ifreq* %46 to i8*
%49 = load i32, i32* %3
%50 = load i32, i32* @SIOCGIFFLAGS
%51 = bitcast %struct.ifreq* %7 to i8*
%52 = call i64 @__ioctl(i32 %49, i32 %50, i8* %51)
%53 = icmp slt i64 %52, 0
br i1 %53, label %54, label %57
54: ; preds = %45
%55 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %45
%58 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %7, i32 0, i32 0
%59 = load i32, i32* %58
%60 = load i32, i32* @IFF_UP
%61 = and i32 %59, %60
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %98
63: ; preds = %57
%64 = load %struct.ifreq*, %struct.ifreq** %8
%65 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %64, i32 0, i32 1
%66 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %65, i32 0, i32 0
%67 = load i64, i64* %66
%68 = load i64, i64* @AF_INET
%69 = icmp eq i64 %67, %68
br i1 %69, label %70, label %98
70: ; preds = %63
%71 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %7, i32 0, i32 0
%72 = load i32, i32* %71
%73 = load i32, i32* @IFF_LOOPBACK
%74 = and i32 %72, %73
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %85
76: ; preds = %70
%77 = load i32, i32* %10
%78 = icmp eq i32 %77, 1
br i1 %78, label %79, label %98
79: ; preds = %76
%80 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %7, i32 0, i32 0
%81 = load i32, i32* %80
%82 = load i32, i32* @IFF_LOOPBACK
%83 = and i32 %81, %82
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %98
85: ; preds = %79, %70
%86 = load %struct.sockaddr_in*, %struct.sockaddr_in** %2
%87 = load %struct.ifreq*, %struct.ifreq** %8
%88 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %87, i32 0, i32 1
%89 = bitcast %struct.TYPE_2__* %88 to %struct.sockaddr_in*
%90 = bitcast %struct.sockaddr_in* %86 to i8*
%91 = bitcast %struct.sockaddr_in* %89 to i8*
%92 = load i32, i32* @PMAPPORT
%93 = call i32 @htons(i32 %92)
%94 = load %struct.sockaddr_in*, %struct.sockaddr_in** %2
%95 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %94, i32 0, i32 0
store i32 %93, i32* %95
%96 = load i32, i32* %3
%97 = call i32 @__close(i32 %96)
store i32 1, i32* %11
br label %113
98: ; preds = %79, %76, %63, %57
%99 = load %struct.ifreq*, %struct.ifreq** %8
%100 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %99, i32 1
store %struct.ifreq* %100, %struct.ifreq** %8
br label %101
101: ; preds = %98
%102 = load i32, i32* %9
%103 = sext i32 %102 to i64
%104 = sub i64 %103, 16
%105 = trunc i64 %104 to i32
store i32 %105, i32* %9
br label %42
106: ; preds = %42
%107 = load i32, i32* %10
%108 = icmp eq i32 %107, 0
br i1 %108, label %109, label %110
109: ; preds = %106
store i32 1, i32* %10
br label %37
110: ; preds = %106
%111 = load i32, i32* %3
%112 = call i32 @__close(i32 %111)
store i32 0, i32* %11
br label %113
113: ; preds = %110, %85
%114 = load i8*, i8** %4
%115 = load i32, i32* %11
switch i32 %115, label %117 [
i32 0, label %116
i32 1, label %116
]
116: ; preds = %113, %113
ret void
117: ; preds = %113
unreachable
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.ifconf = type { i32, i8*, %struct.ifreq* }
%struct.ifreq = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64 }
@BUFSIZ = global i32 0
@AF_INET = global i64 0
@SOCK_DGRAM = global i32 0
@.str = [22 x i8] c"get_myaddress: socket\00"
@SIOCGIFCONF = global i32 0
@.str.1 = [51 x i8] c"get_myaddress: ioctl (get interface configuration)\00"
@SIOCGIFFLAGS = global i32 0
@.str.2 = [21 x i8] c"get_myaddress: ioctl\00"
@IFF_UP = global i32 0
@IFF_LOOPBACK = global i32 0
@PMAPPORT = global i32 0
define void @get_myaddress(%struct.sockaddr_in* nocapture writeonly %0) {
%2 = alloca %struct.ifconf
%3 = alloca %struct.ifreq
%4 = load i32, i32* @BUFSIZ
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = bitcast %struct.ifconf* %2 to i8*
%8 = bitcast %struct.ifreq* %3 to i8*
%9 = load i64, i64* @AF_INET
%10 = load i32, i32* @SOCK_DGRAM
%11 = tail call i32 @__socket(i64 %9, i32 %10, i32 0)
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %1
%17 = getelementptr inbounds %struct.ifconf, %struct.ifconf* %2, i64 0, i32 0
store i32 %4, i32* %17
%18 = getelementptr inbounds %struct.ifconf, %struct.ifconf* %2, i64 0, i32 1
store i8* %6, i8** %18
%19 = load i32, i32* @SIOCGIFCONF
%20 = call i64 @__ioctl(i32 %11, i32 %19, i8* %7)
%21 = icmp slt i64 %20, 0
br i1 %21, label %29, label %22
22: ; preds = %16
%23 = getelementptr inbounds %struct.ifconf, %struct.ifconf* %2, i64 0, i32 2
%24 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %3, i64 0, i32 0
%25 = load i32, i32* %17
%26 = icmp eq i32 %25, 0
br i1 %26, label %96, label %27
27: ; preds = %22
%28 = load %struct.ifreq*, %struct.ifreq** %23
br label %33
29: ; preds = %16
%30 = call i8* @_(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%31 = call i32 @perror(i8* %30)
%32 = call i32 @exit(i32 1)
unreachable
33: ; preds = %27, %65
%34 = phi i32 [ %67, %65 ], [ %25, %27 ]
%35 = phi %struct.ifreq* [ %66, %65 ], [ %28, %27 ]
%36 = bitcast %struct.ifreq* %35 to i8*
%37 = load i32, i32* @SIOCGIFFLAGS
%38 = call i64 @__ioctl(i32 %11, i32 %37, i8* %8)
%39 = icmp slt i64 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %33, %74
%41 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%42 = call i32 @exit(i32 1)
unreachable
43: ; preds = %33
%44 = load i32, i32* %24
%45 = load i32, i32* @IFF_UP
%46 = and i32 %45, %44
%47 = icmp eq i32 %46, 0
br i1 %47, label %65, label %48
48: ; preds = %43
%49 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %35, i64 0, i32 1
%50 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %49, i64 0, i32 0
%51 = load i64, i64* %50
%52 = load i64, i64* @AF_INET
%53 = icmp eq i64 %51, %52
br i1 %53, label %54, label %65
54: ; preds = %48
%55 = load i32, i32* @IFF_LOOPBACK
%56 = and i32 %55, %44
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %65
58: ; preds = %54, %86
%59 = phi %struct.TYPE_2__* [ %87, %86 ], [ %49, %54 ]
%60 = bitcast %struct.TYPE_2__* %59 to i32*
%61 = getelementptr %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 0
%62 = load i32, i32* %60
store i32 %62, i32* %61
%63 = load i32, i32* @PMAPPORT
%64 = call i32 @htons(i32 %63)
store i32 %64, i32* %61
br label %96
65: ; preds = %54, %48, %43
%66 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %35, i64 1
%67 = add i32 %34, -16
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %33
69: ; preds = %65
%70 = load i32, i32* %17
%71 = icmp eq i32 %70, 0
br i1 %71, label %96, label %72
72: ; preds = %69
%73 = load %struct.ifreq*, %struct.ifreq** %23
br label %74
74: ; preds = %72, %92
%75 = phi i32 [ %94, %92 ], [ %70, %72 ]
%76 = phi %struct.ifreq* [ %93, %92 ], [ %73, %72 ]
%77 = bitcast %struct.ifreq* %76 to i8*
%78 = load i32, i32* @SIOCGIFFLAGS
%79 = call i64 @__ioctl(i32 %11, i32 %78, i8* %8)
%80 = icmp slt i64 %79, 0
br i1 %80, label %40, label %81
81: ; preds = %74
%82 = load i32, i32* %24
%83 = load i32, i32* @IFF_UP
%84 = and i32 %83, %82
%85 = icmp eq i32 %84, 0
br i1 %85, label %92, label %86
86: ; preds = %81
%87 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %76, i64 0, i32 1
%88 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %87, i64 0, i32 0
%89 = load i64, i64* %88
%90 = load i64, i64* @AF_INET
%91 = icmp eq i64 %89, %90
br i1 %91, label %58, label %92
92: ; preds = %86, %81
%93 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %76, i64 1
%94 = add i32 %75, -16
%95 = icmp eq i32 %94, 0
br i1 %95, label %96, label %74
96: ; preds = %92, %69, %22, %58
%97 = call i32 @__close(i32 %11)
ret void
}