#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 rtcanmsg {
  scalar_t__ can_family;
  scalar_t__ gwtype;
  int flags;
};
struct rtattr {
  int rta_type;
};
struct nlmsghdr {
  scalar_t__ nlmsg_type;
};
struct cgw_csum_xor {
  int dummy;
};
struct cgw_csum_crc8 {
  int dummy;
};
typedef int __u32;

/* Variables and functions */
scalar_t__ AF_CAN;
#define CGW_CS_CRC8 138
#define CGW_CS_XOR 137
#define CGW_DROPPED 136
#define CGW_DST_IF 135
#define CGW_FILTER 134
int CGW_FLAGS_CAN_ECHO;
int CGW_FLAGS_CAN_SRC_TSTAMP;
#define CGW_HANDLED 133
#define CGW_MOD_AND 132
#define CGW_MOD_OR 131
#define CGW_MOD_SET 130
#define CGW_MOD_XOR 129
#define CGW_SRC_IF 128
scalar_t__ CGW_TYPE_CAN_CAN;
int EINVAL;
int IF_NAMESIZE;
int NLMSG_ALIGN(int);
scalar_t__ NLMSG_DATA(struct nlmsghdr *);
scalar_t__ NLMSG_DONE;
scalar_t__ NLMSG_ERROR;
struct nlmsghdr *NLMSG_NEXT(struct nlmsghdr *, int);
int /*<<< orphan*/ NLMSG_OK(struct nlmsghdr *, int);
int NLMSG_PAYLOAD(struct nlmsghdr *, int);
scalar_t__ RTA_DATA(struct rtattr *);
struct rtattr *RTA_NEXT(struct rtattr *, int);
scalar_t__ RTA_OK(struct rtattr *, int);
char *basename(char *);
char *if_indextoname(unsigned int, char *);
int /*<<< orphan*/ print_cs_crc8(struct cgw_csum_crc8 *);
int /*<<< orphan*/ print_cs_xor(struct cgw_csum_xor *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ printfilter(scalar_t__);
int /*<<< orphan*/ printmod(char *, scalar_t__);
int parse_rtlist(char *prgname, unsigned char *rxbuf, int len) {
  char ifname[IF_NAMESIZE];
  struct rtcanmsg *rtc;
  struct rtattr *rta;
  struct nlmsghdr *nlh;
  unsigned int src_ifindex = 0;
  unsigned int dst_ifindex = 0;
  __u32 handled, dropped;
  int rtlen;
  nlh = (struct nlmsghdr *)rxbuf;
  while (1) {
    if (!NLMSG_OK(nlh, len))
      return 0;
    if (nlh->nlmsg_type == NLMSG_ERROR) {
      printf("NLMSG_ERROR\n");
      return 1;
    }
    if (nlh->nlmsg_type == NLMSG_DONE) {
      return 1;
    }
    rtc = (struct rtcanmsg *)NLMSG_DATA(nlh);
    if (rtc->can_family != AF_CAN) {
      printf("received msg from unknown family %d\n", rtc->can_family);
      return -EINVAL;
    }
    if (rtc->gwtype != CGW_TYPE_CAN_CAN) {
      printf("received msg with unknown gwtype %d\n", rtc->gwtype);
      return -EINVAL;
    }
    handled = 0;
    dropped = 0;
    src_ifindex = 0;
    dst_ifindex = 0;
    printf("%s -A ", basename(prgname));
    rta = (struct rtattr *)((
        struct rtattr *)(((char *)(rtc)) +
                         NLMSG_ALIGN(sizeof(struct rtcanmsg))));
    rtlen = NLMSG_PAYLOAD(nlh, sizeof(struct rtcanmsg));
    for (; RTA_OK(rta, rtlen); rta = RTA_NEXT(rta, rtlen)) {
      switch (rta->rta_type) {
      case CGW_FILTER:
      case CGW_MOD_AND:
      case CGW_MOD_OR:
      case CGW_MOD_XOR:
      case CGW_MOD_SET:
      case CGW_CS_XOR:
      case CGW_CS_CRC8:
        break;
      case CGW_SRC_IF:
        src_ifindex = *(__u32 *)RTA_DATA(rta);
        break;
      case CGW_DST_IF:
        dst_ifindex = *(__u32 *)RTA_DATA(rta);
        break;
      case CGW_HANDLED:
        handled = *(__u32 *)RTA_DATA(rta);
        break;
      case CGW_DROPPED:
        dropped = *(__u32 *)RTA_DATA(rta);
        break;
      default:
        printf("Unknown attribute %d!", rta->rta_type);
        return -EINVAL;
        break;
      }
    }
    printf("-s %s ", if_indextoname(src_ifindex, ifname));
    printf("-d %s ", if_indextoname(dst_ifindex, ifname));
    if (rtc->flags & CGW_FLAGS_CAN_ECHO)
      printf("-e ");
    if (rtc->flags & CGW_FLAGS_CAN_SRC_TSTAMP)
      printf("-t ");
    rta = (struct rtattr *)((
        struct rtattr *)(((char *)(rtc)) +
                         NLMSG_ALIGN(sizeof(struct rtcanmsg))));
    rtlen = NLMSG_PAYLOAD(nlh, sizeof(struct rtcanmsg));
    for (; RTA_OK(rta, rtlen); rta = RTA_NEXT(rta, rtlen)) {
      switch (rta->rta_type) {
      case CGW_FILTER:
        printfilter(RTA_DATA(rta));
        break;
      case CGW_MOD_AND:
        printmod("AND", RTA_DATA(rta));
        break;
      case CGW_MOD_OR:
        printmod("OR", RTA_DATA(rta));
        break;
      case CGW_MOD_XOR:
        printmod("XOR", RTA_DATA(rta));
        break;
      case CGW_MOD_SET:
        printmod("SET", RTA_DATA(rta));
        break;
      case CGW_CS_XOR:
        print_cs_xor((struct cgw_csum_xor *)RTA_DATA(rta));
        break;
      case CGW_CS_CRC8:
        print_cs_crc8((struct cgw_csum_crc8 *)RTA_DATA(rta));
        break;
      case CGW_SRC_IF:
      case CGW_DST_IF:
      case CGW_HANDLED:
      case CGW_DROPPED:
        break;
      default:
        printf("Unknown attribute %d!", rta->rta_type);
        return -EINVAL;
        break;
      }
    }
    printf("# %d handled %d dropped\n", handled, dropped);
    nlh = NLMSG_NEXT(nlh, len);
  }
}


x86 assembly (clang, -O0):
<parse_rtlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    0x2dbb(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    124d <parse_rtlist+0x5d>
mov    -0x48(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <NLMSG_OK@plt>
cmp    $0x0,%eax
jne    1275 <parse_rtlist+0x85>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x60(%rbp)
jmp    16e5 <parse_rtlist+0x4f5>
mov    -0x48(%rbp),%rax
mov    (%rax),%rax
mov    0x2d55(%rip),%rcx
cmp    (%rcx),%rax
jne    12ad <parse_rtlist+0xbd>
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x60(%rbp)
jmp    16e5 <parse_rtlist+0x4f5>
mov    -0x48(%rbp),%rax
mov    (%rax),%rax
mov    0x2cf5(%rip),%rcx
cmp    (%rcx),%rax
jne    12d7 <parse_rtlist+0xe7>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x60(%rbp)
jmp    16e5 <parse_rtlist+0x4f5>
mov    -0x48(%rbp),%rdi
call   10d0 <NLMSG_DATA@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    0x2cfe(%rip),%rcx
cmp    (%rcx),%rax
je     132a <parse_rtlist+0x13a>
mov    -0x38(%rbp),%rax
mov    (%rax),%rsi
lea    0xd5c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %eax,%eax
mov    0x2c8f(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x60(%rbp)
jmp    16e5 <parse_rtlist+0x4f5>
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x2caf(%rip),%rcx
cmp    (%rcx),%rax
je     1372 <parse_rtlist+0x182>
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd39(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %eax,%eax
mov    0x2c47(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x60(%rbp)
jmp    16e5 <parse_rtlist+0x4f5>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
call   10a0 <basename@plt>
mov    %rax,%rsi
lea    0xd0e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    $0x18,%edi
call   1070 <NLMSG_ALIGN@plt>
mov    %eax,%ecx
mov    -0x70(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x48(%rbp),%rdi
mov    $0x18,%esi
call   10b0 <NLMSG_PAYLOAD@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x5c(%rbp),%esi
call   1040 <RTA_OK@plt>
cmp    $0x0,%rax
je     14b6 <parse_rtlist+0x2c6>
mov    -0x40(%rbp),%rax
mov    (%rax),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x78(%rbp)
sub    $0xa,%eax
ja     146e <parse_rtlist+0x27e>
mov    -0x78(%rbp),%rax
lea    0xc18(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    149c <parse_rtlist+0x2ac>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
jmp    149c <parse_rtlist+0x2ac>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
jmp    149c <parse_rtlist+0x2ac>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
jmp    149c <parse_rtlist+0x2ac>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
jmp    149c <parse_rtlist+0x2ac>
mov    -0x40(%rbp),%rax
mov    (%rax),%esi
lea    0xc3b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %eax,%eax
mov    0x2b1d(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x60(%rbp)
jmp    16e5 <parse_rtlist+0x4f5>
jmp    14a1 <parse_rtlist+0x2b1>
mov    -0x40(%rbp),%rdi
mov    -0x5c(%rbp),%esi
call   1030 <RTA_NEXT@plt>
mov    %rax,-0x40(%rbp)
jmp    13db <parse_rtlist+0x1eb>
mov    -0x68(%rbp),%rsi
mov    -0x4c(%rbp),%edi
call   10f0 <if_indextoname@plt>
mov    %rax,%rsi
lea    0xc00(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x68(%rbp),%rsi
mov    -0x50(%rbp),%edi
call   10f0 <if_indextoname@plt>
mov    %rax,%rsi
lea    0xbea(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%eax
mov    0x2ac2(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1517 <parse_rtlist+0x327>
lea    0xbca(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%eax
mov    0x2aab(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     153e <parse_rtlist+0x34e>
lea    0xba7(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    $0x18,%edi
call   1070 <NLMSG_ALIGN@plt>
mov    %eax,%ecx
mov    -0x80(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x48(%rbp),%rdi
mov    $0x18,%esi
call   10b0 <NLMSG_PAYLOAD@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x5c(%rbp),%esi
call   1040 <RTA_OK@plt>
cmp    $0x0,%rax
je     16bc <parse_rtlist+0x4cc>
mov    -0x40(%rbp),%rax
mov    (%rax),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x88(%rbp)
sub    $0xa,%eax
ja     1674 <parse_rtlist+0x484>
mov    -0x88(%rbp),%rax
lea    0xa50(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    %rax,%rdi
call   1050 <printfilter@plt>
jmp    16a2 <parse_rtlist+0x4b2>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    %rax,%rsi
lea    0xb00(%rip),%rdi
call   10e0 <printmod@plt>
jmp    16a2 <parse_rtlist+0x4b2>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    %rax,%rsi
lea    0xae8(%rip),%rdi
call   10e0 <printmod@plt>
jmp    16a2 <parse_rtlist+0x4b2>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    %rax,%rsi
lea    0xaca(%rip),%rdi
call   10e0 <printmod@plt>
jmp    16a2 <parse_rtlist+0x4b2>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    %rax,%rsi
lea    0xab1(%rip),%rdi
call   10e0 <printmod@plt>
jmp    16a2 <parse_rtlist+0x4b2>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    %rax,%rdi
call   1090 <print_cs_xor@plt>
jmp    16a2 <parse_rtlist+0x4b2>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    %rax,%rdi
call   10c0 <print_cs_crc8@plt>
jmp    16a2 <parse_rtlist+0x4b2>
jmp    16a2 <parse_rtlist+0x4b2>
mov    -0x40(%rbp),%rax
mov    (%rax),%esi
lea    0xa35(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %eax,%eax
mov    0x2917(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x60(%rbp)
jmp    16e5 <parse_rtlist+0x4f5>
jmp    16a7 <parse_rtlist+0x4b7>
mov    -0x40(%rbp),%rdi
mov    -0x5c(%rbp),%esi
call   1030 <RTA_NEXT@plt>
mov    %rax,-0x40(%rbp)
jmp    1571 <parse_rtlist+0x381>
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
lea    0xa25(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x48(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1110 <NLMSG_NEXT@plt>
mov    %rax,-0x48(%rbp)
jmp    1248 <parse_rtlist+0x58>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_rtlist>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r13
mov    %rdi,-0x58(%rbp)
mov    0x2da9(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    %rsi,%rdi
mov    %edx,-0x44(%rbp)
mov    %edx,%esi
call   1070 <NLMSG_OK@plt>
test   %eax,%eax
je     1557 <parse_rtlist+0x357>
lea    0xdda(%rip),%r12
lea    0xda7(%rip),%r14
jmp    129a <parse_rtlist+0x9a>
nopl   0x0(%rax,%rax,1)
xor    %r15d,%r15d
lea    0xe77(%rip),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
xor    %eax,%eax
call   1090 <printf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%ebx
mov    %ebx,%esi
call   1120 <NLMSG_NEXT@plt>
mov    %rax,%r13
mov    %rax,%rdi
mov    %ebx,%esi
call   1070 <NLMSG_OK@plt>
test   %eax,%eax
je     15a7 <parse_rtlist+0x3a7>
mov    0x0(%r13),%rax
mov    0x2d33(%rip),%rcx
cmp    (%rcx),%rax
je     156f <parse_rtlist+0x36f>
mov    0x2cfb(%rip),%rcx
cmp    (%rcx),%rax
je     157b <parse_rtlist+0x37b>
mov    %r13,-0x40(%rbp)
mov    %r13,%rdi
call   10e0 <NLMSG_DATA@plt>
mov    %rax,%r13
mov    (%rax),%rsi
mov    0x2d19(%rip),%rax
cmp    (%rax),%rsi
jne    1583 <parse_rtlist+0x383>
mov    0x8(%r13),%rsi
mov    0x2cfd(%rip),%rax
cmp    (%rax),%rsi
jne    158c <parse_rtlist+0x38c>
mov    -0x58(%rbp),%rdi
call   10b0 <basename@plt>
movl   $0x0,-0x38(%rbp)
lea    0xd97(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x18,%edi
call   1080 <NLMSG_ALIGN@plt>
movslq %eax,%rbx
add    %r13,%rbx
mov    -0x40(%rbp),%rdi
mov    $0x18,%esi
call   10c0 <NLMSG_PAYLOAD@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <RTA_OK@plt>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
test   %rax,%rax
je     1400 <parse_rtlist+0x200>
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
jmp    13ae <parse_rtlist+0x1ae>
mov    %rbx,%rdi
call   1110 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r15d,%esi
call   1030 <RTA_NEXT@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15d,%esi
call   1050 <RTA_OK@plt>
test   %rax,%rax
je     1400 <parse_rtlist+0x200>
mov    (%rbx),%esi
lea    -0x80(%rsi),%eax
cmp    $0xa,%eax
ja     155c <parse_rtlist+0x35c>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
mov    %rbx,%rdi
call   1110 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    1390 <parse_rtlist+0x190>
mov    %rbx,%rdi
call   1110 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
jmp    1390 <parse_rtlist+0x190>
mov    %rbx,%rdi
call   1110 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
jmp    1390 <parse_rtlist+0x190>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    -0x38(%rbp),%edi
mov    -0x50(%rbp),%rbx
mov    %rbx,%rsi
call   1100 <if_indextoname@plt>
lea    0xca9(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    -0x34(%rbp),%edi
mov    %rbx,%rsi
call   1100 <if_indextoname@plt>
lea    0xc94(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x10(%r13),%eax
mov    0x2b79(%rip),%rcx
test   %eax,(%rcx)
je     145d <parse_rtlist+0x25d>
lea    0xc7b(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x10(%r13),%eax
mov    0x2b6c(%rip),%rcx
test   %eax,(%rcx)
je     1476 <parse_rtlist+0x276>
lea    0xc62(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x18,%edi
call   1080 <NLMSG_ALIGN@plt>
cltq
add    %rax,%r13
mov    -0x40(%rbp),%rdi
mov    $0x18,%esi
call   10c0 <NLMSG_PAYLOAD@plt>
mov    %eax,%ebx
mov    %r13,%rdi
mov    %eax,%esi
jmp    14c5 <parse_rtlist+0x2c5>
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
lea    0xc2a(%rip),%rdi
mov    %rax,%rsi
call   10f0 <printmod@plt>
mov    %r13,%rdi
mov    %ebx,%esi
call   1030 <RTA_NEXT@plt>
mov    %rax,%r13
mov    %rax,%rdi
mov    %ebx,%esi
call   1050 <RTA_OK@plt>
test   %rax,%rax
je     1260 <parse_rtlist+0x60>
mov    0x0(%r13),%esi
lea    -0x80(%rsi),%eax
cmp    $0xa,%eax
ja     155c <parse_rtlist+0x35c>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
lea    0xbe2(%rip),%rdi
jmp    14ab <parse_rtlist+0x2ab>
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
lea    0xbd5(%rip),%rdi
jmp    14ab <parse_rtlist+0x2ab>
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
lea    0xbea(%rip),%rdi
jmp    14ab <parse_rtlist+0x2ab>
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
mov    %rax,%rdi
call   1060 <printfilter@plt>
jmp    14b3 <parse_rtlist+0x2b3>
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
mov    %rax,%rdi
call   10a0 <print_cs_xor@plt>
jmp    14b3 <parse_rtlist+0x2b3>
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
mov    %rax,%rdi
call   10d0 <print_cs_crc8@plt>
jmp    14b3 <parse_rtlist+0x2b3>
xor    %r15d,%r15d
jmp    15a7 <parse_rtlist+0x3a7>
lea    0xb46(%rip),%rdi
xor    %r15d,%r15d
xor    %eax,%eax
call   1090 <printf@plt>
jmp    159d <parse_rtlist+0x39d>
lea    0xb84(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%r15d
jmp    15a7 <parse_rtlist+0x3a7>
lea    0xace(%rip),%rdi
jmp    1593 <parse_rtlist+0x393>
lea    0xaea(%rip),%rdi
xor    %r15d,%r15d
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x2a04(%rip),%rax
sub    (%rax),%r15d
mov    %r15d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.rtcanmsg = type { i64, i64, i32 }
%struct.rtattr = type { i32 }
%struct.nlmsghdr = type { i64 }
%struct.cgw_csum_xor = type { i32 }
%struct.cgw_csum_crc8 = type { i32 }
@IF_NAMESIZE = global i32 0
@NLMSG_ERROR = global i64 0
@.str = [13 x i8] c"NLMSG_ERROR\0A\00"
@NLMSG_DONE = global i64 0
@AF_CAN = global i64 0
@.str.1 = [37 x i8] c"received msg from unknown family %d\0A\00"
@EINVAL = global i32 0
@CGW_TYPE_CAN_CAN = global i64 0
@.str.2 = [37 x i8] c"received msg with unknown gwtype %d\0A\00"
@.str.3 = [7 x i8] c"%s -A \00"
@.str.4 = [22 x i8] c"Unknown attribute %d!\00"
@.str.5 = [7 x i8] c"-s %s \00"
@.str.6 = [7 x i8] c"-d %s \00"
@CGW_FLAGS_CAN_ECHO = global i32 0
@.str.7 = [4 x i8] c"-e \00"
@CGW_FLAGS_CAN_SRC_TSTAMP = global i32 0
@.str.8 = [4 x i8] c"-t \00"
@.str.9 = [4 x i8] c"AND\00"
@.str.10 = [3 x i8] c"OR\00"
@.str.11 = [4 x i8] c"XOR\00"
@.str.12 = [4 x i8] c"SET\00"
@.str.13 = [25 x i8] c"# %d handled %d dropped\0A\00"
define i32 @parse_rtlist(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca %struct.rtcanmsg*
%11 = alloca %struct.rtattr*
%12 = alloca %struct.nlmsghdr*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%19 = load i32, i32* @IF_NAMESIZE
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %8
%22 = alloca i8, i64 %20
store i64 %20, i64* %9
store i32 0, i32* %13
store i32 0, i32* %14
%23 = load i8*, i8** %6
%24 = bitcast i8* %23 to %struct.nlmsghdr*
store %struct.nlmsghdr* %24, %struct.nlmsghdr** %12
br label %25
25: ; preds = %215, %3
br label %26
26: ; preds = %25
%27 = load %struct.nlmsghdr*, %struct.nlmsghdr** %12
%28 = load i32, i32* %7
%29 = call i32 @NLMSG_OK(%struct.nlmsghdr* %27, i32 %28)
%30 = icmp ne i32 %29, 0
br i1 %30, label %32, label %31
31: ; preds = %26
store i32 0, i32* %4
store i32 1, i32* %18
br label %222
32: ; preds = %26
%33 = load %struct.nlmsghdr*, %struct.nlmsghdr** %12
%34 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %33, i32 0, i32 0
%35 = load i64, i64* %34
%36 = load i64, i64* @NLMSG_ERROR
%37 = icmp eq i64 %35, %36
br i1 %37, label %38, label %40
38: ; preds = %32
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %4
store i32 1, i32* %18
br label %222
40: ; preds = %32
%41 = load %struct.nlmsghdr*, %struct.nlmsghdr** %12
%42 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %41, i32 0, i32 0
%43 = load i64, i64* %42
%44 = load i64, i64* @NLMSG_DONE
%45 = icmp eq i64 %43, %44
br i1 %45, label %46, label %47
46: ; preds = %40
store i32 1, i32* %4
store i32 1, i32* %18
br label %222
47: ; preds = %40
%48 = load %struct.nlmsghdr*, %struct.nlmsghdr** %12
%49 = call i64 @NLMSG_DATA(%struct.nlmsghdr* %48)
%50 = inttoptr i64 %49 to %struct.rtcanmsg*
store %struct.rtcanmsg* %50, %struct.rtcanmsg** %10
%51 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%52 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %51, i32 0, i32 0
%53 = load i64, i64* %52
%54 = load i64, i64* @AF_CAN
%55 = icmp ne i64 %53, %54
br i1 %55, label %56, label %63
56: ; preds = %47
%57 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%58 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %57, i32 0, i32 0
%59 = load i64, i64* %58
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i64 %59)
%61 = load i32, i32* @EINVAL
%62 = sub nsw i32 0, %61
store i32 %62, i32* %4
store i32 1, i32* %18
br label %222
63: ; preds = %47
%64 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%65 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %64, i32 0, i32 1
%66 = load i64, i64* %65
%67 = load i64, i64* @CGW_TYPE_CAN_CAN
%68 = icmp ne i64 %66, %67
br i1 %68, label %69, label %76
69: ; preds = %63
%70 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%71 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %70, i32 0, i32 1
%72 = load i64, i64* %71
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i64 %72)
%74 = load i32, i32* @EINVAL
%75 = sub nsw i32 0, %74
store i32 %75, i32* %4
store i32 1, i32* %18
br label %222
76: ; preds = %63
store i32 0, i32* %15
store i32 0, i32* %16
store i32 0, i32* %13
store i32 0, i32* %14
%77 = load i8*, i8** %5
%78 = call i8* @basename(i8* %77)
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %78)
%80 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%81 = bitcast %struct.rtcanmsg* %80 to i8*
%82 = call i32 @NLMSG_ALIGN(i32 24)
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8, i8* %81, i64 %83
%85 = bitcast i8* %84 to %struct.rtattr*
store %struct.rtattr* %85, %struct.rtattr** %11
%86 = load %struct.nlmsghdr*, %struct.nlmsghdr** %12
%87 = call i32 @NLMSG_PAYLOAD(%struct.nlmsghdr* %86, i32 24)
store i32 %87, i32* %17
br label %88
88: ; preds = %126, %76
%89 = load %struct.rtattr*, %struct.rtattr** %11
%90 = load i32, i32* %17
%91 = call i64 @RTA_OK(%struct.rtattr* %89, i32 %90)
%92 = icmp ne i64 %91, 0
br i1 %92, label %93, label %130
93: ; preds = %88
%94 = load %struct.rtattr*, %struct.rtattr** %11
%95 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %94, i32 0, i32 0
%96 = load i32, i32* %95
switch i32 %96, label %118 [
i32 134, label %97
i32 132, label %97
i32 131, label %97
i32 129, label %97
i32 130, label %97
i32 137, label %97
i32 138, label %97
i32 128, label %98
i32 135, label %103
i32 133, label %108
i32 136, label %113
]
97: ; preds = %93, %93, %93, %93, %93, %93, %93
br label %125
98: ; preds = %93
%99 = load %struct.rtattr*, %struct.rtattr** %11
%100 = call i64 @RTA_DATA(%struct.rtattr* %99)
%101 = inttoptr i64 %100 to i32*
%102 = load i32, i32* %101
store i32 %102, i32* %13
br label %125
103: ; preds = %93
%104 = load %struct.rtattr*, %struct.rtattr** %11
%105 = call i64 @RTA_DATA(%struct.rtattr* %104)
%106 = inttoptr i64 %105 to i32*
%107 = load i32, i32* %106
store i32 %107, i32* %14
br label %125
108: ; preds = %93
%109 = load %struct.rtattr*, %struct.rtattr** %11
%110 = call i64 @RTA_DATA(%struct.rtattr* %109)
%111 = inttoptr i64 %110 to i32*
%112 = load i32, i32* %111
store i32 %112, i32* %15
br label %125
113: ; preds = %93
%114 = load %struct.rtattr*, %struct.rtattr** %11
%115 = call i64 @RTA_DATA(%struct.rtattr* %114)
%116 = inttoptr i64 %115 to i32*
%117 = load i32, i32* %116
store i32 %117, i32* %16
br label %125
118: ; preds = %93
%119 = load %struct.rtattr*, %struct.rtattr** %11
%120 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %119, i32 0, i32 0
%121 = load i32, i32* %120
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %121)
%123 = load i32, i32* @EINVAL
%124 = sub nsw i32 0, %123
store i32 %124, i32* %4
store i32 1, i32* %18
br label %222
125: ; preds = %113, %108, %103, %98, %97
br label %126
126: ; preds = %125
%127 = load %struct.rtattr*, %struct.rtattr** %11
%128 = load i32, i32* %17
%129 = call %struct.rtattr* @RTA_NEXT(%struct.rtattr* %127, i32 %128)
store %struct.rtattr* %129, %struct.rtattr** %11
br label %88
130: ; preds = %88
%131 = load i32, i32* %13
%132 = call i8* @if_indextoname(i32 %131, i8* %22)
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %132)
%134 = load i32, i32* %14
%135 = call i8* @if_indextoname(i32 %134, i8* %22)
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %135)
%137 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%138 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %137, i32 0, i32 2
%139 = load i32, i32* %138
%140 = load i32, i32* @CGW_FLAGS_CAN_ECHO
%141 = and i32 %139, %140
%142 = icmp ne i32 %141, 0
br i1 %142, label %143, label %145
143: ; preds = %130
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %145
145: ; preds = %143, %130
%146 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%147 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %146, i32 0, i32 2
%148 = load i32, i32* %147
%149 = load i32, i32* @CGW_FLAGS_CAN_SRC_TSTAMP
%150 = and i32 %148, %149
%151 = icmp ne i32 %150, 0
br i1 %151, label %152, label %154
152: ; preds = %145
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %154
154: ; preds = %152, %145
%155 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%156 = bitcast %struct.rtcanmsg* %155 to i8*
%157 = call i32 @NLMSG_ALIGN(i32 24)
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds i8, i8* %156, i64 %158
%160 = bitcast i8* %159 to %struct.rtattr*
store %struct.rtattr* %160, %struct.rtattr** %11
%161 = load %struct.nlmsghdr*, %struct.nlmsghdr** %12
%162 = call i32 @NLMSG_PAYLOAD(%struct.nlmsghdr* %161, i32 24)
store i32 %162, i32* %17
br label %163
163: ; preds = %211, %154
%164 = load %struct.rtattr*, %struct.rtattr** %11
%165 = load i32, i32* %17
%166 = call i64 @RTA_OK(%struct.rtattr* %164, i32 %165)
%167 = icmp ne i64 %166, 0
br i1 %167, label %168, label %215
168: ; preds = %163
%169 = load %struct.rtattr*, %struct.rtattr** %11
%170 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %169, i32 0, i32 0
%171 = load i32, i32* %170
switch i32 %171, label %203 [
i32 134, label %172
i32 132, label %176
i32 131, label %180
i32 129, label %184
i32 130, label %188
i32 137, label %192
i32 138, label %197
i32 128, label %202
i32 135, label %202
i32 133, label %202
i32 136, label %202
]
172: ; preds = %168
%173 = load %struct.rtattr*, %struct.rtattr** %11
%174 = call i64 @RTA_DATA(%struct.rtattr* %173)
%175 = call i32 @printfilter(i64 %174)
br label %210
176: ; preds = %168
%177 = load %struct.rtattr*, %struct.rtattr** %11
%178 = call i64 @RTA_DATA(%struct.rtattr* %177)
%179 = call i32 @printmod(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i64 %178)
br label %210
180: ; preds = %168
%181 = load %struct.rtattr*, %struct.rtattr** %11
%182 = call i64 @RTA_DATA(%struct.rtattr* %181)
%183 = call i32 @printmod(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i64 %182)
br label %210
184: ; preds = %168
%185 = load %struct.rtattr*, %struct.rtattr** %11
%186 = call i64 @RTA_DATA(%struct.rtattr* %185)
%187 = call i32 @printmod(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i64 %186)
br label %210
188: ; preds = %168
%189 = load %struct.rtattr*, %struct.rtattr** %11
%190 = call i64 @RTA_DATA(%struct.rtattr* %189)
%191 = call i32 @printmod(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i64 %190)
br label %210
192: ; preds = %168
%193 = load %struct.rtattr*, %struct.rtattr** %11
%194 = call i64 @RTA_DATA(%struct.rtattr* %193)
%195 = inttoptr i64 %194 to %struct.cgw_csum_xor*
%196 = call i32 @print_cs_xor(%struct.cgw_csum_xor* %195)
br label %210
197: ; preds = %168
%198 = load %struct.rtattr*, %struct.rtattr** %11
%199 = call i64 @RTA_DATA(%struct.rtattr* %198)
%200 = inttoptr i64 %199 to %struct.cgw_csum_crc8*
%201 = call i32 @print_cs_crc8(%struct.cgw_csum_crc8* %200)
br label %210
202: ; preds = %168, %168, %168, %168
br label %210
203: ; preds = %168
%204 = load %struct.rtattr*, %struct.rtattr** %11
%205 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %204, i32 0, i32 0
%206 = load i32, i32* %205
%207 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %206)
%208 = load i32, i32* @EINVAL
%209 = sub nsw i32 0, %208
store i32 %209, i32* %4
store i32 1, i32* %18
br label %222
210: ; preds = %202, %197, %192, %188, %184, %180, %176, %172
br label %211
211: ; preds = %210
%212 = load %struct.rtattr*, %struct.rtattr** %11
%213 = load i32, i32* %17
%214 = call %struct.rtattr* @RTA_NEXT(%struct.rtattr* %212, i32 %213)
store %struct.rtattr* %214, %struct.rtattr** %11
br label %163
215: ; preds = %163
%216 = load i32, i32* %15
%217 = load i32, i32* %16
%218 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0), i32 %216, i32 %217)
%219 = load %struct.nlmsghdr*, %struct.nlmsghdr** %12
%220 = load i32, i32* %7
%221 = call %struct.nlmsghdr* @NLMSG_NEXT(%struct.nlmsghdr* %219, i32 %220)
store %struct.nlmsghdr* %221, %struct.nlmsghdr** %12
br label %25
222: ; preds = %203, %118, %69, %56, %46, %38, %31
%223 = load i8*, i8** %8
%224 = load i32, i32* %4
ret i32 %224
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i64 }
%struct.rtcanmsg = type { i64, i64, i32 }
%struct.rtattr = type { i32 }
%struct.cgw_csum_xor = type { i32 }
%struct.cgw_csum_crc8 = type { i32 }
@IF_NAMESIZE = global i32 0
@NLMSG_ERROR = global i64 0
@NLMSG_DONE = global i64 0
@AF_CAN = global i64 0
@.str.1 = [37 x i8] c"received msg from unknown family %d\0A\00"
@EINVAL = global i32 0
@CGW_TYPE_CAN_CAN = global i64 0
@.str.2 = [37 x i8] c"received msg with unknown gwtype %d\0A\00"
@.str.3 = [7 x i8] c"%s -A \00"
@.str.4 = [22 x i8] c"Unknown attribute %d!\00"
@.str.5 = [7 x i8] c"-s %s \00"
@.str.6 = [7 x i8] c"-d %s \00"
@CGW_FLAGS_CAN_ECHO = global i32 0
@.str.7 = [4 x i8] c"-e \00"
@CGW_FLAGS_CAN_SRC_TSTAMP = global i32 0
@.str.8 = [4 x i8] c"-t \00"
@.str.9 = [4 x i8] c"AND\00"
@.str.10 = [3 x i8] c"OR\00"
@.str.11 = [4 x i8] c"XOR\00"
@.str.12 = [4 x i8] c"SET\00"
@.str.13 = [25 x i8] c"# %d handled %d dropped\0A\00"
@str = [12 x i8] c"NLMSG_ERROR\00"
define i32 @parse_rtlist(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @IF_NAMESIZE
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = bitcast i8* %1 to %struct.nlmsghdr*
%8 = call i32 @NLMSG_OK(%struct.nlmsghdr* %7, i32 %2)
%9 = icmp eq i32 %8, 0
br i1 %9, label %160, label %10
10: ; preds = %3, %155
%11 = phi %struct.nlmsghdr* [ %157, %155 ], [ %7, %3 ]
%12 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %11, i64 0, i32 0
%13 = load i64, i64* %12
%14 = load i64, i64* @NLMSG_ERROR
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %160
18: ; preds = %10
%19 = load i64, i64* @NLMSG_DONE
%20 = icmp eq i64 %13, %19
br i1 %20, label %160, label %21
21: ; preds = %18
%22 = call i64 @NLMSG_DATA(%struct.nlmsghdr* %11)
%23 = inttoptr i64 %22 to %struct.rtcanmsg*
%24 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %23, i64 0, i32 0
%25 = load i64, i64* %24
%26 = load i64, i64* @AF_CAN
%27 = icmp eq i64 %25, %26
br i1 %27, label %32, label %28
28: ; preds = %21
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i64 %25)
%30 = load i32, i32* @EINVAL
%31 = sub nsw i32 0, %30
br label %160
32: ; preds = %21
%33 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %23, i64 0, i32 1
%34 = load i64, i64* %33
%35 = load i64, i64* @CGW_TYPE_CAN_CAN
%36 = icmp eq i64 %34, %35
br i1 %36, label %41, label %37
37: ; preds = %32
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i64 %34)
%39 = load i32, i32* @EINVAL
%40 = sub nsw i32 0, %39
br label %160
41: ; preds = %32
%42 = call i8* @basename(i8* %0)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %42)
%44 = inttoptr i64 %22 to i8*
%45 = call i32 @NLMSG_ALIGN(i32 24)
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %44, i64 %46
%48 = bitcast i8* %47 to %struct.rtattr*
%49 = call i32 @NLMSG_PAYLOAD(%struct.nlmsghdr* %11, i32 24)
%50 = call i64 @RTA_OK(%struct.rtattr* %48, i32 %49)
%51 = icmp eq i64 %50, 0
br i1 %51, label %88, label %52
52: ; preds = %41, %80
%53 = phi i32 [ %84, %80 ], [ 0, %41 ]
%54 = phi i32 [ %83, %80 ], [ 0, %41 ]
%55 = phi i32 [ %82, %80 ], [ 0, %41 ]
%56 = phi i32 [ %81, %80 ], [ 0, %41 ]
%57 = phi %struct.rtattr* [ %85, %80 ], [ %48, %41 ]
%58 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %57, i64 0, i32 0
%59 = load i32, i32* %58
switch i32 %59, label %76 [
i32 134, label %80
i32 132, label %80
i32 131, label %80
i32 129, label %80
i32 130, label %80
i32 137, label %80
i32 138, label %80
i32 128, label %60
i32 135, label %64
i32 133, label %68
i32 136, label %72
]
60: ; preds = %52
%61 = call i64 @RTA_DATA(%struct.rtattr* %57)
%62 = inttoptr i64 %61 to i32*
%63 = load i32, i32* %62
br label %80
64: ; preds = %52
%65 = call i64 @RTA_DATA(%struct.rtattr* %57)
%66 = inttoptr i64 %65 to i32*
%67 = load i32, i32* %66
br label %80
68: ; preds = %52
%69 = call i64 @RTA_DATA(%struct.rtattr* %57)
%70 = inttoptr i64 %69 to i32*
%71 = load i32, i32* %70
br label %80
72: ; preds = %52
%73 = call i64 @RTA_DATA(%struct.rtattr* %57)
%74 = inttoptr i64 %73 to i32*
%75 = load i32, i32* %74
br label %80
76: ; preds = %52
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %59)
%78 = load i32, i32* @EINVAL
%79 = sub nsw i32 0, %78
br label %160
80: ; preds = %60, %64, %68, %72, %52, %52, %52, %52, %52, %52, %52
%81 = phi i32 [ %56, %72 ], [ %56, %68 ], [ %56, %64 ], [ %63, %60 ], [ %56, %52 ], [ %56, %52 ], [ %56, %52 ], [ %56, %52 ], [ %56, %52 ], [ %56, %52 ], [ %56, %52 ]
%82 = phi i32 [ %55, %72 ], [ %55, %68 ], [ %67, %64 ], [ %55, %60 ], [ %55, %52 ], [ %55, %52 ], [ %55, %52 ], [ %55, %52 ], [ %55, %52 ], [ %55, %52 ], [ %55, %52 ]
%83 = phi i32 [ %54, %72 ], [ %71, %68 ], [ %54, %64 ], [ %54, %60 ], [ %54, %52 ], [ %54, %52 ], [ %54, %52 ], [ %54, %52 ], [ %54, %52 ], [ %54, %52 ], [ %54, %52 ]
%84 = phi i32 [ %75, %72 ], [ %53, %68 ], [ %53, %64 ], [ %53, %60 ], [ %53, %52 ], [ %53, %52 ], [ %53, %52 ], [ %53, %52 ], [ %53, %52 ], [ %53, %52 ], [ %53, %52 ]
%85 = call %struct.rtattr* @RTA_NEXT(%struct.rtattr* %57, i32 %49)
%86 = call i64 @RTA_OK(%struct.rtattr* %85, i32 %49)
%87 = icmp eq i64 %86, 0
br i1 %87, label %88, label %52
88: ; preds = %80, %41
%89 = phi i32 [ 0, %41 ], [ %81, %80 ]
%90 = phi i32 [ 0, %41 ], [ %82, %80 ]
%91 = phi i32 [ 0, %41 ], [ %83, %80 ]
%92 = phi i32 [ 0, %41 ], [ %84, %80 ]
%93 = call i8* @if_indextoname(i32 %89, i8* %6)
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %93)
%95 = call i8* @if_indextoname(i32 %90, i8* %6)
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %95)
%97 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %23, i64 0, i32 2
%98 = load i32, i32* %97
%99 = load i32, i32* @CGW_FLAGS_CAN_ECHO
%100 = and i32 %99, %98
%101 = icmp eq i32 %100, 0
br i1 %101, label %105, label %102
102: ; preds = %88
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%104 = load i32, i32* %97
br label %105
105: ; preds = %102, %88
%106 = phi i32 [ %104, %102 ], [ %98, %88 ]
%107 = load i32, i32* @CGW_FLAGS_CAN_SRC_TSTAMP
%108 = and i32 %107, %106
%109 = icmp eq i32 %108, 0
br i1 %109, label %112, label %110
110: ; preds = %105
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %112
112: ; preds = %110, %105
%113 = call i32 @NLMSG_ALIGN(i32 24)
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i8, i8* %44, i64 %114
%116 = bitcast i8* %115 to %struct.rtattr*
%117 = call i32 @NLMSG_PAYLOAD(%struct.nlmsghdr* %11, i32 24)
%118 = call i64 @RTA_OK(%struct.rtattr* %116, i32 %117)
%119 = icmp eq i64 %118, 0
br i1 %119, label %155, label %120
120: ; preds = %112, %151
%121 = phi %struct.rtattr* [ %152, %151 ], [ %116, %112 ]
%122 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %121, i64 0, i32 0
%123 = load i32, i32* %122
switch i32 %123, label %147 [
i32 134, label %124
i32 132, label %127
i32 131, label %130
i32 129, label %133
i32 130, label %136
i32 137, label %139
i32 138, label %143
i32 128, label %151
i32 135, label %151
i32 133, label %151
i32 136, label %151
]
124: ; preds = %120
%125 = call i64 @RTA_DATA(%struct.rtattr* %121)
%126 = call i32 @printfilter(i64 %125)
br label %151
127: ; preds = %120
%128 = call i64 @RTA_DATA(%struct.rtattr* %121)
%129 = call i32 @printmod(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i64 %128)
br label %151
130: ; preds = %120
%131 = call i64 @RTA_DATA(%struct.rtattr* %121)
%132 = call i32 @printmod(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i64 %131)
br label %151
133: ; preds = %120
%134 = call i64 @RTA_DATA(%struct.rtattr* %121)
%135 = call i32 @printmod(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i64 %134)
br label %151
136: ; preds = %120
%137 = call i64 @RTA_DATA(%struct.rtattr* %121)
%138 = call i32 @printmod(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i64 %137)
br label %151
139: ; preds = %120
%140 = call i64 @RTA_DATA(%struct.rtattr* %121)
%141 = inttoptr i64 %140 to %struct.cgw_csum_xor*
%142 = call i32 @print_cs_xor(%struct.cgw_csum_xor* %141)
br label %151
143: ; preds = %120
%144 = call i64 @RTA_DATA(%struct.rtattr* %121)
%145 = inttoptr i64 %144 to %struct.cgw_csum_crc8*
%146 = call i32 @print_cs_crc8(%struct.cgw_csum_crc8* %145)
br label %151
147: ; preds = %120
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %123)
%149 = load i32, i32* @EINVAL
%150 = sub nsw i32 0, %149
br label %160
151: ; preds = %124, %127, %130, %133, %136, %139, %143, %120, %120, %120, %120
%152 = call %struct.rtattr* @RTA_NEXT(%struct.rtattr* %121, i32 %117)
%153 = call i64 @RTA_OK(%struct.rtattr* %152, i32 %117)
%154 = icmp eq i64 %153, 0
br i1 %154, label %155, label %120
155: ; preds = %151, %112
%156 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0), i32 %91, i32 %92)
%157 = call %struct.nlmsghdr* @NLMSG_NEXT(%struct.nlmsghdr* %11, i32 %2)
%158 = call i32 @NLMSG_OK(%struct.nlmsghdr* %157, i32 %2)
%159 = icmp eq i32 %158, 0
br i1 %159, label %160, label %10
160: ; preds = %155, %18, %3, %147, %76, %37, %28, %16
%161 = phi i32 [ 1, %16 ], [ %31, %28 ], [ %40, %37 ], [ %79, %76 ], [ %150, %147 ], [ 0, %3 ], [ 0, %155 ], [ 1, %18 ]
ret i32 %161
}