#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 rtnl_link_stats {
  int dummy;
};
struct rtnl_link_ifmap {
  int dummy;
};
struct rtattr {
  int rta_len;
  int rta_type;
};

/* Variables and functions */
#define AF_INET 144
#define IFLA_ADDRESS 143
#define IFLA_BROADCAST 142
#define IFLA_COST 141
#define IFLA_IFNAME 140
#define IFLA_LINK 139
#define IFLA_MAP 138
#define IFLA_MASTER 137
#define IFLA_MTU 136
#define IFLA_PRIORITY 135
#define IFLA_PROTINFO 134
#define IFLA_QDISC 133
#define IFLA_STATS 132
#define IFLA_TXQLEN 131
#define IFLA_UNSPEC 130
#define IFLA_WEIGHT 129
#define IFLA_WIRELESS 128
scalar_t__ RTA_DATA(struct rtattr *);
struct rtattr *RTA_NEXT(struct rtattr *, int);
scalar_t__ RTA_OK(struct rtattr *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void netlink_dump_rta(struct rtattr *rta, int length, int family) {
  struct rtnl_link_stats *stats;
  struct rtnl_link_ifmap *map;
  unsigned char *addr;
  while (RTA_OK(rta, length)) {
    fprintf(stderr, ", %u %u:", rta->rta_len, rta->rta_type);
    switch (rta->rta_type) {
    case IFLA_UNSPEC:
      fprintf(stderr, "IFLA_UNSPEC");
      break;
    case IFLA_ADDRESS:
      fprintf(stderr, "IFLA_ADDRESS ");
      addr = (unsigned char *)RTA_DATA(rta);
      switch (family) {
      case AF_INET:
        fprintf(stderr, "%u.%u.%u.%u", addr[0], addr[1], addr[2], addr[3]);
        break;
      default:
        fprintf(stderr, "%02X:%02X:%02X:%02X:%02X:%02X", addr[0], addr[1],
                addr[2], addr[3], addr[4], addr[5]);
        break;
      }
      break;
    case IFLA_BROADCAST:
      fprintf(stderr, "IFLA_BROADCAST ");
      addr = (unsigned char *)RTA_DATA(rta);
      switch (family) {
      case AF_INET:
        fprintf(stderr, "%u.%u.%u.%u", addr[0], addr[1], addr[2], addr[3]);
        break;
      default:
        fprintf(stderr, "%02X:%02X:%02X:%02X:%02X:%02X", addr[0], addr[1],
                addr[2], addr[3], addr[4], addr[5]);
        break;
      }
      break;
    case IFLA_IFNAME:
      fprintf(stderr, "IFLA_IFNAME: %s", (char *)RTA_DATA(rta));
      break;
    case IFLA_MTU:
      fprintf(stderr, "IFLA_MTU: %u", (unsigned int)RTA_DATA(rta));
      break;
    case IFLA_LINK:
      fprintf(stderr, "IFLA_LINK: %d", (int)RTA_DATA(rta));
      break;
    case IFLA_QDISC:
      fprintf(stderr, "IFLA_QDISC: %s", (char *)RTA_DATA(rta));
      break;
    case IFLA_STATS:
      fprintf(stderr, "IFLA_STATS");
      stats = (struct rtnl_link_stats *)RTA_DATA(rta);
      break;
    case IFLA_COST:
      fprintf(stderr, "IFLA_COST");
      break;
    case IFLA_PRIORITY:
      fprintf(stderr, "IFLA_PRIORITY");
      break;
    case IFLA_MASTER:
      fprintf(stderr, "IFLA_MASTER: %u", (unsigned int)RTA_DATA(rta));
      break;
    case IFLA_WIRELESS:
      fprintf(stderr, "IFLA_WIRELESS");
      break;
    case IFLA_PROTINFO:
      fprintf(stderr, "IFLA_PROTINFO");
      break;
    case IFLA_TXQLEN:
      fprintf(stderr, "IFLA_TXQLEN: %u", (unsigned int)RTA_DATA(rta));
      break;
    case IFLA_MAP:
      map = (struct rtnl_link_ifmap *)RTA_DATA(rta);
      fprintf(stderr, "IFLA_MAP");
      break;
    case IFLA_WEIGHT:
      fprintf(stderr, "IFLA_WEIGHT: %u", (unsigned int)RTA_DATA(rta));
      break;
    default:
      fprintf(stderr, "unhandled rta type");
      break;
    }
    rta = RTA_NEXT(rta, length);
  }
}


x86 assembly (clang, -O0):
<netlink_dump_rta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <RTA_OK@plt>
cmp    $0x0,%rax
je     1590 <netlink_dump_rta+0x450>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    0x4(%rax),%ecx
lea    0xebf(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0xf,%eax
ja     1564 <netlink_dump_rta+0x424>
mov    -0x30(%rbp),%rax
lea    0xe54(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
lea    0xe84(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2e08(%rip),%rax
mov    (%rax),%edi
lea    0xe74(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <RTA_DATA@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x90,%eax
jne    1245 <netlink_dump_rta+0x105>
jmp    1208 <netlink_dump_rta+0xc8>
mov    0x2dd1(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
movzbl (%rax),%edx
mov    -0x28(%rbp),%rax
movzbl 0x1(%rax),%ecx
mov    -0x28(%rbp),%rax
movzbl 0x2(%rax),%r8d
mov    -0x28(%rbp),%rax
movzbl 0x3(%rax),%r9d
lea    0xe2a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1296 <netlink_dump_rta+0x156>
mov    0x2d94(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
movzbl (%rax),%edx
mov    -0x28(%rbp),%rax
movzbl 0x1(%rax),%ecx
mov    -0x28(%rbp),%rax
movzbl 0x2(%rax),%r8d
mov    -0x28(%rbp),%rax
movzbl 0x3(%rax),%r9d
mov    -0x28(%rbp),%rax
movzbl 0x4(%rax),%r10d
mov    -0x28(%rbp),%rax
movzbl 0x5(%rax),%eax
lea    0xde8(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2d3e(%rip),%rax
mov    (%rax),%edi
lea    0xde2(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <RTA_DATA@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x90,%eax
jne    130f <netlink_dump_rta+0x1cf>
jmp    12d2 <netlink_dump_rta+0x192>
mov    0x2d07(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
movzbl (%rax),%edx
mov    -0x28(%rbp),%rax
movzbl 0x1(%rax),%ecx
mov    -0x28(%rbp),%rax
movzbl 0x2(%rax),%r8d
mov    -0x28(%rbp),%rax
movzbl 0x3(%rax),%r9d
lea    0xd60(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1360 <netlink_dump_rta+0x220>
mov    0x2cca(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
movzbl (%rax),%edx
mov    -0x28(%rbp),%rax
movzbl 0x1(%rax),%ecx
mov    -0x28(%rbp),%rax
movzbl 0x2(%rax),%r8d
mov    -0x28(%rbp),%rax
movzbl 0x3(%rax),%r9d
mov    -0x28(%rbp),%rax
movzbl 0x4(%rax),%r10d
mov    -0x28(%rbp),%rax
movzbl 0x5(%rax),%eax
lea    0xd1e(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2c74(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <RTA_DATA@plt>
mov    -0x34(%rbp),%edi
mov    %rax,%rdx
lea    0xd16(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2c46(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <RTA_DATA@plt>
mov    -0x38(%rbp),%edi
mov    %eax,%edx
lea    0xcf9(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2c19(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <RTA_DATA@plt>
mov    -0x3c(%rbp),%edi
mov    %eax,%edx
lea    0xcd9(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2bec(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <RTA_DATA@plt>
mov    -0x40(%rbp),%edi
mov    %rax,%rdx
lea    0xcb9(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2bbe(%rip),%rax
mov    (%rax),%edi
lea    0xcac(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <RTA_DATA@plt>
mov    %rax,-0x18(%rbp)
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2b95(%rip),%rax
mov    (%rax),%edi
lea    0xc8e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2b79(%rip),%rax
mov    (%rax),%edi
lea    0xc7c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2b5d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <RTA_DATA@plt>
mov    -0x44(%rbp),%edi
mov    %eax,%edx
lea    0xc5d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2b30(%rip),%rax
mov    (%rax),%edi
lea    0xc51(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2b14(%rip),%rax
mov    (%rax),%edi
lea    0xc43(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2af8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <RTA_DATA@plt>
mov    -0x48(%rbp),%edi
mov    %eax,%edx
lea    0xc24(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    -0x8(%rbp),%rdi
call   1060 <RTA_DATA@plt>
mov    %rax,-0x20(%rbp)
mov    0x2abe(%rip),%rax
mov    (%rax),%edi
lea    0xc0b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2aa2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <RTA_DATA@plt>
mov    -0x4c(%rbp),%edi
mov    %eax,%edx
lea    0xbe7(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    157b <netlink_dump_rta+0x43b>
mov    0x2a75(%rip),%rax
mov    (%rax),%edi
lea    0xbdb(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <RTA_NEXT@plt>
mov    %rax,-0x8(%rbp)
jmp    1152 <netlink_dump_rta+0x12>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netlink_dump_rta>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,0x4(%rsp)
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <RTA_OK@plt>
test   %rax,%rax
je     13b1 <netlink_dump_rta+0x271>
mov    0x2e77(%rip),%r13
lea    0xed0(%rip),%r15
lea    0xe89(%rip),%r14
jmp    11b7 <netlink_dump_rta+0x77>
mov    0x0(%r13),%edi
lea    0xfcb(%rip),%rsi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <RTA_NEXT@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <RTA_OK@plt>
test   %rax,%rax
je     13b1 <netlink_dump_rta+0x271>
mov    0x0(%r13),%edi
mov    (%rbx),%edx
mov    0x4(%rbx),%ecx
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x4(%rbx),%eax
add    $0xffffff80,%eax
cmp    $0xf,%eax
ja     1179 <netlink_dump_rta+0x39>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
mov    0x0(%r13),%edi
lea    0xf21(%rip),%rsi
jmp    1190 <netlink_dump_rta+0x50>
mov    0x0(%r13),%r12d
mov    %rbx,%rdi
call   1060 <RTA_DATA@plt>
mov    %r12d,%edi
lea    0xf3e(%rip),%rsi
jmp    12f0 <netlink_dump_rta+0x1b0>
mov    0x0(%r13),%edi
lea    0xe38(%rip),%rsi
jmp    1190 <netlink_dump_rta+0x50>
mov    0x0(%r13),%r12d
mov    %rbx,%rdi
call   1060 <RTA_DATA@plt>
mov    %r12d,%edi
lea    0xefa(%rip),%rsi
jmp    12f0 <netlink_dump_rta+0x1b0>
mov    0x0(%r13),%edi
lea    0xe9b(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1060 <RTA_DATA@plt>
jmp    1197 <netlink_dump_rta+0x57>
mov    0x0(%r13),%r12d
mov    %rbx,%rdi
call   1060 <RTA_DATA@plt>
mov    %r12d,%edi
lea    0xe62(%rip),%rsi
jmp    1314 <netlink_dump_rta+0x1d4>
mov    0x0(%r13),%edi
lea    0xea2(%rip),%rsi
jmp    1190 <netlink_dump_rta+0x50>
mov    0x0(%r13),%edi
lea    0xe66(%rip),%rsi
jmp    1190 <netlink_dump_rta+0x50>
mov    0x0(%r13),%r12d
mov    %rbx,%rdi
call   1060 <RTA_DATA@plt>
mov    %r12d,%edi
lea    0xe0c(%rip),%rsi
jmp    12f0 <netlink_dump_rta+0x1b0>
mov    0x0(%r13),%r12d
mov    %rbx,%rdi
call   1060 <RTA_DATA@plt>
mov    %r12d,%edi
lea    0xe41(%rip),%rsi
jmp    12f0 <netlink_dump_rta+0x1b0>
mov    %rbx,%rdi
call   1060 <RTA_DATA@plt>
mov    0x0(%r13),%edi
lea    0xe68(%rip),%rsi
jmp    1190 <netlink_dump_rta+0x50>
mov    0x0(%r13),%r12d
mov    %rbx,%rdi
call   1060 <RTA_DATA@plt>
mov    %r12d,%edi
lea    0xdd1(%rip),%rsi
nopl   0x0(%rax)
mov    %eax,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1197 <netlink_dump_rta+0x57>
mov    0x0(%r13),%r12d
mov    %rbx,%rdi
call   1060 <RTA_DATA@plt>
mov    %r12d,%edi
lea    0xd89(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1197 <netlink_dump_rta+0x57>
mov    0x0(%r13),%edi
lea    0xdb4(%rip),%rsi
jmp    1190 <netlink_dump_rta+0x50>
mov    0x0(%r13),%edi
lea    0xd4f(%rip),%rsi
jmp    134b <netlink_dump_rta+0x20b>
mov    0x0(%r13),%edi
lea    0xd0a(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1060 <RTA_DATA@plt>
mov    0x0(%r13),%edi
movzbl (%rax),%edx
movzbl 0x1(%rax),%ecx
movzbl 0x2(%rax),%r8d
movzbl 0x3(%rax),%r9d
cmpl   $0x90,0x4(%rsp)
jne    138c <netlink_dump_rta+0x24c>
lea    0xce3(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1197 <netlink_dump_rta+0x57>
movzbl 0x4(%rax),%r10d
movzbl 0x5(%rax),%r11d
lea    0xcd2(%rip),%rsi
xor    %eax,%eax
push   %r11
push   %r10
call   1050 <fprintf@plt>
add    $0x10,%rsp
jmp    1197 <netlink_dump_rta+0x57>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.rtattr = type { i32, i32 }
%struct.rtnl_link_stats = type { i32 }
%struct.rtnl_link_ifmap = type { i32 }
@stderr = global i32 0
@.str = [9 x i8] c", %u %u:\00"
@.str.1 = [12 x i8] c"IFLA_UNSPEC\00"
@.str.2 = [14 x i8] c"IFLA_ADDRESS \00"
@.str.3 = [12 x i8] c"%u.%u.%u.%u\00"
@.str.4 = [30 x i8] c"%02X:%02X:%02X:%02X:%02X:%02X\00"
@.str.5 = [16 x i8] c"IFLA_BROADCAST \00"
@.str.6 = [16 x i8] c"IFLA_IFNAME: %s\00"
@.str.7 = [13 x i8] c"IFLA_MTU: %u\00"
@.str.8 = [14 x i8] c"IFLA_LINK: %d\00"
@.str.9 = [15 x i8] c"IFLA_QDISC: %s\00"
@.str.10 = [11 x i8] c"IFLA_STATS\00"
@.str.11 = [10 x i8] c"IFLA_COST\00"
@.str.12 = [14 x i8] c"IFLA_PRIORITY\00"
@.str.13 = [16 x i8] c"IFLA_MASTER: %u\00"
@.str.14 = [14 x i8] c"IFLA_WIRELESS\00"
@.str.15 = [14 x i8] c"IFLA_PROTINFO\00"
@.str.16 = [16 x i8] c"IFLA_TXQLEN: %u\00"
@.str.17 = [9 x i8] c"IFLA_MAP\00"
@.str.18 = [16 x i8] c"IFLA_WEIGHT: %u\00"
@.str.19 = [19 x i8] c"unhandled rta type\00"
define void @netlink_dump_rta(%struct.rtattr* %0, i32 %1, i32 %2) {
%4 = alloca %struct.rtattr*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.rtnl_link_stats*
%8 = alloca %struct.rtnl_link_ifmap*
%9 = alloca i8*
store %struct.rtattr* %0, %struct.rtattr** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %10
10: ; preds = %207, %3
%11 = load %struct.rtattr*, %struct.rtattr** %4
%12 = load i32, i32* %5
%13 = call i64 @RTA_OK(%struct.rtattr* %11, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %211
15: ; preds = %10
%16 = load i32, i32* @stderr
%17 = load %struct.rtattr*, %struct.rtattr** %4
%18 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %17, i32 0, i32 0
%19 = load i32, i32* %18
%20 = load %struct.rtattr*, %struct.rtattr** %4
%21 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %20, i32 0, i32 1
%22 = load i32, i32* %21
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %22)
%24 = load %struct.rtattr*, %struct.rtattr** %4
%25 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %24, i32 0, i32 1
%26 = load i32, i32* %25
switch i32 %26, label %204 [
i32 130, label %27
i32 143, label %30
i32 142, label %84
i32 140, label %138
i32 136, label %144
i32 139, label %150
i32 133, label %156
i32 132, label %162
i32 141, label %168
i32 135, label %171
i32 137, label %174
i32 128, label %180
i32 134, label %183
i32 131, label %186
i32 138, label %192
i32 129, label %198
]
27: ; preds = %15
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %207
30: ; preds = %15
%31 = load i32, i32* @stderr
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%33 = load %struct.rtattr*, %struct.rtattr** %4
%34 = call i64 @RTA_DATA(%struct.rtattr* %33)
%35 = inttoptr i64 %34 to i8*
store i8* %35, i8** %9
%36 = load i32, i32* %6
switch i32 %36, label %56 [
i32 144, label %37
]
37: ; preds = %30
%38 = load i32, i32* @stderr
%39 = load i8*, i8** %9
%40 = getelementptr inbounds i8, i8* %39, i64 0
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = load i8*, i8** %9
%44 = getelementptr inbounds i8, i8* %43, i64 1
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = load i8*, i8** %9
%48 = getelementptr inbounds i8, i8* %47, i64 2
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = load i8*, i8** %9
%52 = getelementptr inbounds i8, i8* %51, i64 3
%53 = load i8, i8* %52
%54 = zext i8 %53 to i32
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %42, i32 %46, i32 %50, i32 %54)
br label %83
56: ; preds = %30
%57 = load i32, i32* @stderr
%58 = load i8*, i8** %9
%59 = getelementptr inbounds i8, i8* %58, i64 0
%60 = load i8, i8* %59
%61 = zext i8 %60 to i32
%62 = load i8*, i8** %9
%63 = getelementptr inbounds i8, i8* %62, i64 1
%64 = load i8, i8* %63
%65 = zext i8 %64 to i32
%66 = load i8*, i8** %9
%67 = getelementptr inbounds i8, i8* %66, i64 2
%68 = load i8, i8* %67
%69 = zext i8 %68 to i32
%70 = load i8*, i8** %9
%71 = getelementptr inbounds i8, i8* %70, i64 3
%72 = load i8, i8* %71
%73 = zext i8 %72 to i32
%74 = load i8*, i8** %9
%75 = getelementptr inbounds i8, i8* %74, i64 4
%76 = load i8, i8* %75
%77 = zext i8 %76 to i32
%78 = load i8*, i8** %9
%79 = getelementptr inbounds i8, i8* %78, i64 5
%80 = load i8, i8* %79
%81 = zext i8 %80 to i32
%82 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %61, i32 %65, i32 %69, i32 %73, i32 %77, i32 %81)
br label %83
83: ; preds = %56, %37
br label %207
84: ; preds = %15
%85 = load i32, i32* @stderr
%86 = call i32 (i32, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%87 = load %struct.rtattr*, %struct.rtattr** %4
%88 = call i64 @RTA_DATA(%struct.rtattr* %87)
%89 = inttoptr i64 %88 to i8*
store i8* %89, i8** %9
%90 = load i32, i32* %6
switch i32 %90, label %110 [
i32 144, label %91
]
91: ; preds = %84
%92 = load i32, i32* @stderr
%93 = load i8*, i8** %9
%94 = getelementptr inbounds i8, i8* %93, i64 0
%95 = load i8, i8* %94
%96 = zext i8 %95 to i32
%97 = load i8*, i8** %9
%98 = getelementptr inbounds i8, i8* %97, i64 1
%99 = load i8, i8* %98
%100 = zext i8 %99 to i32
%101 = load i8*, i8** %9
%102 = getelementptr inbounds i8, i8* %101, i64 2
%103 = load i8, i8* %102
%104 = zext i8 %103 to i32
%105 = load i8*, i8** %9
%106 = getelementptr inbounds i8, i8* %105, i64 3
%107 = load i8, i8* %106
%108 = zext i8 %107 to i32
%109 = call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %96, i32 %100, i32 %104, i32 %108)
br label %137
110: ; preds = %84
%111 = load i32, i32* @stderr
%112 = load i8*, i8** %9
%113 = getelementptr inbounds i8, i8* %112, i64 0
%114 = load i8, i8* %113
%115 = zext i8 %114 to i32
%116 = load i8*, i8** %9
%117 = getelementptr inbounds i8, i8* %116, i64 1
%118 = load i8, i8* %117
%119 = zext i8 %118 to i32
%120 = load i8*, i8** %9
%121 = getelementptr inbounds i8, i8* %120, i64 2
%122 = load i8, i8* %121
%123 = zext i8 %122 to i32
%124 = load i8*, i8** %9
%125 = getelementptr inbounds i8, i8* %124, i64 3
%126 = load i8, i8* %125
%127 = zext i8 %126 to i32
%128 = load i8*, i8** %9
%129 = getelementptr inbounds i8, i8* %128, i64 4
%130 = load i8, i8* %129
%131 = zext i8 %130 to i32
%132 = load i8*, i8** %9
%133 = getelementptr inbounds i8, i8* %132, i64 5
%134 = load i8, i8* %133
%135 = zext i8 %134 to i32
%136 = call i32 (i32, i8*, ...) @fprintf(i32 %111, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %115, i32 %119, i32 %123, i32 %127, i32 %131, i32 %135)
br label %137
137: ; preds = %110, %91
br label %207
138: ; preds = %15
%139 = load i32, i32* @stderr
%140 = load %struct.rtattr*, %struct.rtattr** %4
%141 = call i64 @RTA_DATA(%struct.rtattr* %140)
%142 = inttoptr i64 %141 to i8*
%143 = call i32 (i32, i8*, ...) @fprintf(i32 %139, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %142)
br label %207
144: ; preds = %15
%145 = load i32, i32* @stderr
%146 = load %struct.rtattr*, %struct.rtattr** %4
%147 = call i64 @RTA_DATA(%struct.rtattr* %146)
%148 = trunc i64 %147 to i32
%149 = call i32 (i32, i8*, ...) @fprintf(i32 %145, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %148)
br label %207
150: ; preds = %15
%151 = load i32, i32* @stderr
%152 = load %struct.rtattr*, %struct.rtattr** %4
%153 = call i64 @RTA_DATA(%struct.rtattr* %152)
%154 = trunc i64 %153 to i32
%155 = call i32 (i32, i8*, ...) @fprintf(i32 %151, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i32 %154)
br label %207
156: ; preds = %15
%157 = load i32, i32* @stderr
%158 = load %struct.rtattr*, %struct.rtattr** %4
%159 = call i64 @RTA_DATA(%struct.rtattr* %158)
%160 = inttoptr i64 %159 to i8*
%161 = call i32 (i32, i8*, ...) @fprintf(i32 %157, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i8* %160)
br label %207
162: ; preds = %15
%163 = load i32, i32* @stderr
%164 = call i32 (i32, i8*, ...) @fprintf(i32 %163, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%165 = load %struct.rtattr*, %struct.rtattr** %4
%166 = call i64 @RTA_DATA(%struct.rtattr* %165)
%167 = inttoptr i64 %166 to %struct.rtnl_link_stats*
store %struct.rtnl_link_stats* %167, %struct.rtnl_link_stats** %7
br label %207
168: ; preds = %15
%169 = load i32, i32* @stderr
%170 = call i32 (i32, i8*, ...) @fprintf(i32 %169, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
br label %207
171: ; preds = %15
%172 = load i32, i32* @stderr
%173 = call i32 (i32, i8*, ...) @fprintf(i32 %172, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0))
br label %207
174: ; preds = %15
%175 = load i32, i32* @stderr
%176 = load %struct.rtattr*, %struct.rtattr** %4
%177 = call i64 @RTA_DATA(%struct.rtattr* %176)
%178 = trunc i64 %177 to i32
%179 = call i32 (i32, i8*, ...) @fprintf(i32 %175, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i32 %178)
br label %207
180: ; preds = %15
%181 = load i32, i32* @stderr
%182 = call i32 (i32, i8*, ...) @fprintf(i32 %181, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0))
br label %207
183: ; preds = %15
%184 = load i32, i32* @stderr
%185 = call i32 (i32, i8*, ...) @fprintf(i32 %184, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0))
br label %207
186: ; preds = %15
%187 = load i32, i32* @stderr
%188 = load %struct.rtattr*, %struct.rtattr** %4
%189 = call i64 @RTA_DATA(%struct.rtattr* %188)
%190 = trunc i64 %189 to i32
%191 = call i32 (i32, i8*, ...) @fprintf(i32 %187, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i32 %190)
br label %207
192: ; preds = %15
%193 = load %struct.rtattr*, %struct.rtattr** %4
%194 = call i64 @RTA_DATA(%struct.rtattr* %193)
%195 = inttoptr i64 %194 to %struct.rtnl_link_ifmap*
store %struct.rtnl_link_ifmap* %195, %struct.rtnl_link_ifmap** %8
%196 = load i32, i32* @stderr
%197 = call i32 (i32, i8*, ...) @fprintf(i32 %196, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
br label %207
198: ; preds = %15
%199 = load i32, i32* @stderr
%200 = load %struct.rtattr*, %struct.rtattr** %4
%201 = call i64 @RTA_DATA(%struct.rtattr* %200)
%202 = trunc i64 %201 to i32
%203 = call i32 (i32, i8*, ...) @fprintf(i32 %199, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.18, i64 0, i64 0), i32 %202)
br label %207
204: ; preds = %15
%205 = load i32, i32* @stderr
%206 = call i32 (i32, i8*, ...) @fprintf(i32 %205, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.19, i64 0, i64 0))
br label %207
207: ; preds = %204, %198, %192, %186, %183, %180, %174, %171, %168, %162, %156, %150, %144, %138, %137, %83, %27
%208 = load %struct.rtattr*, %struct.rtattr** %4
%209 = load i32, i32* %5
%210 = call %struct.rtattr* @RTA_NEXT(%struct.rtattr* %208, i32 %209)
store %struct.rtattr* %210, %struct.rtattr** %4
br label %10
211: ; preds = %10
ret void
}

LLVM IR (-O2):
%struct.rtattr = type { i32, i32 }
@stderr = global i32 0
@.str = [9 x i8] c", %u %u:\00"
@.str.1 = [12 x i8] c"IFLA_UNSPEC\00"
@.str.2 = [14 x i8] c"IFLA_ADDRESS \00"
@.str.3 = [12 x i8] c"%u.%u.%u.%u\00"
@.str.4 = [30 x i8] c"%02X:%02X:%02X:%02X:%02X:%02X\00"
@.str.5 = [16 x i8] c"IFLA_BROADCAST \00"
@.str.6 = [16 x i8] c"IFLA_IFNAME: %s\00"
@.str.7 = [13 x i8] c"IFLA_MTU: %u\00"
@.str.8 = [14 x i8] c"IFLA_LINK: %d\00"
@.str.9 = [15 x i8] c"IFLA_QDISC: %s\00"
@.str.10 = [11 x i8] c"IFLA_STATS\00"
@.str.11 = [10 x i8] c"IFLA_COST\00"
@.str.12 = [14 x i8] c"IFLA_PRIORITY\00"
@.str.13 = [16 x i8] c"IFLA_MASTER: %u\00"
@.str.14 = [14 x i8] c"IFLA_WIRELESS\00"
@.str.15 = [14 x i8] c"IFLA_PROTINFO\00"
@.str.16 = [16 x i8] c"IFLA_TXQLEN: %u\00"
@.str.17 = [9 x i8] c"IFLA_MAP\00"
@.str.18 = [16 x i8] c"IFLA_WEIGHT: %u\00"
@.str.19 = [19 x i8] c"unhandled rta type\00"
define void @netlink_dump_rta(%struct.rtattr* %0, i32 %1, i32 %2) {
%4 = tail call i64 @RTA_OK(%struct.rtattr* %0, i32 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %136, label %6
6: ; preds = %3
%7 = icmp eq i32 %2, 144
br label %8
8: ; preds = %6, %132
%9 = phi %struct.rtattr* [ %0, %6 ], [ %133, %132 ]
%10 = load i32, i32* @stderr
%11 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %9, i64 0, i32 0
%12 = load i32, i32* %11
%13 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %9, i64 0, i32 1
%14 = load i32, i32* %13
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %14)
%16 = load i32, i32* %13
switch i32 %16, label %129 [
i32 130, label %17
i32 143, label %20
i32 142, label %47
i32 140, label %74
i32 136, label %79
i32 139, label %84
i32 133, label %89
i32 132, label %94
i32 141, label %98
i32 135, label %101
i32 137, label %104
i32 128, label %109
i32 134, label %112
i32 131, label %115
i32 138, label %120
i32 129, label %124
]
17: ; preds = %8
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %132
20: ; preds = %8
%21 = load i32, i32* @stderr
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%23 = tail call i64 @RTA_DATA(%struct.rtattr* %9)
%24 = inttoptr i64 %23 to i8*
%25 = load i32, i32* @stderr
%26 = load i8, i8* %24
%27 = zext i8 %26 to i32
%28 = getelementptr inbounds i8, i8* %24, i64 1
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = getelementptr inbounds i8, i8* %24, i64 2
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = getelementptr inbounds i8, i8* %24, i64 3
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
br i1 %7, label %37, label %39
37: ; preds = %20
%38 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %27, i32 %30, i32 %33, i32 %36)
br label %132
39: ; preds = %20
%40 = getelementptr inbounds i8, i8* %24, i64 4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = getelementptr inbounds i8, i8* %24, i64 5
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %27, i32 %30, i32 %33, i32 %36, i32 %42, i32 %45)
br label %132
47: ; preds = %8
%48 = load i32, i32* @stderr
%49 = tail call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%50 = tail call i64 @RTA_DATA(%struct.rtattr* %9)
%51 = inttoptr i64 %50 to i8*
%52 = load i32, i32* @stderr
%53 = load i8, i8* %51
%54 = zext i8 %53 to i32
%55 = getelementptr inbounds i8, i8* %51, i64 1
%56 = load i8, i8* %55
%57 = zext i8 %56 to i32
%58 = getelementptr inbounds i8, i8* %51, i64 2
%59 = load i8, i8* %58
%60 = zext i8 %59 to i32
%61 = getelementptr inbounds i8, i8* %51, i64 3
%62 = load i8, i8* %61
%63 = zext i8 %62 to i32
br i1 %7, label %64, label %66
64: ; preds = %47
%65 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %54, i32 %57, i32 %60, i32 %63)
br label %132
66: ; preds = %47
%67 = getelementptr inbounds i8, i8* %51, i64 4
%68 = load i8, i8* %67
%69 = zext i8 %68 to i32
%70 = getelementptr inbounds i8, i8* %51, i64 5
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %54, i32 %57, i32 %60, i32 %63, i32 %69, i32 %72)
br label %132
74: ; preds = %8
%75 = load i32, i32* @stderr
%76 = tail call i64 @RTA_DATA(%struct.rtattr* %9)
%77 = inttoptr i64 %76 to i8*
%78 = tail call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %77)
br label %132
79: ; preds = %8
%80 = load i32, i32* @stderr
%81 = tail call i64 @RTA_DATA(%struct.rtattr* %9)
%82 = trunc i64 %81 to i32
%83 = tail call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %82)
br label %132
84: ; preds = %8
%85 = load i32, i32* @stderr
%86 = tail call i64 @RTA_DATA(%struct.rtattr* %9)
%87 = trunc i64 %86 to i32
%88 = tail call i32 (i32, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i32 %87)
br label %132
89: ; preds = %8
%90 = load i32, i32* @stderr
%91 = tail call i64 @RTA_DATA(%struct.rtattr* %9)
%92 = inttoptr i64 %91 to i8*
%93 = tail call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i8* %92)
br label %132
94: ; preds = %8
%95 = load i32, i32* @stderr
%96 = tail call i32 (i32, i8*, ...) @fprintf(i32 %95, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%97 = tail call i64 @RTA_DATA(%struct.rtattr* %9)
br label %132
98: ; preds = %8
%99 = load i32, i32* @stderr
%100 = tail call i32 (i32, i8*, ...) @fprintf(i32 %99, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
br label %132
101: ; preds = %8
%102 = load i32, i32* @stderr
%103 = tail call i32 (i32, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0))
br label %132
104: ; preds = %8
%105 = load i32, i32* @stderr
%106 = tail call i64 @RTA_DATA(%struct.rtattr* %9)
%107 = trunc i64 %106 to i32
%108 = tail call i32 (i32, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i32 %107)
br label %132
109: ; preds = %8
%110 = load i32, i32* @stderr
%111 = tail call i32 (i32, i8*, ...) @fprintf(i32 %110, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0))
br label %132
112: ; preds = %8
%113 = load i32, i32* @stderr
%114 = tail call i32 (i32, i8*, ...) @fprintf(i32 %113, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0))
br label %132
115: ; preds = %8
%116 = load i32, i32* @stderr
%117 = tail call i64 @RTA_DATA(%struct.rtattr* %9)
%118 = trunc i64 %117 to i32
%119 = tail call i32 (i32, i8*, ...) @fprintf(i32 %116, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i32 %118)
br label %132
120: ; preds = %8
%121 = tail call i64 @RTA_DATA(%struct.rtattr* %9)
%122 = load i32, i32* @stderr
%123 = tail call i32 (i32, i8*, ...) @fprintf(i32 %122, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
br label %132
124: ; preds = %8
%125 = load i32, i32* @stderr
%126 = tail call i64 @RTA_DATA(%struct.rtattr* %9)
%127 = trunc i64 %126 to i32
%128 = tail call i32 (i32, i8*, ...) @fprintf(i32 %125, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.18, i64 0, i64 0), i32 %127)
br label %132
129: ; preds = %8
%130 = load i32, i32* @stderr
%131 = tail call i32 (i32, i8*, ...) @fprintf(i32 %130, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.19, i64 0, i64 0))
br label %132
132: ; preds = %64, %66, %37, %39, %129, %124, %120, %115, %112, %109, %104, %101, %98, %94, %89, %84, %79, %74, %17
%133 = tail call %struct.rtattr* @RTA_NEXT(%struct.rtattr* %9, i32 %1)
%134 = tail call i64 @RTA_OK(%struct.rtattr* %133, i32 %1)
%135 = icmp eq i64 %134, 0
br i1 %135, label %136, label %8
136: ; preds = %132, %3
ret void
}