#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 {
  char *ifr_name;
  int ifr_ifindex;
};
struct can_frame {
  int can_id;
  int can_dlc;
  int *data;
};
struct can_filter {
  void *can_mask;
  void *can_id;
};
typedef int socklen_t;
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 CAN_RTR_FLAG;
int CAN_SFF_MASK;
int /*<<< orphan*/ PF_CAN;
int /*<<< orphan*/ SIOCGIFINDEX;
int /*<<< orphan*/ SIOCGIFNAME;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ SOL_CAN_RAW;
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int getopt(int, char **, char *);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, struct ifreq *);
char *optarg;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int recvfrom(int, struct can_frame *, int, int /*<<< orphan*/,
             struct sockaddr *, int *);
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              struct can_filter **, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strtok(char *, char *);
void *strtol(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  int s;
  struct sockaddr_can addr;
  struct can_filter rfilter[32];
  struct can_frame frame;
  int nbytes, i;
  struct ifreq ifr;
  char *ifname = "any";
  int ifindex;
  int opt;
  int nfilters = 0;
  int deflt = 0;
  while ((opt = getopt(argc, argv, "i:f:d")) != -1) {
    switch (opt) {
    case 'i':
      ifname = optarg;
      break;
    case 'd':
      deflt = 1;
      break;
    case 'f':
      if (nfilters >= 32) {
        fputs("too many filters\n", stderr);
        break;
      }
      rfilter[nfilters].can_id = strtol(strtok(optarg, ":"), NULL, 16);
      rfilter[nfilters].can_mask = strtol(strtok(NULL, ":"), NULL, 16);
      nfilters++;
      break;
    default:
      fprintf(stderr, "Unknown option %c\n", opt);
      break;
    }
  }
  if ((s = socket(PF_CAN, SOCK_RAW, CAN_RAW)) < 0) {
    perror("socket");
    return 1;
  }
  if (deflt) {
    printf("%s: using CAN_RAW socket default filter.\n", argv[0]);
  } else {
    printf("%s: setting %d CAN filter(s).\n", argv[0], nfilters);
    setsockopt(s, SOL_CAN_RAW, CAN_RAW_FILTER, &rfilter,
               sizeof(*rfilter) * nfilters);
  }
  if (strcmp(ifname, "any") == 0)
    ifindex = 0;
  else {
    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;
  }
  while (1) {
    socklen_t len = sizeof(addr);
    nbytes = recvfrom(s, &frame, sizeof(struct can_frame), 0,
                      (struct sockaddr *)&addr, &len);
    if (nbytes < 0) {
      perror("read");
      return 1;
    } else if (nbytes < sizeof(struct can_frame)) {
      fprintf(stderr, "read: incomplete CAN frame from iface %d\n",
              addr.can_ifindex);
      return 1;
    } else {
      ifr.ifr_ifindex = addr.can_ifindex;
      ioctl(s, SIOCGIFNAME, &ifr);
      printf(" %-5s ", ifr.ifr_name);
      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    $0x270,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xdf0(%rip),%rax
mov    %rax,-0x250(%rbp)
movl   $0x0,-0x25c(%rbp)
movl   $0x0,-0x260(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdcb(%rip),%rdx
call   1100 <getopt@plt>
mov    %eax,-0x258(%rbp)
cmp    $0xffffffff,%eax
je     138c <main+0x19c>
mov    -0x258(%rbp),%eax
mov    %eax,-0x268(%rbp)
sub    $0x64,%eax
je     12a5 <main+0xb5>
jmp    1267 <main+0x77>
mov    -0x268(%rbp),%eax
sub    $0x66,%eax
je     12b4 <main+0xc4>
jmp    127b <main+0x8b>
mov    -0x268(%rbp),%eax
sub    $0x69,%eax
jne    136c <main+0x17c>
jmp    128f <main+0x9f>
mov    0x2d62(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x250(%rbp)
jmp    1387 <main+0x197>
movl   $0x1,-0x260(%rbp)
jmp    1387 <main+0x197>
cmpl   $0x20,-0x25c(%rbp)
jl     12db <main+0xeb>
mov    0x2ce8(%rip),%rax
mov    (%rax),%esi
lea    0xd39(%rip),%rdi
call   1060 <fputs@plt>
jmp    1387 <main+0x197>
mov    0x2d16(%rip),%rax
mov    (%rax),%rdi
lea    0xd30(%rip),%rsi
call   10f0 <strtok@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   10a0 <strtol@plt>
mov    %rax,%rcx
movslq -0x25c(%rbp),%rdx
lea    -0x220(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %rcx,0x8(%rax)
xor    %eax,%eax
mov    %eax,%edi
lea    0xcf4(%rip),%rsi
call   10f0 <strtok@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   10a0 <strtol@plt>
mov    %rax,%rcx
movslq -0x25c(%rbp),%rdx
lea    -0x220(%rbp),%rax
shl    $0x4,%rdx
add    %rdx,%rax
mov    %rcx,(%rax)
mov    -0x25c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x25c(%rbp)
jmp    1387 <main+0x197>
mov    0x2c3d(%rip),%rax
mov    (%rax),%edi
mov    -0x258(%rbp),%edx
lea    0xc9c(%rip),%rsi
call   1090 <fprintf@plt>
jmp    122b <main+0x3b>
mov    0x2bf5(%rip),%rax
mov    (%rax),%edi
mov    0x2c34(%rip),%rax
mov    (%rax),%esi
mov    0x2bdb(%rip),%rax
mov    (%rax),%edx
call   1110 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    13d0 <main+0x1e0>
lea    0xc72(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    16b8 <main+0x4c8>
cmpl   $0x0,-0x260(%rbp)
je     13f7 <main+0x207>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xc4d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1441 <main+0x251>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x25c(%rbp),%edx
lea    0xc57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    0x2bac(%rip),%rax
mov    (%rax),%esi
mov    0x2b83(%rip),%rax
mov    (%rax),%edx
lea    -0x220(%rbp),%rcx
movslq -0x25c(%rbp),%rax
shl    $0x4,%rax
mov    %eax,%r8d
call   1040 <setsockopt@plt>
mov    -0x250(%rbp),%rdi
lea    0xbb1(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    146d <main+0x27d>
movl   $0x0,-0x254(%rbp)
jmp    14a4 <main+0x2b4>
mov    -0x248(%rbp),%rdi
mov    -0x250(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%edi
mov    0x2ade(%rip),%rax
mov    (%rax),%esi
lea    -0x248(%rbp),%rdx
call   1070 <ioctl@plt>
mov    -0x240(%rbp),%eax
mov    %eax,-0x254(%rbp)
mov    0x2b3d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x254(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   10d0 <bind@plt>
cmp    $0x0,%rax
jge    14ec <main+0x2fc>
lea    0xba6(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    16b8 <main+0x4c8>
jmp    14f1 <main+0x301>
movl   $0x8,-0x264(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x20(%rbp),%r8
lea    -0x230(%rbp),%rsi
mov    $0x10,%edx
xor    %ecx,%ecx
lea    -0x264(%rbp),%r9
call   10c0 <recvfrom@plt>
mov    %eax,-0x234(%rbp)
cmpl   $0x0,-0x234(%rbp)
jge    1547 <main+0x357>
lea    0xb50(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    16b8 <main+0x4c8>
movslq -0x234(%rbp),%rax
cmp    $0x10,%rax
jae    157c <main+0x38c>
mov    0x2a51(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%edx
lea    0xb20(%rip),%rsi
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    16b8 <main+0x4c8>
mov    -0x20(%rbp),%eax
mov    %eax,-0x240(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2a29(%rip),%rax
mov    (%rax),%esi
lea    -0x248(%rbp),%rdx
call   1070 <ioctl@plt>
mov    -0x248(%rbp),%rsi
lea    0xb0a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x230(%rbp),%eax
mov    0x29e1(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     15ec <main+0x3fc>
mov    -0x230(%rbp),%esi
mov    0x2a01(%rip),%rax
and    (%rax),%esi
lea    0xadc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1609 <main+0x419>
mov    -0x230(%rbp),%esi
mov    0x2977(%rip),%rax
and    (%rax),%esi
lea    0xac0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x22c(%rbp),%esi
lea    0xab2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x238(%rbp)
mov    -0x238(%rbp),%eax
cmp    -0x22c(%rbp),%eax
jge    166c <main+0x47c>
mov    -0x228(%rbp),%rax
movslq -0x238(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xa7d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x238(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x238(%rbp)
jmp    1627 <main+0x437>
mov    -0x230(%rbp),%eax
mov    0x291f(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1692 <main+0x4a2>
lea    0xa49(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0x9e6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x28e9(%rip),%rax
mov    (%rax),%edi
call   10b0 <fflush@plt>
jmp    16b3 <main+0x4c3>
jmp    14f1 <main+0x301>
mov    -0x4(%rbp),%eax
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x248,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %r15d,%r15d
lea    0xde0(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xdd8(%rip),%r12
mov    0x2d7d(%rip),%r14
lea    0xde4(%rip),%r13
movl   $0x0,0x14(%rsp)
jmp    1262 <main+0x62>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0x69,%eax
je     12a8 <main+0xa8>
mov    (%r14),%edi
mov    %r13,%rsi
mov    %eax,%edx
call   10a0 <fprintf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1110 <getopt@plt>
cmp    $0x65,%eax
jle    1290 <main+0x90>
cmp    $0x66,%eax
jne    1250 <main+0x50>
cmp    $0x20,%r15d
jl     12b9 <main+0xb9>
mov    (%r14),%esi
lea    0xd81(%rip),%rdi
call   1070 <fputs@plt>
jmp    1262 <main+0x62>
cmp    $0xffffffff,%eax
je     131a <main+0x11a>
cmp    $0x64,%eax
jne    1255 <main+0x55>
movl   $0x1,0x14(%rsp)
jmp    1262 <main+0x62>
mov    0x2d49(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x18(%rsp)
jmp    1262 <main+0x62>
mov    0x2d38(%rip),%rax
mov    (%rax),%rdi
lea    0xd52(%rip),%rsi
call   1100 <strtok@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0x10,%edx
call   10b0 <strtol@plt>
movslq %r15d,%r14
shl    $0x4,%r14
mov    %rax,0x48(%rsp,%r14,1)
xor    %edi,%edi
lea    0xd2a(%rip),%rsi
call   1100 <strtok@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0x10,%edx
call   10b0 <strtol@plt>
mov    %rax,0x40(%rsp,%r14,1)
mov    0x2c9f(%rip),%r14
add    $0x1,%r15d
jmp    1262 <main+0x62>
mov    0x2c67(%rip),%rax
mov    (%rax),%edi
mov    0x2ca6(%rip),%rax
mov    (%rax),%esi
mov    0x2c4d(%rip),%rax
mov    (%rax),%edx
call   1120 <socket@plt>
test   %eax,%eax
js     158b <main+0x38b>
mov    %eax,%ebp
mov    (%rbx),%rsi
cmpl   $0x0,0x14(%rsp)
je     135e <main+0x15e>
lea    0xce3(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1394 <main+0x194>
lea    0xcfd(%rip),%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2c52(%rip),%rax
mov    (%rax),%esi
mov    0x2c29(%rip),%rax
mov    (%rax),%edx
shl    $0x4,%r15d
lea    0x40(%rsp),%rcx
mov    %ebp,%edi
mov    %r15d,%r8d
call   1050 <setsockopt@plt>
mov    0x18(%rsp),%rbx
lea    0xc60(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13d0 <main+0x1d0>
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    0x2bac(%rip),%rax
mov    (%rax),%esi
lea    0x30(%rsp),%rdx
mov    %ebp,%edi
call   1080 <ioctl@plt>
mov    0x38(%rsp),%eax
jmp    13d2 <main+0x1d2>
xor    %eax,%eax
mov    0x2c0f(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,0xc(%rsp)
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %ebp,%edi
mov    $0x8,%edx
call   10e0 <bind@plt>
test   %rax,%rax
js     1594 <main+0x394>
movl   $0x8,0x4(%rsp)
lea    0x20(%rsp),%rsi
lea    0x8(%rsp),%r8
lea    0x4(%rsp),%r9
mov    %ebp,%edi
mov    $0x10,%edx
xor    %ecx,%ecx
call   10d0 <recvfrom@plt>
test   %eax,%eax
js     1582 <main+0x382>
lea    0xc9d(%rip),%rbx
lea    0x20(%rsp),%r13
lea    0x8(%rsp),%r14
lea    0x4(%rsp),%r15
jmp    148f <main+0x28f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2b2f(%rip),%rax
mov    (%rax),%edi
call   10c0 <fflush@plt>
movl   $0x8,0x4(%rsp)
mov    %ebp,%edi
mov    %r13,%rsi
mov    $0x10,%edx
xor    %ecx,%ecx
mov    %r14,%r8
mov    %r15,%r9
call   10d0 <recvfrom@plt>
test   %eax,%eax
js     1582 <main+0x382>
cmp    $0xf,%eax
jbe    1567 <main+0x367>
mov    0x8(%rsp),%eax
mov    %eax,0x38(%rsp)
mov    0x2b11(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
lea    0x30(%rsp),%rdx
call   1080 <ioctl@plt>
mov    0x30(%rsp),%rsi
lea    0xbf4(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x20(%rsp),%esi
mov    0x2acd(%rip),%rax
mov    (%rax),%eax
and    %esi,%eax
lea    0xbde(%rip),%rdi
lea    0xbdd(%rip),%rax
cmove  %rax,%rdi
mov    0x2ae8(%rip),%rax
cmove  0x2a78(%rip),%rax
and    (%rax),%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x24(%rsp),%esi
lea    0xbbc(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,0x24(%rsp)
jle    1541 <main+0x341>
xor    %r12d,%r12d
nopl   (%rax)
mov    0x28(%rsp),%rax
mov    (%rax,%r12,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%r12
movslq 0x24(%rsp),%rax
cmp    %rax,%r12
jl     1520 <main+0x320>
mov    0x2a50(%rip),%rax
mov    (%rax),%eax
test   %eax,0x20(%rsp)
je     1450 <main+0x250>
lea    0xb79(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1450 <main+0x250>
mov    0x2a42(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rsp),%edx
lea    0xb10(%rip),%rsi
call   10a0 <fprintf@plt>
jmp    15a0 <main+0x3a0>
lea    0xafd(%rip),%rdi
jmp    159b <main+0x39b>
lea    0xa9f(%rip),%rdi
jmp    159b <main+0x39b>
lea    0xae6(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%eax
add    $0x248,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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