#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 */

/* Type definitions */
struct ifreq {
  int dummy;
};
typedef int __u32;

/* Variables and functions */
int IFF_MULTICAST;
int IFF_NOARP;
int IFF_UP;
int /*<<< orphan*/ NEXT_ARG();
scalar_t__ do_changename(char *, char *);
int do_chflags(char *, int, int);
int /*<<< orphan*/ duparg(char *, char *);
int /*<<< orphan*/ duparg2(char *, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int get_address(char *, int *);
scalar_t__ get_integer(int *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ invarg(char *, char *);
scalar_t__ matches(char *, char *);
int on_off(char *);
scalar_t__ parse_address(char *, int, int, char *, struct ifreq *);
scalar_t__ set_address(struct ifreq *, int);
scalar_t__ set_mtu(char *, int);
scalar_t__ set_qlen(char *, int);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ usage();
int do_set(int argc, char **argv) {
  char *dev = NULL;
  __u32 mask = 0;
  __u32 flags = 0;
  int qlen = -1;
  int mtu = -1;
  char *newaddr = NULL;
  char *newbrd = NULL;
  struct ifreq ifr0, ifr1;
  char *newname = NULL;
  int htype, halen;
  while (argc > 0) {
    if (strcmp(*argv, "up") == 0) {
      mask |= IFF_UP;
      flags |= IFF_UP;
    } else if (strcmp(*argv, "down") == 0) {
      mask |= IFF_UP;
      flags &= ~IFF_UP;
    } else if (strcmp(*argv, "name") == 0) {
      NEXT_ARG();
      newname = *argv;
    } else if (matches(*argv, "address") == 0) {
      NEXT_ARG();
      newaddr = *argv;
    } else if (matches(*argv, "broadcast") == 0 || strcmp(*argv, "brd") == 0) {
      NEXT_ARG();
      newbrd = *argv;
    } else if (matches(*argv, "txqueuelen") == 0 ||
               strcmp(*argv, "qlen") == 0 || matches(*argv, "txqlen") == 0) {
      NEXT_ARG();
      if (qlen != -1)
        duparg("txqueuelen", *argv);
      if (get_integer(&qlen, *argv, 0))
        invarg("Invalid \"txqueuelen\" value\n", *argv);
    } else if (strcmp(*argv, "mtu") == 0) {
      NEXT_ARG();
      if (mtu != -1)
        duparg("mtu", *argv);
      if (get_integer(&mtu, *argv, 0))
        invarg("Invalid \"mtu\" value\n", *argv);
    } else if (strcmp(*argv, "multicast") == 0) {
      NEXT_ARG();
      mask |= IFF_MULTICAST;
      if (strcmp(*argv, "on") == 0) {
        flags |= IFF_MULTICAST;
      } else if (strcmp(*argv, "off") == 0) {
        flags &= ~IFF_MULTICAST;
      } else
        return on_off("multicast");
    } else if (strcmp(*argv, "arp") == 0) {
      NEXT_ARG();
      mask |= IFF_NOARP;
      if (strcmp(*argv, "on") == 0) {
        flags &= ~IFF_NOARP;
      } else if (strcmp(*argv, "off") == 0) {
        flags |= IFF_NOARP;
      } else
        return on_off("noarp");
    } else {
      if (strcmp(*argv, "dev") == 0) {
        NEXT_ARG();
      }
      if (matches(*argv, "help") == 0)
        usage();
      if (dev)
        duparg2("dev", *argv);
      dev = *argv;
    }
    argc--;
    argv++;
  }
  if (!dev) {
    fprintf(stderr,
            "Not enough of information: \"dev\" argument is required.\n");
    exit(-1);
  }
  if (newaddr || newbrd) {
    halen = get_address(dev, &htype);
    if (halen < 0)
      return -1;
    if (newaddr) {
      if (parse_address(dev, htype, halen, newaddr, &ifr0) < 0)
        return -1;
    }
    if (newbrd) {
      if (parse_address(dev, htype, halen, newbrd, &ifr1) < 0)
        return -1;
    }
  }
  if (newname && strcmp(dev, newname)) {
    if (do_changename(dev, newname) < 0)
      return -1;
    dev = newname;
  }
  if (qlen != -1) {
    if (set_qlen(dev, qlen) < 0)
      return -1;
  }
  if (mtu != -1) {
    if (set_mtu(dev, mtu) < 0)
      return -1;
  }
  if (newaddr || newbrd) {
    if (newbrd) {
      if (set_address(&ifr1, 1) < 0)
        return -1;
    }
    if (newaddr) {
      if (set_address(&ifr0, 0) < 0)
        return -1;
    }
  }
  if (mask)
    return do_chflags(dev, flags, mask);
  return 0;
}


x86 assembly (clang, -O0):
<do_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0xffffffff,-0x24(%rbp)
movl   $0xffffffff,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x50(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    16f4 <do_set+0x4d4>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd7d(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    12b5 <do_set+0x95>
mov    0x2d3f(%rip),%rax
mov    (%rax),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2d30(%rip),%rax
mov    (%rax),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    16da <do_set+0x4ba>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd40(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    12f8 <do_set+0xd8>
mov    0x2cff(%rip),%rax
mov    (%rax),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2cf0(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    16d5 <do_set+0x4b5>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd02(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    132c <do_set+0x10c>
mov    $0x0,%al
call   10c0 <NEXT_ARG@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
jmp    16d0 <do_set+0x4b0>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xcd3(%rip),%rsi
call   1070 <matches@plt>
cmp    $0x0,%rax
jne    1360 <do_set+0x140>
mov    $0x0,%al
call   10c0 <NEXT_ARG@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    16cb <do_set+0x4ab>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xca7(%rip),%rsi
call   1070 <matches@plt>
cmp    $0x0,%rax
je     139a <do_set+0x17a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xc94(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    13b1 <do_set+0x191>
mov    $0x0,%al
call   10c0 <NEXT_ARG@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
jmp    16c6 <do_set+0x4a6>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xc64(%rip),%rsi
call   1070 <matches@plt>
cmp    $0x0,%rax
je     1408 <do_set+0x1e8>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xc54(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1408 <do_set+0x1e8>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xc35(%rip),%rsi
call   1070 <matches@plt>
cmp    $0x0,%rax
jne    1460 <do_set+0x240>
mov    $0x0,%al
call   10c0 <NEXT_ARG@plt>
cmpl   $0xffffffff,-0x24(%rbp)
je     142c <do_set+0x20c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xbfc(%rip),%rdi
call   1050 <duparg@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    -0x24(%rbp),%rdi
xor    %edx,%edx
call   1060 <get_integer@plt>
cmp    $0x0,%rax
je     145b <do_set+0x23b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xbdf(%rip),%rdi
call   1120 <invarg@plt>
jmp    16c1 <do_set+0x4a1>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xbe3(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    14d5 <do_set+0x2b5>
mov    $0x0,%al
call   10c0 <NEXT_ARG@plt>
cmpl   $0xffffffff,-0x28(%rbp)
je     14a1 <do_set+0x281>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xbb5(%rip),%rdi
call   1050 <duparg@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    -0x28(%rbp),%rdi
xor    %edx,%edx
call   1060 <get_integer@plt>
cmp    $0x0,%rax
je     14d0 <do_set+0x2b0>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xb8a(%rip),%rdi
call   1120 <invarg@plt>
jmp    16bc <do_set+0x49c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xb87(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    158b <do_set+0x36b>
mov    $0x0,%al
call   10c0 <NEXT_ARG@plt>
mov    0x2ae0(%rip),%rax
mov    (%rax),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xb5e(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1539 <do_set+0x319>
mov    0x2ab4(%rip),%rax
mov    (%rax),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1586 <do_set+0x366>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xb30(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    156d <do_set+0x34d>
mov    0x2a83(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1581 <do_set+0x361>
lea    0xaf6(%rip),%rdi
call   10a0 <on_off@plt>
mov    %eax,-0x4(%rbp)
jmp    1930 <do_set+0x710>
jmp    1586 <do_set+0x366>
jmp    16b7 <do_set+0x497>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xae4(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1641 <do_set+0x421>
mov    $0x0,%al
call   10c0 <NEXT_ARG@plt>
mov    0x2a32(%rip),%rax
mov    (%rax),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xaa8(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    15f2 <do_set+0x3d2>
mov    0x2a06(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    163c <do_set+0x41c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xa77(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1623 <do_set+0x403>
mov    0x29d2(%rip),%rax
mov    (%rax),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1637 <do_set+0x417>
lea    0xa51(%rip),%rdi
call   10a0 <on_off@plt>
mov    %eax,-0x4(%rbp)
jmp    1930 <do_set+0x710>
jmp    163c <do_set+0x41c>
jmp    16b2 <do_set+0x492>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xa32(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1665 <do_set+0x445>
mov    $0x0,%al
call   10c0 <NEXT_ARG@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xa12(%rip),%rsi
call   1070 <matches@plt>
cmp    $0x0,%rax
jne    1689 <do_set+0x469>
mov    $0x0,%al
call   10e0 <usage@plt>
cmpq   $0x0,-0x18(%rbp)
je     16a7 <do_set+0x487>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0x9df(%rip),%rdi
call   1100 <duparg2@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    16b7 <do_set+0x497>
jmp    16bc <do_set+0x49c>
jmp    16c1 <do_set+0x4a1>
jmp    16c6 <do_set+0x4a6>
jmp    16cb <do_set+0x4ab>
jmp    16d0 <do_set+0x4b0>
jmp    16d5 <do_set+0x4b5>
jmp    16da <do_set+0x4ba>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    126b <do_set+0x4b>
cmpq   $0x0,-0x18(%rbp)
jne    171e <do_set+0x4fe>
mov    0x28c2(%rip),%rax
mov    (%rax),%edi
lea    0x97b(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0xffffffff,%edi
call   1110 <exit@plt>
cmpq   $0x0,-0x30(%rbp)
jne    1734 <do_set+0x514>
cmpq   $0x0,-0x38(%rbp)
je     17d9 <do_set+0x5b9>
mov    -0x18(%rbp),%rdi
lea    -0x54(%rbp),%rsi
call   1030 <get_address@plt>
mov    %eax,-0x58(%rbp)
cmpl   $0x0,-0x58(%rbp)
jge    175a <do_set+0x53a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1930 <do_set+0x710>
cmpq   $0x0,-0x30(%rbp)
je     1797 <do_set+0x577>
mov    -0x18(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
mov    -0x30(%rbp),%rcx
lea    -0x40(%rbp),%r8
call   1130 <parse_address@plt>
cmp    $0x0,%rax
jge    1792 <do_set+0x572>
movl   $0xffffffff,-0x4(%rbp)
jmp    1930 <do_set+0x710>
jmp    1797 <do_set+0x577>
cmpq   $0x0,-0x38(%rbp)
je     17d4 <do_set+0x5b4>
mov    -0x18(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
mov    -0x38(%rbp),%rcx
lea    -0x48(%rbp),%r8
call   1130 <parse_address@plt>
cmp    $0x0,%rax
jge    17cf <do_set+0x5af>
movl   $0xffffffff,-0x4(%rbp)
jmp    1930 <do_set+0x710>
jmp    17d4 <do_set+0x5b4>
jmp    17d9 <do_set+0x5b9>
cmpq   $0x0,-0x50(%rbp)
je     1826 <do_set+0x606>
mov    -0x18(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1826 <do_set+0x606>
mov    -0x18(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   1040 <do_changename@plt>
cmp    $0x0,%rax
jge    181e <do_set+0x5fe>
movl   $0xffffffff,-0x4(%rbp)
jmp    1930 <do_set+0x710>
mov    -0x50(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
je     1857 <do_set+0x637>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1140 <set_qlen@plt>
cmp    $0x0,%rax
jge    1852 <do_set+0x632>
movl   $0xffffffff,-0x4(%rbp)
jmp    1930 <do_set+0x710>
jmp    1857 <do_set+0x637>
cmpl   $0xffffffff,-0x28(%rbp)
je     1888 <do_set+0x668>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%esi
call   10d0 <set_mtu@plt>
cmp    $0x0,%rax
jge    1883 <do_set+0x663>
movl   $0xffffffff,-0x4(%rbp)
jmp    1930 <do_set+0x710>
jmp    1888 <do_set+0x668>
cmpq   $0x0,-0x30(%rbp)
jne    189e <do_set+0x67e>
cmpq   $0x0,-0x38(%rbp)
je     1908 <do_set+0x6e8>
cmpq   $0x0,-0x38(%rbp)
je     18d2 <do_set+0x6b2>
lea    -0x48(%rbp),%rdi
mov    $0x1,%esi
call   10b0 <set_address@plt>
cmp    $0x0,%rax
jge    18cd <do_set+0x6ad>
movl   $0xffffffff,-0x4(%rbp)
jmp    1930 <do_set+0x710>
jmp    18d2 <do_set+0x6b2>
cmpq   $0x0,-0x30(%rbp)
je     1903 <do_set+0x6e3>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
call   10b0 <set_address@plt>
cmp    $0x0,%rax
jge    18fe <do_set+0x6de>
movl   $0xffffffff,-0x4(%rbp)
jmp    1930 <do_set+0x710>
jmp    1903 <do_set+0x6e3>
jmp    1908 <do_set+0x6e8>
cmpl   $0x0,-0x1c(%rbp)
je     1929 <do_set+0x709>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   10f0 <do_chflags@plt>
mov    %eax,-0x4(%rbp)
jmp    1930 <do_set+0x710>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_set>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movl   $0xffffffff,0x14(%rsp)
ff
movl   $0xffffffff,0x10(%rsp)
ff
test   %edi,%edi
jle    173d <do_set+0x51d>
mov    %rsi,%r13
mov    %edi,%r15d
add    $0x1,%r15d
mov    0x2d89(%rip),%r14
mov    0x2d8a(%rip),%r12
xor    %eax,%eax
mov    %rax,0x40(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x38(%rsp)
xor    %ebp,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
mov    %rax,0x8(%rsp)
jmp    129f <do_set+0x7f>
mov    0x2d51(%rip),%rax
mov    (%rax),%eax
or     %eax,%ebx
or     %eax,%ebp
add    $0x8,%r13
add    $0xffffffff,%r15d
cmp    $0x1,%r15d
jle    15bc <do_set+0x39c>
mov    0x0(%r13),%rdi
lea    0xd56(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1280 <do_set+0x60>
mov    0x0(%r13),%rdi
lea    0xd44(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1430 <do_set+0x210>
mov    0x0(%r13),%rdi
lea    0xd30(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1444 <do_set+0x224>
mov    0x0(%r13),%rdi
lea    0xd1c(%rip),%rsi
call   1070 <matches@plt>
test   %rax,%rax
je     146e <do_set+0x24e>
mov    0x0(%r13),%rdi
lea    0xd0b(%rip),%rsi
call   1070 <matches@plt>
test   %rax,%rax
je     1459 <do_set+0x239>
mov    0x0(%r13),%rdi
lea    0xcfc(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1459 <do_set+0x239>
mov    0x0(%r13),%rdi
lea    0xce7(%rip),%rsi
call   1070 <matches@plt>
test   %rax,%rax
je     1483 <do_set+0x263>
mov    0x0(%r13),%rdi
lea    0xcdb(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1483 <do_set+0x263>
mov    0x0(%r13),%rdi
lea    0xcc0(%rip),%rsi
call   1070 <matches@plt>
test   %rax,%rax
je     1483 <do_set+0x263>
mov    0x0(%r13),%rdi
lea    0xcca(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     14cf <do_set+0x2af>
mov    0x0(%r13),%rdi
lea    0xcca(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     151b <do_set+0x2fb>
mov    0x0(%r13),%rdi
lea    0xcc4(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     155b <do_set+0x33b>
mov    0x0(%r13),%rdi
lea    0xcaf(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    13e3 <do_set+0x1c3>
xor    %eax,%eax
call   10c0 <NEXT_ARG@plt>
mov    0x0(%r13),%rdi
lea    0xc97(%rip),%rsi
call   1070 <matches@plt>
test   %rax,%rax
jne    13ff <do_set+0x1df>
xor    %eax,%eax
call   10e0 <usage@plt>
cmpq   $0x0,0x8(%rsp)
je     1417 <do_set+0x1f7>
mov    0x0(%r13),%rsi
lea    0xc6f(%rip),%rdi
call   1100 <duparg2@plt>
mov    0x0(%r13),%rax
mov    %rax,0x8(%rsp)
jmp    128d <do_set+0x6d>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x2ba1(%rip),%rax
mov    (%rax),%eax
or     %eax,%ebx
not    %eax
and    %eax,%ebp
jmp    128d <do_set+0x6d>
xor    %eax,%eax
call   10c0 <NEXT_ARG@plt>
mov    0x0(%r13),%rax
mov    %rax,0x40(%rsp)
jmp    128d <do_set+0x6d>
xor    %eax,%eax
call   10c0 <NEXT_ARG@plt>
mov    0x0(%r13),%rax
mov    %rax,0x18(%rsp)
jmp    128d <do_set+0x6d>
xor    %eax,%eax
call   10c0 <NEXT_ARG@plt>
mov    0x0(%r13),%rax
mov    %rax,0x38(%rsp)
jmp    128d <do_set+0x6d>
xor    %eax,%eax
call   10c0 <NEXT_ARG@plt>
cmpl   $0xffffffff,0x14(%rsp)
je     14a1 <do_set+0x281>
mov    0x0(%r13),%rsi
lea    0xb87(%rip),%rdi
call   1050 <duparg@plt>
mov    0x0(%r13),%rsi
lea    0x14(%rsp),%rdi
xor    %edx,%edx
call   1060 <get_integer@plt>
test   %rax,%rax
je     128d <do_set+0x6d>
mov    0x0(%r13),%rsi
lea    0xb70(%rip),%rdi
call   1120 <invarg@plt>
jmp    128d <do_set+0x6d>
xor    %eax,%eax
call   10c0 <NEXT_ARG@plt>
cmpl   $0xffffffff,0x10(%rsp)
je     14ed <do_set+0x2cd>
mov    0x0(%r13),%rsi
lea    0xb69(%rip),%rdi
call   1050 <duparg@plt>
mov    0x0(%r13),%rsi
lea    0x10(%rsp),%rdi
xor    %edx,%edx
call   1060 <get_integer@plt>
test   %rax,%rax
je     128d <do_set+0x6d>
mov    0x0(%r13),%rsi
lea    0xb44(%rip),%rdi
call   1120 <invarg@plt>
jmp    128d <do_set+0x6d>
xor    %eax,%eax
call   10c0 <NEXT_ARG@plt>
or     (%r14),%ebx
mov    0x0(%r13),%rdi
lea    0xb44(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     159d <do_set+0x37d>
mov    0x0(%r13),%rdi
lea    0xb32(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    1721 <do_set+0x501>
mov    (%r14),%eax
jmp    143b <do_set+0x21b>
xor    %eax,%eax
call   10c0 <NEXT_ARG@plt>
or     (%r12),%ebx
mov    0x0(%r13),%rdi
lea    0xb03(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     15ac <do_set+0x38c>
mov    0x0(%r13),%rdi
lea    0xaf1(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    172f <do_set+0x50f>
or     (%r12),%ebp
jmp    128d <do_set+0x6d>
mov    0x2a3c(%rip),%r14
or     (%r14),%ebp
jmp    128d <do_set+0x6d>
mov    0x2a35(%rip),%r12
mov    (%r12),%eax
jmp    143b <do_set+0x21b>
cmpq   $0x0,0x8(%rsp)
je     173d <do_set+0x51d>
mov    0x38(%rsp),%r13
mov    %r13,%rax
or     0x18(%rsp),%rax
setne  %r12b
je     164e <do_set+0x42e>
lea    0x24(%rsp),%rsi
mov    0x8(%rsp),%rdi
call   1030 <get_address@plt>
mov    $0xffffffff,%r14d
test   %eax,%eax
js     170a <do_set+0x4ea>
mov    %eax,%r15d
test   %r13,%r13
je     1622 <do_set+0x402>
mov    0x24(%rsp),%esi
lea    0x30(%rsp),%r8
mov    0x8(%rsp),%rdi
mov    %r15d,%edx
mov    %r13,%rcx
call   1130 <parse_address@plt>
test   %rax,%rax
js     170a <do_set+0x4ea>
cmpq   $0x0,0x18(%rsp)
je     164e <do_set+0x42e>
mov    0x24(%rsp),%esi
lea    0x28(%rsp),%r8
mov    0x8(%rsp),%rdi
mov    %r15d,%edx
mov    0x18(%rsp),%rcx
call   1130 <parse_address@plt>
test   %rax,%rax
js     170a <do_set+0x4ea>
mov    0x40(%rsp),%r14
test   %r14,%r14
je     1682 <do_set+0x462>
mov    0x8(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1689 <do_set+0x469>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <do_changename@plt>
test   %rax,%rax
jns    168c <do_set+0x46c>
jmp    1704 <do_set+0x4e4>
mov    0x8(%rsp),%r14
jmp    168c <do_set+0x46c>
mov    %r15,%r14
mov    0x14(%rsp),%esi
cmp    $0xffffffff,%esi
je     16a2 <do_set+0x482>
mov    %r14,%rdi
call   1140 <set_qlen@plt>
test   %rax,%rax
js     1704 <do_set+0x4e4>
mov    0x10(%rsp),%esi
cmp    $0xffffffff,%esi
je     16b8 <do_set+0x498>
mov    %r14,%rdi
call   10d0 <set_mtu@plt>
test   %rax,%rax
js     1704 <do_set+0x4e4>
test   %r12b,%r12b
je     16ef <do_set+0x4cf>
cmpq   $0x0,0x18(%rsp)
je     16d9 <do_set+0x4b9>
lea    0x28(%rsp),%rdi
mov    $0x1,%esi
call   10b0 <set_address@plt>
test   %rax,%rax
js     1704 <do_set+0x4e4>
test   %r13,%r13
je     16ef <do_set+0x4cf>
lea    0x30(%rsp),%rdi
xor    %esi,%esi
call   10b0 <set_address@plt>
test   %rax,%rax
js     1704 <do_set+0x4e4>
test   %ebx,%ebx
je     171c <do_set+0x4fc>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   10f0 <do_chflags@plt>
mov    %eax,%r14d
jmp    170a <do_set+0x4ea>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r14d,%r14d
jmp    170a <do_set+0x4ea>
lea    0x942(%rip),%rdi
call   10a0 <on_off@plt>
jmp    16ff <do_set+0x4df>
lea    0x945(%rip),%rdi
call   10a0 <on_off@plt>
jmp    16ff <do_set+0x4df>
mov    0x2884(%rip),%rax
mov    (%rax),%edi
lea    0x93d(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0xffffffff,%edi
call   1110 <exit@plt>

LLVM IR (-O0):
%struct.ifreq = type { i32 }
@.str = [3 x i8] c"up\00"
@IFF_UP = global i32 0
@.str.1 = [5 x i8] c"down\00"
@.str.2 = [5 x i8] c"name\00"
@.str.3 = [8 x i8] c"address\00"
@.str.4 = [10 x i8] c"broadcast\00"
@.str.5 = [4 x i8] c"brd\00"
@.str.6 = [11 x i8] c"txqueuelen\00"
@.str.7 = [5 x i8] c"qlen\00"
@.str.8 = [7 x i8] c"txqlen\00"
@.str.9 = [28 x i8] c"Invalid \22txqueuelen\22 value\0A\00"
@.str.10 = [4 x i8] c"mtu\00"
@.str.11 = [21 x i8] c"Invalid \22mtu\22 value\0A\00"
@.str.12 = [10 x i8] c"multicast\00"
@IFF_MULTICAST = global i32 0
@.str.13 = [3 x i8] c"on\00"
@.str.14 = [4 x i8] c"off\00"
@.str.15 = [4 x i8] c"arp\00"
@IFF_NOARP = global i32 0
@.str.16 = [6 x i8] c"noarp\00"
@.str.17 = [4 x i8] c"dev\00"
@.str.18 = [5 x i8] c"help\00"
@stderr = global i32 0
@.str.19 = [56 x i8] c"Not enough of information: \22dev\22 argument is required.\0A\00"
define i32 @do_set(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca %struct.ifreq
%14 = alloca %struct.ifreq
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 -1, i32* %9
store i32 -1, i32* %10
store i8* null, i8** %11
store i8* null, i8** %12
store i8* null, i8** %15
br label %18
18: ; preds = %230, %2
%19 = load i32, i32* %4
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %235
21: ; preds = %18
%22 = load i8**, i8*** %5
%23 = load i8*, i8** %22
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %33
26: ; preds = %21
%27 = load i32, i32* @IFF_UP
%28 = load i32, i32* %7
%29 = or i32 %28, %27
store i32 %29, i32* %7
%30 = load i32, i32* @IFF_UP
%31 = load i32, i32* %8
%32 = or i32 %31, %30
store i32 %32, i32* %8
br label %230
33: ; preds = %21
%34 = load i8**, i8*** %5
%35 = load i8*, i8** %34
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %46
38: ; preds = %33
%39 = load i32, i32* @IFF_UP
%40 = load i32, i32* %7
%41 = or i32 %40, %39
store i32 %41, i32* %7
%42 = load i32, i32* @IFF_UP
%43 = xor i32 %42, -1
%44 = load i32, i32* %8
%45 = and i32 %44, %43
store i32 %45, i32* %8
br label %229
46: ; preds = %33
%47 = load i8**, i8*** %5
%48 = load i8*, i8** %47
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %46
%52 = call i32 (...) @NEXT_ARG()
%53 = load i8**, i8*** %5
%54 = load i8*, i8** %53
store i8* %54, i8** %15
br label %228
55: ; preds = %46
%56 = load i8**, i8*** %5
%57 = load i8*, i8** %56
%58 = call i64 @matches(i8* %57, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %64
60: ; preds = %55
%61 = call i32 (...) @NEXT_ARG()
%62 = load i8**, i8*** %5
%63 = load i8*, i8** %62
store i8* %63, i8** %11
br label %227
64: ; preds = %55
%65 = load i8**, i8*** %5
%66 = load i8*, i8** %65
%67 = call i64 @matches(i8* %66, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %74, label %69
69: ; preds = %64
%70 = load i8**, i8*** %5
%71 = load i8*, i8** %70
%72 = call i64 @strcmp(i8* %71, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %78
74: ; preds = %69, %64
%75 = call i32 (...) @NEXT_ARG()
%76 = load i8**, i8*** %5
%77 = load i8*, i8** %76
store i8* %77, i8** %12
br label %226
78: ; preds = %69
%79 = load i8**, i8*** %5
%80 = load i8*, i8** %79
%81 = call i64 @matches(i8* %80, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %93, label %83
83: ; preds = %78
%84 = load i8**, i8*** %5
%85 = load i8*, i8** %84
%86 = call i64 @strcmp(i8* %85, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%87 = icmp eq i64 %86, 0
br i1 %87, label %93, label %88
88: ; preds = %83
%89 = load i8**, i8*** %5
%90 = load i8*, i8** %89
%91 = call i64 @matches(i8* %90, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%92 = icmp eq i64 %91, 0
br i1 %92, label %93, label %111
93: ; preds = %88, %83, %78
%94 = call i32 (...) @NEXT_ARG()
%95 = load i32, i32* %9
%96 = icmp ne i32 %95, -1
br i1 %96, label %97, label %101
97: ; preds = %93
%98 = load i8**, i8*** %5
%99 = load i8*, i8** %98
%100 = call i32 @duparg(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* %99)
br label %101
101: ; preds = %97, %93
%102 = load i8**, i8*** %5
%103 = load i8*, i8** %102
%104 = call i64 @get_integer(i32* %9, i8* %103, i32 0)
%105 = icmp ne i64 %104, 0
br i1 %105, label %106, label %110
106: ; preds = %101
%107 = load i8**, i8*** %5
%108 = load i8*, i8** %107
%109 = call i32 @invarg(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i8* %108)
br label %110
110: ; preds = %106, %101
br label %225
111: ; preds = %88
%112 = load i8**, i8*** %5
%113 = load i8*, i8** %112
%114 = call i64 @strcmp(i8* %113, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%115 = icmp eq i64 %114, 0
br i1 %115, label %116, label %134
116: ; preds = %111
%117 = call i32 (...) @NEXT_ARG()
%118 = load i32, i32* %10
%119 = icmp ne i32 %118, -1
br i1 %119, label %120, label %124
120: ; preds = %116
%121 = load i8**, i8*** %5
%122 = load i8*, i8** %121
%123 = call i32 @duparg(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %122)
br label %124
124: ; preds = %120, %116
%125 = load i8**, i8*** %5
%126 = load i8*, i8** %125
%127 = call i64 @get_integer(i32* %10, i8* %126, i32 0)
%128 = icmp ne i64 %127, 0
br i1 %128, label %129, label %133
129: ; preds = %124
%130 = load i8**, i8*** %5
%131 = load i8*, i8** %130
%132 = call i32 @invarg(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %131)
br label %133
133: ; preds = %129, %124
br label %224
134: ; preds = %111
%135 = load i8**, i8*** %5
%136 = load i8*, i8** %135
%137 = call i64 @strcmp(i8* %136, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
%138 = icmp eq i64 %137, 0
br i1 %138, label %139, label %166
139: ; preds = %134
%140 = call i32 (...) @NEXT_ARG()
%141 = load i32, i32* @IFF_MULTICAST
%142 = load i32, i32* %7
%143 = or i32 %142, %141
store i32 %143, i32* %7
%144 = load i8**, i8*** %5
%145 = load i8*, i8** %144
%146 = call i64 @strcmp(i8* %145, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%147 = icmp eq i64 %146, 0
br i1 %147, label %148, label %152
148: ; preds = %139
%149 = load i32, i32* @IFF_MULTICAST
%150 = load i32, i32* %8
%151 = or i32 %150, %149
store i32 %151, i32* %8
br label %165
152: ; preds = %139
%153 = load i8**, i8*** %5
%154 = load i8*, i8** %153
%155 = call i64 @strcmp(i8* %154, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%156 = icmp eq i64 %155, 0
br i1 %156, label %157, label %162
157: ; preds = %152
%158 = load i32, i32* @IFF_MULTICAST
%159 = xor i32 %158, -1
%160 = load i32, i32* %8
%161 = and i32 %160, %159
store i32 %161, i32* %8
br label %164
162: ; preds = %152
%163 = call i32 @on_off(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
store i32 %163, i32* %3
br label %347
164: ; preds = %157
br label %165
165: ; preds = %164, %148
br label %223
166: ; preds = %134
%167 = load i8**, i8*** %5
%168 = load i8*, i8** %167
%169 = call i64 @strcmp(i8* %168, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%170 = icmp eq i64 %169, 0
br i1 %170, label %171, label %198
171: ; preds = %166
%172 = call i32 (...) @NEXT_ARG()
%173 = load i32, i32* @IFF_NOARP
%174 = load i32, i32* %7
%175 = or i32 %174, %173
store i32 %175, i32* %7
%176 = load i8**, i8*** %5
%177 = load i8*, i8** %176
%178 = call i64 @strcmp(i8* %177, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%179 = icmp eq i64 %178, 0
br i1 %179, label %180, label %185
180: ; preds = %171
%181 = load i32, i32* @IFF_NOARP
%182 = xor i32 %181, -1
%183 = load i32, i32* %8
%184 = and i32 %183, %182
store i32 %184, i32* %8
br label %197
185: ; preds = %171
%186 = load i8**, i8*** %5
%187 = load i8*, i8** %186
%188 = call i64 @strcmp(i8* %187, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%189 = icmp eq i64 %188, 0
br i1 %189, label %190, label %194
190: ; preds = %185
%191 = load i32, i32* @IFF_NOARP
%192 = load i32, i32* %8
%193 = or i32 %192, %191
store i32 %193, i32* %8
br label %196
194: ; preds = %185
%195 = call i32 @on_off(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
store i32 %195, i32* %3
br label %347
196: ; preds = %190
br label %197
197: ; preds = %196, %180
br label %222
198: ; preds = %166
%199 = load i8**, i8*** %5
%200 = load i8*, i8** %199
%201 = call i64 @strcmp(i8* %200, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%202 = icmp eq i64 %201, 0
br i1 %202, label %203, label %205
203: ; preds = %198
%204 = call i32 (...) @NEXT_ARG()
br label %205
205: ; preds = %203, %198
%206 = load i8**, i8*** %5
%207 = load i8*, i8** %206
%208 = call i64 @matches(i8* %207, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0))
%209 = icmp eq i64 %208, 0
br i1 %209, label %210, label %212
210: ; preds = %205
%211 = call i32 (...) @usage()
br label %212
212: ; preds = %210, %205
%213 = load i8*, i8** %6
%214 = icmp ne i8* %213, null
br i1 %214, label %215, label %219
215: ; preds = %212
%216 = load i8**, i8*** %5
%217 = load i8*, i8** %216
%218 = call i32 @duparg2(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i8* %217)
br label %219
219: ; preds = %215, %212
%220 = load i8**, i8*** %5
%221 = load i8*, i8** %220
store i8* %221, i8** %6
br label %222
222: ; preds = %219, %197
br label %223
223: ; preds = %222, %165
br label %224
224: ; preds = %223, %133
br label %225
225: ; preds = %224, %110
br label %226
226: ; preds = %225, %74
br label %227
227: ; preds = %226, %60
br label %228
228: ; preds = %227, %51
br label %229
229: ; preds = %228, %38
br label %230
230: ; preds = %229, %26
%231 = load i32, i32* %4
%232 = add nsw i32 %231, -1
store i32 %232, i32* %4
%233 = load i8**, i8*** %5
%234 = getelementptr inbounds i8*, i8** %233, i32 1
store i8** %234, i8*** %5
br label %18
235: ; preds = %18
%236 = load i8*, i8** %6
%237 = icmp ne i8* %236, null
br i1 %237, label %242, label %238
238: ; preds = %235
%239 = load i32, i32* @stderr
%240 = call i32 @fprintf(i32 %239, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.19, i64 0, i64 0))
%241 = call i32 @exit(i32 -1)
unreachable
242: ; preds = %235
%243 = load i8*, i8** %11
%244 = icmp ne i8* %243, null
br i1 %244, label %248, label %245
245: ; preds = %242
%246 = load i8*, i8** %12
%247 = icmp ne i8* %246, null
br i1 %247, label %248, label %279
248: ; preds = %245, %242
%249 = load i8*, i8** %6
%250 = call i32 @get_address(i8* %249, i32* %16)
store i32 %250, i32* %17
%251 = load i32, i32* %17
%252 = icmp slt i32 %251, 0
br i1 %252, label %253, label %254
253: ; preds = %248
store i32 -1, i32* %3
br label %347
254: ; preds = %248
%255 = load i8*, i8** %11
%256 = icmp ne i8* %255, null
br i1 %256, label %257, label %266
257: ; preds = %254
%258 = load i8*, i8** %6
%259 = load i32, i32* %16
%260 = load i32, i32* %17
%261 = load i8*, i8** %11
%262 = call i64 @parse_address(i8* %258, i32 %259, i32 %260, i8* %261, %struct.ifreq* %13)
%263 = icmp slt i64 %262, 0
br i1 %263, label %264, label %265
264: ; preds = %257
store i32 -1, i32* %3
br label %347
265: ; preds = %257
br label %266
266: ; preds = %265, %254
%267 = load i8*, i8** %12
%268 = icmp ne i8* %267, null
br i1 %268, label %269, label %278
269: ; preds = %266
%270 = load i8*, i8** %6
%271 = load i32, i32* %16
%272 = load i32, i32* %17
%273 = load i8*, i8** %12
%274 = call i64 @parse_address(i8* %270, i32 %271, i32 %272, i8* %273, %struct.ifreq* %14)
%275 = icmp slt i64 %274, 0
br i1 %275, label %276, label %277
276: ; preds = %269
store i32 -1, i32* %3
br label %347
277: ; preds = %269
br label %278
278: ; preds = %277, %266
br label %279
279: ; preds = %278, %245
%280 = load i8*, i8** %15
%281 = icmp ne i8* %280, null
br i1 %281, label %282, label %295
282: ; preds = %279
%283 = load i8*, i8** %6
%284 = load i8*, i8** %15
%285 = call i64 @strcmp(i8* %283, i8* %284)
%286 = icmp ne i64 %285, 0
br i1 %286, label %287, label %295
287: ; preds = %282
%288 = load i8*, i8** %6
%289 = load i8*, i8** %15
%290 = call i64 @do_changename(i8* %288, i8* %289)
%291 = icmp slt i64 %290, 0
br i1 %291, label %292, label %293
292: ; preds = %287
store i32 -1, i32* %3
br label %347
293: ; preds = %287
%294 = load i8*, i8** %15
store i8* %294, i8** %6
br label %295
295: ; preds = %293, %282, %279
%296 = load i32, i32* %9
%297 = icmp ne i32 %296, -1
br i1 %297, label %298, label %305
298: ; preds = %295
%299 = load i8*, i8** %6
%300 = load i32, i32* %9
%301 = call i64 @set_qlen(i8* %299, i32 %300)
%302 = icmp slt i64 %301, 0
br i1 %302, label %303, label %304
303: ; preds = %298
store i32 -1, i32* %3
br label %347
304: ; preds = %298
br label %305
305: ; preds = %304, %295
%306 = load i32, i32* %10
%307 = icmp ne i32 %306, -1
br i1 %307, label %308, label %315
308: ; preds = %305
%309 = load i8*, i8** %6
%310 = load i32, i32* %10
%311 = call i64 @set_mtu(i8* %309, i32 %310)
%312 = icmp slt i64 %311, 0
br i1 %312, label %313, label %314
313: ; preds = %308
store i32 -1, i32* %3
br label %347
314: ; preds = %308
br label %315
315: ; preds = %314, %305
%316 = load i8*, i8** %11
%317 = icmp ne i8* %316, null
br i1 %317, label %321, label %318
318: ; preds = %315
%319 = load i8*, i8** %12
%320 = icmp ne i8* %319, null
br i1 %320, label %321, label %338
321: ; preds = %318, %315
%322 = load i8*, i8** %12
%323 = icmp ne i8* %322, null
br i1 %323, label %324, label %329
324: ; preds = %321
%325 = call i64 @set_address(%struct.ifreq* %14, i32 1)
%326 = icmp slt i64 %325, 0
br i1 %326, label %327, label %328
327: ; preds = %324
store i32 -1, i32* %3
br label %347
328: ; preds = %324
br label %329
329: ; preds = %328, %321
%330 = load i8*, i8** %11
%331 = icmp ne i8* %330, null
br i1 %331, label %332, label %337
332: ; preds = %329
%333 = call i64 @set_address(%struct.ifreq* %13, i32 0)
%334 = icmp slt i64 %333, 0
br i1 %334, label %335, label %336
335: ; preds = %332
store i32 -1, i32* %3
br label %347
336: ; preds = %332
br label %337
337: ; preds = %336, %329
br label %338
338: ; preds = %337, %318
%339 = load i32, i32* %7
%340 = icmp ne i32 %339, 0
br i1 %340, label %341, label %346
341: ; preds = %338
%342 = load i8*, i8** %6
%343 = load i32, i32* %8
%344 = load i32, i32* %7
%345 = call i32 @do_chflags(i8* %342, i32 %343, i32 %344)
store i32 %345, i32* %3
br label %347
346: ; preds = %338
store i32 0, i32* %3
br label %347
347: ; preds = %346, %341, %335, %327, %313, %303, %292, %276, %264, %253, %194, %162
%348 = load i32, i32* %3
ret i32 %348
}

LLVM IR (-O2):
%struct.ifreq = type { i32 }
@.str = [3 x i8] c"up\00"
@IFF_UP = global i32 0
@.str.1 = [5 x i8] c"down\00"
@.str.2 = [5 x i8] c"name\00"
@.str.3 = [8 x i8] c"address\00"
@.str.4 = [10 x i8] c"broadcast\00"
@.str.5 = [4 x i8] c"brd\00"
@.str.6 = [11 x i8] c"txqueuelen\00"
@.str.7 = [5 x i8] c"qlen\00"
@.str.8 = [7 x i8] c"txqlen\00"
@.str.9 = [28 x i8] c"Invalid \22txqueuelen\22 value\0A\00"
@.str.10 = [4 x i8] c"mtu\00"
@.str.11 = [21 x i8] c"Invalid \22mtu\22 value\0A\00"
@.str.12 = [10 x i8] c"multicast\00"
@IFF_MULTICAST = global i32 0
@.str.13 = [3 x i8] c"on\00"
@.str.14 = [4 x i8] c"off\00"
@.str.15 = [4 x i8] c"arp\00"
@IFF_NOARP = global i32 0
@.str.16 = [6 x i8] c"noarp\00"
@.str.17 = [4 x i8] c"dev\00"
@.str.18 = [5 x i8] c"help\00"
@stderr = global i32 0
@.str.19 = [56 x i8] c"Not enough of information: \22dev\22 argument is required.\0A\00"
define i32 @do_set(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.ifreq
%6 = alloca %struct.ifreq
%7 = alloca i32
%8 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%9 = bitcast i32* %4 to i8*
store i32 -1, i32* %4
%10 = bitcast %struct.ifreq* %5 to i8*
%11 = bitcast %struct.ifreq* %6 to i8*
%12 = bitcast i32* %7 to i8*
%13 = icmp sgt i32 %0, 0
br i1 %13, label %14, label %187
14: ; preds = %2, %175
%15 = phi i8* [ %181, %175 ], [ null, %2 ]
%16 = phi i8* [ %180, %175 ], [ null, %2 ]
%17 = phi i8* [ %179, %175 ], [ null, %2 ]
%18 = phi i32 [ %178, %175 ], [ 0, %2 ]
%19 = phi i32 [ %177, %175 ], [ 0, %2 ]
%20 = phi i8* [ %176, %175 ], [ null, %2 ]
%21 = phi i8** [ %183, %175 ], [ %1, %2 ]
%22 = phi i32 [ %182, %175 ], [ %0, %2 ]
%23 = load i8*, i8** %21
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %14
%27 = load i32, i32* @IFF_UP
%28 = or i32 %27, %19
%29 = or i32 %27, %18
br label %175
30: ; preds = %14
%31 = load i8*, i8** %21
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %30
%35 = load i32, i32* @IFF_UP
%36 = or i32 %35, %19
%37 = xor i32 %35, -1
%38 = and i32 %18, %37
br label %175
39: ; preds = %30
%40 = load i8*, i8** %21
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %39
%44 = call i32 (...) @NEXT_ARG()
%45 = load i8*, i8** %21
br label %175
46: ; preds = %39
%47 = load i8*, i8** %21
%48 = call i64 @matches(i8* %47, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %46
%51 = call i32 (...) @NEXT_ARG()
%52 = load i8*, i8** %21
br label %175
53: ; preds = %46
%54 = load i8*, i8** %21
%55 = call i64 @matches(i8* %54, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %61, label %57
57: ; preds = %53
%58 = load i8*, i8** %21
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %57, %53
%62 = call i32 (...) @NEXT_ARG()
%63 = load i8*, i8** %21
br label %175
64: ; preds = %57
%65 = load i8*, i8** %21
%66 = call i64 @matches(i8* %65, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %76, label %68
68: ; preds = %64
%69 = load i8*, i8** %21
%70 = call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %76, label %72
72: ; preds = %68
%73 = load i8*, i8** %21
%74 = call i64 @matches(i8* %73, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %76, label %90
76: ; preds = %72, %68, %64
%77 = call i32 (...) @NEXT_ARG()
%78 = load i32, i32* %3
%79 = icmp eq i32 %78, -1
br i1 %79, label %83, label %80
80: ; preds = %76
%81 = load i8*, i8** %21
%82 = call i32 @duparg(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* %81)
br label %83
83: ; preds = %80, %76
%84 = load i8*, i8** %21
%85 = call i64 @get_integer(i32* %3, i8* %84, i32 0)
%86 = icmp eq i64 %85, 0
br i1 %86, label %175, label %87
87: ; preds = %83
%88 = load i8*, i8** %21
%89 = call i32 @invarg(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i8* %88)
br label %175
90: ; preds = %72
%91 = load i8*, i8** %21
%92 = call i64 @strcmp(i8* %91, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%93 = icmp eq i64 %92, 0
br i1 %93, label %94, label %108
94: ; preds = %90
%95 = call i32 (...) @NEXT_ARG()
%96 = load i32, i32* %4
%97 = icmp eq i32 %96, -1
br i1 %97, label %101, label %98
98: ; preds = %94
%99 = load i8*, i8** %21
%100 = call i32 @duparg(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %99)
br label %101
101: ; preds = %98, %94
%102 = load i8*, i8** %21
%103 = call i64 @get_integer(i32* %4, i8* %102, i32 0)
%104 = icmp eq i64 %103, 0
br i1 %104, label %175, label %105
105: ; preds = %101
%106 = load i8*, i8** %21
%107 = call i32 @invarg(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %106)
br label %175
108: ; preds = %90
%109 = load i8*, i8** %21
%110 = call i64 @strcmp(i8* %109, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
%111 = icmp eq i64 %110, 0
br i1 %111, label %112, label %132
112: ; preds = %108
%113 = call i32 (...) @NEXT_ARG()
%114 = load i32, i32* @IFF_MULTICAST
%115 = or i32 %114, %19
%116 = load i8*, i8** %21
%117 = call i64 @strcmp(i8* %116, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%118 = icmp eq i64 %117, 0
br i1 %118, label %119, label %122
119: ; preds = %112
%120 = load i32, i32* @IFF_MULTICAST
%121 = or i32 %120, %18
br label %175
122: ; preds = %112
%123 = load i8*, i8** %21
%124 = call i64 @strcmp(i8* %123, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%125 = icmp eq i64 %124, 0
br i1 %125, label %126, label %130
126: ; preds = %122
%127 = load i32, i32* @IFF_MULTICAST
%128 = xor i32 %127, -1
%129 = and i32 %18, %128
br label %175
130: ; preds = %122
%131 = call i32 @on_off(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
br label %242
132: ; preds = %108
%133 = load i8*, i8** %21
%134 = call i64 @strcmp(i8* %133, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%135 = icmp eq i64 %134, 0
br i1 %135, label %136, label %156
136: ; preds = %132
%137 = call i32 (...) @NEXT_ARG()
%138 = load i32, i32* @IFF_NOARP
%139 = or i32 %138, %19
%140 = load i8*, i8** %21
%141 = call i64 @strcmp(i8* %140, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%142 = icmp eq i64 %141, 0
br i1 %142, label %143, label %147
143: ; preds = %136
%144 = load i32, i32* @IFF_NOARP
%145 = xor i32 %144, -1
%146 = and i32 %18, %145
br label %175
147: ; preds = %136
%148 = load i8*, i8** %21
%149 = call i64 @strcmp(i8* %148, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%150 = icmp eq i64 %149, 0
br i1 %150, label %151, label %154
151: ; preds = %147
%152 = load i32, i32* @IFF_NOARP
%153 = or i32 %152, %18
br label %175
154: ; preds = %147
%155 = call i32 @on_off(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
br label %242
156: ; preds = %132
%157 = load i8*, i8** %21
%158 = call i64 @strcmp(i8* %157, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%159 = icmp eq i64 %158, 0
br i1 %159, label %160, label %162
160: ; preds = %156
%161 = call i32 (...) @NEXT_ARG()
br label %162
162: ; preds = %160, %156
%163 = load i8*, i8** %21
%164 = call i64 @matches(i8* %163, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0))
%165 = icmp eq i64 %164, 0
br i1 %165, label %166, label %168
166: ; preds = %162
%167 = call i32 (...) @usage()
br label %168
168: ; preds = %166, %162
%169 = icmp eq i8* %20, null
br i1 %169, label %173, label %170
170: ; preds = %168
%171 = load i8*, i8** %21
%172 = call i32 @duparg2(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i8* %171)
br label %173
173: ; preds = %170, %168
%174 = load i8*, i8** %21
br label %175
175: ; preds = %34, %50, %87, %83, %126, %119, %143, %151, %173, %101, %105, %61, %43, %26
%176 = phi i8* [ %20, %26 ], [ %20, %34 ], [ %20, %43 ], [ %20, %50 ], [ %20, %61 ], [ %20, %87 ], [ %20, %83 ], [ %20, %105 ], [ %20, %101 ], [ %20, %119 ], [ %20, %126 ], [ %20, %143 ], [ %20, %151 ], [ %174, %173 ]
%177 = phi i32 [ %28, %26 ], [ %36, %34 ], [ %19, %43 ], [ %19, %50 ], [ %19, %61 ], [ %19, %87 ], [ %19, %83 ], [ %19, %105 ], [ %19, %101 ], [ %115, %119 ], [ %115, %126 ], [ %139, %143 ], [ %139, %151 ], [ %19, %173 ]
%178 = phi i32 [ %29, %26 ], [ %38, %34 ], [ %18, %43 ], [ %18, %50 ], [ %18, %61 ], [ %18, %87 ], [ %18, %83 ], [ %18, %105 ], [ %18, %101 ], [ %121, %119 ], [ %129, %126 ], [ %146, %143 ], [ %153, %151 ], [ %18, %173 ]
%179 = phi i8* [ %17, %26 ], [ %17, %34 ], [ %17, %43 ], [ %52, %50 ], [ %17, %61 ], [ %17, %87 ], [ %17, %83 ], [ %17, %105 ], [ %17, %101 ], [ %17, %119 ], [ %17, %126 ], [ %17, %143 ], [ %17, %151 ], [ %17, %173 ]
%180 = phi i8* [ %16, %26 ], [ %16, %34 ], [ %16, %43 ], [ %16, %50 ], [ %63, %61 ], [ %16, %87 ], [ %16, %83 ], [ %16, %105 ], [ %16, %101 ], [ %16, %119 ], [ %16, %126 ], [ %16, %143 ], [ %16, %151 ], [ %16, %173 ]
%181 = phi i8* [ %15, %26 ], [ %15, %34 ], [ %45, %43 ], [ %15, %50 ], [ %15, %61 ], [ %15, %87 ], [ %15, %83 ], [ %15, %105 ], [ %15, %101 ], [ %15, %119 ], [ %15, %126 ], [ %15, %143 ], [ %15, %151 ], [ %15, %173 ]
%182 = add nsw i32 %22, -1
%183 = getelementptr inbounds i8*, i8** %21, i64 1
%184 = icmp sgt i32 %22, 1
br i1 %184, label %14, label %185
185: ; preds = %175
%186 = icmp eq i8* %176, null
br i1 %186, label %187, label %191
187: ; preds = %2, %185
%188 = load i32, i32* @stderr
%189 = call i32 @fprintf(i32 %188, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.19, i64 0, i64 0))
%190 = call i32 @exit(i32 -1)
unreachable
191: ; preds = %185
%192 = icmp ne i8* %179, null
%193 = icmp ne i8* %180, null
%194 = select i1 %192, i1 true, i1 %193
br i1 %194, label %195, label %208
195: ; preds = %191
%196 = call i32 @get_address(i8* %176, i32* %7)
%197 = icmp slt i32 %196, 0
br i1 %197, label %242, label %198
198: ; preds = %195
br i1 %192, label %199, label %203
199: ; preds = %198
%200 = load i32, i32* %7
%201 = call i64 @parse_address(i8* %176, i32 %200, i32 %196, i8* %179, %struct.ifreq* %5)
%202 = icmp slt i64 %201, 0
br i1 %202, label %242, label %203
203: ; preds = %199, %198
br i1 %193, label %204, label %208
204: ; preds = %203
%205 = load i32, i32* %7
%206 = call i64 @parse_address(i8* %176, i32 %205, i32 %196, i8* %180, %struct.ifreq* %6)
%207 = icmp slt i64 %206, 0
br i1 %207, label %242, label %208
208: ; preds = %203, %204, %191
%209 = icmp eq i8* %181, null
br i1 %209, label %216, label %210
210: ; preds = %208
%211 = call i64 @strcmp(i8* %176, i8* %181)
%212 = icmp eq i64 %211, 0
br i1 %212, label %216, label %213
213: ; preds = %210
%214 = call i64 @do_changename(i8* %176, i8* %181)
%215 = icmp slt i64 %214, 0
br i1 %215, label %242, label %216
216: ; preds = %213, %210, %208
%217 = phi i8* [ %176, %210 ], [ %176, %208 ], [ %181, %213 ]
%218 = load i32, i32* %3
%219 = icmp eq i32 %218, -1
br i1 %219, label %223, label %220
220: ; preds = %216
%221 = call i64 @set_qlen(i8* %217, i32 %218)
%222 = icmp slt i64 %221, 0
br i1 %222, label %242, label %223
223: ; preds = %220, %216
%224 = load i32, i32* %4
%225 = icmp eq i32 %224, -1
br i1 %225, label %229, label %226
226: ; preds = %223
%227 = call i64 @set_mtu(i8* %217, i32 %224)
%228 = icmp slt i64 %227, 0
br i1 %228, label %242, label %229
229: ; preds = %226, %223
br i1 %194, label %230, label %238
230: ; preds = %229
br i1 %193, label %231, label %234
231: ; preds = %230
%232 = call i64 @set_address(%struct.ifreq* %6, i32 1)
%233 = icmp slt i64 %232, 0
br i1 %233, label %242, label %234
234: ; preds = %231, %230
br i1 %192, label %235, label %238
235: ; preds = %234
%236 = call i64 @set_address(%struct.ifreq* %5, i32 0)
%237 = icmp slt i64 %236, 0
br i1 %237, label %242, label %238
238: ; preds = %234, %235, %229
%239 = icmp eq i32 %177, 0
br i1 %239, label %242, label %240
240: ; preds = %238
%241 = call i32 @do_chflags(i8* %217, i32 %178, i32 %177)
br label %242
242: ; preds = %238, %235, %231, %226, %220, %213, %204, %199, %195, %240, %154, %130
%243 = phi i32 [ %131, %130 ], [ %155, %154 ], [ %241, %240 ], [ -1, %195 ], [ -1, %199 ], [ -1, %204 ], [ -1, %213 ], [ -1, %220 ], [ -1, %226 ], [ -1, %231 ], [ -1, %235 ], [ 0, %238 ]
ret i32 %243
}