#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 nlmsghdr {
  int dummy;
};
struct link_util {
  int dummy;
};
struct can_ctrlmode {
  int bitrate;
  int sample_point;
  int tq;
  int prop_seg;
  int phase_seg1;
  int phase_seg2;
  int sjw;
  scalar_t__ mask;
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};
struct can_bittiming {
  int bitrate;
  int sample_point;
  int tq;
  int prop_seg;
  int phase_seg1;
  int phase_seg2;
  int sjw;
  scalar_t__ mask;
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};
typedef int /*<<< orphan*/ cm;
typedef int /*<<< orphan*/ bt;
typedef int __u32;

/* Variables and functions */
int /*<<< orphan*/ CAN_CTRLMODE_3_SAMPLES;
int /*<<< orphan*/ CAN_CTRLMODE_BERR_REPORTING;
int /*<<< orphan*/ CAN_CTRLMODE_LISTENONLY;
int /*<<< orphan*/ CAN_CTRLMODE_LOOPBACK;
int /*<<< orphan*/ CAN_CTRLMODE_ONE_SHOT;
int /*<<< orphan*/ IFLA_CAN_BITTIMING;
int /*<<< orphan*/ IFLA_CAN_CTRLMODE;
int /*<<< orphan*/ IFLA_CAN_RESTART;
int /*<<< orphan*/ IFLA_CAN_RESTART_MS;
int /*<<< orphan*/ NEXT_ARG();
int /*<<< orphan*/ addattr32(struct nlmsghdr *, int, int /*<<< orphan*/, int);
int /*<<< orphan*/ addattr_l(struct nlmsghdr *, int, int /*<<< orphan*/,
                             struct can_ctrlmode *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ get_float(float *, char *);
scalar_t__ get_u32(int *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ invarg(char *, char *);
scalar_t__ matches(char *, char *);
int /*<<< orphan*/ memset(struct can_ctrlmode *, int /*<<< orphan*/, int);
int /*<<< orphan*/ set_ctrlmode(char *, char *, struct can_ctrlmode *,
                                int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage();
int can_parse_opt(struct link_util *lu, int argc, char **argv,
                  struct nlmsghdr *n) {
  struct can_bittiming bt;
  struct can_ctrlmode cm = {0, 0};
  memset(&bt, 0, sizeof(bt));
  while (argc > 0) {
    if (matches(*argv, "bitrate") == 0) {
      NEXT_ARG();
      if (get_u32(&bt.bitrate, *argv, 0))
        invarg("invalid \"bitrate\" value\n", *argv);
    } else if (matches(*argv, "sample-point") == 0) {
      float sp;
      NEXT_ARG();
      if (get_float(&sp, *argv))
        invarg("invalid \"sample-point\" value\n", *argv);
      bt.sample_point = (__u32)(sp * 1000);
    } else if (matches(*argv, "tq") == 0) {
      NEXT_ARG();
      if (get_u32(&bt.tq, *argv, 0))
        invarg("invalid \"tq\" value\n", *argv);
    } else if (matches(*argv, "prop-seg") == 0) {
      NEXT_ARG();
      if (get_u32(&bt.prop_seg, *argv, 0))
        invarg("invalid \"prop-seg\" value\n", *argv);
    } else if (matches(*argv, "phase-seg1") == 0) {
      NEXT_ARG();
      if (get_u32(&bt.phase_seg1, *argv, 0))
        invarg("invalid \"phase-seg1\" value\n", *argv);
    } else if (matches(*argv, "phase-seg2") == 0) {
      NEXT_ARG();
      if (get_u32(&bt.phase_seg2, *argv, 0))
        invarg("invalid \"phase-seg2\" value\n", *argv);
    } else if (matches(*argv, "sjw") == 0) {
      NEXT_ARG();
      if (get_u32(&bt.sjw, *argv, 0))
        invarg("invalid \"sjw\" value\n", *argv);
    } else if (matches(*argv, "loopback") == 0) {
      NEXT_ARG();
      set_ctrlmode("loopback", *argv, &cm, CAN_CTRLMODE_LOOPBACK);
    } else if (matches(*argv, "listen-only") == 0) {
      NEXT_ARG();
      set_ctrlmode("listen-only", *argv, &cm, CAN_CTRLMODE_LISTENONLY);
    } else if (matches(*argv, "triple-sampling") == 0) {
      NEXT_ARG();
      set_ctrlmode("triple-sampling", *argv, &cm, CAN_CTRLMODE_3_SAMPLES);
    } else if (matches(*argv, "one-shot") == 0) {
      NEXT_ARG();
      set_ctrlmode("one-shot", *argv, &cm, CAN_CTRLMODE_ONE_SHOT);
    } else if (matches(*argv, "berr-reporting") == 0) {
      NEXT_ARG();
      set_ctrlmode("berr-reporting", *argv, &cm, CAN_CTRLMODE_BERR_REPORTING);
    } else if (matches(*argv, "restart") == 0) {
      __u32 val = 1;
      addattr32(n, 1024, IFLA_CAN_RESTART, val);
    } else if (matches(*argv, "restart-ms") == 0) {
      __u32 val;
      NEXT_ARG();
      if (get_u32(&val, *argv, 0))
        invarg("invalid \"restart-ms\" value\n", *argv);
      addattr32(n, 1024, IFLA_CAN_RESTART_MS, val);
    } else if (matches(*argv, "help") == 0) {
      usage();
      return -1;
    } else {
      fprintf(stderr, "can: unknown option \"%s\"\n", *argv);
      usage();
      return -1;
    }
    argc--, argv++;
  }
  if (bt.bitrate || bt.tq)
    addattr_l(n, 1024, IFLA_CAN_BITTIMING, &bt, sizeof(bt));
  if (cm.mask)
    addattr_l(n, 1024, IFLA_CAN_CTRLMODE, &cm, sizeof(cm));
  return 0;
}


x86 assembly (clang, -O0):
<can_parse_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
lea    -0x88(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1060 <memset@plt>
lea    -0x58(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1060 <memset@plt>
cmpl   $0x0,-0x14(%rbp)
jle    1782 <can_parse_opt+0x5d2>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xdff(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    124f <can_parse_opt+0x9f>
mov    $0x0,%al
call   10a0 <NEXT_ARG@plt>
lea    -0x58(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
xor    %edx,%edx
call   1050 <get_u32@plt>
cmp    $0x0,%rax
je     124a <can_parse_opt+0x9a>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xdc7(%rip),%rdi
call   10d0 <invarg@plt>
jmp    1768 <can_parse_opt+0x5b8>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xdc8(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    12bf <can_parse_opt+0x10f>
mov    $0x0,%al
call   10a0 <NEXT_ARG@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    -0x8c(%rbp),%rdi
call   1080 <get_float@plt>
cmp    $0x0,%rax
je     12a3 <can_parse_opt+0xf3>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xd94(%rip),%rdi
call   10d0 <invarg@plt>
movss  0xd55(%rip),%xmm0
mulss  -0x8c(%rbp),%xmm0
ff
cvttss2si %xmm0,%eax
mov    %eax,-0x54(%rbp)
jmp    1763 <can_parse_opt+0x5b3>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xd83(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    131b <can_parse_opt+0x16b>
mov    $0x0,%al
call   10a0 <NEXT_ARG@plt>
lea    -0x58(%rbp),%rdi
add    $0x8,%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
xor    %edx,%edx
call   1050 <get_u32@plt>
cmp    $0x0,%rax
je     1316 <can_parse_opt+0x166>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xd42(%rip),%rdi
call   10d0 <invarg@plt>
jmp    175e <can_parse_opt+0x5ae>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xd3e(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    1377 <can_parse_opt+0x1c7>
mov    $0x0,%al
call   10a0 <NEXT_ARG@plt>
lea    -0x58(%rbp),%rdi
add    $0xc,%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
xor    %edx,%edx
call   1050 <get_u32@plt>
cmp    $0x0,%rax
je     1372 <can_parse_opt+0x1c2>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xd03(%rip),%rdi
call   10d0 <invarg@plt>
jmp    1759 <can_parse_opt+0x5a9>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xd05(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    13d3 <can_parse_opt+0x223>
mov    $0x0,%al
call   10a0 <NEXT_ARG@plt>
lea    -0x58(%rbp),%rdi
add    $0x10,%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
xor    %edx,%edx
call   1050 <get_u32@plt>
cmp    $0x0,%rax
je     13ce <can_parse_opt+0x21e>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xccc(%rip),%rdi
call   10d0 <invarg@plt>
jmp    1754 <can_parse_opt+0x5a4>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xcd0(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    142f <can_parse_opt+0x27f>
mov    $0x0,%al
call   10a0 <NEXT_ARG@plt>
lea    -0x58(%rbp),%rdi
add    $0x14,%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
xor    %edx,%edx
call   1050 <get_u32@plt>
cmp    $0x0,%rax
je     142a <can_parse_opt+0x27a>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xc97(%rip),%rdi
call   10d0 <invarg@plt>
jmp    174f <can_parse_opt+0x59f>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xc9b(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    148b <can_parse_opt+0x2db>
mov    $0x0,%al
call   10a0 <NEXT_ARG@plt>
lea    -0x58(%rbp),%rdi
add    $0x18,%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
xor    %edx,%edx
call   1050 <get_u32@plt>
cmp    $0x0,%rax
je     1486 <can_parse_opt+0x2d6>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xc5b(%rip),%rdi
call   10d0 <invarg@plt>
jmp    174a <can_parse_opt+0x59a>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xc58(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    14d7 <can_parse_opt+0x327>
mov    $0x0,%al
call   10a0 <NEXT_ARG@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
mov    0x2afb(%rip),%rax
mov    (%rax),%ecx
lea    0xc2b(%rip),%rdi
lea    -0x88(%rbp),%rdx
call   1090 <set_ctrlmode@plt>
jmp    1745 <can_parse_opt+0x595>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xc15(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    1523 <can_parse_opt+0x373>
mov    $0x0,%al
call   10a0 <NEXT_ARG@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
mov    0x2ae7(%rip),%rax
mov    (%rax),%ecx
lea    0xbe8(%rip),%rdi
lea    -0x88(%rbp),%rdx
call   1090 <set_ctrlmode@plt>
jmp    1740 <can_parse_opt+0x590>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xbd5(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    156f <can_parse_opt+0x3bf>
mov    $0x0,%al
call   10a0 <NEXT_ARG@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
mov    0x2a4b(%rip),%rax
mov    (%rax),%ecx
lea    0xba8(%rip),%rdi
lea    -0x88(%rbp),%rdx
call   1090 <set_ctrlmode@plt>
jmp    173b <can_parse_opt+0x58b>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xb99(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    15bb <can_parse_opt+0x40b>
mov    $0x0,%al
call   10a0 <NEXT_ARG@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
mov    0x2a37(%rip),%rax
mov    (%rax),%ecx
lea    0xb6c(%rip),%rdi
lea    -0x88(%rbp),%rdx
call   1090 <set_ctrlmode@plt>
jmp    1736 <can_parse_opt+0x586>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xb56(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    1607 <can_parse_opt+0x457>
mov    $0x0,%al
call   10a0 <NEXT_ARG@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
mov    0x29e3(%rip),%rax
mov    (%rax),%ecx
lea    0xb29(%rip),%rdi
lea    -0x88(%rbp),%rdx
call   1090 <set_ctrlmode@plt>
jmp    1731 <can_parse_opt+0x581>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xb19(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    1650 <can_parse_opt+0x4a0>
movl   $0x1,-0x90(%rbp)
mov    -0x28(%rbp),%rdi
mov    0x29a7(%rip),%rax
mov    (%rax),%edx
mov    -0x90(%rbp),%ecx
mov    $0x400,%esi
call   10c0 <addattr32@plt>
jmp    172c <can_parse_opt+0x57c>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xad8(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    16c8 <can_parse_opt+0x518>
mov    $0x0,%al
call   10a0 <NEXT_ARG@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    -0x94(%rbp),%rdi
xor    %edx,%edx
call   1050 <get_u32@plt>
cmp    $0x0,%rax
je     16a6 <can_parse_opt+0x4f6>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xaa0(%rip),%rdi
call   10d0 <invarg@plt>
mov    -0x28(%rbp),%rdi
mov    0x2917(%rip),%rax
mov    (%rax),%edx
mov    -0x94(%rbp),%ecx
mov    $0x400,%esi
call   10c0 <addattr32@plt>
jmp    1727 <can_parse_opt+0x577>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xa87(%rip),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
jne    16f8 <can_parse_opt+0x548>
mov    $0x0,%al
call   10b0 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    17ed <can_parse_opt+0x63d>
mov    0x28b1(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%rdx
lea    0xa53(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x0,%al
call   10b0 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    17ed <can_parse_opt+0x63d>
jmp    172c <can_parse_opt+0x57c>
jmp    1731 <can_parse_opt+0x581>
jmp    1736 <can_parse_opt+0x586>
jmp    173b <can_parse_opt+0x58b>
jmp    1740 <can_parse_opt+0x590>
jmp    1745 <can_parse_opt+0x595>
jmp    174a <can_parse_opt+0x59a>
jmp    174f <can_parse_opt+0x59f>
jmp    1754 <can_parse_opt+0x5a4>
jmp    1759 <can_parse_opt+0x5a9>
jmp    175e <can_parse_opt+0x5ae>
jmp    1763 <can_parse_opt+0x5b3>
jmp    1768 <can_parse_opt+0x5b8>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    11ed <can_parse_opt+0x3d>
cmpl   $0x0,-0x58(%rbp)
jne    1796 <can_parse_opt+0x5e6>
cmpl   $0x0,-0x50(%rbp)
je     17b7 <can_parse_opt+0x607>
mov    -0x28(%rbp),%rdi
mov    0x2807(%rip),%rax
mov    (%rax),%edx
lea    -0x58(%rbp),%rcx
mov    $0x400,%esi
mov    $0x30,%r8d
call   1040 <addattr_l@plt>
cmpq   $0x0,-0x68(%rbp)
je     17e6 <can_parse_opt+0x636>
mov    -0x28(%rbp),%rdi
mov    0x27cb(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
lea    -0x88(%rbp),%rcx
mov    $0x30,%r8d
call   1040 <addattr_l@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_parse_opt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rcx,0x8(%rsp)
mov    %rdx,%rbx
mov    %esi,%ebp
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1060 <memset@plt>
test   %ebp,%ebp
jle    1646 <can_parse_opt+0x496>
add    $0x1,%ebp
lea    0xe07(%rip),%r13
lea    0x10(%rsp),%r15
lea    0xe1c(%rip),%r14
lea    0xe40(%rip),%r12
jmp    1246 <can_parse_opt+0x96>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  0x4(%rsp),%xmm0
mulss  0xdd2(%rip),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,0x14(%rsp)
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
jle    1646 <can_parse_opt+0x496>
mov    (%rbx),%rdi
mov    %r13,%rsi
call   1030 <matches@plt>
test   %rax,%rax
je     13f0 <can_parse_opt+0x240>
mov    (%rbx),%rdi
mov    %r14,%rsi
call   1030 <matches@plt>
test   %rax,%rax
je     1430 <can_parse_opt+0x280>
mov    (%rbx),%rdi
mov    %r12,%rsi
call   1030 <matches@plt>
test   %rax,%rax
je     1461 <can_parse_opt+0x2b1>
mov    (%rbx),%rdi
lea    0xddb(%rip),%rsi
call   1030 <matches@plt>
test   %rax,%rax
je     1494 <can_parse_opt+0x2e4>
mov    (%rbx),%rdi
lea    0xde6(%rip),%rsi
call   1030 <matches@plt>
test   %rax,%rax
je     14c7 <can_parse_opt+0x317>
mov    (%rbx),%rdi
lea    0xdf5(%rip),%rsi
call   1030 <matches@plt>
test   %rax,%rax
je     14fa <can_parse_opt+0x34a>
mov    (%rbx),%rdi
lea    0xe04(%rip),%rsi
call   1030 <matches@plt>
test   %rax,%rax
je     152d <can_parse_opt+0x37d>
mov    %r12,%r14
mov    %r15,%r12
mov    (%rbx),%rdi
lea    0xdff(%rip),%r15
mov    %r15,%rsi
call   1030 <matches@plt>
test   %rax,%rax
je     1560 <can_parse_opt+0x3b0>
mov    (%rbx),%rdi
lea    0xded(%rip),%r15
mov    %r15,%rsi
call   1030 <matches@plt>
test   %rax,%rax
je     1573 <can_parse_opt+0x3c3>
mov    (%rbx),%rdi
lea    0xdde(%rip),%rsi
call   1030 <matches@plt>
test   %rax,%rax
mov    %r12,%r15
je     15a5 <can_parse_opt+0x3f5>
mov    (%rbx),%rdi
lea    0xdd3(%rip),%rsi
call   1030 <matches@plt>
test   %rax,%rax
mov    %r14,%r12
je     15cb <can_parse_opt+0x41b>
mov    (%rbx),%rdi
lea    0xdc1(%rip),%rsi
call   1030 <matches@plt>
test   %rax,%rax
lea    0xcb8(%rip),%r14
je     15fb <can_parse_opt+0x44b>
mov    (%rbx),%rdi
lea    0xdb1(%rip),%rsi
call   1030 <matches@plt>
test   %rax,%rax
je     1624 <can_parse_opt+0x474>
mov    (%rbx),%rdi
lea    0xda1(%rip),%rsi
call   1030 <matches@plt>
test   %rax,%rax
jne    16b2 <can_parse_opt+0x502>
xor    %eax,%eax
call   10a0 <NEXT_ARG@plt>
mov    (%rbx),%rsi
lea    0x4(%rsp),%rdi
xor    %edx,%edx
call   1050 <get_u32@plt>
test   %rax,%rax
je     13cd <can_parse_opt+0x21d>
mov    (%rbx),%rsi
lea    0xd79(%rip),%rdi
call   10d0 <invarg@plt>
mov    0x2bf4(%rip),%rax
mov    (%rax),%edx
mov    0x4(%rsp),%ecx
mov    0x8(%rsp),%rdi
mov    $0x400,%esi
jmp    163c <can_parse_opt+0x48c>
nopl   0x0(%rax)
xor    %eax,%eax
call   10a0 <NEXT_ARG@plt>
mov    (%rbx),%rsi
mov    %r15,%rdi
xor    %edx,%edx
call   1050 <get_u32@plt>
test   %rax,%rax
je     1236 <can_parse_opt+0x86>
mov    (%rbx),%rsi
lea    0xbf5(%rip),%rdi
call   10d0 <invarg@plt>
jmp    1236 <can_parse_opt+0x86>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10a0 <NEXT_ARG@plt>
mov    (%rbx),%rsi
lea    0x4(%rsp),%rdi
call   1080 <get_float@plt>
test   %rax,%rax
je     1220 <can_parse_opt+0x70>
mov    (%rbx),%rsi
lea    0xbdb(%rip),%rdi
call   10d0 <invarg@plt>
jmp    1220 <can_parse_opt+0x70>
xor    %eax,%eax
call   10a0 <NEXT_ARG@plt>
mov    (%rbx),%rsi
lea    0x18(%rsp),%rdi
xor    %edx,%edx
call   1050 <get_u32@plt>
test   %rax,%rax
je     1236 <can_parse_opt+0x86>
mov    (%rbx),%rsi
lea    0xbc9(%rip),%rdi
call   10d0 <invarg@plt>
jmp    1236 <can_parse_opt+0x86>
xor    %eax,%eax
call   10a0 <NEXT_ARG@plt>
mov    (%rbx),%rsi
lea    0x1c(%rsp),%rdi
xor    %edx,%edx
call   1050 <get_u32@plt>
test   %rax,%rax
je     1236 <can_parse_opt+0x86>
mov    (%rbx),%rsi
lea    0xbb3(%rip),%rdi
call   10d0 <invarg@plt>
jmp    1236 <can_parse_opt+0x86>
xor    %eax,%eax
call   10a0 <NEXT_ARG@plt>
mov    (%rbx),%rsi
lea    0x20(%rsp),%rdi
xor    %edx,%edx
call   1050 <get_u32@plt>
test   %rax,%rax
je     1236 <can_parse_opt+0x86>
mov    (%rbx),%rsi
lea    0xba5(%rip),%rdi
call   10d0 <invarg@plt>
jmp    1236 <can_parse_opt+0x86>
xor    %eax,%eax
call   10a0 <NEXT_ARG@plt>
mov    (%rbx),%rsi
lea    0x24(%rsp),%rdi
xor    %edx,%edx
call   1050 <get_u32@plt>
test   %rax,%rax
je     1236 <can_parse_opt+0x86>
mov    (%rbx),%rsi
lea    0xb99(%rip),%rdi
call   10d0 <invarg@plt>
jmp    1236 <can_parse_opt+0x86>
xor    %eax,%eax
call   10a0 <NEXT_ARG@plt>
mov    (%rbx),%rsi
lea    0x28(%rsp),%rdi
xor    %edx,%edx
call   1050 <get_u32@plt>
test   %rax,%rax
je     1236 <can_parse_opt+0x86>
mov    (%rbx),%rsi
lea    0xb86(%rip),%rdi
call   10d0 <invarg@plt>
jmp    1236 <can_parse_opt+0x86>
xor    %eax,%eax
call   10a0 <NEXT_ARG@plt>
mov    (%rbx),%rsi
mov    0x2a47(%rip),%rax
jmp    1584 <can_parse_opt+0x3d4>
xor    %eax,%eax
call   10a0 <NEXT_ARG@plt>
mov    (%rbx),%rsi
mov    0x2a6c(%rip),%rax
mov    (%rax),%ecx
mov    %r15,%rdi
lea    0x40(%rsp),%rdx
call   1090 <set_ctrlmode@plt>
mov    %r12,%r15
mov    %r14,%r12
lea    0xa85(%rip),%r14
jmp    1236 <can_parse_opt+0x86>
xor    %eax,%eax
call   10a0 <NEXT_ARG@plt>
mov    (%rbx),%rsi
mov    0x29ea(%rip),%rax
mov    (%rax),%ecx
lea    0xb47(%rip),%rdi
lea    0x40(%rsp),%rdx
call   1090 <set_ctrlmode@plt>
jmp    1596 <can_parse_opt+0x3e6>
xor    %eax,%eax
call   10a0 <NEXT_ARG@plt>
mov    (%rbx),%rsi
mov    0x29fc(%rip),%rax
mov    (%rax),%ecx
lea    0xb31(%rip),%rdi
lea    0x40(%rsp),%rdx
call   1090 <set_ctrlmode@plt>
lea    0xa2f(%rip),%r14
jmp    1236 <can_parse_opt+0x86>
xor    %eax,%eax
call   10a0 <NEXT_ARG@plt>
mov    (%rbx),%rsi
mov    0x29c4(%rip),%rax
mov    (%rax),%ecx
lea    0xb0a(%rip),%rdi
lea    0x40(%rsp),%rdx
call   1090 <set_ctrlmode@plt>
jmp    1236 <can_parse_opt+0x86>
mov    0x29b5(%rip),%rax
mov    (%rax),%edx
mov    0x8(%rsp),%rdi
mov    $0x400,%esi
mov    $0x1,%ecx
call   10c0 <addattr32@plt>
jmp    1236 <can_parse_opt+0x86>
mov    0x10(%rsp),%eax
or     0x18(%rsp),%eax
mov    0x8(%rsp),%rbp
je     1676 <can_parse_opt+0x4c6>
mov    0x294c(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%rcx
mov    %rbp,%rdi
mov    $0x400,%esi
mov    $0x30,%r8d
call   1040 <addattr_l@plt>
xor    %ebx,%ebx
cmpq   $0x0,0x60(%rsp)
je     16a1 <can_parse_opt+0x4f1>
mov    0x2911(%rip),%rax
mov    (%rax),%edx
lea    0x40(%rsp),%rcx
mov    %rbp,%rdi
mov    $0x400,%esi
mov    $0x30,%r8d
call   1040 <addattr_l@plt>
mov    %ebx,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%rdi
lea    0xaa1(%rip),%rsi
call   1030 <matches@plt>
test   %rax,%rax
je     16de <can_parse_opt+0x52e>
mov    0x28e3(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xa89(%rip),%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
call   10b0 <usage@plt>
mov    $0xffffffff,%ebx
jmp    16a1 <can_parse_opt+0x4f1>

LLVM IR (-O0):
%struct.link_util = type { i32 }
%struct.nlmsghdr = type { i32 }
%struct.can_bittiming = type { i32, i32, i32, i32, i32, i32, i32, i64, i32, i32 }
%struct.can_ctrlmode = type { i32, i32, i32, i32, i32, i32, i32, i64, i32, i32 }
@.str = [8 x i8] c"bitrate\00"
@.str.1 = [25 x i8] c"invalid \22bitrate\22 value\0A\00"
@.str.2 = [13 x i8] c"sample-point\00"
@.str.3 = [30 x i8] c"invalid \22sample-point\22 value\0A\00"
@.str.4 = [3 x i8] c"tq\00"
@.str.5 = [20 x i8] c"invalid \22tq\22 value\0A\00"
@.str.6 = [9 x i8] c"prop-seg\00"
@.str.7 = [26 x i8] c"invalid \22prop-seg\22 value\0A\00"
@.str.8 = [11 x i8] c"phase-seg1\00"
@.str.9 = [28 x i8] c"invalid \22phase-seg1\22 value\0A\00"
@.str.10 = [11 x i8] c"phase-seg2\00"
@.str.11 = [28 x i8] c"invalid \22phase-seg2\22 value\0A\00"
@.str.12 = [4 x i8] c"sjw\00"
@.str.13 = [21 x i8] c"invalid \22sjw\22 value\0A\00"
@.str.14 = [9 x i8] c"loopback\00"
@CAN_CTRLMODE_LOOPBACK = global i32 0
@.str.15 = [12 x i8] c"listen-only\00"
@CAN_CTRLMODE_LISTENONLY = global i32 0
@.str.16 = [16 x i8] c"triple-sampling\00"
@CAN_CTRLMODE_3_SAMPLES = global i32 0
@.str.17 = [9 x i8] c"one-shot\00"
@CAN_CTRLMODE_ONE_SHOT = global i32 0
@.str.18 = [15 x i8] c"berr-reporting\00"
@CAN_CTRLMODE_BERR_REPORTING = global i32 0
@.str.19 = [8 x i8] c"restart\00"
@IFLA_CAN_RESTART = global i32 0
@.str.20 = [11 x i8] c"restart-ms\00"
@.str.21 = [28 x i8] c"invalid \22restart-ms\22 value\0A\00"
@IFLA_CAN_RESTART_MS = global i32 0
@.str.22 = [5 x i8] c"help\00"
@stderr = global i32 0
@.str.23 = [26 x i8] c"can: unknown option \22%s\22\0A\00"
@IFLA_CAN_BITTIMING = global i32 0
@IFLA_CAN_CTRLMODE = global i32 0
define i32 @can_parse_opt(%struct.link_util* %0, i32 %1, i8** %2, %struct.nlmsghdr* %3) {
%5 = alloca i32
%6 = alloca %struct.link_util*
%7 = alloca i32
%8 = alloca i8**
%9 = alloca %struct.nlmsghdr*
%10 = alloca %struct.can_bittiming
%11 = alloca %struct.can_ctrlmode
%12 = alloca float
%13 = alloca i32
%14 = alloca i32
store %struct.link_util* %0, %struct.link_util** %6
store i32 %1, i32* %7
store i8** %2, i8*** %8
store %struct.nlmsghdr* %3, %struct.nlmsghdr** %9
%15 = bitcast %struct.can_ctrlmode* %11 to i8*
%16 = bitcast %struct.can_bittiming* %10 to %struct.can_ctrlmode*
%17 = call i32 @memset(%struct.can_ctrlmode* %16, i32 0, i32 48)
br label %18
18: ; preds = %254, %4
%19 = load i32, i32* %7
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %259
21: ; preds = %18
%22 = load i8**, i8*** %8
%23 = load i8*, i8** %22
%24 = call i64 @matches(i8* %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %38
26: ; preds = %21
%27 = call i32 (...) @NEXT_ARG()
%28 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %10, i32 0, i32 0
%29 = load i8**, i8*** %8
%30 = load i8*, i8** %29
%31 = call i64 @get_u32(i32* %28, i8* %30, i32 0)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %26
%34 = load i8**, i8*** %8
%35 = load i8*, i8** %34
%36 = call i32 @invarg(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %35)
br label %37
37: ; preds = %33, %26
br label %254
38: ; preds = %21
%39 = load i8**, i8*** %8
%40 = load i8*, i8** %39
%41 = call i64 @matches(i8* %40, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %58
43: ; preds = %38
%44 = call i32 (...) @NEXT_ARG()
%45 = load i8**, i8*** %8
%46 = load i8*, i8** %45
%47 = call i64 @get_float(float* %12, i8* %46)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %43
%50 = load i8**, i8*** %8
%51 = load i8*, i8** %50
%52 = call i32 @invarg(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %51)
br label %53
53: ; preds = %49, %43
%54 = load float, float* %12
%55 = fmul float %54, 1.000000e+03
%56 = fptosi float %55 to i32
%57 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %10, i32 0, i32 1
store i32 %56, i32* %57
br label %253
58: ; preds = %38
%59 = load i8**, i8*** %8
%60 = load i8*, i8** %59
%61 = call i64 @matches(i8* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %75
63: ; preds = %58
%64 = call i32 (...) @NEXT_ARG()
%65 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %10, i32 0, i32 2
%66 = load i8**, i8*** %8
%67 = load i8*, i8** %66
%68 = call i64 @get_u32(i32* %65, i8* %67, i32 0)
%69 = icmp ne i64 %68, 0
br i1 %69, label %70, label %74
70: ; preds = %63
%71 = load i8**, i8*** %8
%72 = load i8*, i8** %71
%73 = call i32 @invarg(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* %72)
br label %74
74: ; preds = %70, %63
br label %252
75: ; preds = %58
%76 = load i8**, i8*** %8
%77 = load i8*, i8** %76
%78 = call i64 @matches(i8* %77, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %92
80: ; preds = %75
%81 = call i32 (...) @NEXT_ARG()
%82 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %10, i32 0, i32 3
%83 = load i8**, i8*** %8
%84 = load i8*, i8** %83
%85 = call i64 @get_u32(i32* %82, i8* %84, i32 0)
%86 = icmp ne i64 %85, 0
br i1 %86, label %87, label %91
87: ; preds = %80
%88 = load i8**, i8*** %8
%89 = load i8*, i8** %88
%90 = call i32 @invarg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %89)
br label %91
91: ; preds = %87, %80
br label %251
92: ; preds = %75
%93 = load i8**, i8*** %8
%94 = load i8*, i8** %93
%95 = call i64 @matches(i8* %94, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %109
97: ; preds = %92
%98 = call i32 (...) @NEXT_ARG()
%99 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %10, i32 0, i32 4
%100 = load i8**, i8*** %8
%101 = load i8*, i8** %100
%102 = call i64 @get_u32(i32* %99, i8* %101, i32 0)
%103 = icmp ne i64 %102, 0
br i1 %103, label %104, label %108
104: ; preds = %97
%105 = load i8**, i8*** %8
%106 = load i8*, i8** %105
%107 = call i32 @invarg(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i8* %106)
br label %108
108: ; preds = %104, %97
br label %250
109: ; preds = %92
%110 = load i8**, i8*** %8
%111 = load i8*, i8** %110
%112 = call i64 @matches(i8* %111, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%113 = icmp eq i64 %112, 0
br i1 %113, label %114, label %126
114: ; preds = %109
%115 = call i32 (...) @NEXT_ARG()
%116 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %10, i32 0, i32 5
%117 = load i8**, i8*** %8
%118 = load i8*, i8** %117
%119 = call i64 @get_u32(i32* %116, i8* %118, i32 0)
%120 = icmp ne i64 %119, 0
br i1 %120, label %121, label %125
121: ; preds = %114
%122 = load i8**, i8*** %8
%123 = load i8*, i8** %122
%124 = call i32 @invarg(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0), i8* %123)
br label %125
125: ; preds = %121, %114
br label %249
126: ; preds = %109
%127 = load i8**, i8*** %8
%128 = load i8*, i8** %127
%129 = call i64 @matches(i8* %128, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%130 = icmp eq i64 %129, 0
br i1 %130, label %131, label %143
131: ; preds = %126
%132 = call i32 (...) @NEXT_ARG()
%133 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %10, i32 0, i32 6
%134 = load i8**, i8*** %8
%135 = load i8*, i8** %134
%136 = call i64 @get_u32(i32* %133, i8* %135, i32 0)
%137 = icmp ne i64 %136, 0
br i1 %137, label %138, label %142
138: ; preds = %131
%139 = load i8**, i8*** %8
%140 = load i8*, i8** %139
%141 = call i32 @invarg(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), i8* %140)
br label %142
142: ; preds = %138, %131
br label %248
143: ; preds = %126
%144 = load i8**, i8*** %8
%145 = load i8*, i8** %144
%146 = call i64 @matches(i8* %145, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
%147 = icmp eq i64 %146, 0
br i1 %147, label %148, label %154
148: ; preds = %143
%149 = call i32 (...) @NEXT_ARG()
%150 = load i8**, i8*** %8
%151 = load i8*, i8** %150
%152 = load i32, i32* @CAN_CTRLMODE_LOOPBACK
%153 = call i32 @set_ctrlmode(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8* %151, %struct.can_ctrlmode* %11, i32 %152)
br label %247
154: ; preds = %143
%155 = load i8**, i8*** %8
%156 = load i8*, i8** %155
%157 = call i64 @matches(i8* %156, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0))
%158 = icmp eq i64 %157, 0
br i1 %158, label %159, label %165
159: ; preds = %154
%160 = call i32 (...) @NEXT_ARG()
%161 = load i8**, i8*** %8
%162 = load i8*, i8** %161
%163 = load i32, i32* @CAN_CTRLMODE_LISTENONLY
%164 = call i32 @set_ctrlmode(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i8* %162, %struct.can_ctrlmode* %11, i32 %163)
br label %246
165: ; preds = %154
%166 = load i8**, i8*** %8
%167 = load i8*, i8** %166
%168 = call i64 @matches(i8* %167, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0))
%169 = icmp eq i64 %168, 0
br i1 %169, label %170, label %176
170: ; preds = %165
%171 = call i32 (...) @NEXT_ARG()
%172 = load i8**, i8*** %8
%173 = load i8*, i8** %172
%174 = load i32, i32* @CAN_CTRLMODE_3_SAMPLES
%175 = call i32 @set_ctrlmode(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i8* %173, %struct.can_ctrlmode* %11, i32 %174)
br label %245
176: ; preds = %165
%177 = load i8**, i8*** %8
%178 = load i8*, i8** %177
%179 = call i64 @matches(i8* %178, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
%180 = icmp eq i64 %179, 0
br i1 %180, label %181, label %187
181: ; preds = %176
%182 = call i32 (...) @NEXT_ARG()
%183 = load i8**, i8*** %8
%184 = load i8*, i8** %183
%185 = load i32, i32* @CAN_CTRLMODE_ONE_SHOT
%186 = call i32 @set_ctrlmode(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i8* %184, %struct.can_ctrlmode* %11, i32 %185)
br label %244
187: ; preds = %176
%188 = load i8**, i8*** %8
%189 = load i8*, i8** %188
%190 = call i64 @matches(i8* %189, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0))
%191 = icmp eq i64 %190, 0
br i1 %191, label %192, label %198
192: ; preds = %187
%193 = call i32 (...) @NEXT_ARG()
%194 = load i8**, i8*** %8
%195 = load i8*, i8** %194
%196 = load i32, i32* @CAN_CTRLMODE_BERR_REPORTING
%197 = call i32 @set_ctrlmode(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0), i8* %195, %struct.can_ctrlmode* %11, i32 %196)
br label %243
198: ; preds = %187
%199 = load i8**, i8*** %8
%200 = load i8*, i8** %199
%201 = call i64 @matches(i8* %200, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
%202 = icmp eq i64 %201, 0
br i1 %202, label %203, label %208
203: ; preds = %198
store i32 1, i32* %13
%204 = load %struct.nlmsghdr*, %struct.nlmsghdr** %9
%205 = load i32, i32* @IFLA_CAN_RESTART
%206 = load i32, i32* %13
%207 = call i32 @addattr32(%struct.nlmsghdr* %204, i32 1024, i32 %205, i32 %206)
br label %242
208: ; preds = %198
%209 = load i8**, i8*** %8
%210 = load i8*, i8** %209
%211 = call i64 @matches(i8* %210, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
%212 = icmp eq i64 %211, 0
br i1 %212, label %213, label %228
213: ; preds = %208
%214 = call i32 (...) @NEXT_ARG()
%215 = load i8**, i8*** %8
%216 = load i8*, i8** %215
%217 = call i64 @get_u32(i32* %14, i8* %216, i32 0)
%218 = icmp ne i64 %217, 0
br i1 %218, label %219, label %223
219: ; preds = %213
%220 = load i8**, i8*** %8
%221 = load i8*, i8** %220
%222 = call i32 @invarg(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.21, i64 0, i64 0), i8* %221)
br label %223
223: ; preds = %219, %213
%224 = load %struct.nlmsghdr*, %struct.nlmsghdr** %9
%225 = load i32, i32* @IFLA_CAN_RESTART_MS
%226 = load i32, i32* %14
%227 = call i32 @addattr32(%struct.nlmsghdr* %224, i32 1024, i32 %225, i32 %226)
br label %241
228: ; preds = %208
%229 = load i8**, i8*** %8
%230 = load i8*, i8** %229
%231 = call i64 @matches(i8* %230, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0))
%232 = icmp eq i64 %231, 0
br i1 %232, label %233, label %235
233: ; preds = %228
%234 = call i32 (...) @usage()
store i32 -1, i32* %5
br label %281
235: ; preds = %228
%236 = load i32, i32* @stderr
%237 = load i8**, i8*** %8
%238 = load i8*, i8** %237
%239 = call i32 @fprintf(i32 %236, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.23, i64 0, i64 0), i8* %238)
%240 = call i32 (...) @usage()
store i32 -1, i32* %5
br label %281
241: ; preds = %223
br label %242
242: ; preds = %241, %203
br label %243
243: ; preds = %242, %192
br label %244
244: ; preds = %243, %181
br label %245
245: ; preds = %244, %170
br label %246
246: ; preds = %245, %159
br label %247
247: ; preds = %246, %148
br label %248
248: ; preds = %247, %142
br label %249
249: ; preds = %248, %125
br label %250
250: ; preds = %249, %108
br label %251
251: ; preds = %250, %91
br label %252
252: ; preds = %251, %74
br label %253
253: ; preds = %252, %53
br label %254
254: ; preds = %253, %37
%255 = load i32, i32* %7
%256 = add nsw i32 %255, -1
store i32 %256, i32* %7
%257 = load i8**, i8*** %8
%258 = getelementptr inbounds i8*, i8** %257, i32 1
store i8** %258, i8*** %8
br label %18
259: ; preds = %18
%260 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %10, i32 0, i32 0
%261 = load i32, i32* %260
%262 = icmp ne i32 %261, 0
br i1 %262, label %267, label %263
263: ; preds = %259
%264 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %10, i32 0, i32 2
%265 = load i32, i32* %264
%266 = icmp ne i32 %265, 0
br i1 %266, label %267, label %272
267: ; preds = %263, %259
%268 = load %struct.nlmsghdr*, %struct.nlmsghdr** %9
%269 = load i32, i32* @IFLA_CAN_BITTIMING
%270 = bitcast %struct.can_bittiming* %10 to %struct.can_ctrlmode*
%271 = call i32 @addattr_l(%struct.nlmsghdr* %268, i32 1024, i32 %269, %struct.can_ctrlmode* %270, i32 48)
br label %272
272: ; preds = %267, %263
%273 = getelementptr inbounds %struct.can_ctrlmode, %struct.can_ctrlmode* %11, i32 0, i32 7
%274 = load i64, i64* %273
%275 = icmp ne i64 %274, 0
br i1 %275, label %276, label %280
276: ; preds = %272
%277 = load %struct.nlmsghdr*, %struct.nlmsghdr** %9
%278 = load i32, i32* @IFLA_CAN_CTRLMODE
%279 = call i32 @addattr_l(%struct.nlmsghdr* %277, i32 1024, i32 %278, %struct.can_ctrlmode* %11, i32 48)
br label %280
280: ; preds = %276, %272
store i32 0, i32* %5
br label %281
281: ; preds = %280, %235, %233
%282 = load i32, i32* %5
ret i32 %282
}

LLVM IR (-O2):
%struct.link_util = type { i32 }
%struct.nlmsghdr = type { i32 }
%struct.can_bittiming = type { i32, i32, i32, i32, i32, i32, i32, i64, i32, i32 }
%struct.can_ctrlmode = type { i32, i32, i32, i32, i32, i32, i32, i64, i32, i32 }
@.str = [8 x i8] c"bitrate\00"
@.str.1 = [25 x i8] c"invalid \22bitrate\22 value\0A\00"
@.str.2 = [13 x i8] c"sample-point\00"
@.str.3 = [30 x i8] c"invalid \22sample-point\22 value\0A\00"
@.str.4 = [3 x i8] c"tq\00"
@.str.5 = [20 x i8] c"invalid \22tq\22 value\0A\00"
@.str.6 = [9 x i8] c"prop-seg\00"
@.str.7 = [26 x i8] c"invalid \22prop-seg\22 value\0A\00"
@.str.8 = [11 x i8] c"phase-seg1\00"
@.str.9 = [28 x i8] c"invalid \22phase-seg1\22 value\0A\00"
@.str.10 = [11 x i8] c"phase-seg2\00"
@.str.11 = [28 x i8] c"invalid \22phase-seg2\22 value\0A\00"
@.str.12 = [4 x i8] c"sjw\00"
@.str.13 = [21 x i8] c"invalid \22sjw\22 value\0A\00"
@.str.14 = [9 x i8] c"loopback\00"
@CAN_CTRLMODE_LOOPBACK = global i32 0
@.str.15 = [12 x i8] c"listen-only\00"
@CAN_CTRLMODE_LISTENONLY = global i32 0
@.str.16 = [16 x i8] c"triple-sampling\00"
@CAN_CTRLMODE_3_SAMPLES = global i32 0
@.str.17 = [9 x i8] c"one-shot\00"
@CAN_CTRLMODE_ONE_SHOT = global i32 0
@.str.18 = [15 x i8] c"berr-reporting\00"
@CAN_CTRLMODE_BERR_REPORTING = global i32 0
@.str.19 = [8 x i8] c"restart\00"
@IFLA_CAN_RESTART = global i32 0
@.str.20 = [11 x i8] c"restart-ms\00"
@.str.21 = [28 x i8] c"invalid \22restart-ms\22 value\0A\00"
@IFLA_CAN_RESTART_MS = global i32 0
@.str.22 = [5 x i8] c"help\00"
@stderr = global i32 0
@.str.23 = [26 x i8] c"can: unknown option \22%s\22\0A\00"
@IFLA_CAN_BITTIMING = global i32 0
@IFLA_CAN_CTRLMODE = global i32 0
define i32 @can_parse_opt(%struct.link_util* nocapture readnone %0, i32 %1, i8** %2, %struct.nlmsghdr* %3) {
%5 = alloca %struct.can_bittiming
%6 = alloca %struct.can_ctrlmode
%7 = alloca float
%8 = alloca i32
%9 = bitcast %struct.can_bittiming* %5 to i8*
%10 = bitcast %struct.can_ctrlmode* %6 to i8*
%11 = bitcast %struct.can_bittiming* %5 to %struct.can_ctrlmode*
%12 = call i32 @memset(%struct.can_ctrlmode* %11, i32 0, i32 48)
%13 = icmp sgt i32 %1, 0
br i1 %13, label %14, label %197
14: ; preds = %4
%15 = bitcast i32* %8 to i8*
%16 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %5, i64 0, i32 6
%17 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %5, i64 0, i32 5
%18 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %5, i64 0, i32 4
%19 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %5, i64 0, i32 3
%20 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %5, i64 0, i32 2
%21 = bitcast float* %7 to i8*
%22 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %5, i64 0, i32 1
%23 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %5, i64 0, i32 0
br label %24
24: ; preds = %14, %193
%25 = phi i32 [ %1, %14 ], [ %194, %193 ]
%26 = phi i8** [ %2, %14 ], [ %195, %193 ]
%27 = load i8*, i8** %26
%28 = call i64 @matches(i8* %27, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %38
30: ; preds = %24
%31 = call i32 (...) @NEXT_ARG()
%32 = load i8*, i8** %26
%33 = call i64 @get_u32(i32* %23, i8* %32, i32 0)
%34 = icmp eq i64 %33, 0
br i1 %34, label %193, label %35
35: ; preds = %30
%36 = load i8*, i8** %26
%37 = call i32 @invarg(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %36)
br label %193
38: ; preds = %24
%39 = load i8*, i8** %26
%40 = call i64 @matches(i8* %39, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %54
42: ; preds = %38
%43 = call i32 (...) @NEXT_ARG()
%44 = load i8*, i8** %26
%45 = call i64 @get_float(float* %7, i8* %44)
%46 = icmp eq i64 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %42
%48 = load i8*, i8** %26
%49 = call i32 @invarg(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %48)
br label %50
50: ; preds = %47, %42
%51 = load float, float* %7
%52 = fmul float %51, 1.000000e+03
%53 = fptosi float %52 to i32
store i32 %53, i32* %22
br label %193
54: ; preds = %38
%55 = load i8*, i8** %26
%56 = call i64 @matches(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %66
58: ; preds = %54
%59 = call i32 (...) @NEXT_ARG()
%60 = load i8*, i8** %26
%61 = call i64 @get_u32(i32* %20, i8* %60, i32 0)
%62 = icmp eq i64 %61, 0
br i1 %62, label %193, label %63
63: ; preds = %58
%64 = load i8*, i8** %26
%65 = call i32 @invarg(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* %64)
br label %193
66: ; preds = %54
%67 = load i8*, i8** %26
%68 = call i64 @matches(i8* %67, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %78
70: ; preds = %66
%71 = call i32 (...) @NEXT_ARG()
%72 = load i8*, i8** %26
%73 = call i64 @get_u32(i32* %19, i8* %72, i32 0)
%74 = icmp eq i64 %73, 0
br i1 %74, label %193, label %75
75: ; preds = %70
%76 = load i8*, i8** %26
%77 = call i32 @invarg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %76)
br label %193
78: ; preds = %66
%79 = load i8*, i8** %26
%80 = call i64 @matches(i8* %79, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %90
82: ; preds = %78
%83 = call i32 (...) @NEXT_ARG()
%84 = load i8*, i8** %26
%85 = call i64 @get_u32(i32* %18, i8* %84, i32 0)
%86 = icmp eq i64 %85, 0
br i1 %86, label %193, label %87
87: ; preds = %82
%88 = load i8*, i8** %26
%89 = call i32 @invarg(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i8* %88)
br label %193
90: ; preds = %78
%91 = load i8*, i8** %26
%92 = call i64 @matches(i8* %91, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%93 = icmp eq i64 %92, 0
br i1 %93, label %94, label %102
94: ; preds = %90
%95 = call i32 (...) @NEXT_ARG()
%96 = load i8*, i8** %26
%97 = call i64 @get_u32(i32* %17, i8* %96, i32 0)
%98 = icmp eq i64 %97, 0
br i1 %98, label %193, label %99
99: ; preds = %94
%100 = load i8*, i8** %26
%101 = call i32 @invarg(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0), i8* %100)
br label %193
102: ; preds = %90
%103 = load i8*, i8** %26
%104 = call i64 @matches(i8* %103, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%105 = icmp eq i64 %104, 0
br i1 %105, label %106, label %114
106: ; preds = %102
%107 = call i32 (...) @NEXT_ARG()
%108 = load i8*, i8** %26
%109 = call i64 @get_u32(i32* %16, i8* %108, i32 0)
%110 = icmp eq i64 %109, 0
br i1 %110, label %193, label %111
111: ; preds = %106
%112 = load i8*, i8** %26
%113 = call i32 @invarg(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), i8* %112)
br label %193
114: ; preds = %102
%115 = load i8*, i8** %26
%116 = call i64 @matches(i8* %115, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
%117 = icmp eq i64 %116, 0
br i1 %117, label %118, label %123
118: ; preds = %114
%119 = call i32 (...) @NEXT_ARG()
%120 = load i8*, i8** %26
%121 = load i32, i32* @CAN_CTRLMODE_LOOPBACK
%122 = call i32 @set_ctrlmode(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8* %120, %struct.can_ctrlmode* %6, i32 %121)
br label %193
123: ; preds = %114
%124 = load i8*, i8** %26
%125 = call i64 @matches(i8* %124, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0))
%126 = icmp eq i64 %125, 0
br i1 %126, label %127, label %132
127: ; preds = %123
%128 = call i32 (...) @NEXT_ARG()
%129 = load i8*, i8** %26
%130 = load i32, i32* @CAN_CTRLMODE_LISTENONLY
%131 = call i32 @set_ctrlmode(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i8* %129, %struct.can_ctrlmode* %6, i32 %130)
br label %193
132: ; preds = %123
%133 = load i8*, i8** %26
%134 = call i64 @matches(i8* %133, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0))
%135 = icmp eq i64 %134, 0
br i1 %135, label %136, label %141
136: ; preds = %132
%137 = call i32 (...) @NEXT_ARG()
%138 = load i8*, i8** %26
%139 = load i32, i32* @CAN_CTRLMODE_3_SAMPLES
%140 = call i32 @set_ctrlmode(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i8* %138, %struct.can_ctrlmode* %6, i32 %139)
br label %193
141: ; preds = %132
%142 = load i8*, i8** %26
%143 = call i64 @matches(i8* %142, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
%144 = icmp eq i64 %143, 0
br i1 %144, label %145, label %150
145: ; preds = %141
%146 = call i32 (...) @NEXT_ARG()
%147 = load i8*, i8** %26
%148 = load i32, i32* @CAN_CTRLMODE_ONE_SHOT
%149 = call i32 @set_ctrlmode(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i8* %147, %struct.can_ctrlmode* %6, i32 %148)
br label %193
150: ; preds = %141
%151 = load i8*, i8** %26
%152 = call i64 @matches(i8* %151, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0))
%153 = icmp eq i64 %152, 0
br i1 %153, label %154, label %159
154: ; preds = %150
%155 = call i32 (...) @NEXT_ARG()
%156 = load i8*, i8** %26
%157 = load i32, i32* @CAN_CTRLMODE_BERR_REPORTING
%158 = call i32 @set_ctrlmode(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0), i8* %156, %struct.can_ctrlmode* %6, i32 %157)
br label %193
159: ; preds = %150
%160 = load i8*, i8** %26
%161 = call i64 @matches(i8* %160, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
%162 = icmp eq i64 %161, 0
br i1 %162, label %163, label %166
163: ; preds = %159
%164 = load i32, i32* @IFLA_CAN_RESTART
%165 = call i32 @addattr32(%struct.nlmsghdr* %3, i32 1024, i32 %164, i32 1)
br label %193
166: ; preds = %159
%167 = load i8*, i8** %26
%168 = call i64 @matches(i8* %167, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
%169 = icmp eq i64 %168, 0
br i1 %169, label %170, label %182
170: ; preds = %166
%171 = call i32 (...) @NEXT_ARG()
%172 = load i8*, i8** %26
%173 = call i64 @get_u32(i32* %8, i8* %172, i32 0)
%174 = icmp eq i64 %173, 0
br i1 %174, label %178, label %175
175: ; preds = %170
%176 = load i8*, i8** %26
%177 = call i32 @invarg(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.21, i64 0, i64 0), i8* %176)
br label %178
178: ; preds = %175, %170
%179 = load i32, i32* @IFLA_CAN_RESTART_MS
%180 = load i32, i32* %8
%181 = call i32 @addattr32(%struct.nlmsghdr* %3, i32 1024, i32 %179, i32 %180)
br label %193
182: ; preds = %166
%183 = load i8*, i8** %26
%184 = call i64 @matches(i8* %183, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0))
%185 = icmp eq i64 %184, 0
br i1 %185, label %186, label %188
186: ; preds = %182
%187 = call i32 (...) @usage()
br label %215
188: ; preds = %182
%189 = load i32, i32* @stderr
%190 = load i8*, i8** %26
%191 = call i32 @fprintf(i32 %189, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.23, i64 0, i64 0), i8* %190)
%192 = call i32 (...) @usage()
br label %215
193: ; preds = %50, %75, %70, %99, %94, %118, %136, %154, %178, %163, %145, %127, %106, %111, %82, %87, %58, %63, %30, %35
%194 = add nsw i32 %25, -1
%195 = getelementptr inbounds i8*, i8** %26, i64 1
%196 = icmp sgt i32 %25, 1
br i1 %196, label %24, label %197
197: ; preds = %193, %4
%198 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %5, i64 0, i32 0
%199 = load i32, i32* %198
%200 = icmp ne i32 %199, 0
%201 = getelementptr inbounds %struct.can_bittiming, %struct.can_bittiming* %5, i64 0, i32 2
%202 = load i32, i32* %201
%203 = icmp ne i32 %202, 0
%204 = select i1 %200, i1 true, i1 %203
br i1 %204, label %205, label %208
205: ; preds = %197
%206 = load i32, i32* @IFLA_CAN_BITTIMING
%207 = call i32 @addattr_l(%struct.nlmsghdr* %3, i32 1024, i32 %206, %struct.can_ctrlmode* %11, i32 48)
br label %208
208: ; preds = %197, %205
%209 = getelementptr inbounds %struct.can_ctrlmode, %struct.can_ctrlmode* %6, i64 0, i32 7
%210 = load i64, i64* %209
%211 = icmp eq i64 %210, 0
br i1 %211, label %215, label %212
212: ; preds = %208
%213 = load i32, i32* @IFLA_CAN_CTRLMODE
%214 = call i32 @addattr_l(%struct.nlmsghdr* %3, i32 1024, i32 %213, %struct.can_ctrlmode* %6, i32 48)
br label %215
215: ; preds = %208, %212, %188, %186
%216 = phi i32 [ -1, %186 ], [ -1, %188 ], [ 0, %212 ], [ 0, %208 ]
ret i32 %216
}