#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 sockaddr_can {
  int can_ifindex;
  int /*<<< orphan*/ can_family;
};
struct sockaddr {
  int dummy;
};
struct ifreq {
  int ifr_ifindex;
  int /*<<< orphan*/ ifr_name;
};
struct can_frame {
  int can_id;
  int can_dlc;
  int *data;
};
struct can_filter {
  int can_id;
  int can_mask;
};
typedef int /*<<< orphan*/ rfilter;
typedef int /*<<< orphan*/ recv_own_msgs;
typedef int /*<<< orphan*/ loopback;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int /*<<< orphan*/ AF_CAN;
int CAN_EFF_FLAG;
int CAN_EFF_MASK;
int /*<<< orphan*/ CAN_RAW;
int /*<<< orphan*/ CAN_RAW_FILTER;
int /*<<< orphan*/ CAN_RAW_LOOPBACK;
int /*<<< orphan*/ CAN_RAW_RECV_OWN_MSGS;
int CAN_RTR_FLAG;
int CAN_SFF_MASK;
int /*<<< orphan*/ PF_CAN;
int /*<<< orphan*/ SIOCGIFINDEX;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ SOL_CAN_RAW;
int atoi(char *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getopt(int, char **, char *);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, struct ifreq *);
char *optarg;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, struct can_frame *, int);
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, ...);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char *);
int write(int, struct can_frame *, int);
int main(int argc, char **argv) {
  int s;
  struct sockaddr_can addr;
  struct can_filter rfilter[4];
  struct can_frame frame;
  int nbytes, i;
  struct ifreq ifr;
  char *ifname = "vcan2";
  int ifindex;
  int opt;
  int loopback = 0;
  int set_loopback = 0;
  int recv_own_msgs = 0;
  int set_recv_own_msgs = 0;
  int send_one_frame = 0;
  int ignore_errors = 0;
  while ((opt = getopt(argc, argv, "i:l:r:se")) != -1) {
    switch (opt) {
    case 'i':
      ifname = optarg;
      break;
    case 'l':
      loopback = atoi(optarg);
      set_loopback = 1;
      break;
    case 'r':
      recv_own_msgs = atoi(optarg);
      set_recv_own_msgs = 1;
      break;
    case 's':
      send_one_frame = 1;
      break;
    case 'e':
      ignore_errors = 1;
      break;
    default:
      fprintf(stderr, "Unknown option %c\n", opt);
      break;
    }
  }
  if ((s = socket(PF_CAN, SOCK_RAW, CAN_RAW)) < 0) {
    perror("socket");
    return 1;
  }
  rfilter[0].can_id = 0x123;
  rfilter[0].can_mask = CAN_SFF_MASK;
  rfilter[1].can_id = 0x200;
  rfilter[1].can_mask = 0x700;
  rfilter[2].can_id = 0x80123456;
  rfilter[2].can_mask = 0x1FFFF000;
  rfilter[3].can_id = 0x80333333;
  rfilter[3].can_mask = CAN_EFF_MASK;
  setsockopt(s, SOL_CAN_RAW, CAN_RAW_FILTER, &rfilter, sizeof(rfilter));
  if (set_loopback)
    setsockopt(s, SOL_CAN_RAW, CAN_RAW_LOOPBACK, &loopback, sizeof(loopback));
  if (set_recv_own_msgs)
    setsockopt(s, SOL_CAN_RAW, CAN_RAW_RECV_OWN_MSGS, &recv_own_msgs,
               sizeof(recv_own_msgs));
  strcpy(ifr.ifr_name, ifname);
  ioctl(s, SIOCGIFINDEX, &ifr);
  ifindex = ifr.ifr_ifindex;
  addr.can_family = AF_CAN;
  addr.can_ifindex = ifindex;
  if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
    perror("bind");
    return 1;
  }
  if (send_one_frame) {
    frame.can_id = 0x123;
    frame.can_dlc = 2;
    frame.data[0] = 0x11;
    frame.data[1] = 0x22;
    nbytes = write(s, &frame, sizeof(struct can_frame));
  }
  while (1) {
    if ((nbytes = read(s, &frame, sizeof(struct can_frame))) < 0) {
      perror("read");
      if (!ignore_errors)
        return 1;
    } else if (nbytes < sizeof(struct can_frame)) {
      fprintf(stderr, "read: incomplete CAN frame\n");
      return 1;
    } else {
      if (frame.can_id & CAN_EFF_FLAG)
        printf("%8X  ", frame.can_id & CAN_EFF_MASK);
      else
        printf("%3X  ", frame.can_id & CAN_SFF_MASK);
      printf("[%d] ", frame.can_dlc);
      for (i = 0; i < frame.can_dlc; i++) {
        printf("%02X ", frame.data[i]);
      }
      if (frame.can_id & CAN_RTR_FLAG)
        printf("remote request");
      printf("\n");
      fflush(stdout);
    }
  }
  close(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe4c(%rip),%rax
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0x84(%rbp)
movl   $0x0,-0x88(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe10(%rip),%rdx
call   10d0 <getopt@plt>
mov    %eax,-0x70(%rbp)
cmp    $0xffffffff,%eax
je     12fe <main+0x12e>
mov    -0x70(%rbp),%eax
add    $0xffffff9b,%eax
mov    %eax,%ecx
mov    %rcx,-0x90(%rbp)
sub    $0xe,%eax
ja     12df <main+0x10f>
mov    -0x90(%rbp),%rax
lea    0xd97(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2d7f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x68(%rbp)
jmp    12f9 <main+0x129>
mov    0x2d6c(%rip),%rax
mov    (%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x74(%rbp)
movl   $0x1,-0x78(%rbp)
jmp    12f9 <main+0x129>
mov    0x2d4e(%rip),%rax
mov    (%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x7c(%rbp)
movl   $0x1,-0x80(%rbp)
jmp    12f9 <main+0x129>
movl   $0x1,-0x84(%rbp)
jmp    12f9 <main+0x129>
movl   $0x1,-0x88(%rbp)
jmp    12f9 <main+0x129>
mov    0x2cca(%rip),%rax
mov    (%rax),%edi
mov    -0x70(%rbp),%edx
lea    0xd59(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1224 <main+0x54>
mov    0x2c83(%rip),%rax
mov    (%rax),%edi
mov    0x2cc2(%rip),%rax
mov    (%rax),%esi
mov    0x2c69(%rip),%rax
mov    (%rax),%edx
call   10f0 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1342 <main+0x172>
lea    0xd2d(%rip),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1619 <main+0x449>
movl   $0x123,-0x40(%rbp)
mov    0x2c18(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
movl   $0x200,-0x38(%rbp)
movl   $0x700,-0x34(%rbp)
movl   $0x80123456,-0x30(%rbp)
movl   $0x1ffff000,-0x2c(%rbp)
movl   $0x80333333,-0x28(%rbp)
mov    0x2c59(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2c32(%rip),%rax
mov    (%rax),%esi
mov    0x2c11(%rip),%rax
mov    (%rax),%edx
lea    -0x40(%rbp),%rcx
mov    $0x20,%r8d
mov    $0x0,%al
call   1040 <setsockopt@plt>
cmpl   $0x0,-0x78(%rbp)
je     13da <main+0x20a>
mov    -0x14(%rbp),%edi
mov    0x2c02(%rip),%rax
mov    (%rax),%esi
mov    0x2ba9(%rip),%rax
mov    (%rax),%edx
lea    -0x74(%rbp),%rcx
mov    $0x4,%r8d
mov    $0x0,%al
call   1040 <setsockopt@plt>
cmpl   $0x0,-0x80(%rbp)
je     140a <main+0x23a>
mov    -0x14(%rbp),%edi
mov    0x2bd2(%rip),%rax
mov    (%rax),%esi
mov    0x2bd1(%rip),%rax
mov    (%rax),%edx
lea    -0x7c(%rbp),%rcx
mov    $0x4,%r8d
mov    $0x0,%al
call   1040 <setsockopt@plt>
mov    -0x5c(%rbp),%edi
mov    -0x68(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%edi
mov    0x2b40(%rip),%rax
mov    (%rax),%esi
lea    -0x60(%rbp),%rdx
call   1070 <ioctl@plt>
mov    -0x60(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    0x2bb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   10b0 <bind@plt>
cmp    $0x0,%rax
jge    1476 <main+0x2a6>
lea    0xc00(%rip),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1619 <main+0x449>
cmpl   $0x0,-0x84(%rbp)
je     14ba <main+0x2ea>
movl   $0x123,-0x50(%rbp)
movl   $0x2,-0x4c(%rbp)
mov    -0x48(%rbp),%rax
movl   $0x11,(%rax)
mov    -0x48(%rbp),%rax
movl   $0x22,0x4(%rax)
mov    -0x14(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    $0x10,%edx
call   1050 <write@plt>
mov    %eax,-0x54(%rbp)
jmp    14bf <main+0x2ef>
mov    -0x14(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    $0x10,%edx
call   1080 <read@plt>
mov    %eax,-0x54(%rbp)
cmp    $0x0,%eax
jge    1506 <main+0x336>
lea    0xb87(%rip),%rdi
call   10c0 <perror@plt>
cmpl   $0x0,-0x88(%rbp)
jne    1501 <main+0x331>
movl   $0x1,-0x4(%rbp)
jmp    1619 <main+0x449>
jmp    1614 <main+0x444>
movslq -0x54(%rbp),%rax
cmp    $0x10,%rax
jae    1537 <main+0x367>
mov    0x2a95(%rip),%rax
mov    (%rax),%edi
lea    0xb4b(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1619 <main+0x449>
mov    -0x50(%rbp),%eax
mov    0x2a5f(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     156b <main+0x39b>
mov    -0x50(%rbp),%esi
mov    0x2a82(%rip),%rax
and    (%rax),%esi
lea    0xb2c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1585 <main+0x3b5>
mov    -0x50(%rbp),%esi
mov    0x29f3(%rip),%rax
and    (%rax),%esi
lea    0xb13(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4c(%rbp),%esi
lea    0xb08(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    15d0 <main+0x400>
mov    -0x48(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xae2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    159d <main+0x3cd>
mov    -0x50(%rbp),%eax
mov    0x29be(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     15f3 <main+0x423>
lea    0xab7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xa62(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2988(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
jmp    1614 <main+0x444>
jmp    14bf <main+0x2ef>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
mov    $0x1,%al
mov    %eax,0xc(%rsp)
lea    0xe5c(%rip),%rax
mov    %rax,0x28(%rsp)
lea    0xe56(%rip),%r15
mov    0x2dad(%rip),%r13
lea    0xe51(%rip),%r12
lea    0xdff(%rip),%r14
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x1c(%rsp)
movl   $0x0,0x18(%rsp)
jmp    1259 <main+0x89>
nopl   0x0(%rax,%rax,1)
cmp    $0xffffffff,%eax
je     12d6 <main+0x106>
mov    0x0(%r13),%edi
mov    %r12,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
call   10d0 <getopt@plt>
lea    -0x65(%rax),%ecx
cmp    $0xe,%ecx
ja     1240 <main+0x70>
movslq (%r14,%rcx,4),%rcx
add    %r14,%rcx
jmp    *%rcx
movl   $0x1,0x18(%rsp)
jmp    1259 <main+0x89>
mov    0x2d70(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x28(%rsp)
jmp    1259 <main+0x89>
mov    0x2d5f(%rip),%rax
mov    (%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,0x8(%rsp)
movl   $0x0,0xc(%rsp)
jmp    1259 <main+0x89>
mov    0x2d42(%rip),%rax
mov    (%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,0x14(%rsp)
movl   $0x1,0x10(%rsp)
jmp    1259 <main+0x89>
movl   $0x1,0x1c(%rsp)
jmp    1259 <main+0x89>
mov    0x14(%rsp),%eax
mov    %eax,0x20(%rsp)
mov    0x8(%rsp),%eax
mov    %eax,0x24(%rsp)
mov    0x2c9b(%rip),%rax
mov    (%rax),%edi
mov    0x2cda(%rip),%rax
mov    (%rax),%esi
mov    0x2c81(%rip),%rax
mov    (%rax),%edx
call   10f0 <socket@plt>
test   %eax,%eax
js     1549 <main+0x379>
mov    %eax,%ebp
movl   $0x123,0x50(%rsp)
mov    0x2c49(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x54(%rsp)
movaps 0xcd4(%rip),%xmm0
movups %xmm0,0x58(%rsp)
movl   $0x80333333,0x68(%rsp)
80
mov    0x2c98(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x6c(%rsp)
mov    0x2c73(%rip),%rbx
mov    (%rbx),%esi
mov    0x2c52(%rip),%rax
mov    (%rax),%edx
lea    0x50(%rsp),%rcx
mov    $0x20,%r8d
mov    %ebp,%edi
xor    %eax,%eax
call   1050 <setsockopt@plt>
testb  $0x1,0xc(%rsp)
jne    1392 <main+0x1c2>
mov    (%rbx),%esi
mov    0x2bf4(%rip),%rax
mov    (%rax),%edx
lea    0x24(%rsp),%rcx
mov    $0x4,%r8d
mov    %ebp,%edi
xor    %eax,%eax
call   1050 <setsockopt@plt>
cmpl   $0x0,0x10(%rsp)
je     13b8 <main+0x1e8>
mov    (%rbx),%esi
mov    0x2c26(%rip),%rax
mov    (%rax),%edx
lea    0x20(%rsp),%rcx
mov    $0x4,%r8d
mov    %ebp,%edi
xor    %eax,%eax
call   1050 <setsockopt@plt>
mov    0x28(%rsp),%rsi
call   1040 <strcpy@plt>
mov    0x2b97(%rip),%rax
mov    (%rax),%esi
lea    0x38(%rsp),%rdx
mov    %ebp,%edi
call   1070 <ioctl@plt>
mov    0x38(%rsp),%eax
mov    0x2c06(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,0x34(%rsp)
mov    %eax,0x30(%rsp)
lea    0x30(%rsp),%rsi
mov    %ebp,%edi
mov    $0x8,%edx
call   10b0 <bind@plt>
test   %rax,%rax
js     1557 <main+0x387>
lea    0xca0(%rip),%rbx
mov    %ebp,0x8(%rsp)
jmp    143f <main+0x26f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2b5f(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
mov    %rbp,%r13
mov    0x8(%rsp),%ebp
mov    %ebp,%edi
lea    0x40(%rsp),%rsi
mov    $0x10,%edx
call   1080 <read@plt>
test   %eax,%eax
js     150a <main+0x33a>
cmp    $0xf,%eax
jbe    1523 <main+0x353>
mov    %r13,%rbp
mov    0x40(%rsp),%r13d
mov    0x2b30(%rip),%rax
mov    (%rax),%eax
and    %r13d,%eax
lea    0xc1f(%rip),%rdi
lea    0xc1e(%rip),%rax
cmove  %rax,%rdi
mov    0x2b4a(%rip),%rax
cmove  0x2ad2(%rip),%rax
mov    (%rax),%esi
and    %r13d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x44(%rsp),%r14d
lea    0xbf9(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
test   %r14d,%r14d
jle    14e7 <main+0x317>
mov    0x48(%rsp),%r15
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%r12,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%r12
cmp    %r12,%r14
jne    14d0 <main+0x300>
mov    0x2aaa(%rip),%rax
test   %r13d,(%rax)
je     1420 <main+0x250>
lea    0xbb5(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1420 <main+0x250>
lea    0xb69(%rip),%rdi
call   10c0 <perror@plt>
cmpl   $0x0,0x18(%rsp)
jne    143f <main+0x26f>
jmp    1535 <main+0x365>
mov    0x0(%r13),%edi
lea    0xb51(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xb1e(%rip),%rdi
call   10c0 <perror@plt>
jmp    1535 <main+0x365>
lea    0xb17(%rip),%rdi
call   10c0 <perror@plt>
jmp    1535 <main+0x365>

LLVM IR (-O0):
%struct.sockaddr_can = type { i32, i32 }
%struct.can_filter = type { i32, i32 }
%struct.can_frame = type { i32, i32, i32* }
%struct.ifreq = type { i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [6 x i8] c"vcan2\00"
@.str.1 = [9 x i8] c"i:l:r:se\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.2 = [19 x i8] c"Unknown option %c\0A\00"
@PF_CAN = global i32 0
@SOCK_RAW = global i32 0
@CAN_RAW = global i32 0
@.str.3 = [7 x i8] c"socket\00"
@CAN_SFF_MASK = global i32 0
@CAN_EFF_MASK = global i32 0
@SOL_CAN_RAW = global i32 0
@CAN_RAW_FILTER = global i32 0
@CAN_RAW_LOOPBACK = global i32 0
@CAN_RAW_RECV_OWN_MSGS = global i32 0
@SIOCGIFINDEX = global i32 0
@AF_CAN = global i32 0
@.str.4 = [5 x i8] c"bind\00"
@.str.5 = [5 x i8] c"read\00"
@.str.6 = [28 x i8] c"read: incomplete CAN frame\0A\00"
@CAN_EFF_FLAG = global i32 0
@.str.7 = [6 x i8] c"%8X \00"
@.str.8 = [6 x i8] c"%3X \00"
@.str.9 = [6 x i8] c"[%d] \00"
@.str.10 = [6 x i8] c"%02X \00"
@CAN_RTR_FLAG = global i32 0
@.str.11 = [15 x i8] c"remote request\00"
@.str.12 = [2 x i8] c"\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.sockaddr_can
%8 = alloca [4 x %struct.can_filter]
%9 = alloca %struct.can_frame
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.ifreq
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %13
store i32 0, i32* %16
store i32 0, i32* %17
store i32 0, i32* %18
store i32 0, i32* %19
store i32 0, i32* %20
store i32 0, i32* %21
br label %22
22: ; preds = %43, %2
%23 = load i32, i32* %4
%24 = load i8**, i8*** %5
%25 = call i32 @getopt(i32 %23, i8** %24, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i32 %25, i32* %15
%26 = icmp ne i32 %25, -1
br i1 %26, label %27, label %44
27: ; preds = %22
%28 = load i32, i32* %15
switch i32 %28, label %39 [
i32 105, label %29
i32 108, label %31
i32 114, label %34
i32 115, label %37
i32 101, label %38
]
29: ; preds = %27
%30 = load i8*, i8** @optarg
store i8* %30, i8** %13
br label %43
31: ; preds = %27
%32 = load i8*, i8** @optarg
%33 = call i32 @atoi(i8* %32)
store i32 %33, i32* %16
store i32 1, i32* %17
br label %43
34: ; preds = %27
%35 = load i8*, i8** @optarg
%36 = call i32 @atoi(i8* %35)
store i32 %36, i32* %18
store i32 1, i32* %19
br label %43
37: ; preds = %27
store i32 1, i32* %20
br label %43
38: ; preds = %27
store i32 1, i32* %21
br label %43
39: ; preds = %27
%40 = load i32, i32* @stderr
%41 = load i32, i32* %15
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %39, %38, %37, %34, %31, %29
br label %22
44: ; preds = %22
%45 = load i32, i32* @PF_CAN
%46 = load i32, i32* @SOCK_RAW
%47 = load i32, i32* @CAN_RAW
%48 = call i32 @socket(i32 %45, i32 %46, i32 %47)
store i32 %48, i32* %6
%49 = icmp slt i32 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %44
%51 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %194
52: ; preds = %44
%53 = getelementptr inbounds [4 x %struct.can_filter], [4 x %struct.can_filter]* %8, i64 0, i64 0
%54 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %53, i32 0, i32 0
store i32 291, i32* %54
%55 = load i32, i32* @CAN_SFF_MASK
%56 = getelementptr inbounds [4 x %struct.can_filter], [4 x %struct.can_filter]* %8, i64 0, i64 0
%57 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %56, i32 0, i32 1
store i32 %55, i32* %57
%58 = getelementptr inbounds [4 x %struct.can_filter], [4 x %struct.can_filter]* %8, i64 0, i64 1
%59 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %58, i32 0, i32 0
store i32 512, i32* %59
%60 = getelementptr inbounds [4 x %struct.can_filter], [4 x %struct.can_filter]* %8, i64 0, i64 1
%61 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %60, i32 0, i32 1
store i32 1792, i32* %61
%62 = getelementptr inbounds [4 x %struct.can_filter], [4 x %struct.can_filter]* %8, i64 0, i64 2
%63 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %62, i32 0, i32 0
store i32 -2146290602, i32* %63
%64 = getelementptr inbounds [4 x %struct.can_filter], [4 x %struct.can_filter]* %8, i64 0, i64 2
%65 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %64, i32 0, i32 1
store i32 536866816, i32* %65
%66 = getelementptr inbounds [4 x %struct.can_filter], [4 x %struct.can_filter]* %8, i64 0, i64 3
%67 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %66, i32 0, i32 0
store i32 -2144128205, i32* %67
%68 = load i32, i32* @CAN_EFF_MASK
%69 = getelementptr inbounds [4 x %struct.can_filter], [4 x %struct.can_filter]* %8, i64 0, i64 3
%70 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %69, i32 0, i32 1
store i32 %68, i32* %70
%71 = load i32, i32* %6
%72 = load i32, i32* @SOL_CAN_RAW
%73 = load i32, i32* @CAN_RAW_FILTER
%74 = call i32 (i32, i32, i32, ...) @setsockopt(i32 %71, i32 %72, i32 %73, [4 x %struct.can_filter]* %8, i64 32)
%75 = load i32, i32* %17
%76 = icmp ne i32 %75, 0
br i1 %76, label %77, label %82
77: ; preds = %52
%78 = load i32, i32* %6
%79 = load i32, i32* @SOL_CAN_RAW
%80 = load i32, i32* @CAN_RAW_LOOPBACK
%81 = call i32 (i32, i32, i32, ...) @setsockopt(i32 %78, i32 %79, i32 %80, i32* %16, i64 4)
br label %82
82: ; preds = %77, %52
%83 = load i32, i32* %19
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %90
85: ; preds = %82
%86 = load i32, i32* %6
%87 = load i32, i32* @SOL_CAN_RAW
%88 = load i32, i32* @CAN_RAW_RECV_OWN_MSGS
%89 = call i32 (i32, i32, i32, ...) @setsockopt(i32 %86, i32 %87, i32 %88, i32* %18, i64 4)
br label %90
90: ; preds = %85, %82
%91 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %12, i32 0, i32 1
%92 = load i32, i32* %91
%93 = load i8*, i8** %13
%94 = call i32 @strcpy(i32 %92, i8* %93)
%95 = load i32, i32* %6
%96 = load i32, i32* @SIOCGIFINDEX
%97 = call i32 @ioctl(i32 %95, i32 %96, %struct.ifreq* %12)
%98 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %12, i32 0, i32 0
%99 = load i32, i32* %98
store i32 %99, i32* %14
%100 = load i32, i32* @AF_CAN
%101 = getelementptr inbounds %struct.sockaddr_can, %struct.sockaddr_can* %7, i32 0, i32 1
store i32 %100, i32* %101
%102 = load i32, i32* %14
%103 = getelementptr inbounds %struct.sockaddr_can, %struct.sockaddr_can* %7, i32 0, i32 0
store i32 %102, i32* %103
%104 = load i32, i32* %6
%105 = bitcast %struct.sockaddr_can* %7 to %struct.sockaddr*
%106 = call i64 @bind(i32 %104, %struct.sockaddr* %105, i32 8)
%107 = icmp slt i64 %106, 0
br i1 %107, label %108, label %110
108: ; preds = %90
%109 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %194
110: ; preds = %90
%111 = load i32, i32* %20
%112 = icmp ne i32 %111, 0
br i1 %112, label %113, label %124
113: ; preds = %110
%114 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %9, i32 0, i32 0
store i32 291, i32* %114
%115 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %9, i32 0, i32 1
store i32 2, i32* %115
%116 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %9, i32 0, i32 2
%117 = load i32*, i32** %116
%118 = getelementptr inbounds i32, i32* %117, i64 0
store i32 17, i32* %118
%119 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %9, i32 0, i32 2
%120 = load i32*, i32** %119
%121 = getelementptr inbounds i32, i32* %120, i64 1
store i32 34, i32* %121
%122 = load i32, i32* %6
%123 = call i32 @write(i32 %122, %struct.can_frame* %9, i32 16)
store i32 %123, i32* %10
br label %124
124: ; preds = %113, %110
br label %125
125: ; preds = %124, %193
%126 = load i32, i32* %6
%127 = call i32 @read(i32 %126, %struct.can_frame* %9, i32 16)
store i32 %127, i32* %10
%128 = icmp slt i32 %127, 0
br i1 %128, label %129, label %135
129: ; preds = %125
%130 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%131 = load i32, i32* %21
%132 = icmp ne i32 %131, 0
br i1 %132, label %134, label %133
133: ; preds = %129
store i32 1, i32* %3
br label %194
134: ; preds = %129
br label %193
135: ; preds = %125
%136 = load i32, i32* %10
%137 = sext i32 %136 to i64
%138 = icmp ult i64 %137, 16
br i1 %138, label %139, label %142
139: ; preds = %135
%140 = load i32, i32* @stderr
%141 = call i32 (i32, i8*, ...) @fprintf(i32 %140, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %194
142: ; preds = %135
%143 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %9, i32 0, i32 0
%144 = load i32, i32* %143
%145 = load i32, i32* @CAN_EFF_FLAG
%146 = and i32 %144, %145
%147 = icmp ne i32 %146, 0
br i1 %147, label %148, label %154
148: ; preds = %142
%149 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %9, i32 0, i32 0
%150 = load i32, i32* %149
%151 = load i32, i32* @CAN_EFF_MASK
%152 = and i32 %150, %151
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %152)
br label %160
154: ; preds = %142
%155 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %9, i32 0, i32 0
%156 = load i32, i32* %155
%157 = load i32, i32* @CAN_SFF_MASK
%158 = and i32 %156, %157
%159 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %158)
br label %160
160: ; preds = %154, %148
%161 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %9, i32 0, i32 1
%162 = load i32, i32* %161
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %162)
store i32 0, i32* %11
br label %164
164: ; preds = %177, %160
%165 = load i32, i32* %11
%166 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %9, i32 0, i32 1
%167 = load i32, i32* %166
%168 = icmp slt i32 %165, %167
br i1 %168, label %169, label %180
169: ; preds = %164
%170 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %9, i32 0, i32 2
%171 = load i32*, i32** %170
%172 = load i32, i32* %11
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i32, i32* %171, i64 %173
%175 = load i32, i32* %174
%176 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i32 %175)
br label %177
177: ; preds = %169
%178 = load i32, i32* %11
%179 = add nsw i32 %178, 1
store i32 %179, i32* %11
br label %164
180: ; preds = %164
%181 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %9, i32 0, i32 0
%182 = load i32, i32* %181
%183 = load i32, i32* @CAN_RTR_FLAG
%184 = and i32 %182, %183
%185 = icmp ne i32 %184, 0
br i1 %185, label %186, label %188
186: ; preds = %180
%187 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0))
br label %188
188: ; preds = %186, %180
%189 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%190 = load i32, i32* @stdout
%191 = call i32 @fflush(i32 %190)
br label %192
192: ; preds = %188
br label %193
193: ; preds = %192, %134
br label %125
194: ; preds = %139, %133, %108, %50
%195 = load i32, i32* %3
ret i32 %195
}

LLVM IR (-O2):
%struct.sockaddr_can = type { i32, i32 }
%struct.can_filter = type { i32, i32 }
%struct.can_frame = type { i32, i32, i32* }
%struct.ifreq = type { i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [6 x i8] c"vcan2\00"
@.str.1 = [9 x i8] c"i:l:r:se\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.2 = [19 x i8] c"Unknown option %c\0A\00"
@PF_CAN = global i32 0
@SOCK_RAW = global i32 0
@CAN_RAW = global i32 0
@.str.3 = [7 x i8] c"socket\00"
@CAN_SFF_MASK = global i32 0
@CAN_EFF_MASK = global i32 0
@SOL_CAN_RAW = global i32 0
@CAN_RAW_FILTER = global i32 0
@CAN_RAW_LOOPBACK = global i32 0
@CAN_RAW_RECV_OWN_MSGS = global i32 0
@SIOCGIFINDEX = global i32 0
@AF_CAN = global i32 0
@.str.4 = [5 x i8] c"bind\00"
@.str.5 = [5 x i8] c"read\00"
@.str.6 = [28 x i8] c"read: incomplete CAN frame\0A\00"
@CAN_EFF_FLAG = global i32 0
@.str.7 = [6 x i8] c"%8X \00"
@.str.8 = [6 x i8] c"%3X \00"
@.str.9 = [6 x i8] c"[%d] \00"
@.str.10 = [6 x i8] c"%02X \00"
@CAN_RTR_FLAG = global i32 0
@.str.11 = [15 x i8] c"remote request\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.sockaddr_can
%4 = alloca [4 x %struct.can_filter]
%5 = alloca %struct.can_frame
%6 = alloca %struct.ifreq
%7 = alloca i32
%8 = alloca i32
%9 = bitcast %struct.sockaddr_can* %3 to i8*
%10 = bitcast [4 x %struct.can_filter]* %4 to i8*
%11 = bitcast %struct.can_frame* %5 to i8*
%12 = bitcast %struct.ifreq* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = bitcast i32* %8 to i8*
br label %15
15: ; preds = %42, %2
%16 = phi i32 [ %44, %42 ], [ 0, %2 ]
%17 = phi i32 [ %24, %42 ], [ 0, %2 ]
%18 = phi i8* [ %30, %42 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %2 ]
%19 = phi i1 [ false, %42 ], [ true, %2 ]
%20 = phi i32 [ %26, %42 ], [ 0, %2 ]
%21 = phi i32 [ %34, %42 ], [ 0, %2 ]
%22 = phi i32 [ %37, %42 ], [ 0, %2 ]
br label %23
23: ; preds = %15, %45
%24 = phi i32 [ %17, %15 ], [ %47, %45 ]
%25 = phi i8* [ %18, %15 ], [ %30, %45 ]
%26 = phi i32 [ %20, %15 ], [ 1, %45 ]
%27 = phi i32 [ %21, %15 ], [ %34, %45 ]
%28 = phi i32 [ %22, %15 ], [ %37, %45 ]
br label %29
29: ; preds = %23, %40
%30 = phi i8* [ %25, %23 ], [ %41, %40 ]
%31 = phi i32 [ %27, %23 ], [ %34, %40 ]
%32 = phi i32 [ %28, %23 ], [ %37, %40 ]
br label %33
33: ; preds = %38, %29
%34 = phi i32 [ %31, %29 ], [ 1, %38 ]
%35 = phi i32 [ %32, %29 ], [ %37, %38 ]
br label %36
36: ; preds = %38, %33
%37 = phi i32 [ %35, %33 ], [ 1, %38 ]
br label %38
38: ; preds = %36, %48
%39 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
switch i32 %39, label %48 [
i32 -1, label %51
i32 105, label %40
i32 108, label %42
i32 114, label %45
i32 115, label %33
i32 101, label %36
]
40: ; preds = %38
%41 = load i8*, i8** @optarg
br label %29
42: ; preds = %38
%43 = load i8*, i8** @optarg
%44 = tail call i32 @atoi(i8* %43)
br label %15
45: ; preds = %38
%46 = load i8*, i8** @optarg
%47 = tail call i32 @atoi(i8* %46)
br label %23
48: ; preds = %38
%49 = load i32, i32* @stderr
%50 = tail call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %39)
br label %38
51: ; preds = %38
store i32 %24, i32* %8
store i32 %16, i32* %7
%52 = load i32, i32* @PF_CAN
%53 = load i32, i32* @SOCK_RAW
%54 = load i32, i32* @CAN_RAW
%55 = tail call i32 @socket(i32 %52, i32 %53, i32 %54)
%56 = icmp slt i32 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %51
%58 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %146
59: ; preds = %51
%60 = getelementptr inbounds [4 x %struct.can_filter], [4 x %struct.can_filter]* %4, i64 0, i64 0, i32 0
store i32 291, i32* %60
%61 = load i32, i32* @CAN_SFF_MASK
%62 = getelementptr inbounds [4 x %struct.can_filter], [4 x %struct.can_filter]* %4, i64 0, i64 0, i32 1
store i32 %61, i32* %62
%63 = getelementptr inbounds [4 x %struct.can_filter], [4 x %struct.can_filter]* %4, i64 0, i64 1, i32 0
%64 = bitcast i32* %63 to <4 x i32>*
store <4 x i32> <i32 512, i32 1792, i32 -2146290602, i32 536866816>, <4 x i32>* %64
%65 = getelementptr inbounds [4 x %struct.can_filter], [4 x %struct.can_filter]* %4, i64 0, i64 3, i32 0
store i32 -2144128205, i32* %65
%66 = load i32, i32* @CAN_EFF_MASK
%67 = getelementptr inbounds [4 x %struct.can_filter], [4 x %struct.can_filter]* %4, i64 0, i64 3, i32 1
store i32 %66, i32* %67
%68 = load i32, i32* @SOL_CAN_RAW
%69 = load i32, i32* @CAN_RAW_FILTER
%70 = call i32 (i32, i32, i32, ...) @setsockopt(i32 %55, i32 %68, i32 %69, [4 x %struct.can_filter]* %4, i64 32)
br i1 %19, label %75, label %71
71: ; preds = %59
%72 = load i32, i32* @SOL_CAN_RAW
%73 = load i32, i32* @CAN_RAW_LOOPBACK
%74 = call i32 (i32, i32, i32, ...) @setsockopt(i32 %55, i32 %72, i32 %73, i32* %7, i64 4)
br label %75
75: ; preds = %71, %59
%76 = icmp eq i32 %26, 0
br i1 %76, label %81, label %77
77: ; preds = %75
%78 = load i32, i32* @SOL_CAN_RAW
%79 = load i32, i32* @CAN_RAW_RECV_OWN_MSGS
%80 = call i32 (i32, i32, i32, ...) @setsockopt(i32 %55, i32 %78, i32 %79, i32* %8, i64 4)
br label %81
81: ; preds = %77, %75
%82 = call i32 @strcpy(i32 undef, i8* %30)
%83 = load i32, i32* @SIOCGIFINDEX
%84 = call i32 @ioctl(i32 %55, i32 %83, %struct.ifreq* %6)
%85 = getelementptr inbounds %struct.ifreq, %struct.ifreq* %6, i64 0, i32 0
%86 = load i32, i32* %85
%87 = load i32, i32* @AF_CAN
%88 = getelementptr inbounds %struct.sockaddr_can, %struct.sockaddr_can* %3, i64 0, i32 1
store i32 %87, i32* %88
%89 = getelementptr inbounds %struct.sockaddr_can, %struct.sockaddr_can* %3, i64 0, i32 0
store i32 %86, i32* %89
%90 = bitcast %struct.sockaddr_can* %3 to %struct.sockaddr*
%91 = call i64 @bind(i32 %55, %struct.sockaddr* %90, i32 8)
%92 = icmp slt i64 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %81
%94 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %146
95: ; preds = %81
%96 = icmp eq i32 %34, 0
%97 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i64 0, i32 0
%98 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i64 0, i32 1
%99 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i64 0, i32 2
%100 = icmp eq i32 %37, 0
br label %101
101: ; preds = %106, %95
%102 = call i32 @read(i32 %55, %struct.can_frame* %5, i32 16)
%103 = icmp slt i32 %102, 0
br i1 %103, label %104, label %107
104: ; preds = %101
%105 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br i1 %100, label %146, label %106
106: ; preds = %104, %142
br label %101
107: ; preds = %101
%108 = icmp ult i32 %102, 16
br i1 %108, label %109, label %112
109: ; preds = %107
%110 = load i32, i32* @stderr
%111 = call i32 (i32, i8*, ...) @fprintf(i32 %110, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
br label %146
112: ; preds = %107
%113 = load i32, i32* %97
%114 = load i32, i32* @CAN_EFF_FLAG
%115 = and i32 %114, %113
%116 = icmp eq i32 %115, 0
%117 = select i1 %116, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0)
%118 = load i32, i32* @CAN_SFF_MASK
%119 = load i32, i32* @CAN_EFF_MASK
%120 = select i1 %116, i32 %118, i32 %119
%121 = and i32 %120, %113
%122 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %117, i32 %121)
%123 = load i32, i32* %98
%124 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %123)
%125 = icmp sgt i32 %123, 0
br i1 %125, label %126, label %136
126: ; preds = %112
%127 = load i32*, i32** %99
%128 = zext i32 %123 to i64
br label %129
129: ; preds = %126, %129
%130 = phi i64 [ 0, %126 ], [ %134, %129 ]
%131 = getelementptr inbounds i32, i32* %127, i64 %130
%132 = load i32, i32* %131
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i32 %132)
%134 = add nuw nsw i64 %130, 1
%135 = icmp eq i64 %134, %128
br i1 %135, label %136, label %129
136: ; preds = %129, %112
%137 = load i32, i32* @CAN_RTR_FLAG
%138 = and i32 %137, %113
%139 = icmp eq i32 %138, 0
br i1 %139, label %142, label %140
140: ; preds = %136
%141 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0))
br label %142
142: ; preds = %140, %136
%143 = call i32 @putchar(i32 10)
%144 = load i32, i32* @stdout
%145 = call i32 @fflush(i32 %144)
br label %106
146: ; preds = %104, %109, %93, %57
ret i32 1
}