#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_6__ TYPE_3__;
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct timeval {
  int member_0;
  int /*<<< orphan*/ member_1;
};
struct sockaddr_storage {
  scalar_t__ ss_family;
};
struct sockaddr_in6 {
  int /*<<< orphan*/ sin6_addr;
};
struct TYPE_5__ {
  int /*<<< orphan*/ member_0;
};
struct sockaddr_in {
  scalar_t__ member_0;
  int member_1;
  int /*<<< orphan*/ sin_addr;
  TYPE_2__ member_2;
};
struct msghdr {
  int msg_namelen;
  int msg_iovlen;
  size_t *msg_control;
  int msg_controllen;
  struct iovec *msg_iov;
  struct sockaddr_storage *msg_name;
};
struct iovec {
  char **iov_base;
  int iov_len;
};
struct TYPE_4__ {
  int /*<<< orphan*/ s_addr;
};
struct in_pktinfo {
  TYPE_1__ ipi_spec_dst;
};
struct ifaddrs {
  int ifa_flags;
  TYPE_3__ *ifa_addr;
  struct ifaddrs *ifa_next;
};
struct cmsghdr {
  scalar_t__ cmsg_level;
  scalar_t__ cmsg_type;
};
typedef int /*<<< orphan*/ one;
typedef int /*<<< orphan*/ msgh;
typedef int /*<<< orphan*/ fd_set;
typedef int /*<<< orphan*/ ctlbuf;
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ address;
typedef int /*<<< orphan*/ XDR;
struct TYPE_6__ {
  scalar_t__ sa_family;
};

