#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 __u8;
typedef int __u32;

/* Variables and functions */
scalar_t__ AF_CAN;
#define CGW_CS_CRC8 141
#define CGW_CS_XOR 140
#define CGW_DELETED 139
#define CGW_DROPPED 138
#define CGW_DST_IF 137
#define CGW_FILTER 136
int CGW_FLAGS_CAN_ECHO;
int CGW_FLAGS_CAN_IIF_TX_OK;
int CGW_FLAGS_CAN_SRC_TSTAMP;
#define CGW_HANDLED 135
#define CGW_LIM_HOPS 134
#define CGW_MOD_AND 133
#define CGW_MOD_OR 132
#define CGW_MOD_SET 131
#define CGW_MOD_UID 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, deleted;
  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;
    deleted = 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_MOD_UID:
      case CGW_LIM_HOPS:
      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;
      case CGW_DELETED:
        deleted = *(__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 ");
    if (rtc->flags & CGW_FLAGS_CAN_IIF_TX_OK)
      printf("-i ");
    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_MOD_UID:
        printf("-u %X ", *(__u32 *)RTA_DATA(rta));
        break;
      case CGW_LIM_HOPS:
        printf("-l %d ", *(__u8 *)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:
      case CGW_DELETED:
        break;
      default:
        printf("Unknown attribute %d!", rta->rta_type);
        return -EINVAL;
        break;
      }
    }
    printf("# %d handled %d dropped %d deleted\n", handled, dropped, deleted);
    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    0x2db3(%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,-0x70(%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,-0x64(%rbp)
jmp    176b <parse_rtlist+0x57b>
mov    -0x48(%rbp),%rax
mov    (%rax),%rax
mov    0x2d4d(%rip),%rcx
cmp    (%rcx),%rax
jne    12ad <parse_rtlist+0xbd>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x64(%rbp)
jmp    176b <parse_rtlist+0x57b>
mov    -0x48(%rbp),%rax
mov    (%rax),%rax
mov    0x2ced(%rip),%rcx
cmp    (%rcx),%rax
jne    12d7 <parse_rtlist+0xe7>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x64(%rbp)
jmp    176b <parse_rtlist+0x57b>
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    0xd74(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %eax,%eax
mov    0x2c87(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x64(%rbp)
jmp    176b <parse_rtlist+0x57b>
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    0xd51(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %eax,%eax
mov    0x2c3f(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x64(%rbp)
jmp    176b <parse_rtlist+0x57b>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
call   10a0 <basename@plt>
mov    %rax,%rsi
lea    0xd1f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    $0x18,%edi
call   1070 <NLMSG_ALIGN@plt>
mov    %eax,%ecx
mov    -0x78(%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,-0x60(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x60(%rbp),%esi
call   1040 <RTA_OK@plt>
cmp    $0x0,%rax
je     14d0 <parse_rtlist+0x2e0>
mov    -0x40(%rbp),%rax
mov    (%rax),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x80(%rbp)
sub    $0xd,%eax
ja     1488 <parse_rtlist+0x298>
mov    -0x80(%rbp),%rax
lea    0xc1d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    14b6 <parse_rtlist+0x2c6>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
jmp    14b6 <parse_rtlist+0x2c6>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
jmp    14b6 <parse_rtlist+0x2c6>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
jmp    14b6 <parse_rtlist+0x2c6>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
jmp    14b6 <parse_rtlist+0x2c6>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
jmp    14b6 <parse_rtlist+0x2c6>
mov    -0x40(%rbp),%rax
mov    (%rax),%esi
lea    0xc39(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %eax,%eax
mov    0x2afb(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x64(%rbp)
jmp    176b <parse_rtlist+0x57b>
jmp    14bb <parse_rtlist+0x2cb>
mov    -0x40(%rbp),%rdi
mov    -0x60(%rbp),%esi
call   1030 <RTA_NEXT@plt>
mov    %rax,-0x40(%rbp)
jmp    13e2 <parse_rtlist+0x1f2>
mov    -0x70(%rbp),%rsi
mov    -0x4c(%rbp),%edi
call   10f0 <if_indextoname@plt>
mov    %rax,%rsi
lea    0xbfe(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x70(%rbp),%rsi
mov    -0x50(%rbp),%edi
call   10f0 <if_indextoname@plt>
mov    %rax,%rsi
lea    0xbe8(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%eax
mov    0x2aa0(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1531 <parse_rtlist+0x341>
lea    0xbc8(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%eax
mov    0x2a89(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1558 <parse_rtlist+0x368>
lea    0xba5(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%eax
mov    0x2a72(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     157f <parse_rtlist+0x38f>
lea    0xb82(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    $0x18,%edi
call   1070 <NLMSG_ALIGN@plt>
mov    %eax,%ecx
mov    -0x88(%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,-0x60(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x60(%rbp),%esi
call   1040 <RTA_OK@plt>
cmp    $0x0,%rax
je     173f <parse_rtlist+0x54f>
mov    -0x40(%rbp),%rax
mov    (%rax),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x90(%rbp)
sub    $0xd,%eax
ja     16f7 <parse_rtlist+0x507>
mov    -0x90(%rbp),%rax
lea    0xa09(%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    1725 <parse_rtlist+0x535>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    %rax,%rsi
lea    0xad5(%rip),%rdi
call   10e0 <printmod@plt>
jmp    1725 <parse_rtlist+0x535>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    %rax,%rsi
lea    0xabd(%rip),%rdi
call   10e0 <printmod@plt>
jmp    1725 <parse_rtlist+0x535>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    %rax,%rsi
lea    0xa9f(%rip),%rdi
call   10e0 <printmod@plt>
jmp    1725 <parse_rtlist+0x535>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    %rax,%rsi
lea    0xa86(%rip),%rdi
call   10e0 <printmod@plt>
jmp    1725 <parse_rtlist+0x535>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    (%rax),%esi
lea    0xa6e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1725 <parse_rtlist+0x535>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    (%rax),%esi
lea    0xa57(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1725 <parse_rtlist+0x535>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    %rax,%rdi
call   1090 <print_cs_xor@plt>
jmp    1725 <parse_rtlist+0x535>
mov    -0x40(%rbp),%rdi
call   1100 <RTA_DATA@plt>
mov    %rax,%rdi
call   10c0 <print_cs_crc8@plt>
jmp    1725 <parse_rtlist+0x535>
jmp    1725 <parse_rtlist+0x535>
mov    -0x40(%rbp),%rax
mov    (%rax),%esi
lea    0x9ca(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %eax,%eax
mov    0x288c(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x64(%rbp)
jmp    176b <parse_rtlist+0x57b>
jmp    172a <parse_rtlist+0x53a>
mov    -0x40(%rbp),%rdi
mov    -0x60(%rbp),%esi
call   1030 <RTA_NEXT@plt>
mov    %rax,-0x40(%rbp)
jmp    15b8 <parse_rtlist+0x3c8>
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
mov    -0x5c(%rbp),%ecx
lea    0x9c9(%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,-0x60(%rbp)
mov    0x2da1(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
mov    %rsi,%rdi
mov    %edx,-0x4c(%rbp)
mov    %edx,%esi
call   1070 <NLMSG_OK@plt>
test   %eax,%eax
je     15ce <parse_rtlist+0x3ce>
lea    0xde6(%rip),%r14
lea    0xda7(%rip),%r15
jmp    129d <parse_rtlist+0x9d>
nopl   0x0(%rax,%rax,1)
xor    %r12d,%r12d
lea    0xea1(%rip),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
xor    %eax,%eax
call   1090 <printf@plt>
mov    -0x48(%rbp),%rdi
mov    -0x4c(%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     161e <parse_rtlist+0x41e>
mov    0x0(%r13),%rax
mov    0x2d28(%rip),%rcx
cmp    (%rcx),%rax
je     15e6 <parse_rtlist+0x3e6>
mov    0x2cf0(%rip),%rcx
cmp    (%rcx),%rax
je     15f2 <parse_rtlist+0x3f2>
mov    %r13,-0x48(%rbp)
mov    %r13,%rdi
call   10e0 <NLMSG_DATA@plt>
mov    %rax,%r13
mov    (%rax),%rsi
mov    0x2d16(%rip),%rax
cmp    (%rax),%rsi
jne    15fa <parse_rtlist+0x3fa>
mov    0x8(%r13),%rsi
mov    0x2cfa(%rip),%rax
cmp    (%rax),%rsi
jne    1603 <parse_rtlist+0x403>
mov    -0x60(%rbp),%rdi
call   10b0 <basename@plt>
movl   $0x0,-0x3c(%rbp)
lea    0xdac(%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    -0x48(%rbp),%rdi
mov    $0x18,%esi
call   10c0 <NLMSG_PAYLOAD@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <RTA_OK@plt>
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
test   %rax,%rax
je     1420 <parse_rtlist+0x220>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
jmp    13be <parse_rtlist+0x1be>
mov    %rbx,%rdi
call   1110 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r12d,%esi
call   1030 <RTA_NEXT@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12d,%esi
call   1050 <RTA_OK@plt>
test   %rax,%rax
je     1420 <parse_rtlist+0x220>
mov    (%rbx),%esi
lea    -0x80(%rsi),%eax
cmp    $0xd,%eax
ja     15d3 <parse_rtlist+0x3d3>
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
mov    %rbx,%rdi
call   1110 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    13a0 <parse_rtlist+0x1a0>
mov    %rbx,%rdi
call   1110 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
jmp    13a0 <parse_rtlist+0x1a0>
mov    %rbx,%rdi
call   1110 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
jmp    13a0 <parse_rtlist+0x1a0>
mov    %rbx,%rdi
call   1110 <RTA_DATA@plt>
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
jmp    13a0 <parse_rtlist+0x1a0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0x3c(%rbp),%edi
mov    -0x58(%rbp),%rbx
mov    %rbx,%rsi
call   1100 <if_indextoname@plt>
lea    0xca1(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    -0x38(%rbp),%edi
mov    %rbx,%rsi
call   1100 <if_indextoname@plt>
lea    0xc8c(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x10(%r13),%eax
mov    0x2b51(%rip),%rcx
test   %eax,(%rcx)
je     147d <parse_rtlist+0x27d>
lea    0xc73(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x10(%r13),%eax
mov    0x2b44(%rip),%rcx
test   %eax,(%rcx)
je     149a <parse_rtlist+0x29a>
lea    0xc5a(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x10(%r13),%eax
mov    0x2b37(%rip),%rcx
test   %eax,(%rcx)
je     14b3 <parse_rtlist+0x2b3>
lea    0xc41(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x18,%edi
call   1080 <NLMSG_ALIGN@plt>
cltq
add    %rax,%r13
mov    -0x48(%rbp),%rdi
mov    $0x18,%esi
call   10c0 <NLMSG_PAYLOAD@plt>
mov    %eax,%ebx
mov    %r13,%rdi
mov    %eax,%esi
jmp    1502 <parse_rtlist+0x302>
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
lea    0xc09(%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    $0xd,%eax
ja     15d3 <parse_rtlist+0x3d3>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
lea    0xbbd(%rip),%rdi
jmp    14e8 <parse_rtlist+0x2e8>
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
mov    (%rax),%esi
lea    0xbb2(%rip),%rdi
jmp    1583 <parse_rtlist+0x383>
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
lea    0xb9d(%rip),%rdi
jmp    14e8 <parse_rtlist+0x2e8>
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
lea    0xbcb(%rip),%rdi
jmp    14e8 <parse_rtlist+0x2e8>
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
mov    (%rax),%esi
lea    0xb81(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    14f0 <parse_rtlist+0x2f0>
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
mov    %rax,%rdi
call   1060 <printfilter@plt>
jmp    14f0 <parse_rtlist+0x2f0>
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
mov    %rax,%rdi
call   10a0 <print_cs_xor@plt>
jmp    14f0 <parse_rtlist+0x2f0>
mov    %r13,%rdi
call   1110 <RTA_DATA@plt>
mov    %rax,%rdi
call   10d0 <print_cs_crc8@plt>
jmp    14f0 <parse_rtlist+0x2f0>
xor    %r12d,%r12d
jmp    161e <parse_rtlist+0x41e>
lea    0xae7(%rip),%rdi
xor    %r12d,%r12d
xor    %eax,%eax
call   1090 <printf@plt>
jmp    1614 <parse_rtlist+0x414>
lea    0xb42(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%r12d
jmp    161e <parse_rtlist+0x41e>
lea    0xa6f(%rip),%rdi
jmp    160a <parse_rtlist+0x40a>
lea    0xa8b(%rip),%rdi
xor    %r12d,%r12d
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x2985(%rip),%rax
sub    (%rax),%r12d
mov    %r12d,%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"
@CGW_FLAGS_CAN_IIF_TX_OK = global i32 0
@.str.9 = [4 x i8] c"-i \00"
@.str.10 = [4 x i8] c"AND\00"
@.str.11 = [3 x i8] c"OR\00"
@.str.12 = [4 x i8] c"XOR\00"
@.str.13 = [4 x i8] c"SET\00"
@.str.14 = [7 x i8] c"-u %X \00"
@.str.15 = [7 x i8] c"-l %d \00"
@.str.16 = [36 x i8] c"# %d handled %d dropped %d deleted\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
%19 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%20 = load i32, i32* @IF_NAMESIZE
%21 = zext i32 %20 to i64
%22 = call i8* @llvm.stacksave()
store i8* %22, i8** %8
%23 = alloca i8, i64 %21
store i64 %21, i64* %9
store i32 0, i32* %13
store i32 0, i32* %14
%24 = load i8*, i8** %6
%25 = bitcast i8* %24 to %struct.nlmsghdr*
store %struct.nlmsghdr* %25, %struct.nlmsghdr** %12
br label %26
26: ; preds = %242, %3
br label %27
27: ; preds = %26
%28 = load %struct.nlmsghdr*, %struct.nlmsghdr** %12
%29 = load i32, i32* %7
%30 = call i32 @NLMSG_OK(%struct.nlmsghdr* %28, i32 %29)
%31 = icmp ne i32 %30, 0
br i1 %31, label %33, label %32
32: ; preds = %27
store i32 0, i32* %4
store i32 1, i32* %19
br label %250
33: ; preds = %27
%34 = load %struct.nlmsghdr*, %struct.nlmsghdr** %12
%35 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %34, i32 0, i32 0
%36 = load i64, i64* %35
%37 = load i64, i64* @NLMSG_ERROR
%38 = icmp eq i64 %36, %37
br i1 %38, label %39, label %41
39: ; preds = %33
%40 = 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* %19
br label %250
41: ; preds = %33
%42 = load %struct.nlmsghdr*, %struct.nlmsghdr** %12
%43 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %42, i32 0, i32 0
%44 = load i64, i64* %43
%45 = load i64, i64* @NLMSG_DONE
%46 = icmp eq i64 %44, %45
br i1 %46, label %47, label %48
47: ; preds = %41
store i32 1, i32* %4
store i32 1, i32* %19
br label %250
48: ; preds = %41
%49 = load %struct.nlmsghdr*, %struct.nlmsghdr** %12
%50 = call i64 @NLMSG_DATA(%struct.nlmsghdr* %49)
%51 = inttoptr i64 %50 to %struct.rtcanmsg*
store %struct.rtcanmsg* %51, %struct.rtcanmsg** %10
%52 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%53 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %52, i32 0, i32 0
%54 = load i64, i64* %53
%55 = load i64, i64* @AF_CAN
%56 = icmp ne i64 %54, %55
br i1 %56, label %57, label %64
57: ; preds = %48
%58 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%59 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %58, i32 0, i32 0
%60 = load i64, i64* %59
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i64 %60)
%62 = load i32, i32* @EINVAL
%63 = sub nsw i32 0, %62
store i32 %63, i32* %4
store i32 1, i32* %19
br label %250
64: ; preds = %48
%65 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%66 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %65, i32 0, i32 1
%67 = load i64, i64* %66
%68 = load i64, i64* @CGW_TYPE_CAN_CAN
%69 = icmp ne i64 %67, %68
br i1 %69, label %70, label %77
70: ; preds = %64
%71 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%72 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %71, i32 0, i32 1
%73 = load i64, i64* %72
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i64 %73)
%75 = load i32, i32* @EINVAL
%76 = sub nsw i32 0, %75
store i32 %76, i32* %4
store i32 1, i32* %19
br label %250
77: ; preds = %64
store i32 0, i32* %15
store i32 0, i32* %16
store i32 0, i32* %17
store i32 0, i32* %13
store i32 0, i32* %14
%78 = load i8*, i8** %5
%79 = call i8* @basename(i8* %78)
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %79)
%81 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%82 = bitcast %struct.rtcanmsg* %81 to i8*
%83 = call i32 @NLMSG_ALIGN(i32 24)
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %82, i64 %84
%86 = bitcast i8* %85 to %struct.rtattr*
store %struct.rtattr* %86, %struct.rtattr** %11
%87 = load %struct.nlmsghdr*, %struct.nlmsghdr** %12
%88 = call i32 @NLMSG_PAYLOAD(%struct.nlmsghdr* %87, i32 24)
store i32 %88, i32* %18
br label %89
89: ; preds = %132, %77
%90 = load %struct.rtattr*, %struct.rtattr** %11
%91 = load i32, i32* %18
%92 = call i64 @RTA_OK(%struct.rtattr* %90, i32 %91)
%93 = icmp ne i64 %92, 0
br i1 %93, label %94, label %136
94: ; preds = %89
%95 = load %struct.rtattr*, %struct.rtattr** %11
%96 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %95, i32 0, i32 0
%97 = load i32, i32* %96
switch i32 %97, label %124 [
i32 136, label %98
i32 133, label %98
i32 132, label %98
i32 129, label %98
i32 131, label %98
i32 130, label %98
i32 134, label %98
i32 140, label %98
i32 141, label %98
i32 128, label %99
i32 137, label %104
i32 135, label %109
i32 138, label %114
i32 139, label %119
]
98: ; preds = %94, %94, %94, %94, %94, %94, %94, %94, %94
br label %131
99: ; preds = %94
%100 = load %struct.rtattr*, %struct.rtattr** %11
%101 = call i64 @RTA_DATA(%struct.rtattr* %100)
%102 = inttoptr i64 %101 to i32*
%103 = load i32, i32* %102
store i32 %103, i32* %13
br label %131
104: ; preds = %94
%105 = load %struct.rtattr*, %struct.rtattr** %11
%106 = call i64 @RTA_DATA(%struct.rtattr* %105)
%107 = inttoptr i64 %106 to i32*
%108 = load i32, i32* %107
store i32 %108, i32* %14
br label %131
109: ; preds = %94
%110 = load %struct.rtattr*, %struct.rtattr** %11
%111 = call i64 @RTA_DATA(%struct.rtattr* %110)
%112 = inttoptr i64 %111 to i32*
%113 = load i32, i32* %112
store i32 %113, i32* %15
br label %131
114: ; preds = %94
%115 = load %struct.rtattr*, %struct.rtattr** %11
%116 = call i64 @RTA_DATA(%struct.rtattr* %115)
%117 = inttoptr i64 %116 to i32*
%118 = load i32, i32* %117
store i32 %118, i32* %16
br label %131
119: ; preds = %94
%120 = load %struct.rtattr*, %struct.rtattr** %11
%121 = call i64 @RTA_DATA(%struct.rtattr* %120)
%122 = inttoptr i64 %121 to i32*
%123 = load i32, i32* %122
store i32 %123, i32* %17
br label %131
124: ; preds = %94
%125 = load %struct.rtattr*, %struct.rtattr** %11
%126 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %125, i32 0, i32 0
%127 = load i32, i32* %126
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %127)
%129 = load i32, i32* @EINVAL
%130 = sub nsw i32 0, %129
store i32 %130, i32* %4
store i32 1, i32* %19
br label %250
131: ; preds = %119, %114, %109, %104, %99, %98
br label %132
132: ; preds = %131
%133 = load %struct.rtattr*, %struct.rtattr** %11
%134 = load i32, i32* %18
%135 = call %struct.rtattr* @RTA_NEXT(%struct.rtattr* %133, i32 %134)
store %struct.rtattr* %135, %struct.rtattr** %11
br label %89
136: ; preds = %89
%137 = load i32, i32* %13
%138 = call i8* @if_indextoname(i32 %137, i8* %23)
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %138)
%140 = load i32, i32* %14
%141 = call i8* @if_indextoname(i32 %140, i8* %23)
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %141)
%143 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%144 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %143, i32 0, i32 2
%145 = load i32, i32* %144
%146 = load i32, i32* @CGW_FLAGS_CAN_ECHO
%147 = and i32 %145, %146
%148 = icmp ne i32 %147, 0
br i1 %148, label %149, label %151
149: ; preds = %136
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %151
151: ; preds = %149, %136
%152 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%153 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %152, i32 0, i32 2
%154 = load i32, i32* %153
%155 = load i32, i32* @CGW_FLAGS_CAN_SRC_TSTAMP
%156 = and i32 %154, %155
%157 = icmp ne i32 %156, 0
br i1 %157, label %158, label %160
158: ; preds = %151
%159 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %160
160: ; preds = %158, %151
%161 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%162 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %161, i32 0, i32 2
%163 = load i32, i32* %162
%164 = load i32, i32* @CGW_FLAGS_CAN_IIF_TX_OK
%165 = and i32 %163, %164
%166 = icmp ne i32 %165, 0
br i1 %166, label %167, label %169
167: ; preds = %160
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %169
169: ; preds = %167, %160
%170 = load %struct.rtcanmsg*, %struct.rtcanmsg** %10
%171 = bitcast %struct.rtcanmsg* %170 to i8*
%172 = call i32 @NLMSG_ALIGN(i32 24)
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i8, i8* %171, i64 %173
%175 = bitcast i8* %174 to %struct.rtattr*
store %struct.rtattr* %175, %struct.rtattr** %11
%176 = load %struct.nlmsghdr*, %struct.nlmsghdr** %12
%177 = call i32 @NLMSG_PAYLOAD(%struct.nlmsghdr* %176, i32 24)
store i32 %177, i32* %18
br label %178
178: ; preds = %238, %169
%179 = load %struct.rtattr*, %struct.rtattr** %11
%180 = load i32, i32* %18
%181 = call i64 @RTA_OK(%struct.rtattr* %179, i32 %180)
%182 = icmp ne i64 %181, 0
br i1 %182, label %183, label %242
183: ; preds = %178
%184 = load %struct.rtattr*, %struct.rtattr** %11
%185 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %184, i32 0, i32 0
%186 = load i32, i32* %185
switch i32 %186, label %230 [
i32 136, label %187
i32 133, label %191
i32 132, label %195
i32 129, label %199
i32 131, label %203
i32 130, label %207
i32 134, label %213
i32 140, label %219
i32 141, label %224
i32 128, label %229
i32 137, label %229
i32 135, label %229
i32 138, label %229
i32 139, label %229
]
187: ; preds = %183
%188 = load %struct.rtattr*, %struct.rtattr** %11
%189 = call i64 @RTA_DATA(%struct.rtattr* %188)
%190 = call i32 @printfilter(i64 %189)
br label %237
191: ; preds = %183
%192 = load %struct.rtattr*, %struct.rtattr** %11
%193 = call i64 @RTA_DATA(%struct.rtattr* %192)
%194 = call i32 @printmod(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i64 %193)
br label %237
195: ; preds = %183
%196 = load %struct.rtattr*, %struct.rtattr** %11
%197 = call i64 @RTA_DATA(%struct.rtattr* %196)
%198 = call i32 @printmod(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i64 %197)
br label %237
199: ; preds = %183
%200 = load %struct.rtattr*, %struct.rtattr** %11
%201 = call i64 @RTA_DATA(%struct.rtattr* %200)
%202 = call i32 @printmod(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i64 %201)
br label %237
203: ; preds = %183
%204 = load %struct.rtattr*, %struct.rtattr** %11
%205 = call i64 @RTA_DATA(%struct.rtattr* %204)
%206 = call i32 @printmod(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i64 %205)
br label %237
207: ; preds = %183
%208 = load %struct.rtattr*, %struct.rtattr** %11
%209 = call i64 @RTA_DATA(%struct.rtattr* %208)
%210 = inttoptr i64 %209 to i32*
%211 = load i32, i32* %210
%212 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i32 %211)
br label %237
213: ; preds = %183
%214 = load %struct.rtattr*, %struct.rtattr** %11
%215 = call i64 @RTA_DATA(%struct.rtattr* %214)
%216 = inttoptr i64 %215 to i32*
%217 = load i32, i32* %216
%218 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i32 %217)
br label %237
219: ; preds = %183
%220 = load %struct.rtattr*, %struct.rtattr** %11
%221 = call i64 @RTA_DATA(%struct.rtattr* %220)
%222 = inttoptr i64 %221 to %struct.cgw_csum_xor*
%223 = call i32 @print_cs_xor(%struct.cgw_csum_xor* %222)
br label %237
224: ; preds = %183
%225 = load %struct.rtattr*, %struct.rtattr** %11
%226 = call i64 @RTA_DATA(%struct.rtattr* %225)
%227 = inttoptr i64 %226 to %struct.cgw_csum_crc8*
%228 = call i32 @print_cs_crc8(%struct.cgw_csum_crc8* %227)
br label %237
229: ; preds = %183, %183, %183, %183, %183
br label %237
230: ; preds = %183
%231 = load %struct.rtattr*, %struct.rtattr** %11
%232 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %231, i32 0, i32 0
%233 = load i32, i32* %232
%234 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %233)
%235 = load i32, i32* @EINVAL
%236 = sub nsw i32 0, %235
store i32 %236, i32* %4
store i32 1, i32* %19
br label %250
237: ; preds = %229, %224, %219, %213, %207, %203, %199, %195, %191, %187
br label %238
238: ; preds = %237
%239 = load %struct.rtattr*, %struct.rtattr** %11
%240 = load i32, i32* %18
%241 = call %struct.rtattr* @RTA_NEXT(%struct.rtattr* %239, i32 %240)
store %struct.rtattr* %241, %struct.rtattr** %11
br label %178
242: ; preds = %178
%243 = load i32, i32* %15
%244 = load i32, i32* %16
%245 = load i32, i32* %17
%246 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.16, i64 0, i64 0), i32 %243, i32 %244, i32 %245)
%247 = load %struct.nlmsghdr*, %struct.nlmsghdr** %12
%248 = load i32, i32* %7
%249 = call %struct.nlmsghdr* @NLMSG_NEXT(%struct.nlmsghdr* %247, i32 %248)
store %struct.nlmsghdr* %249, %struct.nlmsghdr** %12
br label %26
250: ; preds = %230, %124, %70, %57, %47, %39, %32
%251 = load i8*, i8** %8
%252 = load i32, i32* %4
ret i32 %252
}

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"
@CGW_FLAGS_CAN_IIF_TX_OK = global i32 0
@.str.9 = [4 x i8] c"-i \00"
@.str.10 = [4 x i8] c"AND\00"
@.str.11 = [3 x i8] c"OR\00"
@.str.12 = [4 x i8] c"XOR\00"
@.str.13 = [4 x i8] c"SET\00"
@.str.14 = [7 x i8] c"-u %X \00"
@.str.15 = [7 x i8] c"-l %d \00"
@.str.16 = [36 x i8] c"# %d handled %d dropped %d deleted\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 %185, label %10
10: ; preds = %3, %180
%11 = phi %struct.nlmsghdr* [ %182, %180 ], [ %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 %185
18: ; preds = %10
%19 = load i64, i64* @NLMSG_DONE
%20 = icmp eq i64 %13, %19
br i1 %20, label %185, 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 %185
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 %185
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 %94, label %52
52: ; preds = %41, %85
%53 = phi i32 [ %90, %85 ], [ 0, %41 ]
%54 = phi i32 [ %89, %85 ], [ 0, %41 ]
%55 = phi i32 [ %88, %85 ], [ 0, %41 ]
%56 = phi i32 [ %87, %85 ], [ 0, %41 ]
%57 = phi i32 [ %86, %85 ], [ 0, %41 ]
%58 = phi %struct.rtattr* [ %91, %85 ], [ %48, %41 ]
%59 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %58, i64 0, i32 0
%60 = load i32, i32* %59
switch i32 %60, label %81 [
i32 136, label %85
i32 133, label %85
i32 132, label %85
i32 129, label %85
i32 131, label %85
i32 130, label %85
i32 134, label %85
i32 140, label %85
i32 141, label %85
i32 128, label %61
i32 137, label %65
i32 135, label %69
i32 138, label %73
i32 139, label %77
]
61: ; preds = %52
%62 = call i64 @RTA_DATA(%struct.rtattr* %58)
%63 = inttoptr i64 %62 to i32*
%64 = load i32, i32* %63
br label %85
65: ; preds = %52
%66 = call i64 @RTA_DATA(%struct.rtattr* %58)
%67 = inttoptr i64 %66 to i32*
%68 = load i32, i32* %67
br label %85
69: ; preds = %52
%70 = call i64 @RTA_DATA(%struct.rtattr* %58)
%71 = inttoptr i64 %70 to i32*
%72 = load i32, i32* %71
br label %85
73: ; preds = %52
%74 = call i64 @RTA_DATA(%struct.rtattr* %58)
%75 = inttoptr i64 %74 to i32*
%76 = load i32, i32* %75
br label %85
77: ; preds = %52
%78 = call i64 @RTA_DATA(%struct.rtattr* %58)
%79 = inttoptr i64 %78 to i32*
%80 = load i32, i32* %79
br label %85
81: ; preds = %52
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %60)
%83 = load i32, i32* @EINVAL
%84 = sub nsw i32 0, %83
br label %185
85: ; preds = %61, %65, %69, %73, %77, %52, %52, %52, %52, %52, %52, %52, %52, %52
%86 = phi i32 [ %57, %77 ], [ %57, %73 ], [ %57, %69 ], [ %57, %65 ], [ %64, %61 ], [ %57, %52 ], [ %57, %52 ], [ %57, %52 ], [ %57, %52 ], [ %57, %52 ], [ %57, %52 ], [ %57, %52 ], [ %57, %52 ], [ %57, %52 ]
%87 = phi i32 [ %56, %77 ], [ %56, %73 ], [ %56, %69 ], [ %68, %65 ], [ %56, %61 ], [ %56, %52 ], [ %56, %52 ], [ %56, %52 ], [ %56, %52 ], [ %56, %52 ], [ %56, %52 ], [ %56, %52 ], [ %56, %52 ], [ %56, %52 ]
%88 = phi i32 [ %55, %77 ], [ %55, %73 ], [ %72, %69 ], [ %55, %65 ], [ %55, %61 ], [ %55, %52 ], [ %55, %52 ], [ %55, %52 ], [ %55, %52 ], [ %55, %52 ], [ %55, %52 ], [ %55, %52 ], [ %55, %52 ], [ %55, %52 ]
%89 = phi i32 [ %54, %77 ], [ %76, %73 ], [ %54, %69 ], [ %54, %65 ], [ %54, %61 ], [ %54, %52 ], [ %54, %52 ], [ %54, %52 ], [ %54, %52 ], [ %54, %52 ], [ %54, %52 ], [ %54, %52 ], [ %54, %52 ], [ %54, %52 ]
%90 = phi i32 [ %80, %77 ], [ %53, %73 ], [ %53, %69 ], [ %53, %65 ], [ %53, %61 ], [ %53, %52 ], [ %53, %52 ], [ %53, %52 ], [ %53, %52 ], [ %53, %52 ], [ %53, %52 ], [ %53, %52 ], [ %53, %52 ], [ %53, %52 ]
%91 = call %struct.rtattr* @RTA_NEXT(%struct.rtattr* %58, i32 %49)
%92 = call i64 @RTA_OK(%struct.rtattr* %91, i32 %49)
%93 = icmp eq i64 %92, 0
br i1 %93, label %94, label %52
94: ; preds = %85, %41
%95 = phi i32 [ 0, %41 ], [ %86, %85 ]
%96 = phi i32 [ 0, %41 ], [ %87, %85 ]
%97 = phi i32 [ 0, %41 ], [ %88, %85 ]
%98 = phi i32 [ 0, %41 ], [ %89, %85 ]
%99 = phi i32 [ 0, %41 ], [ %90, %85 ]
%100 = call i8* @if_indextoname(i32 %95, i8* %6)
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %100)
%102 = call i8* @if_indextoname(i32 %96, i8* %6)
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %102)
%104 = getelementptr inbounds %struct.rtcanmsg, %struct.rtcanmsg* %23, i64 0, i32 2
%105 = load i32, i32* %104
%106 = load i32, i32* @CGW_FLAGS_CAN_ECHO
%107 = and i32 %106, %105
%108 = icmp eq i32 %107, 0
br i1 %108, label %112, label %109
109: ; preds = %94
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%111 = load i32, i32* %104
br label %112
112: ; preds = %109, %94
%113 = phi i32 [ %111, %109 ], [ %105, %94 ]
%114 = load i32, i32* @CGW_FLAGS_CAN_SRC_TSTAMP
%115 = and i32 %114, %113
%116 = icmp eq i32 %115, 0
br i1 %116, label %120, label %117
117: ; preds = %112
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%119 = load i32, i32* %104
br label %120
120: ; preds = %117, %112
%121 = phi i32 [ %119, %117 ], [ %113, %112 ]
%122 = load i32, i32* @CGW_FLAGS_CAN_IIF_TX_OK
%123 = and i32 %122, %121
%124 = icmp eq i32 %123, 0
br i1 %124, label %127, label %125
125: ; preds = %120
%126 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %127
127: ; preds = %125, %120
%128 = call i32 @NLMSG_ALIGN(i32 24)
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds i8, i8* %44, i64 %129
%131 = bitcast i8* %130 to %struct.rtattr*
%132 = call i32 @NLMSG_PAYLOAD(%struct.nlmsghdr* %11, i32 24)
%133 = call i64 @RTA_OK(%struct.rtattr* %131, i32 %132)
%134 = icmp eq i64 %133, 0
br i1 %134, label %180, label %135
135: ; preds = %127, %176
%136 = phi %struct.rtattr* [ %177, %176 ], [ %131, %127 ]
%137 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %136, i64 0, i32 0
%138 = load i32, i32* %137
switch i32 %138, label %172 [
i32 136, label %139
i32 133, label %142
i32 132, label %145
i32 129, label %148
i32 131, label %151
i32 130, label %154
i32 134, label %159
i32 140, label %164
i32 141, label %168
i32 128, label %176
i32 137, label %176
i32 135, label %176
i32 138, label %176
i32 139, label %176
]
139: ; preds = %135
%140 = call i64 @RTA_DATA(%struct.rtattr* %136)
%141 = call i32 @printfilter(i64 %140)
br label %176
142: ; preds = %135
%143 = call i64 @RTA_DATA(%struct.rtattr* %136)
%144 = call i32 @printmod(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i64 %143)
br label %176
145: ; preds = %135
%146 = call i64 @RTA_DATA(%struct.rtattr* %136)
%147 = call i32 @printmod(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i64 %146)
br label %176
148: ; preds = %135
%149 = call i64 @RTA_DATA(%struct.rtattr* %136)
%150 = call i32 @printmod(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i64 %149)
br label %176
151: ; preds = %135
%152 = call i64 @RTA_DATA(%struct.rtattr* %136)
%153 = call i32 @printmod(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i64 %152)
br label %176
154: ; preds = %135
%155 = call i64 @RTA_DATA(%struct.rtattr* %136)
%156 = inttoptr i64 %155 to i32*
%157 = load i32, i32* %156
%158 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i32 %157)
br label %176
159: ; preds = %135
%160 = call i64 @RTA_DATA(%struct.rtattr* %136)
%161 = inttoptr i64 %160 to i32*
%162 = load i32, i32* %161
%163 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i32 %162)
br label %176
164: ; preds = %135
%165 = call i64 @RTA_DATA(%struct.rtattr* %136)
%166 = inttoptr i64 %165 to %struct.cgw_csum_xor*
%167 = call i32 @print_cs_xor(%struct.cgw_csum_xor* %166)
br label %176
168: ; preds = %135
%169 = call i64 @RTA_DATA(%struct.rtattr* %136)
%170 = inttoptr i64 %169 to %struct.cgw_csum_crc8*
%171 = call i32 @print_cs_crc8(%struct.cgw_csum_crc8* %170)
br label %176
172: ; preds = %135
%173 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %138)
%174 = load i32, i32* @EINVAL
%175 = sub nsw i32 0, %174
br label %185
176: ; preds = %139, %142, %145, %148, %151, %154, %159, %164, %168, %135, %135, %135, %135, %135
%177 = call %struct.rtattr* @RTA_NEXT(%struct.rtattr* %136, i32 %132)
%178 = call i64 @RTA_OK(%struct.rtattr* %177, i32 %132)
%179 = icmp eq i64 %178, 0
br i1 %179, label %180, label %135
180: ; preds = %176, %127
%181 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.16, i64 0, i64 0), i32 %97, i32 %98, i32 %99)
%182 = call %struct.nlmsghdr* @NLMSG_NEXT(%struct.nlmsghdr* %11, i32 %2)
%183 = call i32 @NLMSG_OK(%struct.nlmsghdr* %182, i32 %2)
%184 = icmp eq i32 %183, 0
br i1 %184, label %185, label %10
185: ; preds = %180, %18, %3, %172, %81, %37, %28, %16
%186 = phi i32 [ 1, %16 ], [ %31, %28 ], [ %40, %37 ], [ %84, %81 ], [ %175, %172 ], [ 0, %3 ], [ 0, %180 ], [ 1, %18 ]
ret i32 %186
}