#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;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
scalar_t__ ioctl(int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ perror(char *);
int socket(scalar_t__, int /*<<< orphan*/, int /*<<< orphan*/);
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    0x2e3d(%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    0x2e36(%rip),%rax
mov    (%rax),%rdi
mov    0x2e1c(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1080 <socket@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    11df <get_myaddress+0x7f>
lea    0xe30(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x68(%rbp),%rax
mov    -0x70(%rbp),%rcx
mov    %ecx,-0x38(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2db0(%rip),%rax
mov    (%rax),%esi
lea    -0x38(%rbp),%rdx
call   1040 <ioctl@plt>
cmp    $0x0,%rax
jge    1223 <get_myaddress+0xc3>
lea    0xe02(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    1228 <get_myaddress+0xc8>
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
je     133c <get_myaddress+0x1dc>
mov    -0x50(%rbp),%rax
mov    (%rax),%rcx
mov    %rcx,-0x48(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2d63(%rip),%rax
mov    (%rax),%esi
lea    -0x48(%rbp),%rdx
call   1040 <ioctl@plt>
cmp    $0x0,%rax
jge    1288 <get_myaddress+0x128>
lea    0xdd0(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x48(%rbp),%eax
mov    0x2d46(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1320 <get_myaddress+0x1c0>
mov    -0x50(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2d34(%rip),%rcx
cmp    (%rcx),%rax
jne    1320 <get_myaddress+0x1c0>
mov    -0x48(%rbp),%eax
mov    0x2d39(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     12e9 <get_myaddress+0x189>
cmpl   $0x1,-0x58(%rbp)
jne    1320 <get_myaddress+0x1c0>
mov    -0x48(%rbp),%eax
mov    0x2d1a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1320 <get_myaddress+0x1c0>
mov    -0x8(%rbp),%rax
mov    -0x50(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    %ecx,(%rax)
mov    0x2ccb(%rip),%rax
mov    (%rax),%edi
call   1030 <htons@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edi
call   1050 <close@plt>
movl   $0x1,-0x5c(%rbp)
jmp    1361 <get_myaddress+0x201>
mov    -0x50(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x50(%rbp)
movslq -0x54(%rbp),%rax
sub    $0x10,%rax
mov    %eax,-0x54(%rbp)
jmp    1236 <get_myaddress+0xd6>
cmpl   $0x0,-0x58(%rbp)
jne    1352 <get_myaddress+0x1f2>
movl   $0x1,-0x58(%rbp)
jmp    1228 <get_myaddress+0xc8>
mov    -0xc(%rbp),%edi
call   1050 <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    0x2e35(%rip),%rax
mov    (%rax),%r14d
mov    %rsp,%rbx
lea    0xf(%r14),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x2e4a(%rip),%rax
mov    (%rax),%rdi
mov    0x2e30(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1080 <socket@plt>
test   %eax,%eax
js     12f8 <get_myaddress+0x198>
mov    %eax,%r13d
mov    %r14d,-0x58(%rbp)
mov    %rbx,-0x50(%rbp)
mov    0x2de5(%rip),%rax
mov    (%rax),%esi
lea    -0x58(%rbp),%rdx
mov    %r13d,%edi
call   1040 <ioctl@plt>
test   %rax,%rax
js     1301 <get_myaddress+0x1a1>
mov    %r15,-0x60(%rbp)
mov    -0x58(%rbp),%r14d
test   %r14d,%r14d
je     12cb <get_myaddress+0x16b>
mov    -0x48(%rbp),%rbx
add    $0x8,%rbx
lea    -0x40(%rbp),%r15
mov    0x2dda(%rip),%r12
jmp    120a <get_myaddress+0xaa>
add    $0x10,%rbx
add    $0xfffffff0,%r14d
je     1254 <get_myaddress+0xf4>
movups -0x8(%rbx),%xmm0
movaps %xmm0,-0x40(%rbp)
mov    0x2da7(%rip),%rax
mov    (%rax),%esi
mov    %r13d,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
test   %rax,%rax
js     12e2 <get_myaddress+0x182>
mov    -0x40(%rbp),%eax
test   %eax,(%r12)
je     1200 <get_myaddress+0xa0>
mov    (%rbx),%rcx
mov    0x2d9e(%rip),%rdx
cmp    (%rdx),%rcx
jne    1200 <get_myaddress+0xa0>
mov    0x2daa(%rip),%rcx
test   %eax,(%rcx)
jne    1200 <get_myaddress+0xa0>
jmp    12b3 <get_myaddress+0x153>
mov    -0x58(%rbp),%r14d
test   %r14d,%r14d
je     12cb <get_myaddress+0x16b>
mov    -0x48(%rbp),%rbx
add    $0x8,%rbx
lea    -0x40(%rbp),%r15
jmp    127a <get_myaddress+0x11a>
nopl   0x0(%rax,%rax,1)
add    $0x10,%rbx
add    $0xfffffff0,%r14d
je     12cb <get_myaddress+0x16b>
movups -0x8(%rbx),%xmm0
movaps %xmm0,-0x40(%rbp)
mov    0x2d37(%rip),%rax
mov    (%rax),%esi
mov    %r13d,%edi
mov    %r15,%rdx
call   1040 <ioctl@plt>
test   %rax,%rax
js     12e2 <get_myaddress+0x182>
mov    (%r12),%eax
test   %eax,-0x40(%rbp)
je     1270 <get_myaddress+0x110>
mov    (%rbx),%rax
mov    0x2d32(%rip),%rcx
cmp    (%rcx),%rax
jne    1270 <get_myaddress+0x110>
mov    (%rbx),%eax
mov    -0x60(%rbp),%rbx
mov    %eax,(%rbx)
mov    0x2d06(%rip),%rax
mov    (%rax),%edi
call   1030 <htons@plt>
mov    %eax,(%rbx)
mov    %r13d,%edi
call   1050 <close@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd60(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
lea    0xd01(%rip),%rdi
jmp    12e9 <get_myaddress+0x189>
lea    0xd0e(%rip),%rdi
jmp    12e9 <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 %35
32: ; preds = %23
%33 = call i32 @perror(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %23
br label %36
36: ; preds = %108, %35
%37 = getelementptr inbounds %struct.ifconf, %struct.ifconf* %6, i32 0, i32 2
%38 = load %struct.ifreq*, %struct.ifreq** %37
store %struct.ifreq* %38, %struct.ifreq** %8
%39 = getelementptr inbounds %struct.ifconf, %struct.ifconf* %6, i32 0, i32 0
%40 = load i32, i32* %39
store i32 %40, i32* %9
br label %41
41: ; preds = %100, %36
%42 = load i32, i32* %9
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %105
44: ; preds = %41
%45 = load %struct.ifreq*, %struct.ifreq** %8
%46 = bitcast %struct.ifreq* %7 to i8*
%47 = bitcast %struct.ifreq* %45 to i8*
%48 = load i32, i32* %3
%49 = load i32, i32* @SIOCGIFFLAGS
%50 = bitcast %struct.ifreq* %7 to i8*
%51 = call i64 @ioctl(i32 %48, i32 %49, i8* %50)
%52 = icmp slt i64 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %44
%54 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%55 = call i32 @exit(i32 1)
unreachable
56: ; preds = %44
%57 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %7, i32 0, i32 0
%58 = load i32, i32* %57
%59 = load i32, i32* @IFF_UP
%60 = and i32 %58, %59
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %97
62: ; preds = %56
%63 = load %struct.ifreq*, %struct.ifreq** %8
%64 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %63, i32 0, i32 1
%65 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %64, i32 0, i32 0
%66 = load i64, i64* %65
%67 = load i64, i64* @AF_INET
%68 = icmp eq i64 %66, %67
br i1 %68, label %69, label %97
69: ; preds = %62
%70 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %7, i32 0, i32 0
%71 = load i32, i32* %70
%72 = load i32, i32* @IFF_LOOPBACK
%73 = and i32 %71, %72
%74 = icmp ne i32 %73, 0
br i1 %74, label %75, label %84
75: ; preds = %69
%76 = load i32, i32* %10
%77 = icmp eq i32 %76, 1
br i1 %77, label %78, label %97
78: ; preds = %75
%79 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %7, i32 0, i32 0
%80 = load i32, i32* %79
%81 = load i32, i32* @IFF_LOOPBACK
%82 = and i32 %80, %81
%83 = icmp ne i32 %82, 0
br i1 %83, label %84, label %97
84: ; preds = %78, %69
%85 = load %struct.sockaddr_in*, %struct.sockaddr_in** %2
%86 = load %struct.ifreq*, %struct.ifreq** %8
%87 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %86, i32 0, i32 1
%88 = bitcast %struct.TYPE_2__* %87 to %struct.sockaddr_in*
%89 = bitcast %struct.sockaddr_in* %85 to i8*
%90 = bitcast %struct.sockaddr_in* %88 to i8*
%91 = load i32, i32* @PMAPPORT
%92 = call i32 @htons(i32 %91)
%93 = load %struct.sockaddr_in*, %struct.sockaddr_in** %2
%94 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %93, i32 0, i32 0
store i32 %92, i32* %94
%95 = load i32, i32* %3
%96 = call i32 @close(i32 %95)
store i32 1, i32* %11
br label %112
97: ; preds = %78, %75, %62, %56
%98 = load %struct.ifreq*, %struct.ifreq** %8
%99 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %98, i32 1
store %struct.ifreq* %99, %struct.ifreq** %8
br label %100
100: ; preds = %97
%101 = load i32, i32* %9
%102 = sext i32 %101 to i64
%103 = sub i64 %102, 16
%104 = trunc i64 %103 to i32
store i32 %104, i32* %9
br label %41
105: ; preds = %41
%106 = load i32, i32* %10
%107 = icmp eq i32 %106, 0
br i1 %107, label %108, label %109
108: ; preds = %105
store i32 1, i32* %10
br label %36
109: ; preds = %105
%110 = load i32, i32* %3
%111 = call i32 @close(i32 %110)
store i32 0, i32* %11
br label %112
112: ; preds = %109, %84
%113 = load i8*, i8** %4
%114 = load i32, i32* %11
switch i32 %114, label %116 [
i32 0, label %115
i32 1, label %115
]
115: ; preds = %112, %112
ret void
116: ; preds = %112
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 %95, label %27
27: ; preds = %22
%28 = load %struct.ifreq*, %struct.ifreq** %23
br label %32
29: ; preds = %16
%30 = call i32 @perror(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %27, %64
%33 = phi i32 [ %66, %64 ], [ %25, %27 ]
%34 = phi %struct.ifreq* [ %65, %64 ], [ %28, %27 ]
%35 = bitcast %struct.ifreq* %34 to i8*
%36 = load i32, i32* @SIOCGIFFLAGS
%37 = call i64 @ioctl(i32 %11, i32 %36, i8* %8)
%38 = icmp slt i64 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %32, %73
%40 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%41 = call i32 @exit(i32 1)
unreachable
42: ; preds = %32
%43 = load i32, i32* %24
%44 = load i32, i32* @IFF_UP
%45 = and i32 %44, %43
%46 = icmp eq i32 %45, 0
br i1 %46, label %64, label %47
47: ; preds = %42
%48 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %34, i64 0, i32 1
%49 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %48, i64 0, i32 0
%50 = load i64, i64* %49
%51 = load i64, i64* @AF_INET
%52 = icmp eq i64 %50, %51
br i1 %52, label %53, label %64
53: ; preds = %47
%54 = load i32, i32* @IFF_LOOPBACK
%55 = and i32 %54, %43
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %64
57: ; preds = %53, %85
%58 = phi %struct.TYPE_2__* [ %86, %85 ], [ %48, %53 ]
%59 = bitcast %struct.TYPE_2__* %58 to i32*
%60 = getelementptr %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 0
%61 = load i32, i32* %59
store i32 %61, i32* %60
%62 = load i32, i32* @PMAPPORT
%63 = call i32 @htons(i32 %62)
store i32 %63, i32* %60
br label %95
64: ; preds = %53, %47, %42
%65 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %34, i64 1
%66 = add i32 %33, -16
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %32
68: ; preds = %64
%69 = load i32, i32* %17
%70 = icmp eq i32 %69, 0
br i1 %70, label %95, label %71
71: ; preds = %68
%72 = load %struct.ifreq*, %struct.ifreq** %23
br label %73
73: ; preds = %71, %91
%74 = phi i32 [ %93, %91 ], [ %69, %71 ]
%75 = phi %struct.ifreq* [ %92, %91 ], [ %72, %71 ]
%76 = bitcast %struct.ifreq* %75 to i8*
%77 = load i32, i32* @SIOCGIFFLAGS
%78 = call i64 @ioctl(i32 %11, i32 %77, i8* %8)
%79 = icmp slt i64 %78, 0
br i1 %79, label %39, label %80
80: ; preds = %73
%81 = load i32, i32* %24
%82 = load i32, i32* @IFF_UP
%83 = and i32 %82, %81
%84 = icmp eq i32 %83, 0
br i1 %84, label %91, label %85
85: ; preds = %80
%86 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %75, i64 0, i32 1
%87 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %86, i64 0, i32 0
%88 = load i64, i64* %87
%89 = load i64, i64* @AF_INET
%90 = icmp eq i64 %88, %89
br i1 %90, label %57, label %91
91: ; preds = %85, %80
%92 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %75, i64 1
%93 = add i32 %74, -16
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %73
95: ; preds = %91, %68, %22, %57
%96 = call i32 @close(i32 %11)
ret void
}