/* Variables and functions */
scalar_t__ AF_INET;
scalar_t__ AF_INET6;
scalar_t__ CMSG_DATA(struct cmsghdr *);
struct cmsghdr *CMSG_FIRSTHDR(struct msghdr *);
struct cmsghdr *CMSG_NXTHDR(struct msghdr *, struct cmsghdr *);
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int IFF_BROADCAST;
int IFF_MULTICAST;
int INET6_ADDRSTRLEN;
scalar_t__ IPPROTO_IP;
scalar_t__ IPPROTO_IPV6;
int /*<<< orphan*/ IPPROTO_TCP;
scalar_t__ IPV6_PKTINFO;
scalar_t__ IPV6_RECVPKTINFO;
scalar_t__ IP_PKTINFO;
int /*<<< orphan*/ SOCK_DGRAM;
scalar_t__ SOL_SOCKET;
scalar_t__ SO_BROADCAST;
int /*<<< orphan*/ XDR_ENCODE;
int /*<<< orphan*/ assert(int);
char *clnt_spcreateerror(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fill_vxi_getport_xdr(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ freeifaddrs(struct ifaddrs *);
scalar_t__ getifaddrs(struct ifaddrs **);
scalar_t__ inet_aton(char *, int /*<<< orphan*/ *);
scalar_t__ inet_ntop(scalar_t__, int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ memset(struct msghdr *, int /*<<< orphan*/, int);
short parse_getport_response(char *, int);
short pmap_getport(struct sockaddr_in *, int, int, int /*<<< orphan*/);
int recvmsg(int, struct msghdr *, int /*<<< orphan*/);
scalar_t__ select(int, int /*<<< orphan*/ *, int /*<<< orphan*/,
                  int /*<<< orphan*/, struct timeval *);
int /*<<< orphan*/ send_rpc_broadcast_ipv4(int, struct iovec *,
                                           struct ifaddrs *);
int /*<<< orphan*/ send_rpc_broadcast_ipv6(int, struct iovec *,
                                           struct ifaddrs *);
int /*<<< orphan*/ setsockopt(int, scalar_t__, scalar_t__, int *, int);
int socket(scalar_t__, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
scalar_t__ xdr_getpos(int /*<<< orphan*/ *);
int /*<<< orphan*/ xdrmem_create(int /*<<< orphan*/ *, char *, int,
                                 int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  if ((argc == 2) && (*argv[1] != '-')) {
    struct sockaddr_in sock = {AF_INET, 111, {0}};
    fprintf(stderr, "Sending unicast query to '%s'\n", argv[1]);
    if (inet_aton(argv[1], &sock.sin_addr) == 0) {
      fprintf(stderr, "Invalid address\n");
      exit(EXIT_FAILURE);
    }
    short port = pmap_getport(&sock, 0x0607AF, 1, IPPROTO_TCP);
    if (port) {
      fprintf(stderr, "Found VXI-11 on port %d\n", port);
    } else {
      fprintf(stderr, "RPC failed:\n%s\n", clnt_spcreateerror(""));
    }
    exit(0);
  }
  if ((argc == 2) && (*argv[1] == '-')) {
    if (strcmp(argv[1], "-b") != 0)
      exit(EXIT_FAILURE);
    int udp_socket = socket(AF_INET, SOCK_DGRAM, 0);
    int udp_socket6 = socket(AF_INET6, SOCK_DGRAM, 0);
    int one = 1;
    setsockopt(udp_socket, SOL_SOCKET, SO_BROADCAST, &one, sizeof(one));
    setsockopt(udp_socket6, SOL_SOCKET, SO_BROADCAST, &one, sizeof(one));
    setsockopt(udp_socket, IPPROTO_IP, IP_PKTINFO, &one, sizeof(one));
    setsockopt(udp_socket6, IPPROTO_IPV6, IPV6_RECVPKTINFO, &one, sizeof(one));
    XDR xdr;
    char buf[200];
    xdrmem_create(&xdr, buf, sizeof(buf), XDR_ENCODE);
    assert(xdr_getpos(&xdr) == 0);
    fill_vxi_getport_xdr(&xdr);
    struct ifaddrs *ifap, *ifp;
    if (getifaddrs(&ifap) != 0)
      exit(EXIT_FAILURE);
    for (ifp = ifap; ifp; ifp = ifp->ifa_next) {
      struct iovec io;
      if ((ifp->ifa_flags & (IFF_MULTICAST | IFF_BROADCAST)) == 0)
        continue;
      io.iov_base = &buf;
      io.iov_len = xdr_getpos(&xdr);
      if (ifp->ifa_addr->sa_family == AF_INET)
        send_rpc_broadcast_ipv4(udp_socket, &io, ifp);
      else if (ifp->ifa_addr->sa_family == AF_INET6)
        send_rpc_broadcast_ipv6(udp_socket6, &io, ifp);
    }
    freeifaddrs(ifap);
    struct timeval timeout = {2, 0};
    fd_set fds;
    FD_ZERO(&fds);
    FD_SET(udp_socket, &fds);
    FD_SET(udp_socket6, &fds);
    short port = 0;
    while (1) {
      struct sockaddr_storage address;
      struct msghdr msgh;
      struct iovec io;
      struct cmsghdr *cmsg;
      size_t ctlbuf[128];
      char srcbuf[INET6_ADDRSTRLEN];
      char destbuf[INET6_ADDRSTRLEN];
      int len;
      if (select(udp_socket6 + 1, &fds, 0, 0, &timeout) == 0)
        break;
      if (!FD_ISSET(udp_socket, &fds) && !FD_ISSET(udp_socket6, &fds))
        continue;
      memset(&msgh, 0, sizeof(msgh));
      msgh.msg_name = &address;
      msgh.msg_namelen = sizeof(address);
      msgh.msg_iov = &io;
      msgh.msg_iovlen = 1;
      msgh.msg_control = ctlbuf;
      msgh.msg_controllen = sizeof(ctlbuf);
      io.iov_base = &buf;
      io.iov_len = sizeof(buf);
      if (FD_ISSET(udp_socket, &fds))
        len = recvmsg(udp_socket, &msgh, 0);
      else if (FD_ISSET(udp_socket6, &fds))
        len = recvmsg(udp_socket6, &msgh, 0);
      port = parse_getport_response(buf, len);
      if (address.ss_family == AF_INET) {
        for (cmsg = CMSG_FIRSTHDR(&msgh); cmsg != NULL;
             cmsg = CMSG_NXTHDR(&msgh, cmsg)) {
          if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_PKTINFO) {
            struct in_pktinfo *pktinfo = (struct in_pktinfo *)CMSG_DATA(cmsg);
            if (inet_ntop(AF_INET, &pktinfo->ipi_spec_dst.s_addr, destbuf,
                          INET6_ADDRSTRLEN) == 0)
              destbuf[0] = '\0';
            fprintf(stderr, "Got IP_PKTINFO on %s\n", destbuf);
            break;
          }
        }
        struct sockaddr_in *inaddr = (struct sockaddr_in *)(&address);
        if (inet_ntop(AF_INET, &inaddr->sin_addr, srcbuf, INET6_ADDRSTRLEN) ==
            0)
          srcbuf[0] = '\0';
      }
      if (address.ss_family == AF_INET6) {
        struct sockaddr_in6 *in6addr = (struct sockaddr_in6 *)(&address);
        if (inet_ntop(AF_INET6, &in6addr->sin6_addr, srcbuf,
                      INET6_ADDRSTRLEN) == 0)
          srcbuf[0] = '\0';
        for (cmsg = CMSG_FIRSTHDR(&msgh); cmsg != NULL;
             cmsg = CMSG_NXTHDR(&msgh, cmsg)) {
          if (cmsg->cmsg_level == IPPROTO_IPV6 &&
              cmsg->cmsg_type == IPV6_PKTINFO) {
            fprintf(stderr, "Got IPV6_PKTINFO\n");
            break;
          }
        }
      }
      fprintf(stderr, "'%s' has VXI-11 on port %d\n", srcbuf, port);
    }
    if (!port)
      fprintf(stderr, "No answer received\n");
    exit(0);
  }
  fprintf(stderr, "%1$s <dotted-address>\n%1$s -b\n", argv[0]);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x5f0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    13fe <main+0x14e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     13fe <main+0x14e>
mov    0x2ce2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
movl   $0x6f,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0x28(%rbp),%rdi
add    $0x10,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1090 <memset@plt>
mov    0x2c62(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xcd1(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x28(%rbp),%rsi
add    $0xc,%rsi
call   1120 <inet_aton@plt>
cmp    $0x0,%rax
jne    137a <main+0xca>
mov    0x2c24(%rip),%rax
mov    (%rax),%edi
lea    0xcba(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
mov    0x2bfd(%rip),%rax
mov    (%rax),%edi
call   1170 <exit@plt>
mov    0x2c2f(%rip),%rax
mov    (%rax),%ecx
lea    -0x28(%rbp),%rdi
mov    $0x607af,%esi
mov    $0x1,%edx
call   10a0 <pmap_getport@plt>
mov    %ax,-0x2a(%rbp)
cmpw   $0x0,-0x2a(%rbp)
je     13c5 <main+0x115>
mov    0x2bd4(%rip),%rax
mov    (%rax),%edi
movswl -0x2a(%rbp),%edx
lea    0xc77(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
jmp    13f7 <main+0x147>
mov    0x2bb4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5cc(%rbp)
lea    0xc43(%rip),%rdi
call   10c0 <clnt_spcreateerror@plt>
mov    -0x5cc(%rbp),%edi
mov    %rax,%rdx
lea    0xc59(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
xor    %edi,%edi
call   1170 <exit@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1b73 <main+0x8c3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1b73 <main+0x8c3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xc2e(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
je     1448 <main+0x198>
mov    0x2b2f(%rip),%rax
mov    (%rax),%edi
call   1170 <exit@plt>
mov    0x2b81(%rip),%rax
mov    (%rax),%rdi
mov    0x2b4f(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   11d0 <socket@plt>
mov    %eax,-0x30(%rbp)
mov    0x2b2c(%rip),%rax
mov    (%rax),%rdi
mov    0x2b32(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   11d0 <socket@plt>
mov    %eax,-0x34(%rbp)
movl   $0x1,-0x38(%rbp)
mov    -0x30(%rbp),%edi
mov    0x2b4d(%rip),%rax
mov    (%rax),%rsi
mov    0x2b03(%rip),%rax
mov    (%rax),%rdx
lea    -0x38(%rbp),%rcx
mov    $0x4,%r8d
call   1070 <setsockopt@plt>
mov    -0x34(%rbp),%edi
mov    0x2b27(%rip),%rax
mov    (%rax),%rsi
mov    0x2add(%rip),%rax
mov    (%rax),%rdx
lea    -0x38(%rbp),%rcx
mov    $0x4,%r8d
call   1070 <setsockopt@plt>
mov    -0x30(%rbp),%edi
mov    0x2ae9(%rip),%rax
mov    (%rax),%rsi
mov    0x2ad7(%rip),%rax
mov    (%rax),%rdx
lea    -0x38(%rbp),%rcx
mov    $0x4,%r8d
call   1070 <setsockopt@plt>
mov    -0x34(%rbp),%edi
mov    0x2a63(%rip),%rax
mov    (%rax),%rsi
mov    0x2ae1(%rip),%rax
mov    (%rax),%rdx
lea    -0x38(%rbp),%rcx
mov    $0x4,%r8d
call   1070 <setsockopt@plt>
lea    -0x110(%rbp),%rsi
mov    0x2a61(%rip),%rax
mov    (%rax),%ecx
lea    -0x3c(%rbp),%rdi
mov    $0xc8,%edx
call   11b0 <xdrmem_create@plt>
lea    -0x3c(%rbp),%rdi
call   1190 <xdr_getpos@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10e0 <assert@plt>
lea    -0x3c(%rbp),%rdi
call   11a0 <fill_vxi_getport_xdr@plt>
lea    -0x118(%rbp),%rdi
call   1130 <getifaddrs@plt>
cmp    $0x0,%rax
je     1586 <main+0x2d6>
mov    0x29f1(%rip),%rax
mov    (%rax),%edi
call   1170 <exit@plt>
mov    -0x118(%rbp),%rax
mov    %rax,-0x120(%rbp)
cmpq   $0x0,-0x120(%rbp)
je     1678 <main+0x3c8>
mov    -0x120(%rbp),%rax
mov    (%rax),%eax
mov    0x2a06(%rip),%rcx
mov    (%rcx),%ecx
mov    0x29a5(%rip),%rdx
or     (%rdx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    15cd <main+0x31d>
jmp    1661 <main+0x3b1>
lea    -0x110(%rbp),%rax
mov    %rax,-0x130(%rbp)
lea    -0x3c(%rbp),%rdi
call   1190 <xdr_getpos@plt>
mov    %eax,-0x128(%rbp)
mov    -0x120(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    0x29d1(%rip),%rcx
cmp    (%rcx),%rax
jne    1623 <main+0x373>
mov    -0x30(%rbp),%edi
mov    -0x120(%rbp),%rdx
lea    -0x130(%rbp),%rsi
call   1050 <send_rpc_broadcast_ipv4@plt>
jmp    165c <main+0x3ac>
mov    -0x120(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    0x2960(%rip),%rcx
cmp    (%rcx),%rax
jne    1657 <main+0x3a7>
mov    -0x34(%rbp),%edi
mov    -0x120(%rbp),%rdx
lea    -0x130(%rbp),%rsi
call   1040 <send_rpc_broadcast_ipv6@plt>
jmp    165c <main+0x3ac>
jmp    1661 <main+0x3b1>
mov    -0x120(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x120(%rbp)
jmp    1594 <main+0x2e4>
mov    -0x118(%rbp),%rdi
call   1160 <freeifaddrs@plt>
mov    0xa49(%rip),%rax
mov    %rax,-0x138(%rbp)
lea    -0x13c(%rbp),%rdi
call   1100 <FD_ZERO@plt>
mov    -0x30(%rbp),%edi
lea    -0x13c(%rbp),%rsi
call   11c0 <FD_SET@plt>
mov    -0x34(%rbp),%edi
lea    -0x13c(%rbp),%rsi
call   11c0 <FD_SET@plt>
movw   $0x0,-0x13e(%rbp)
mov    0x290c(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rdx
mov    %rdx,-0x598(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x5e0(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x5a0(%rbp)
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x5d8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x5a8(%rbp)
mov    -0x34(%rbp),%edi
add    $0x1,%edi
lea    -0x13c(%rbp),%rsi
xor    %ecx,%ecx
lea    -0x138(%rbp),%r8
mov    %ecx,%edx
call   1110 <select@plt>
cmp    $0x0,%rax
jne    1754 <main+0x4a4>
movl   $0x6,-0x5b0(%rbp)
jmp    1b06 <main+0x856>
mov    -0x30(%rbp),%edi
lea    -0x13c(%rbp),%rsi
call   1080 <FD_ISSET@plt>
cmp    $0x0,%rax
jne    1795 <main+0x4e5>
mov    -0x34(%rbp),%edi
lea    -0x13c(%rbp),%rsi
call   1080 <FD_ISSET@plt>
cmp    $0x0,%rax
jne    1795 <main+0x4e5>
movl   $0x5,-0x5b0(%rbp)
jmp    1b06 <main+0x856>
lea    -0x170(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1090 <memset@plt>
lea    -0x148(%rbp),%rax
mov    %rax,-0x150(%rbp)
movl   $0x8,-0x170(%rbp)
lea    -0x180(%rbp),%rax
mov    %rax,-0x158(%rbp)
movl   $0x1,-0x16c(%rbp)
lea    -0x590(%rbp),%rax
mov    %rax,-0x168(%rbp)
movl   $0x400,-0x160(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x180(%rbp)
movl   $0xc8,-0x178(%rbp)
mov    -0x30(%rbp),%edi
lea    -0x13c(%rbp),%rsi
call   1080 <FD_ISSET@plt>
cmp    $0x0,%rax
je     183d <main+0x58d>
mov    -0x30(%rbp),%edi
lea    -0x170(%rbp),%rsi
xor    %edx,%edx
call   1150 <recvmsg@plt>
mov    %eax,-0x5ac(%rbp)
jmp    1872 <main+0x5c2>
mov    -0x34(%rbp),%edi
lea    -0x13c(%rbp),%rsi
call   1080 <FD_ISSET@plt>
cmp    $0x0,%rax
je     186d <main+0x5bd>
mov    -0x34(%rbp),%edi
lea    -0x170(%rbp),%rsi
xor    %edx,%edx
call   1150 <recvmsg@plt>
mov    %eax,-0x5ac(%rbp)
jmp    1872 <main+0x5c2>
lea    -0x110(%rbp),%rdi
mov    -0x5ac(%rbp),%esi
call   10b0 <parse_getport_response@plt>
mov    %ax,-0x13e(%rbp)
mov    -0x148(%rbp),%rax
mov    0x2737(%rip),%rcx
cmp    (%rcx),%rax
jne    19dd <main+0x72d>
lea    -0x170(%rbp),%rdi
call   1180 <CMSG_FIRSTHDR@plt>
mov    %rax,-0x188(%rbp)
cmpq   $0x0,-0x188(%rbp)
je     198c <main+0x6dc>
mov    -0x188(%rbp),%rax
mov    (%rax),%rax
mov    0x26f4(%rip),%rcx
cmp    (%rcx),%rax
jne    1968 <main+0x6b8>
mov    -0x188(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x26d1(%rip),%rcx
cmp    (%rcx),%rax
jne    1968 <main+0x6b8>
mov    -0x188(%rbp),%rdi
call   1060 <CMSG_DATA@plt>
mov    -0x5d8(%rbp),%rdx
mov    %rax,-0x5b8(%rbp)
mov    0x26b7(%rip),%rax
mov    (%rax),%rdi
mov    -0x5b8(%rbp),%rsi
mov    0x26ae(%rip),%rax
mov    (%rax),%ecx
call   1030 <inet_ntop@plt>
cmp    $0x0,%rax
jne    1945 <main+0x695>
mov    -0x5d8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x5d8(%rbp),%rdx
mov    0x262d(%rip),%rax
mov    (%rax),%edi
lea    0x700(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
jmp    198c <main+0x6dc>
jmp    196d <main+0x6bd>
mov    -0x188(%rbp),%rsi
lea    -0x170(%rbp),%rdi
call   1140 <CMSG_NXTHDR@plt>
mov    %rax,-0x188(%rbp)
jmp    18b5 <main+0x605>
mov    -0x5e0(%rbp),%rdx
lea    -0x148(%rbp),%rax
mov    %rax,-0x5c0(%rbp)
mov    0x2628(%rip),%rax
mov    (%rax),%rdi
mov    -0x5c0(%rbp),%rsi
add    $0xc,%rsi
mov    0x261b(%rip),%rax
mov    (%rax),%ecx
call   1030 <inet_ntop@plt>
cmp    $0x0,%rax
jne    19d8 <main+0x728>
mov    -0x5e0(%rbp),%rax
movb   $0x0,(%rax)
jmp    19dd <main+0x72d>
mov    -0x148(%rbp),%rax
mov    0x25ad(%rip),%rcx
cmp    (%rcx),%rax
jne    1ad7 <main+0x827>
mov    -0x5e0(%rbp),%rdx
lea    -0x148(%rbp),%rax
mov    %rax,-0x5c8(%rbp)
mov    0x2588(%rip),%rax
mov    (%rax),%rdi
mov    -0x5c8(%rbp),%rsi
mov    0x25b7(%rip),%rax
mov    (%rax),%ecx
call   1030 <inet_ntop@plt>
cmp    $0x0,%rax
jne    1a3c <main+0x78c>
mov    -0x5e0(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x170(%rbp),%rdi
call   1180 <CMSG_FIRSTHDR@plt>
mov    %rax,-0x188(%rbp)
cmpq   $0x0,-0x188(%rbp)
je     1ad2 <main+0x822>
mov    -0x188(%rbp),%rax
mov    (%rax),%rax
mov    0x24fa(%rip),%rcx
cmp    (%rcx),%rax
jne    1aae <main+0x7fe>
mov    -0x188(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x24ef(%rip),%rcx
cmp    (%rcx),%rax
jne    1aae <main+0x7fe>
mov    0x24e7(%rip),%rax
mov    (%rax),%edi
lea    0x5d0(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
jmp    1ad2 <main+0x822>
jmp    1ab3 <main+0x803>
mov    -0x188(%rbp),%rsi
lea    -0x170(%rbp),%rdi
call   1140 <CMSG_NXTHDR@plt>
mov    %rax,-0x188(%rbp)
jmp    1a4f <main+0x79f>
jmp    1ad7 <main+0x827>
mov    -0x5e0(%rbp),%rdx
mov    0x249b(%rip),%rax
mov    (%rax),%edi
movswl -0x13e(%rbp),%ecx
lea    0x58f(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
movl   $0x0,-0x5b0(%rbp)
mov    -0x598(%rbp),%rax
mov    %rax,%rsp
mov    -0x5b0(%rbp),%eax
mov    %eax,-0x5e4(%rbp)
test   %eax,%eax
je     1b42 <main+0x892>
jmp    1b29 <main+0x879>
mov    -0x5e4(%rbp),%eax
sub    $0x5,%eax
je     16c5 <main+0x415>
jmp    1b3d <main+0x88d>
jmp    1b47 <main+0x897>
jmp    16c5 <main+0x415>
cmpw   $0x0,-0x13e(%rbp)
jne    1b6c <main+0x8bc>
mov    0x2424(%rip),%rax
mov    (%rax),%edi
lea    0x53b(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
xor    %edi,%edi
call   1170 <exit@plt>
mov    0x2406(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0x52a(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
mov    0x23d8(%rip),%rax
mov    (%rax),%edi
call   1170 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x548,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1426 <main+0x176>
mov    0x8(%rbx),%rdx
cmpb   $0x2d,(%rdx)
jne    144e <main+0x19e>
lea    0xd75(%rip),%rsi
mov    %rdx,%rdi
call   10d0 <strcmp@plt>
test   %rax,%rax
jne    1440 <main+0x190>
mov    0x2cd4(%rip),%rax
mov    (%rax),%rdi
mov    0x2ca2(%rip),%rbx
mov    (%rbx),%esi
xor    %edx,%edx
call   11d0 <socket@plt>
mov    %eax,%r12d
mov    0x2c7f(%rip),%rax
mov    (%rax),%rdi
mov    (%rbx),%esi
xor    %edx,%edx
call   11d0 <socket@plt>
mov    %eax,%r13d
movl   $0x1,-0x54(%rbp)
mov    0x2caa(%rip),%r14
mov    (%r14),%rsi
mov    0x2c60(%rip),%rbx
mov    (%rbx),%rdx
lea    -0x54(%rbp),%r15
mov    %r12d,%edi
mov    %r15,%rcx
mov    $0x4,%r8d
call   1070 <setsockopt@plt>
mov    (%r14),%rsi
mov    (%rbx),%rdx
mov    %r13d,%edi
mov    %r15,%rcx
mov    $0x4,%r8d
call   1070 <setsockopt@plt>
mov    0x2c52(%rip),%rax
mov    (%rax),%rsi
mov    0x2c40(%rip),%rax
mov    (%rax),%rdx
mov    %r12d,%edi
mov    %r15,%rcx
mov    $0x4,%r8d
call   1070 <setsockopt@plt>
mov    0x2bcd(%rip),%rax
mov    (%rax),%rsi
mov    0x2c4b(%rip),%rax
mov    (%rax),%rdx
mov    %r13d,%edi
mov    %r15,%rcx
mov    $0x4,%r8d
call   1070 <setsockopt@plt>
mov    0x2bd0(%rip),%rax
mov    (%rax),%ecx
lea    -0x50(%rbp),%rbx
lea    -0x170(%rbp),%rsi
mov    %rbx,%rdi
mov    $0xc8,%edx
call   11b0 <xdrmem_create@plt>
mov    %rbx,%rdi
call   1190 <xdr_getpos@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   10e0 <assert@plt>
mov    %rbx,%rdi
call   11a0 <fill_vxi_getport_xdr@plt>
lea    -0x68(%rbp),%rdi
call   1130 <getifaddrs@plt>
test   %rax,%rax
jne    1440 <main+0x190>
mov    %r13d,-0x34(%rbp)
mov    %r13d,-0x2c(%rbp)
mov    -0x68(%rbp),%rbx
test   %rbx,%rbx
mov    %r12d,-0x38(%rbp)
jne    151e <main+0x26e>
xor    %edi,%edi
jmp    15b6 <main+0x306>
mov    0x2b53(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xc7b(%rip),%rsi
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    0x2b29(%rip),%rax
mov    (%rax),%edi
call   1170 <exit@plt>
mov    0x2b7b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x570(%rbp)
movq   $0x6f,-0x568(%rbp)
lea    -0x564(%rbp),%r14
movl   $0x0,-0x560(%rbp)
mov    0x2afe(%rip),%r15
mov    (%r15),%edi
lea    0xb74(%rip),%rsi
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    0x8(%rbx),%rdi
mov    %r14,%rsi
call   1120 <inet_aton@plt>
test   %rax,%rax
jne    14b7 <main+0x207>
mov    (%r15),%edi
lea    0xb71(%rip),%rsi
xor    %eax,%eax
call   10f0 <fprintf@plt>
jmp    1440 <main+0x190>
mov    0x2af2(%rip),%rax
mov    (%rax),%ecx
lea    -0x570(%rbp),%rdi
mov    $0x607af,%esi
mov    $0x1,%edx
call   10a0 <pmap_getport@plt>
mov    (%r15),%ebx
test   %ax,%ax
jne    1504 <main+0x254>
lea    0xb39(%rip),%rdi
call   10c0 <clnt_spcreateerror@plt>
lea    0xb58(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
xor    %edi,%edi
call   1170 <exit@plt>
movswl %ax,%edx
lea    0xb22(%rip),%rsi
mov    %ebx,%edi
xor    %eax,%eax
call   10f0 <fprintf@plt>
xor    %edi,%edi
call   1170 <exit@plt>
mov    0x2a93(%rip),%r12
mov    0x2a34(%rip),%r13
lea    -0x50(%rbp),%r14
lea    -0x570(%rbp),%r15
jmp    1557 <main+0x2a7>
nopl   0x0(%rax)
mov    -0x38(%rbp),%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <send_rpc_broadcast_ipv4@plt>
mov    0x10(%rbx),%rbx
test   %rbx,%rbx
je     15ae <main+0x2fe>
mov    0x0(%r13),%eax
or     (%r12),%eax
test   %eax,(%rbx)
je     154e <main+0x29e>
lea    -0x170(%rbp),%rax
mov    %rax,-0x570(%rbp)
mov    %r14,%rdi
call   1190 <xdr_getpos@plt>
mov    %eax,-0x568(%rbp)
mov    0x8(%rbx),%rax
mov    (%rax),%rax
mov    0x2a43(%rip),%rcx
cmp    (%rcx),%rax
je     1540 <main+0x290>
mov    0x29ff(%rip),%rcx
cmp    (%rcx),%rax
jne    154e <main+0x29e>
mov    -0x2c(%rbp),%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <send_rpc_broadcast_ipv6@plt>
jmp    154e <main+0x29e>
mov    -0x68(%rbp),%rdi
mov    -0x38(%rbp),%r12d
call   1160 <freeifaddrs@plt>
movq   $0x2,-0x60(%rbp)
lea    -0x30(%rbp),%r15
mov    %r15,%rdi
call   1100 <FD_ZERO@plt>
mov    %r12d,%edi
mov    %r15,%rsi
call   11c0 <FD_SET@plt>
mov    -0x2c(%rbp),%edi
mov    %r15,%rsi
call   11c0 <FD_SET@plt>
mov    %rsp,%rbx
mov    -0x34(%rbp),%edi
add    $0x1,%edi
mov    0x29e3(%rip),%rcx
mov    (%rcx),%eax
mov    %rsp,%r13
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    (%rcx),%eax
mov    %rsp,%r14
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
lea    -0x60(%rbp),%r8
mov    %edi,-0x34(%rbp)
mov    %r15,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1110 <select@plt>
test   %rax,%rax
jne    163b <main+0x38b>
mov    %rbx,%rsp
jmp    190f <main+0x65f>
lea    -0x30(%rbp),%r15
movl   $0x0,-0x3c(%rbp)
mov    %rbx,%rax
jmp    16c6 <main+0x416>
nopl   0x0(%rax,%rax,1)
mov    0x2929(%rip),%rax
mov    (%rax),%edi
movswl -0x3c(%rbp),%ecx
lea    0xa20(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    -0x70(%rbp),%rbx
mov    %rbx,%rsp
mov    %rsp,%rbx
mov    0x2959(%rip),%rcx
mov    (%rcx),%eax
mov    %rsp,%r13
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    (%rcx),%eax
mov    %rsp,%r14
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
xor    %edx,%edx
xor    %ecx,%ecx
lea    -0x60(%rbp),%r8
call   1110 <select@plt>
lea    -0x30(%rbp),%r15
test   %rax,%rax
je     1901 <main+0x651>
mov    -0x38(%rbp),%r12d
mov    %r12d,%edi
mov    %r15,%rsi
call   1080 <FD_ISSET@plt>
test   %rax,%rax
jne    16ea <main+0x43a>
mov    -0x2c(%rbp),%edi
mov    %r15,%rsi
call   1080 <FD_ISSET@plt>
test   %rax,%rax
je     1672 <main+0x3c2>
mov    %rbx,-0x70(%rbp)
lea    -0xa8(%rbp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1090 <memset@plt>
lea    -0x48(%rbp),%rax
mov    %rax,-0x88(%rbp)
movabs $0x100000008,%rax
mov    %rax,-0xa8(%rbp)
lea    -0x80(%rbp),%rax
mov    %rax,-0x90(%rbp)
lea    -0x570(%rbp),%rax
mov    %rax,-0xa0(%rbp)
movl   $0x400,-0x98(%rbp)
lea    -0x170(%rbp),%rax
mov    %rax,-0x80(%rbp)
movl   $0xc8,-0x78(%rbp)
mov    %r12d,%edi
mov    %r15,%rsi
mov    %rbx,%r15
call   1080 <FD_ISSET@plt>
test   %rax,%rax
jne    177d <main+0x4cd>
mov    -0x2c(%rbp),%r12d
mov    %r12d,%edi
lea    -0x30(%rbp),%rsi
call   1080 <FD_ISSET@plt>
test   %rax,%rax
je     178d <main+0x4dd>
mov    %r12d,%edi
mov    %r15,%rsi
xor    %edx,%edx
call   1150 <recvmsg@plt>
mov    %eax,-0x4c(%rbp)
lea    -0x170(%rbp),%rdi
mov    -0x4c(%rbp),%esi
call   10b0 <parse_getport_response@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x48(%rbp),%rax
mov    0x2826(%rip),%rcx
cmp    (%rcx),%rax
mov    0x2814(%rip),%rbx
mov    0x2805(%rip),%r12
jne    1870 <main+0x5c0>
mov    %r15,%rdi
call   1180 <CMSG_FIRSTHDR@plt>
jmp    17db <main+0x52b>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rax,%rsi
call   1140 <CMSG_NXTHDR@plt>
test   %rax,%rax
je     183b <main+0x58b>
mov    (%rax),%rcx
cmp    (%rbx),%rcx
jne    17d0 <main+0x520>
mov    0x8(%rax),%rcx
cmp    (%r12),%rcx
jne    17d0 <main+0x520>
mov    %rax,%rdi
call   1060 <CMSG_DATA@plt>
mov    0x27cf(%rip),%rcx
mov    (%rcx),%rdi
mov    0x27cd(%rip),%rcx
mov    (%rcx),%ecx
mov    %rax,%rsi
mov    %r14,%rdx
call   1030 <inet_ntop@plt>
test   %rax,%rax
jne    1821 <main+0x571>
movb   $0x0,(%r14)
mov    0x2758(%rip),%rax
mov    (%rax),%edi
lea    0x82b(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   10f0 <fprintf@plt>
mov    0x278e(%rip),%rax
mov    (%rax),%rdi
mov    0x278c(%rip),%rax
mov    (%rax),%ecx
lea    -0x3c(%rbp),%rsi
mov    %r13,%rdx
call   1030 <inet_ntop@plt>
test   %rax,%rax
jne    1870 <main+0x5c0>
movb   $0x0,0x0(%r13)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    -0x48(%rbp),%rdi
mov    0x271d(%rip),%rax
cmp    (%rax),%rdi
mov    0x26e3(%rip),%rbx
mov    0x26ec(%rip),%r14
jne    1650 <main+0x3a0>
mov    0x273f(%rip),%rax
mov    (%rax),%ecx
lea    -0x48(%rbp),%rsi
mov    %r13,%rdx
call   1030 <inet_ntop@plt>
test   %rax,%rax
jne    18b1 <main+0x601>
movb   $0x0,0x0(%r13)
mov    %r15,%rdi
call   1180 <CMSG_FIRSTHDR@plt>
jmp    18cb <main+0x61b>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rax,%rsi
call   1140 <CMSG_NXTHDR@plt>
test   %rax,%rax
je     1650 <main+0x3a0>
mov    (%rax),%rcx
cmp    (%rbx),%rcx
jne    18c0 <main+0x610>
mov    0x8(%rax),%rcx
cmp    (%r14),%rcx
jne    18c0 <main+0x610>
mov    0x2694(%rip),%rax
mov    (%rax),%edi
lea    0x77d(%rip),%rsi
xor    %eax,%eax
call   10f0 <fprintf@plt>
jmp    1650 <main+0x3a0>
mov    %rbx,%rsp
cmpw   $0x0,-0x3c(%rbp)
jne    14fd <main+0x24d>
mov    0x266a(%rip),%rax
mov    (%rax),%edi
lea    0x781(%rip),%rsi
xor    %eax,%eax
call   10f0 <fprintf@plt>
xor    %edi,%edi
call   1170 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.sockaddr_in = type { i64, i32, i32, %struct.TYPE_5__ }
%struct.TYPE_5__ = type { i32 }
%struct.ifaddrs = type { i32, %struct.TYPE_6__*, %struct.ifaddrs* }
%struct.TYPE_6__ = type { i64 }
%struct.iovec = type { i8**, i32 }
%struct.sockaddr_storage = type { i64 }
%struct.msghdr = type { i32, i32, i64*, i32, %struct.iovec*, %struct.sockaddr_storage* }
%struct.cmsghdr = type { i64, i64 }
%struct.in_pktinfo = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
%struct.sockaddr_in6 = type { i32 }
@AF_INET = global i64 0
@stderr = global i32 0
@.str = [31 x i8] c"Sending unicast query to '%s'\0A\00"
@.str.1 = [17 x i8] c"Invalid address\0A\00"
@EXIT_FAILURE = global i32 0
@IPPROTO_TCP = global i32 0
@.str.2 = [25 x i8] c"Found VXI-11 on port %d\0A\00"
@.str.3 = [16 x i8] c"RPC failed:\0A%s\0A\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [3 x i8] c"-b\00"
@SOCK_DGRAM = global i32 0
@AF_INET6 = global i64 0
@SOL_SOCKET = global i64 0
@SO_BROADCAST = global i64 0
@IPPROTO_IP = global i64 0
@IP_PKTINFO = global i64 0
@IPPROTO_IPV6 = global i64 0
@IPV6_RECVPKTINFO = global i64 0
@XDR_ENCODE = global i32 0
@IFF_MULTICAST = global i32 0
@IFF_BROADCAST = global i32 0
@__const.main.timeout = %struct.timeval { i32 2, i32 0 }
@INET6_ADDRSTRLEN = global i32 0
@.str.6 = [22 x i8] c"Got IP_PKTINFO on %s\0A\00"
@IPV6_PKTINFO = global i64 0
@.str.7 = [18 x i8] c"Got IPV6_PKTINFO\0A\00"
@.str.8 = [28 x i8] c"'%s' has VXI-11 on port %d\0A\00"
@.str.9 = [20 x i8] c"No answer received\0A\00"
@.str.10 = [31 x i8] c"%1$s <dotted-address>\0A%1$s -b\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sockaddr_in
%7 = alloca i16
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [200 x i8]
%13 = alloca %struct.ifaddrs*
%14 = alloca %struct.ifaddrs*
%15 = alloca %struct.iovec
%16 = alloca %struct.timeval
%17 = alloca i32
%18 = alloca i16
%19 = alloca %struct.sockaddr_storage
%20 = alloca %struct.msghdr
%21 = alloca %struct.iovec
%22 = alloca %struct.cmsghdr*
%23 = alloca [128 x i64]
%24 = alloca i8*
%25 = alloca i64
%26 = alloca i64
%27 = alloca i32
%28 = alloca i32
%29 = alloca %struct.in_pktinfo*
%30 = alloca %struct.sockaddr_in*
%31 = alloca %struct.sockaddr_in6*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%32 = load i32, i32* %4
%33 = icmp eq i32 %32, 2
br i1 %33, label %34, label %80
34: ; preds = %2
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp ne i32 %39, 45
br i1 %40, label %41, label %80
41: ; preds = %34
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%43 = load i64, i64* @AF_INET
store i64 %43, i64* %42
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 1
store i32 111, i32* %44
%45 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 2
store i32 0, i32* %45
%46 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 3
%47 = bitcast %struct.TYPE_5__* %46 to i8*
%48 = load i32, i32* @stderr
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 1
%51 = load i8*, i8** %50
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %51)
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 1
%55 = load i8*, i8** %54
%56 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 2
%57 = call i64 @inet_aton(i8* %55, i32* %56)
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %64
59: ; preds = %41
%60 = load i32, i32* @stderr
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%62 = load i32, i32* @EXIT_FAILURE
%63 = call i32 @exit(i32 %62)
unreachable
64: ; preds = %41
%65 = load i32, i32* @IPPROTO_TCP
%66 = call signext i16 @pmap_getport(%struct.sockaddr_in* %6, i32 395183, i32 1, i32 %65)
store i16 %66, i16* %7
%67 = load i16, i16* %7
%68 = icmp ne i16 %67, 0
br i1 %68, label %69, label %74
69: ; preds = %64
%70 = load i32, i32* @stderr
%71 = load i16, i16* %7
%72 = sext i16 %71 to i32
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %72)
br label %78
74: ; preds = %64
%75 = load i32, i32* @stderr
%76 = call i8* @clnt_spcreateerror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
%77 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %76)
br label %78
78: ; preds = %74, %69
%79 = call i32 @exit(i32 0)
unreachable
80: ; preds = %34, %2
%81 = load i32, i32* %4
%82 = icmp eq i32 %81, 2
br i1 %82, label %83, label %355
83: ; preds = %80
%84 = load i8**, i8*** %5
%85 = getelementptr inbounds i8*, i8** %84, i64 1
%86 = load i8*, i8** %85
%87 = load i8, i8* %86
%88 = sext i8 %87 to i32
%89 = icmp eq i32 %88, 45
br i1 %89, label %90, label %355
90: ; preds = %83
%91 = load i8**, i8*** %5
%92 = getelementptr inbounds i8*, i8** %91, i64 1
%93 = load i8*, i8** %92
%94 = call i64 @strcmp(i8* %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %99
96: ; preds = %90
%97 = load i32, i32* @EXIT_FAILURE
%98 = call i32 @exit(i32 %97)
unreachable
99: ; preds = %90
%100 = load i64, i64* @AF_INET
%101 = load i32, i32* @SOCK_DGRAM
%102 = call i32 @socket(i64 %100, i32 %101, i32 0)
store i32 %102, i32* %8
%103 = load i64, i64* @AF_INET6
%104 = load i32, i32* @SOCK_DGRAM
%105 = call i32 @socket(i64 %103, i32 %104, i32 0)
store i32 %105, i32* %9
store i32 1, i32* %10
%106 = load i32, i32* %8
%107 = load i64, i64* @SOL_SOCKET
%108 = load i64, i64* @SO_BROADCAST
%109 = call i32 @setsockopt(i32 %106, i64 %107, i64 %108, i32* %10, i32 4)
%110 = load i32, i32* %9
%111 = load i64, i64* @SOL_SOCKET
%112 = load i64, i64* @SO_BROADCAST
%113 = call i32 @setsockopt(i32 %110, i64 %111, i64 %112, i32* %10, i32 4)
%114 = load i32, i32* %8
%115 = load i64, i64* @IPPROTO_IP
%116 = load i64, i64* @IP_PKTINFO
%117 = call i32 @setsockopt(i32 %114, i64 %115, i64 %116, i32* %10, i32 4)
%118 = load i32, i32* %9
%119 = load i64, i64* @IPPROTO_IPV6
%120 = load i64, i64* @IPV6_RECVPKTINFO
%121 = call i32 @setsockopt(i32 %118, i64 %119, i64 %120, i32* %10, i32 4)
%122 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%123 = load i32, i32* @XDR_ENCODE
%124 = call i32 @xdrmem_create(i32* %11, i8* %122, i32 200, i32 %123)
%125 = call i64 @xdr_getpos(i32* %11)
%126 = icmp eq i64 %125, 0
%127 = zext i1 %126 to i32
%128 = call i32 @assert(i32 %127)
%129 = call i32 @fill_vxi_getport_xdr(i32* %11)
%130 = call i64 @getifaddrs(%struct.ifaddrs** %13)
%131 = icmp ne i64 %130, 0
br i1 %131, label %132, label %135
132: ; preds = %99
%133 = load i32, i32* @EXIT_FAILURE
%134 = call i32 @exit(i32 %133)
unreachable
135: ; preds = %99
%136 = load %struct.ifaddrs*, %struct.ifaddrs** %13
store %struct.ifaddrs* %136, %struct.ifaddrs** %14
br label %137
137: ; preds = %181, %135
%138 = load %struct.ifaddrs*, %struct.ifaddrs** %14
%139 = icmp ne %struct.ifaddrs* %138, null
br i1 %139, label %140, label %185
140: ; preds = %137
%141 = load %struct.ifaddrs*, %struct.ifaddrs** %14
%142 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %141, i32 0, i32 0
%143 = load i32, i32* %142
%144 = load i32, i32* @IFF_MULTICAST
%145 = load i32, i32* @IFF_BROADCAST
%146 = or i32 %144, %145
%147 = and i32 %143, %146
%148 = icmp eq i32 %147, 0
br i1 %148, label %149, label %150
149: ; preds = %140
br label %181
150: ; preds = %140
%151 = bitcast [200 x i8]* %12 to i8**
%152 = getelementptr inbounds %struct.iovec, %struct.iovec* %15, i32 0, i32 0
store i8** %151, i8*** %152
%153 = call i64 @xdr_getpos(i32* %11)
%154 = trunc i64 %153 to i32
%155 = getelementptr inbounds %struct.iovec, %struct.iovec* %15, i32 0, i32 1
store i32 %154, i32* %155
%156 = load %struct.ifaddrs*, %struct.ifaddrs** %14
%157 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %156, i32 0, i32 1
%158 = load %struct.TYPE_6__*, %struct.TYPE_6__** %157
%159 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %158, i32 0, i32 0
%160 = load i64, i64* %159
%161 = load i64, i64* @AF_INET
%162 = icmp eq i64 %160, %161
br i1 %162, label %163, label %167
163: ; preds = %150
%164 = load i32, i32* %8
%165 = load %struct.ifaddrs*, %struct.ifaddrs** %14
%166 = call i32 @send_rpc_broadcast_ipv4(i32 %164, %struct.iovec* %15, %struct.ifaddrs* %165)
br label %180
167: ; preds = %150
%168 = load %struct.ifaddrs*, %struct.ifaddrs** %14
%169 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %168, i32 0, i32 1
%170 = load %struct.TYPE_6__*, %struct.TYPE_6__** %169
%171 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %170, i32 0, i32 0
%172 = load i64, i64* %171
%173 = load i64, i64* @AF_INET6
%174 = icmp eq i64 %172, %173
br i1 %174, label %175, label %179
175: ; preds = %167
%176 = load i32, i32* %9
%177 = load %struct.ifaddrs*, %struct.ifaddrs** %14
%178 = call i32 @send_rpc_broadcast_ipv6(i32 %176, %struct.iovec* %15, %struct.ifaddrs* %177)
br label %179
179: ; preds = %175, %167
br label %180
180: ; preds = %179, %163
br label %181
181: ; preds = %180, %149
%182 = load %struct.ifaddrs*, %struct.ifaddrs** %14
%183 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %182, i32 0, i32 2
%184 = load %struct.ifaddrs*, %struct.ifaddrs** %183
store %struct.ifaddrs* %184, %struct.ifaddrs** %14
br label %137
185: ; preds = %137
%186 = load %struct.ifaddrs*, %struct.ifaddrs** %13
%187 = call i32 @freeifaddrs(%struct.ifaddrs* %186)
%188 = bitcast %struct.timeval* %16 to i8*
%189 = call i32 @FD_ZERO(i32* %17)
%190 = load i32, i32* %8
%191 = call i32 @FD_SET(i32 %190, i32* %17)
%192 = load i32, i32* %9
%193 = call i32 @FD_SET(i32 %192, i32* %17)
store i16 0, i16* %18
br label %194
194: ; preds = %185, %343, %346
%195 = load i32, i32* @INET6_ADDRSTRLEN
%196 = zext i32 %195 to i64
%197 = call i8* @llvm.stacksave()
store i8* %197, i8** %24
%198 = alloca i8, i64 %196
store i64 %196, i64* %25
%199 = load i32, i32* @INET6_ADDRSTRLEN
%200 = zext i32 %199 to i64
%201 = alloca i8, i64 %200
store i64 %200, i64* %26
%202 = load i32, i32* %9
%203 = add nsw i32 %202, 1
%204 = call i64 @select(i32 %203, i32* %17, i32 0, i32 0, %struct.timeval* %16)
%205 = icmp eq i64 %204, 0
br i1 %205, label %206, label %207
206: ; preds = %194
store i32 6, i32* %28
br label %343
207: ; preds = %194
%208 = load i32, i32* %8
%209 = call i64 @FD_ISSET(i32 %208, i32* %17)
%210 = icmp ne i64 %209, 0
br i1 %210, label %216, label %211
211: ; preds = %207
%212 = load i32, i32* %9
%213 = call i64 @FD_ISSET(i32 %212, i32* %17)
%214 = icmp ne i64 %213, 0
br i1 %214, label %216, label %215
215: ; preds = %211
store i32 5, i32* %28
br label %343
216: ; preds = %211, %207
%217 = call i32 @memset(%struct.msghdr* %20, i32 0, i32 40)
%218 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %20, i32 0, i32 5
store %struct.sockaddr_storage* %19, %struct.sockaddr_storage** %218
%219 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %20, i32 0, i32 0
store i32 8, i32* %219
%220 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %20, i32 0, i32 4
store %struct.iovec* %21, %struct.iovec** %220
%221 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %20, i32 0, i32 1
store i32 1, i32* %221
%222 = getelementptr inbounds [128 x i64], [128 x i64]* %23, i64 0, i64 0
%223 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %20, i32 0, i32 2
store i64* %222, i64** %223
%224 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %20, i32 0, i32 3
store i32 1024, i32* %224
%225 = bitcast [200 x i8]* %12 to i8**
%226 = getelementptr inbounds %struct.iovec, %struct.iovec* %21, i32 0, i32 0
store i8** %225, i8*** %226
%227 = getelementptr inbounds %struct.iovec, %struct.iovec* %21, i32 0, i32 1
store i32 200, i32* %227
%228 = load i32, i32* %8
%229 = call i64 @FD_ISSET(i32 %228, i32* %17)
%230 = icmp ne i64 %229, 0
br i1 %230, label %231, label %234
231: ; preds = %216
%232 = load i32, i32* %8
%233 = call i32 @recvmsg(i32 %232, %struct.msghdr* %20, i32 0)
store i32 %233, i32* %27
br label %242
234: ; preds = %216
%235 = load i32, i32* %9
%236 = call i64 @FD_ISSET(i32 %235, i32* %17)
%237 = icmp ne i64 %236, 0
br i1 %237, label %238, label %241
238: ; preds = %234
%239 = load i32, i32* %9
%240 = call i32 @recvmsg(i32 %239, %struct.msghdr* %20, i32 0)
store i32 %240, i32* %27
br label %241
241: ; preds = %238, %234
br label %242
242: ; preds = %241, %231
%243 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%244 = load i32, i32* %27
%245 = call signext i16 @parse_getport_response(i8* %243, i32 %244)
store i16 %245, i16* %18
%246 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %19, i32 0, i32 0
%247 = load i64, i64* %246
%248 = load i64, i64* @AF_INET
%249 = icmp eq i64 %247, %248
br i1 %249, label %250, label %298
250: ; preds = %242
%251 = call %struct.cmsghdr* @CMSG_FIRSTHDR(%struct.msghdr* %20)
store %struct.cmsghdr* %251, %struct.cmsghdr** %22
br label %252
252: ; preds = %284, %250
%253 = load %struct.cmsghdr*, %struct.cmsghdr** %22
%254 = icmp ne %struct.cmsghdr* %253, null
br i1 %254, label %255, label %287
255: ; preds = %252
%256 = load %struct.cmsghdr*, %struct.cmsghdr** %22
%257 = getelementptr inbounds %struct.cmsghdr, %struct.cmsghdr* %256, i32 0, i32 0
%258 = load i64, i64* %257
%259 = load i64, i64* @IPPROTO_IP
%260 = icmp eq i64 %258, %259
br i1 %260, label %261, label %283
261: ; preds = %255
%262 = load %struct.cmsghdr*, %struct.cmsghdr** %22
%263 = getelementptr inbounds %struct.cmsghdr, %struct.cmsghdr* %262, i32 0, i32 1
%264 = load i64, i64* %263
%265 = load i64, i64* @IP_PKTINFO
%266 = icmp eq i64 %264, %265
br i1 %266, label %267, label %283
267: ; preds = %261
%268 = load %struct.cmsghdr*, %struct.cmsghdr** %22
%269 = call i64 @CMSG_DATA(%struct.cmsghdr* %268)
%270 = inttoptr i64 %269 to %struct.in_pktinfo*
store %struct.in_pktinfo* %270, %struct.in_pktinfo** %29
%271 = load i64, i64* @AF_INET
%272 = load %struct.in_pktinfo*, %struct.in_pktinfo** %29
%273 = getelementptr inbounds %struct.in_pktinfo, %struct.in_pktinfo* %272, i32 0, i32 0
%274 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %273, i32 0, i32 0
%275 = load i32, i32* @INET6_ADDRSTRLEN
%276 = call i64 @inet_ntop(i64 %271, i32* %274, i8* %201, i32 %275)
%277 = icmp eq i64 %276, 0
br i1 %277, label %278, label %280
278: ; preds = %267
%279 = getelementptr inbounds i8, i8* %201, i64 0
store i8 0, i8* %279
br label %280
280: ; preds = %278, %267
%281 = load i32, i32* @stderr
%282 = call i32 (i32, i8*, ...) @fprintf(i32 %281, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %201)
br label %287
283: ; preds = %261, %255
br label %284
284: ; preds = %283
%285 = load %struct.cmsghdr*, %struct.cmsghdr** %22
%286 = call %struct.cmsghdr* @CMSG_NXTHDR(%struct.msghdr* %20, %struct.cmsghdr* %285)
store %struct.cmsghdr* %286, %struct.cmsghdr** %22
br label %252
287: ; preds = %280, %252
%288 = bitcast %struct.sockaddr_storage* %19 to %struct.sockaddr_in*
store %struct.sockaddr_in* %288, %struct.sockaddr_in** %30
%289 = load i64, i64* @AF_INET
%290 = load %struct.sockaddr_in*, %struct.sockaddr_in** %30
%291 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %290, i32 0, i32 2
%292 = load i32, i32* @INET6_ADDRSTRLEN
%293 = call i64 @inet_ntop(i64 %289, i32* %291, i8* %198, i32 %292)
%294 = icmp eq i64 %293, 0
br i1 %294, label %295, label %297
295: ; preds = %287
%296 = getelementptr inbounds i8, i8* %198, i64 0
store i8 0, i8* %296
br label %297
297: ; preds = %295, %287
br label %298
298: ; preds = %297, %242
%299 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %19, i32 0, i32 0
%300 = load i64, i64* %299
%301 = load i64, i64* @AF_INET6
%302 = icmp eq i64 %300, %301
br i1 %302, label %303, label %338
303: ; preds = %298
%304 = bitcast %struct.sockaddr_storage* %19 to %struct.sockaddr_in6*
store %struct.sockaddr_in6* %304, %struct.sockaddr_in6** %31
%305 = load i64, i64* @AF_INET6
%306 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %31
%307 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %306, i32 0, i32 0
%308 = load i32, i32* @INET6_ADDRSTRLEN
%309 = call i64 @inet_ntop(i64 %305, i32* %307, i8* %198, i32 %308)
%310 = icmp eq i64 %309, 0
br i1 %310, label %311, label %313
311: ; preds = %303
%312 = getelementptr inbounds i8, i8* %198, i64 0
store i8 0, i8* %312
br label %313
313: ; preds = %311, %303
%314 = call %struct.cmsghdr* @CMSG_FIRSTHDR(%struct.msghdr* %20)
store %struct.cmsghdr* %314, %struct.cmsghdr** %22
br label %315
315: ; preds = %334, %313
%316 = load %struct.cmsghdr*, %struct.cmsghdr** %22
%317 = icmp ne %struct.cmsghdr* %316, null
br i1 %317, label %318, label %337
318: ; preds = %315
%319 = load %struct.cmsghdr*, %struct.cmsghdr** %22
%320 = getelementptr inbounds %struct.cmsghdr, %struct.cmsghdr* %319, i32 0, i32 0
%321 = load i64, i64* %320
%322 = load i64, i64* @IPPROTO_IPV6
%323 = icmp eq i64 %321, %322
br i1 %323, label %324, label %333
324: ; preds = %318
%325 = load %struct.cmsghdr*, %struct.cmsghdr** %22
%326 = getelementptr inbounds %struct.cmsghdr, %struct.cmsghdr* %325, i32 0, i32 1
%327 = load i64, i64* %326
%328 = load i64, i64* @IPV6_PKTINFO
%329 = icmp eq i64 %327, %328
br i1 %329, label %330, label %333
330: ; preds = %324
%331 = load i32, i32* @stderr
%332 = call i32 (i32, i8*, ...) @fprintf(i32 %331, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
br label %337
333: ; preds = %324, %318
br label %334
334: ; preds = %333
%335 = load %struct.cmsghdr*, %struct.cmsghdr** %22
%336 = call %struct.cmsghdr* @CMSG_NXTHDR(%struct.msghdr* %20, %struct.cmsghdr* %335)
store %struct.cmsghdr* %336, %struct.cmsghdr** %22
br label %315
337: ; preds = %330, %315
br label %338
338: ; preds = %337, %298
%339 = load i32, i32* @stderr
%340 = load i16, i16* %18
%341 = sext i16 %340 to i32
%342 = call i32 (i32, i8*, ...) @fprintf(i32 %339, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* %198, i32 %341)
store i32 0, i32* %28
br label %343
343: ; preds = %338, %215, %206
%344 = load i8*, i8** %24
%345 = load i32, i32* %28
switch i32 %345, label %363 [
i32 0, label %346
i32 6, label %347
i32 5, label %194
]
346: ; preds = %343
br label %194
347: ; preds = %343
%348 = load i16, i16* %18
%349 = icmp ne i16 %348, 0
br i1 %349, label %353, label %350
350: ; preds = %347
%351 = load i32, i32* @stderr
%352 = call i32 (i32, i8*, ...) @fprintf(i32 %351, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
br label %353
353: ; preds = %350, %347
%354 = call i32 @exit(i32 0)
unreachable
355: ; preds = %83, %80
%356 = load i32, i32* @stderr
%357 = load i8**, i8*** %5
%358 = getelementptr inbounds i8*, i8** %357, i64 0
%359 = load i8*, i8** %358
%360 = call i32 (i32, i8*, ...) @fprintf(i32 %356, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8* %359)
%361 = load i32, i32* @EXIT_FAILURE
%362 = call i32 @exit(i32 %361)
unreachable
363: ; preds = %343
unreachable
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i64, i32, i32, %struct.TYPE_5__ }
%struct.TYPE_5__ = type { i32 }
%struct.ifaddrs = type { i32, %struct.TYPE_6__*, %struct.ifaddrs* }
%struct.TYPE_6__ = type { i64 }
%struct.iovec = type { i8**, i32 }
%struct.timeval = type { i32, i32 }
%struct.sockaddr_storage = type { i64 }
%struct.msghdr = type { i32, i32, i64*, i32, %struct.iovec*, %struct.sockaddr_storage* }
%struct.cmsghdr = type { i64, i64 }
%struct.in_pktinfo = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
@AF_INET = global i64 0
@stderr = global i32 0
@.str = [31 x i8] c"Sending unicast query to '%s'\0A\00"
@.str.1 = [17 x i8] c"Invalid address\0A\00"
@EXIT_FAILURE = global i32 0
@IPPROTO_TCP = global i32 0
@.str.2 = [25 x i8] c"Found VXI-11 on port %d\0A\00"
@.str.3 = [16 x i8] c"RPC failed:\0A%s\0A\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [3 x i8] c"-b\00"
@SOCK_DGRAM = global i32 0
@AF_INET6 = global i64 0
@SOL_SOCKET = global i64 0
@SO_BROADCAST = global i64 0
@IPPROTO_IP = global i64 0
@IP_PKTINFO = global i64 0
@IPPROTO_IPV6 = global i64 0
@IPV6_RECVPKTINFO = global i64 0
@XDR_ENCODE = global i32 0
@IFF_MULTICAST = global i32 0
@IFF_BROADCAST = global i32 0
@INET6_ADDRSTRLEN = global i32 0
@.str.6 = [22 x i8] c"Got IP_PKTINFO on %s\0A\00"
@IPV6_PKTINFO = global i64 0
@.str.7 = [18 x i8] c"Got IPV6_PKTINFO\0A\00"
@.str.8 = [28 x i8] c"'%s' has VXI-11 on port %d\0A\00"
@.str.9 = [20 x i8] c"No answer received\0A\00"
@.str.10 = [31 x i8] c"%1$s <dotted-address>\0A%1$s -b\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca i32
%6 = alloca [200 x i8]
%7 = alloca %struct.ifaddrs*
%8 = alloca %struct.iovec
%9 = alloca i64
%10 = bitcast i64* %9 to %struct.timeval*
%11 = alloca i32
%12 = alloca %struct.sockaddr_storage
%13 = alloca %struct.msghdr
%14 = alloca %struct.iovec
%15 = alloca [128 x i64]
%16 = icmp eq i32 %0, 2
br i1 %16, label %17, label %282
17: ; preds = %2
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 45
br i1 %21, label %52, label %22
22: ; preds = %17
%23 = bitcast %struct.sockaddr_in* %3 to i8*
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
%25 = load i64, i64* @AF_INET
store i64 %25, i64* %24
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i32 111, i32* %26
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 0, i32* %27
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 3, i32 0
store i32 0, i32* %28
%29 = load i32, i32* @stderr
%30 = tail call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %19)
%31 = load i8*, i8** %18
%32 = call i64 @inet_aton(i8* %31, i32* %27)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %22
%35 = load i32, i32* @stderr
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%37 = load i32, i32* @EXIT_FAILURE
%38 = call i32 @exit(i32 %37)
unreachable
39: ; preds = %22
%40 = load i32, i32* @IPPROTO_TCP
%41 = call signext i16 @pmap_getport(%struct.sockaddr_in* %3, i32 395183, i32 1, i32 %40)
%42 = icmp eq i16 %41, 0
%43 = load i32, i32* @stderr
br i1 %42, label %47, label %44
44: ; preds = %39
%45 = sext i16 %41 to i32
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %45)
br label %50
47: ; preds = %39
%48 = call i8* @clnt_spcreateerror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %48)
br label %50
50: ; preds = %47, %44
%51 = call i32 @exit(i32 0)
unreachable
52: ; preds = %17
%53 = tail call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %58, label %55
55: ; preds = %52
%56 = load i32, i32* @EXIT_FAILURE
%57 = tail call i32 @exit(i32 %56)
unreachable
58: ; preds = %52
%59 = load i64, i64* @AF_INET
%60 = load i32, i32* @SOCK_DGRAM
%61 = tail call i32 @socket(i64 %59, i32 %60, i32 0)
%62 = load i64, i64* @AF_INET6
%63 = load i32, i32* @SOCK_DGRAM
%64 = tail call i32 @socket(i64 %62, i32 %63, i32 0)
%65 = bitcast i32* %4 to i8*
store i32 1, i32* %4
%66 = load i64, i64* @SOL_SOCKET
%67 = load i64, i64* @SO_BROADCAST
%68 = call i32 @setsockopt(i32 %61, i64 %66, i64 %67, i32* %4, i32 4)
%69 = load i64, i64* @SOL_SOCKET
%70 = load i64, i64* @SO_BROADCAST
%71 = call i32 @setsockopt(i32 %64, i64 %69, i64 %70, i32* %4, i32 4)
%72 = load i64, i64* @IPPROTO_IP
%73 = load i64, i64* @IP_PKTINFO
%74 = call i32 @setsockopt(i32 %61, i64 %72, i64 %73, i32* %4, i32 4)
%75 = load i64, i64* @IPPROTO_IPV6
%76 = load i64, i64* @IPV6_RECVPKTINFO
%77 = call i32 @setsockopt(i32 %64, i64 %75, i64 %76, i32* %4, i32 4)
%78 = bitcast i32* %5 to i8*
%79 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%80 = load i32, i32* @XDR_ENCODE
%81 = call i32 @xdrmem_create(i32* %5, i8* %79, i32 200, i32 %80)
%82 = call i64 @xdr_getpos(i32* %5)
%83 = icmp eq i64 %82, 0
%84 = zext i1 %83 to i32
%85 = call i32 @assert(i32 %84)
%86 = call i32 @fill_vxi_getport_xdr(i32* %5)
%87 = bitcast %struct.ifaddrs** %7 to i8*
%88 = call i64 @getifaddrs(%struct.ifaddrs** %7)
%89 = icmp eq i64 %88, 0
br i1 %89, label %90, label %97
90: ; preds = %58
%91 = load %struct.ifaddrs*, %struct.ifaddrs** %7
%92 = icmp eq %struct.ifaddrs* %91, null
br i1 %92, label %131, label %93
93: ; preds = %90
%94 = bitcast %struct.iovec* %8 to i8*
%95 = bitcast %struct.iovec* %8 to [200 x i8]**
%96 = getelementptr inbounds %struct.iovec, %struct.iovec* %8, i64 0, i32 1
br label %100
97: ; preds = %58
%98 = load i32, i32* @EXIT_FAILURE
%99 = call i32 @exit(i32 %98)
unreachable
100: ; preds = %93, %125
%101 = phi %struct.ifaddrs* [ %91, %93 ], [ %127, %125 ]
%102 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %101, i64 0, i32 0
%103 = load i32, i32* %102
%104 = load i32, i32* @IFF_MULTICAST
%105 = load i32, i32* @IFF_BROADCAST
%106 = or i32 %105, %104
%107 = and i32 %106, %103
%108 = icmp eq i32 %107, 0
br i1 %108, label %125, label %109
109: ; preds = %100
store [200 x i8]* %6, [200 x i8]** %95
%110 = call i64 @xdr_getpos(i32* %5)
%111 = trunc i64 %110 to i32
store i32 %111, i32* %96
%112 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %101, i64 0, i32 1
%113 = load %struct.TYPE_6__*, %struct.TYPE_6__** %112
%114 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %113, i64 0, i32 0
%115 = load i64, i64* %114
%116 = load i64, i64* @AF_INET
%117 = icmp eq i64 %115, %116
br i1 %117, label %118, label %120
118: ; preds = %109
%119 = call i32 @send_rpc_broadcast_ipv4(i32 %61, %struct.iovec* %8, %struct.ifaddrs* %101)
br label %125
120: ; preds = %109
%121 = load i64, i64* @AF_INET6
%122 = icmp eq i64 %115, %121
br i1 %122, label %123, label %125
123: ; preds = %120
%124 = call i32 @send_rpc_broadcast_ipv6(i32 %64, %struct.iovec* %8, %struct.ifaddrs* %101)
br label %125
125: ; preds = %118, %123, %120, %100
%126 = getelementptr inbounds %struct.ifaddrs, %struct.ifaddrs* %101, i64 0, i32 2
%127 = load %struct.ifaddrs*, %struct.ifaddrs** %126
%128 = icmp eq %struct.ifaddrs* %127, null
br i1 %128, label %129, label %100
129: ; preds = %125
%130 = load %struct.ifaddrs*, %struct.ifaddrs** %7
br label %131
131: ; preds = %129, %90
%132 = phi %struct.ifaddrs* [ %130, %129 ], [ null, %90 ]
%133 = call i32 @freeifaddrs(%struct.ifaddrs* %132)
%134 = bitcast i64* %9 to i8*
store i64 2, i64* %9
%135 = bitcast i32* %11 to i8*
%136 = call i32 @FD_ZERO(i32* %11)
%137 = call i32 @FD_SET(i32 %61, i32* %11)
%138 = call i32 @FD_SET(i32 %64, i32* %11)
%139 = bitcast %struct.sockaddr_storage* %12 to i8*
%140 = bitcast %struct.msghdr* %13 to i8*
%141 = bitcast %struct.iovec* %14 to i8*
%142 = bitcast [128 x i64]* %15 to i8*
%143 = add nsw i32 %64, 1
%144 = load i32, i32* @INET6_ADDRSTRLEN
%145 = zext i32 %144 to i64
%146 = call i8* @llvm.stacksave()
%147 = alloca i8, i64 %145
%148 = load i32, i32* @INET6_ADDRSTRLEN
%149 = zext i32 %148 to i64
%150 = alloca i8, i64 %149
%151 = call i64 @select(i32 %143, i32* %11, i32 0, i32 0, %struct.timeval* %10)
%152 = icmp eq i64 %151, 0
br i1 %152, label %153, label %154
153: ; preds = %131
br label %277
154: ; preds = %131
%155 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %13, i64 0, i32 5
%156 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %13, i64 0, i32 0
%157 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %13, i64 0, i32 4
%158 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %13, i64 0, i32 1
%159 = getelementptr inbounds [128 x i64], [128 x i64]* %15, i64 0, i64 0
%160 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %13, i64 0, i32 2
%161 = getelementptr inbounds %struct.msghdr, %struct.msghdr* %13, i64 0, i32 3
%162 = bitcast %struct.iovec* %14 to [200 x i8]**
%163 = getelementptr inbounds %struct.iovec, %struct.iovec* %14, i64 0, i32 1
%164 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %12, i64 0, i32 0
%165 = bitcast %struct.sockaddr_storage* %12 to %struct.sockaddr_in*
%166 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %165, i64 0, i32 2
%167 = bitcast %struct.sockaddr_storage* %12 to i32*
br label %168
168: ; preds = %154, %263
%169 = phi i8* [ %150, %154 ], [ %272, %263 ]
%170 = phi i8* [ %147, %154 ], [ %269, %263 ]
%171 = phi i8* [ %146, %154 ], [ %268, %263 ]
%172 = phi i16 [ 0, %154 ], [ %265, %263 ]
%173 = phi i32 [ undef, %154 ], [ %264, %263 ]
%174 = call i64 @FD_ISSET(i32 %61, i32* %11)
%175 = icmp eq i64 %174, 0
br i1 %175, label %176, label %179
176: ; preds = %168
%177 = call i64 @FD_ISSET(i32 %64, i32* %11)
%178 = icmp eq i64 %177, 0
br i1 %178, label %263, label %179
179: ; preds = %176, %168
%180 = call i32 @memset(%struct.msghdr* %13, i32 0, i32 40)
store %struct.sockaddr_storage* %12, %struct.sockaddr_storage** %155
store i32 8, i32* %156
store %struct.iovec* %14, %struct.iovec** %157
store i32 1, i32* %158
store i64* %159, i64** %160
store i32 1024, i32* %161
store [200 x i8]* %6, [200 x i8]** %162
store i32 200, i32* %163
%181 = call i64 @FD_ISSET(i32 %61, i32* %11)
%182 = icmp eq i64 %181, 0
br i1 %182, label %183, label %186
183: ; preds = %179
%184 = call i64 @FD_ISSET(i32 %64, i32* %11)
%185 = icmp eq i64 %184, 0
br i1 %185, label %189, label %186
186: ; preds = %183, %179
%187 = phi i32 [ %61, %179 ], [ %64, %183 ]
%188 = call i32 @recvmsg(i32 %187, %struct.msghdr* %13, i32 0)
br label %189
189: ; preds = %186, %183
%190 = phi i32 [ %173, %183 ], [ %188, %186 ]
%191 = call signext i16 @parse_getport_response(i8* %79, i32 %190)
%192 = load i64, i64* %164
%193 = load i64, i64* @AF_INET
%194 = icmp eq i64 %192, %193
br i1 %194, label %195, label %230
195: ; preds = %189
%196 = call %struct.cmsghdr* @CMSG_FIRSTHDR(%struct.msghdr* %13)
%197 = icmp eq %struct.cmsghdr* %196, null
br i1 %197, label %224, label %198
198: ; preds = %195, %221
%199 = phi %struct.cmsghdr* [ %222, %221 ], [ %196, %195 ]
%200 = getelementptr inbounds %struct.cmsghdr, %struct.cmsghdr* %199, i64 0, i32 0
%201 = load i64, i64* %200
%202 = load i64, i64* @IPPROTO_IP
%203 = icmp eq i64 %201, %202
br i1 %203, label %204, label %221
204: ; preds = %198
%205 = getelementptr inbounds %struct.cmsghdr, %struct.cmsghdr* %199, i64 0, i32 1
%206 = load i64, i64* %205
%207 = load i64, i64* @IP_PKTINFO
%208 = icmp eq i64 %206, %207
br i1 %208, label %209, label %221
209: ; preds = %204
%210 = call i64 @CMSG_DATA(%struct.cmsghdr* %199)
%211 = inttoptr i64 %210 to %struct.in_pktinfo*
%212 = load i64, i64* @AF_INET
%213 = getelementptr inbounds %struct.in_pktinfo, %struct.in_pktinfo* %211, i64 0, i32 0, i32 0
%214 = load i32, i32* @INET6_ADDRSTRLEN
%215 = call i64 @inet_ntop(i64 %212, i32* %213, i8* %169, i32 %214)
%216 = icmp eq i64 %215, 0
br i1 %216, label %217, label %218
217: ; preds = %209
store i8 0, i8* %169
br label %218
218: ; preds = %217, %209
%219 = load i32, i32* @stderr
%220 = call i32 (i32, i8*, ...) @fprintf(i32 %219, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %169)
br label %224
221: ; preds = %198, %204
%222 = call %struct.cmsghdr* @CMSG_NXTHDR(%struct.msghdr* %13, %struct.cmsghdr* %199)
%223 = icmp eq %struct.cmsghdr* %222, null
br i1 %223, label %224, label %198
224: ; preds = %221, %195, %218
%225 = load i64, i64* @AF_INET
%226 = load i32, i32* @INET6_ADDRSTRLEN
%227 = call i64 @inet_ntop(i64 %225, i32* %166, i8* %170, i32 %226)
%228 = icmp eq i64 %227, 0
br i1 %228, label %229, label %230
229: ; preds = %224
store i8 0, i8* %170
br label %230
230: ; preds = %224, %229, %189
%231 = load i64, i64* %164
%232 = load i64, i64* @AF_INET6
%233 = icmp eq i64 %231, %232
br i1 %233, label %234, label %259
234: ; preds = %230
%235 = load i32, i32* @INET6_ADDRSTRLEN
%236 = call i64 @inet_ntop(i64 %231, i32* %167, i8* %170, i32 %235)
%237 = icmp eq i64 %236, 0
br i1 %237, label %238, label %239
238: ; preds = %234
store i8 0, i8* %170
br label %239
239: ; preds = %238, %234
%240 = call %struct.cmsghdr* @CMSG_FIRSTHDR(%struct.msghdr* %13)
%241 = icmp eq %struct.cmsghdr* %240, null
br i1 %241, label %259, label %242
242: ; preds = %239, %256
%243 = phi %struct.cmsghdr* [ %257, %256 ], [ %240, %239 ]
%244 = getelementptr inbounds %struct.cmsghdr, %struct.cmsghdr* %243, i64 0, i32 0
%245 = load i64, i64* %244
%246 = load i64, i64* @IPPROTO_IPV6
%247 = icmp eq i64 %245, %246
br i1 %247, label %248, label %256
248: ; preds = %242
%249 = getelementptr inbounds %struct.cmsghdr, %struct.cmsghdr* %243, i64 0, i32 1
%250 = load i64, i64* %249
%251 = load i64, i64* @IPV6_PKTINFO
%252 = icmp eq i64 %250, %251
br i1 %252, label %253, label %256
253: ; preds = %248
%254 = load i32, i32* @stderr
%255 = call i32 (i32, i8*, ...) @fprintf(i32 %254, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
br label %259
256: ; preds = %242, %248
%257 = call %struct.cmsghdr* @CMSG_NXTHDR(%struct.msghdr* %13, %struct.cmsghdr* %243)
%258 = icmp eq %struct.cmsghdr* %257, null
br i1 %258, label %259, label %242
259: ; preds = %256, %239, %253, %230
%260 = load i32, i32* @stderr
%261 = sext i16 %191 to i32
%262 = call i32 (i32, i8*, ...) @fprintf(i32 %260, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* %170, i32 %261)
br label %263
263: ; preds = %176, %259
%264 = phi i32 [ %190, %259 ], [ %173, %176 ]
%265 = phi i16 [ %191, %259 ], [ %172, %176 ]
%266 = load i32, i32* @INET6_ADDRSTRLEN
%267 = zext i32 %266 to i64
%268 = call i8* @llvm.stacksave()
%269 = alloca i8, i64 %267
%270 = load i32, i32* @INET6_ADDRSTRLEN
%271 = zext i32 %270 to i64
%272 = alloca i8, i64 %271
%273 = call i64 @select(i32 %143, i32* %11, i32 0, i32 0, %struct.timeval* %10)
%274 = icmp eq i64 %273, 0
br i1 %274, label %275, label %168
275: ; preds = %263
%276 = icmp eq i16 %265, 0
br i1 %276, label %277, label %280
277: ; preds = %153, %275
%278 = load i32, i32* @stderr
%279 = call i32 (i32, i8*, ...) @fprintf(i32 %278, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
br label %280
280: ; preds = %277, %275
%281 = call i32 @exit(i32 0)
unreachable
282: ; preds = %2
%283 = load i32, i32* @stderr
%284 = load i8*, i8** %1
%285 = tail call i32 (i32, i8*, ...) @fprintf(i32 %283, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8* %284)
%286 = load i32, i32* @EXIT_FAILURE
%287 = tail call i32 @exit(i32 %286)
unreachable
}