#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 timeval {
  scalar_t__ tv_sec;
  int /*<<< orphan*/ tv_usec;
};
struct timespec {
  unsigned long tv_sec;
  unsigned long tv_nsec;
};
struct sockaddr_can {
  int can_ifindex;
  void *can_family;
};
struct sockaddr {
  int dummy;
};
struct can_frame {
  int dummy;
};
typedef int /*<<< orphan*/ loopback;
typedef int /*<<< orphan*/ addr;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void *AF_CAN;
int /*<<< orphan*/ CAN_RAW;
int /*<<< orphan*/ CAN_RAW_FILTER;
int /*<<< orphan*/ CAN_RAW_LOOPBACK;
int IFNAMSIZ;
int /*<<< orphan*/ PF_CAN;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ SOL_CAN_RAW;
int abs(scalar_t__);
scalar_t__ add_assignment(char *, int, char *, char *, int);
int atoi(char *);
int /*<<< orphan*/ basename(char *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ create_diff_tv(struct timeval *, struct timeval *,
                                  struct timeval *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprint_long_canframe(int /*<<< orphan*/, struct can_frame *,
                                        char *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ frames_to_send(struct timeval *, struct timeval *, struct timeval *);
int get_txidx(char *);
char *get_txname(char *);
int getopt(int, char **, char *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
scalar_t__ nanosleep(struct timespec *, int /*<<< orphan*/ *);
char *optarg;
int optind;
scalar_t__ parse_canframe(char *, struct can_frame *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ print_usage(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int sendto(int, struct can_frame *, int, int /*<<< orphan*/, struct sockaddr *,
           int);
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int sscanf(char *, char *, scalar_t__ *, int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void *strtoul(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  static char buf[400], device[400], ascframe[400];
  struct sockaddr_can addr;
  static struct can_frame frame;
  static struct timeval today_tv, log_tv, last_log_tv, diff_tv;
  struct timespec sleep_ts;
  int s;
  FILE *infile = stdin;
  unsigned long gap = 1;
  int use_timestamps = 1;
  static int verbose, opt, delay_loops, skipgap;
  static int loopback_disable = 0;
  static int infinite_loops = 0;
  static int loops = 1;
  int assignments;
  int txidx;
  int eof, nbytes, i, j;
  char *fret;
  while ((opt = getopt(argc, argv, "I:l:tg:s:xv?")) != -1) {
    switch (opt) {
    case 'I':
      infile = fopen(optarg, "r");
      if (!infile) {
        perror("infile");
        return 1;
      }
      break;
    case 'l':
      if (optarg[0] == 'i')
        infinite_loops = 1;
      else if (!(loops = atoi(optarg))) {
        fprintf(stderr, "Invalid argument for option -l !\n");
        return 1;
      }
      break;
    case 't':
      use_timestamps = 0;
      break;
    case 'g':
      gap = strtoul(optarg, NULL, 10);
      break;
    case 's':
      skipgap = strtoul(optarg, NULL, 10);
      if (skipgap < 1) {
        fprintf(stderr, "Invalid argument for option -s !\n");
        return 1;
      }
      break;
    case 'x':
      loopback_disable = 1;
      break;
    case 'v':
      verbose++;
      break;
    case '?':
    default:
      print_usage(basename(argv[0]));
      return 1;
      break;
    }
  }
  assignments = argc - optind;
  if (infile == stdin) {
    infinite_loops = 0;
    loops = 1;
  }
  if (verbose > 1) {
    if (infinite_loops)
      printf("infinite_loops\n");
    else
      printf("%d loops\n", loops);
  }
  sleep_ts.tv_sec = gap / 1000;
  sleep_ts.tv_nsec = (gap % 1000) * 1000000;
  if ((s = socket(PF_CAN, SOCK_RAW, CAN_RAW)) < 0) {
    perror("socket");
    return 1;
  }
  addr.can_family = AF_CAN;
  addr.can_ifindex = 0;
  setsockopt(s, SOL_CAN_RAW, CAN_RAW_FILTER, NULL, 0);
  if (loopback_disable) {
    int loopback = 0;
    setsockopt(s, SOL_CAN_RAW, CAN_RAW_LOOPBACK, &loopback, sizeof(loopback));
  }
  if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
    perror("bind");
    return 1;
  }
  if (assignments) {
    for (i = 0; i < assignments; i++) {
      if (strlen(argv[optind + i]) >= 400) {
        fprintf(stderr, "Assignment too long!\n");
        print_usage(basename(argv[0]));
        return 1;
      }
      strcpy(buf, argv[optind + i]);
      for (j = 0; j < 400; j++) {
        if (buf[j] == '=')
          break;
      }
      if ((j == 400) || (buf[j] != '=')) {
        fprintf(stderr, "'=' missing in assignment!\n");
        print_usage(basename(argv[0]));
        return 1;
      }
      buf[j] = 0;
      if (add_assignment("user", s, &buf[0], &buf[j + 1], verbose))
        return 1;
    }
  }
  while (infinite_loops || loops--) {
    if (infile != stdin)
      rewind(infile);
    if (verbose > 1)
      printf(">>>>>>>>> start reading file. remaining loops = %d\n", loops);
    while ((fret = fgets(buf, 400 - 1, infile)) != NULL && buf[0] != '(') {
      if (strlen(buf) >= 400 - 2) {
        fprintf(stderr, "comment line too long for input buffer\n");
        return 1;
      }
    }
    if (!fret)
      goto out;
    eof = 0;
    if (sscanf(buf, "(%ld.%ld) %s %s", &log_tv.tv_sec, &log_tv.tv_usec, device,
               ascframe) != 4) {
      fprintf(stderr, "incorrect line format in logfile\n");
      return 1;
    }
    if (use_timestamps) {
      gettimeofday(&today_tv, NULL);
      create_diff_tv(&today_tv, &diff_tv, &log_tv);
      last_log_tv = log_tv;
    }
    while (!eof) {
      while ((!use_timestamps) ||
             (frames_to_send(&today_tv, &diff_tv, &log_tv) < 0)) {
        if (strlen(device) >= IFNAMSIZ) {
          fprintf(stderr, "log interface name '%s' too long!", device);
          return 1;
        }
        txidx = get_txidx(device);
        if ((!txidx) && (!assignments)) {
          if (add_assignment("auto", s, device, device, verbose))
            return 1;
          txidx = get_txidx(device);
        }
        if (txidx == 65536) {
          printf("%s", buf);
          fflush(stdout);
        } else if (txidx > 0) {
          if (parse_canframe(ascframe, &frame)) {
            fprintf(stderr, "wrong CAN frame format: '%s'!", ascframe);
            return 1;
          }
          addr.can_family = AF_CAN;
          addr.can_ifindex = txidx;
          nbytes = sendto(s, &frame, sizeof(struct can_frame), 0,
                          (struct sockaddr *)&addr, sizeof(addr));
          if (nbytes != sizeof(struct can_frame)) {
            perror("sendto");
            return 1;
          }
          if (verbose) {
            printf("%s (%s) ", get_txname(device), device);
            fprint_long_canframe(stdout, &frame, "\n", 1);
          }
        }
        while ((fret = fgets(buf, 400 - 1, infile)) != NULL && buf[0] != '(') {
          if (strlen(buf) >= 400 - 2) {
            fprintf(stderr, "comment line too long for input buffer\n");
            return 1;
          }
        }
        if (!fret) {
          eof = 1;
          break;
        }
        if (sscanf(buf, "(%ld.%ld) %s %s", &log_tv.tv_sec, &log_tv.tv_usec,
                   device, ascframe) != 4) {
          fprintf(stderr, "incorrect line format in logfile\n");
          return 1;
        }
        if (use_timestamps) {
          gettimeofday(&today_tv, NULL);
          if ((last_log_tv.tv_sec > log_tv.tv_sec) ||
              (skipgap && abs(last_log_tv.tv_sec - log_tv.tv_sec) > skipgap))
            create_diff_tv(&today_tv, &diff_tv, &log_tv);
          last_log_tv = log_tv;
        }
      }
      if (nanosleep(&sleep_ts, NULL))
        return 1;
      delay_loops++;
      gettimeofday(&today_tv, NULL);
    }
  }
out:
  close(s);
  fclose(infile);
  if (verbose > 1)
    printf("%d delay_loops\n", delay_loops);
  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)
mov    0x2cc0(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
movq   $0x1,-0x48(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdb4(%rip),%rdx
call   11b0 <getopt@plt>
mov    %eax,0x32f5(%rip)
cmp    $0xffffffff,%eax
je     14f2 <main+0x202>
mov    0x32e6(%rip),%eax
add    $0xffffffc1,%eax
mov    %eax,%ecx
mov    %rcx,-0x80(%rbp)
sub    $0x39,%eax
ja     14ce <main+0x1de>
mov    -0x80(%rbp),%rax
lea    0xc95(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2c7d(%rip),%rax
mov    (%rax),%rdi
lea    0xe16(%rip),%rsi
call   1190 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    13b1 <main+0xc1>
lea    0xd55(%rip),%rdi
call   11a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
jmp    14ed <main+0x1fd>
mov    0x2c3b(%rip),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x69,%eax
jne    13db <main+0xeb>
movl   $0x1,0x326e(%rip)
jmp    1421 <main+0x131>
mov    0x2c16(%rip),%rax
mov    (%rax),%rdi
call   11d0 <atoi@plt>
mov    %eax,0x2d28(%rip)
cmp    $0x0,%eax
jne    141c <main+0x12c>
mov    0x2bb0(%rip),%rax
mov    (%rax),%edi
lea    0xcf3(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
jmp    1421 <main+0x131>
jmp    14ed <main+0x1fd>
movl   $0x0,-0x4c(%rbp)
jmp    14ed <main+0x1fd>
mov    0x2bbf(%rip),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   11c0 <strtoul@plt>
mov    %rax,-0x48(%rbp)
jmp    14ed <main+0x1fd>
mov    0x2b9e(%rip),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   11c0 <strtoul@plt>
mov    %eax,0x31cb(%rip)
cmpl   $0x1,0x31c4(%rip)
jge    14a1 <main+0x1b1>
mov    0x2b2b(%rip),%rax
mov    (%rax),%edi
lea    0xc90(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
jmp    14ed <main+0x1fd>
movl   $0x1,0x3190(%rip)
jmp    14ed <main+0x1fd>
mov    0x3175(%rip),%eax
add    $0x1,%eax
mov    %eax,0x316c(%rip)
jmp    14ed <main+0x1fd>
jmp    14ce <main+0x1de>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1120 <basename@plt>
mov    %eax,%edi
call   11f0 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
jmp    1326 <main+0x36>
mov    -0x8(%rbp),%eax
mov    0x2ac4(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x50(%rbp)
mov    -0x40(%rbp),%rax
mov    0x2ac4(%rip),%rcx
cmp    (%rcx),%rax
jne    1529 <main+0x239>
movl   $0x0,0x3125(%rip)
movl   $0x1,0x2bef(%rip)
cmpl   $0x1,0x3100(%rip)
jle    156f <main+0x27f>
cmpl   $0x0,0x3107(%rip)
je     1556 <main+0x266>
lea    0xbf6(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    156a <main+0x27a>
mov    0x2bbc(%rip),%esi
lea    0xbed(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    156f <main+0x27f>
mov    -0x48(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x30(%rbp)
mov    -0x48(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
imul   $0xf4240,%rdx,%rax
mov    %rax,-0x28(%rbp)
mov    0x29ef(%rip),%rax
mov    (%rax),%edi
mov    0x2a2e(%rip),%rax
mov    (%rax),%esi
mov    0x29d5(%rip),%rax
mov    (%rax),%edx
call   1210 <socket@plt>
mov    %eax,-0x34(%rbp)
cmp    $0x0,%eax
jge    15de <main+0x2ee>
lea    0xb8d(%rip),%rdi
call   11a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
mov    0x2a03(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x34(%rbp),%edi
mov    0x29cb(%rip),%rax
mov    (%rax),%esi
mov    0x299a(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1050 <setsockopt@plt>
cmpl   $0x0,0x3025(%rip)
je     164c <main+0x35c>
movl   $0x0,-0x74(%rbp)
mov    -0x34(%rbp),%edi
mov    0x2996(%rip),%rax
mov    (%rax),%esi
mov    0x293d(%rip),%rax
mov    (%rax),%edx
lea    -0x74(%rbp),%rcx
mov    $0x4,%r8d
call   1050 <setsockopt@plt>
mov    -0x34(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1170 <bind@plt>
cmp    $0x0,%rax
jge    167f <main+0x38f>
lea    0xaf3(%rip),%rdi
call   11a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
cmpl   $0x0,-0x50(%rbp)
je     1827 <main+0x537>
movl   $0x0,-0x60(%rbp)
mov    -0x60(%rbp),%eax
cmp    -0x50(%rbp),%eax
jge    1822 <main+0x532>
mov    -0x10(%rbp),%rax
mov    0x2919(%rip),%rcx
mov    (%rcx),%ecx
add    -0x60(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1070 <strlen@plt>
cmp    $0x190,%eax
jl     16f9 <main+0x409>
mov    0x28e6(%rip),%rax
mov    (%rax),%edi
lea    0xa93(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1120 <basename@plt>
mov    %eax,%edi
call   11f0 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
mov    -0x10(%rbp),%rax
mov    0x28bc(%rip),%rcx
mov    (%rcx),%ecx
add    -0x60(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
lea    0x2a19(%rip),%rdi
call   1030 <strcpy@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0x190,-0x64(%rbp)
jge    1760 <main+0x470>
movslq -0x64(%rbp),%rcx
lea    0x29f5(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
jne    174d <main+0x45d>
jmp    1760 <main+0x470>
jmp    1752 <main+0x462>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1723 <main+0x433>
cmpl   $0x190,-0x64(%rbp)
je     1785 <main+0x495>
movslq -0x64(%rbp),%rcx
lea    0x29b8(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
je     17bb <main+0x4cb>
mov    0x2824(%rip),%rax
mov    (%rax),%edi
lea    0x9e7(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1120 <basename@plt>
mov    %eax,%edi
call   11f0 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
movslq -0x64(%rbp),%rcx
lea    0x296a(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x34(%rbp),%esi
mov    -0x64(%rbp),%eax
add    $0x1,%eax
cltq
lea    0x2954(%rip),%rcx
add    %rax,%rcx
mov    0x2e4a(%rip),%r8d
lea    0x9ab(%rip),%rdi
lea    0x293c(%rip),%rdx
call   1130 <add_assignment@plt>
cmp    $0x0,%rax
je     180f <main+0x51f>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
jmp    1814 <main+0x524>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    1690 <main+0x3a0>
jmp    1827 <main+0x537>
jmp    182c <main+0x53c>
mov    $0x1,%al
cmpl   $0x0,0x2e0f(%rip)
mov    %al,-0x81(%rbp)
jne    185e <main+0x56e>
mov    0x28d1(%rip),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,0x28c6(%rip)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x81(%rbp)
mov    -0x81(%rbp),%al
test   $0x1,%al
jne    1871 <main+0x581>
jmp    1e4c <main+0xb5c>
mov    -0x40(%rbp),%rax
mov    0x2754(%rip),%rcx
cmp    (%rcx),%rax
je     188e <main+0x59e>
mov    -0x40(%rbp),%rdi
call   10a0 <rewind@plt>
cmpl   $0x1,0x2d9b(%rip)
jle    18af <main+0x5bf>
mov    0x2877(%rip),%esi
lea    0x8f5(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    18b4 <main+0x5c4>
mov    -0x40(%rbp),%rdx
lea    0x2871(%rip),%rdi
mov    $0x18f,%esi
call   1100 <fgets@plt>
mov    %rax,%rcx
mov    %rcx,-0x70(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x82(%rbp)
je     18f5 <main+0x605>
movsbl 0x2847(%rip),%eax
cmp    $0x28,%eax
setne  %al
mov    %al,-0x82(%rbp)
mov    -0x82(%rbp),%al
test   $0x1,%al
jne    1908 <main+0x618>
jmp    1947 <main+0x657>
lea    0x2821(%rip),%rdi
call   1070 <strlen@plt>
cmp    $0x18e,%eax
jl     1942 <main+0x652>
mov    0x268a(%rip),%rax
mov    (%rax),%edi
lea    0x8a2(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
jmp    18b4 <main+0x5c4>
cmpq   $0x0,-0x70(%rbp)
jne    1957 <main+0x667>
jmp    1e51 <main+0xb61>
movl   $0x0,-0x58(%rbp)
lea    0x27cb(%rip),%rdi
lea    0x88d(%rip),%rsi
lea    0x2c85(%rip),%rdx
mov    %rdx,%rcx
add    $0x8,%rcx
lea    0x293f(%rip),%r8
lea    0x2ac8(%rip),%r9
call   1160 <sscanf@plt>
cmp    $0x4,%eax
je     19b9 <main+0x6c9>
mov    0x2613(%rip),%rax
mov    (%rax),%edi
lea    0x863(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
cmpl   $0x0,-0x4c(%rbp)
je     1a09 <main+0x719>
lea    0x2c1e(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   10c0 <gettimeofday@plt>
lea    0x2c0e(%rip),%rdi
lea    0x2c37(%rip),%rsi
lea    0x2c10(%rip),%rdx
call   1200 <create_diff_tv@plt>
mov    0x2c04(%rip),%rax
mov    %rax,0x2c0d(%rip)
mov    0x2bfe(%rip),%rax
mov    %rax,0x2c07(%rip)
jmp    1a0e <main+0x71e>
cmpl   $0x0,-0x58(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1a24 <main+0x734>
jmp    1e47 <main+0xb57>
jmp    1a29 <main+0x739>
mov    $0x1,%al
cmpl   $0x0,-0x4c(%rbp)
mov    %al,-0x83(%rbp)
je     1a62 <main+0x772>
lea    0x2ba6(%rip),%rdi
lea    0x2bcf(%rip),%rsi
lea    0x2ba8(%rip),%rdx
call   10f0 <frames_to_send@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,-0x83(%rbp)
mov    -0x83(%rbp),%al
test   $0x1,%al
jne    1a75 <main+0x785>
jmp    1e00 <main+0xb10>
lea    0x2844(%rip),%rdi
call   1070 <strlen@plt>
mov    0x2520(%rip),%rcx
cmp    (%rcx),%eax
jl     1aba <main+0x7ca>
mov    0x2519(%rip),%rax
mov    (%rax),%edi
lea    0x78b(%rip),%rsi
lea    0x2819(%rip),%rdx
mov    $0x0,%al
call   1110 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
lea    0x27ff(%rip),%rdi
call   11e0 <get_txidx@plt>
mov    %eax,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
jne    1b22 <main+0x832>
cmpl   $0x0,-0x50(%rbp)
jne    1b22 <main+0x832>
mov    -0x34(%rbp),%esi
mov    0x2b49(%rip),%r8d
lea    0x75f(%rip),%rdi
lea    0x27cb(%rip),%rcx
mov    %rcx,%rdx
call   1130 <add_assignment@plt>
cmp    $0x0,%rax
je     1b13 <main+0x823>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
lea    0x27a6(%rip),%rdi
call   11e0 <get_txidx@plt>
mov    %eax,-0x54(%rbp)
cmpl   $0x10000,-0x54(%rbp)
jne    1b57 <main+0x867>
lea    0x6d0(%rip),%rdi
lea    0x25f3(%rip),%rsi
mov    $0x0,%al
call   1090 <printf@plt>
mov    0x244d(%rip),%rax
mov    (%rax),%edi
call   1150 <fflush@plt>
jmp    1c61 <main+0x971>
cmpl   $0x0,-0x54(%rbp)
jle    1c5c <main+0x96c>
lea    0x28e8(%rip),%rdi
lea    0x2a71(%rip),%rsi
call   1140 <parse_canframe@plt>
cmp    $0x0,%rax
je     1ba8 <main+0x8b8>
mov    0x242b(%rip),%rax
mov    (%rax),%edi
lea    0x6c4(%rip),%rsi
lea    0x28bb(%rip),%rdx
mov    $0x0,%al
call   1110 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
mov    0x2439(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x20(%rbp),%r8
lea    0x2a16(%rip),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    $0x10,%r9d
call   10d0 <sendto@plt>
mov    %eax,-0x5c(%rbp)
movslq -0x5c(%rbp),%rax
cmp    $0x4,%rax
je     1c05 <main+0x915>
lea    0x67c(%rip),%rdi
call   11a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
cmpl   $0x0,0x2a24(%rip)
je     1c57 <main+0x967>
lea    0x26a7(%rip),%rdi
call   1180 <get_txname@plt>
mov    %rax,%rsi
lea    0x64f(%rip),%rdi
lea    0x2691(%rip),%rdx
mov    $0x0,%al
call   1090 <printf@plt>
mov    0x235b(%rip),%rax
mov    (%rax),%edi
lea    0x299a(%rip),%rsi
lea    0x4cf(%rip),%rdx
mov    $0x1,%ecx
call   1080 <fprint_long_canframe@plt>
jmp    1c5c <main+0x96c>
jmp    1c61 <main+0x971>
jmp    1c66 <main+0x976>
mov    -0x40(%rbp),%rdx
lea    0x24bf(%rip),%rdi
mov    $0x18f,%esi
call   1100 <fgets@plt>
mov    %rax,%rcx
mov    %rcx,-0x70(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x84(%rbp)
je     1ca7 <main+0x9b7>
movsbl 0x2495(%rip),%eax
cmp    $0x28,%eax
setne  %al
mov    %al,-0x84(%rbp)
mov    -0x84(%rbp),%al
test   $0x1,%al
jne    1cba <main+0x9ca>
jmp    1cf9 <main+0xa09>
lea    0x246f(%rip),%rdi
call   1070 <strlen@plt>
cmp    $0x18e,%eax
jl     1cf4 <main+0xa04>
mov    0x22d8(%rip),%rax
mov    (%rax),%edi
lea    0x4f0(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
jmp    1c66 <main+0x976>
cmpq   $0x0,-0x70(%rbp)
jne    1d10 <main+0xa20>
movl   $0x1,-0x58(%rbp)
jmp    1e00 <main+0xb10>
lea    0x2419(%rip),%rdi
lea    0x4db(%rip),%rsi
lea    0x28d3(%rip),%rdx
mov    %rdx,%rcx
add    $0x8,%rcx
lea    0x258d(%rip),%r8
lea    0x2716(%rip),%r9
call   1160 <sscanf@plt>
cmp    $0x4,%eax
je     1d6b <main+0xa7b>
mov    0x2261(%rip),%rax
mov    (%rax),%edi
lea    0x4b1(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
cmpl   $0x0,-0x4c(%rbp)
je     1dfb <main+0xb0b>
lea    0x286c(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   10c0 <gettimeofday@plt>
mov    0x287c(%rip),%rax
cmp    0x2865(%rip),%rax
jg     1dc5 <main+0xad5>
cmpl   $0x0,0x289c(%rip)
je     1ddf <main+0xaef>
mov    0x285b(%rip),%rdi
sub    0x2844(%rip),%rdi
call   1040 <abs@plt>
cmp    0x287d(%rip),%eax
jle    1ddf <main+0xaef>
lea    0x281c(%rip),%rdi
lea    0x2845(%rip),%rsi
lea    0x281e(%rip),%rdx
call   1200 <create_diff_tv@plt>
mov    0x2812(%rip),%rax
mov    %rax,0x281b(%rip)
mov    0x280c(%rip),%rax
mov    %rax,0x2815(%rip)
jmp    1a29 <main+0x739>
lea    -0x30(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   10b0 <nanosleep@plt>
cmp    $0x0,%rax
je     1e23 <main+0xb33>
movl   $0x1,-0x4(%rbp)
jmp    1e8a <main+0xb9a>
mov    0x280f(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2806(%rip)
lea    0x27af(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   10c0 <gettimeofday@plt>
jmp    1a0e <main+0x71e>
jmp    182c <main+0x53c>
jmp    1e51 <main+0xb61>
mov    -0x34(%rbp),%edi
call   10e0 <close@plt>
mov    -0x40(%rbp),%rdi
call   1060 <fclose@plt>
cmpl   $0x1,0x27c7(%rip)
jle    1e83 <main+0xb93>
mov    0x27c3(%rip),%esi
lea    0x404(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x0,-0x4(%rbp)
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    $0x38,%rsp
mov    %rsi,%rbp
mov    %edi,%r12d
mov    0x2cb5(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x8(%rsp)
mov    $0x1,%ecx
mov    $0x1,%eax
mov    %rax,(%rsp)
lea    0xd88(%rip),%rbx
lea    0xcc1(%rip),%r14
mov    0x2cb2(%rip),%r15
jmp    1360 <main+0x60>
addl   $0x1,0x32f1(%rip)
mov    %r13d,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ecx,%r13d
mov    %r12d,%edi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   11c0 <getopt@plt>
lea    -0x49(%rax),%ecx
cmp    $0x2f,%ecx
ja     1434 <main+0x134>
movslq (%r14,%rcx,4),%rax
add    %r14,%rax
xor    %ecx,%ecx
jmp    *%rax
mov    (%r15),%rdi
lea    0xdd1(%rip),%rsi
call   11a0 <fopen@plt>
mov    %r13d,%ecx
mov    %rax,0x8(%rsp)
test   %rax,%rax
jne    1360 <main+0x60>
jmp    1a7d <main+0x77d>
mov    (%r15),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   11d0 <strtoul@plt>
mov    %rax,(%rsp)
mov    %r13d,%ecx
jmp    1360 <main+0x60>
mov    (%r15),%rdi
cmpb   $0x69,(%rdi)
jne    1409 <main+0x109>
movb   $0x1,0x3280(%rip)
mov    %r13d,%ecx
jmp    1360 <main+0x60>
mov    (%r15),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   11d0 <strtoul@plt>
mov    %eax,0x325e(%rip)
mov    %r13d,%ecx
test   %eax,%eax
jg     1360 <main+0x60>
jmp    1489 <main+0x189>
movb   $0x1,0x324b(%rip)
mov    %r13d,%ecx
jmp    1360 <main+0x60>
call   11e0 <atoi@plt>
mov    %eax,0x2d0c(%rip)
mov    %r13d,%ecx
test   %eax,%eax
jne    1360 <main+0x60>
mov    0x2b8a(%rip),%rax
mov    (%rax),%edi
lea    0xca5(%rip),%rsi
jmp    1a5e <main+0x75e>
cmp    $0xffffffff,%eax
jne    1a3c <main+0x73c>
mov    0x2b7c(%rip),%rax
sub    (%rax),%r12d
mov    0x2b82(%rip),%rax
mov    0x8(%rsp),%rcx
cmp    (%rax),%rcx
jne    1469 <main+0x169>
movb   $0x0,0x31f1(%rip)
movl   $0x1,0x2cb7(%rip)
cmpl   $0x2,0x31d0(%rip)
jl     14b2 <main+0x1b2>
cmpb   $0x1,0x31d7(%rip)
jne    149e <main+0x19e>
lea    0xdd6(%rip),%rdi
call   1040 <puts@plt>
jmp    14b2 <main+0x1b2>
mov    0x2b20(%rip),%rax
mov    (%rax),%edi
lea    0xc5d(%rip),%rsi
jmp    1a5e <main+0x75e>
mov    0x2c7c(%rip),%esi
lea    0xc6d(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    (%rsp),%rsi
mov    %rsi,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
shr    $0x4,%rdx
mov    %rdx,0x28(%rsp)
imul   $0x3e8,%rdx,%rax
sub    %rax,%rsi
imul   $0xf4240,%rsi,%rax
mov    %rax,0x30(%rsp)
mov    0x2aa0(%rip),%rax
mov    (%rax),%edi
mov    0x2adf(%rip),%rax
mov    (%rax),%esi
mov    0x2a86(%rip),%rax
mov    (%rax),%edx
call   1220 <socket@plt>
mov    %eax,(%rsp)
test   %eax,%eax
js     1a98 <main+0x798>
mov    0x2acd(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x20(%rsp)
movl   $0x0,0x18(%rsp)
mov    0x2a96(%rip),%rbx
mov    (%rbx),%esi
mov    0x2a65(%rip),%rax
mov    (%rax),%edx
mov    (%rsp),%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1060 <setsockopt@plt>
cmpb   $0x1,0x30fb(%rip)
jne    1579 <main+0x279>
movl   $0x0,0x14(%rsp)
mov    (%rbx),%esi
mov    0x2a14(%rip),%rax
mov    (%rax),%edx
lea    0x14(%rsp),%rcx
mov    (%rsp),%edi
mov    $0x4,%r8d
call   1060 <setsockopt@plt>
lea    0x18(%rsp),%rsi
mov    (%rsp),%edi
mov    $0x10,%edx
call   1180 <bind@plt>
test   %rax,%rax
js     1aa1 <main+0x7a1>
test   %r12d,%r12d
jle    1690 <main+0x390>
xor    %ecx,%ecx
lea    0x2b9a(%rip),%r14
mov    0x2a13(%rip),%r15
movslq (%r15),%rax
mov    %ecx,0x10(%rsp)
movslq %ecx,%rbx
add    %rbx,%rax
mov    0x0(%rbp,%rax,8),%rdi
call   1080 <strlen@plt>
cmp    $0x190,%eax
jge    1a86 <main+0x786>
movslq (%r15),%rax
add    %rbx,%rax
mov    0x0(%rbp,%rax,8),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    $0x4,%ecx
nopw   0x0(%rax,%rax,1)
cmpb   $0x3d,-0x4(%rcx,%r14,1)
je     1629 <main+0x329>
cmpb   $0x3d,-0x3(%rcx,%r14,1)
je     162f <main+0x32f>
cmpb   $0x3d,-0x2(%rcx,%r14,1)
je     1635 <main+0x335>
cmpb   $0x3d,-0x1(%rcx,%r14,1)
je     163b <main+0x33b>
cmpb   $0x3d,(%rcx,%r14,1)
je     1640 <main+0x340>
add    $0x5,%rcx
cmp    $0x194,%rcx
jne    15f0 <main+0x2f0>
jmp    1a25 <main+0x725>
add    $0xfffffffffffffffc,%rcx
jmp    1640 <main+0x340>
add    $0xfffffffffffffffd,%rcx
jmp    1640 <main+0x340>
add    $0xfffffffffffffffe,%rcx
jmp    1640 <main+0x340>
add    $0xffffffffffffffff,%rcx
nop
mov    %ecx,%eax
cmpb   $0x3d,(%rax,%r14,1)
jne    1a25 <main+0x725>
movb   $0x0,(%rax,%r14,1)
add    $0x1,%ecx
add    %r14,%rcx
mov    0x2fe1(%rip),%r8d
lea    0xafa(%rip),%rdi
mov    (%rsp),%esi
mov    %r14,%rdx
call   1140 <add_assignment@plt>
mov    0x10(%rsp),%ecx
add    $0x1,%ecx
mov    $0x1,%r15d
test   %rax,%rax
jne    1a6b <main+0x76b>
cmp    %r12d,%ecx
jne    15a6 <main+0x2a6>
lea    0x2aa9(%rip),%r14
lea    0x2c32(%rip),%rbp
mov    0x8(%rsp),%rbx
cmpb   $0x0,0x2fa6(%rip)
jne    16b9 <main+0x3b9>
subl   $0x1,0x2a6d(%rip)
jb     1aaf <main+0x7af>
mov    0x2910(%rip),%rax
cmp    (%rax),%rbx
je     16cd <main+0x3cd>
mov    %rbx,%rdi
call   10b0 <rewind@plt>
cmpl   $0x2,0x2f6c(%rip)
jl     16f0 <main+0x3f0>
mov    0x2a44(%rip),%esi
lea    0xa82(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x18f,%esi
mov    %rbx,%rdx
call   1110 <fgets@plt>
movzbl 0x2a39(%rip),%ecx
test   %rax,%rax
je     1725 <main+0x425>
cmp    $0x28,%cl
je     1725 <main+0x425>
mov    %r14,%rdi
call   1080 <strlen@plt>
cmp    $0x18e,%eax
jl     16f0 <main+0x3f0>
jmp    1a4e <main+0x74e>
test   %rax,%rax
je     1aaf <main+0x7af>
mov    %r14,%rdi
lea    0xa89(%rip),%rsi
lea    0x2ec9(%rip),%rdx
lea    0x2eca(%rip),%rcx
mov    %rbp,%r8
lea    0x2d10(%rip),%r9
call   1170 <sscanf@plt>
cmp    $0x4,%eax
jne    1ae4 <main+0x7e4>
test   %r13d,%r13d
je     1811 <main+0x511>
lea    0x2e8a(%rip),%rdi
xor    %esi,%esi
call   10d0 <gettimeofday@plt>
lea    0x2e7c(%rip),%rdi
lea    0x2ea5(%rip),%rsi
lea    0x2e7e(%rip),%rdx
call   1210 <create_diff_tv@plt>
movups 0x2e72(%rip),%xmm0
movups %xmm0,0x2e7b(%rip)
test   %r13d,%r13d
je     1811 <main+0x511>
lea    0x2e4f(%rip),%rdi
lea    0x2e78(%rip),%rsi
lea    0x2e51(%rip),%rdx
call   1100 <frames_to_send@plt>
mov    $0x1,%bpl
test   %rax,%rax
js     1811 <main+0x511>
lea    0x28(%rsp),%rdi
xor    %esi,%esi
call   10c0 <nanosleep@plt>
mov    $0x1,%r15d
test   %rax,%rax
lea    0x2af0(%rip),%rax
jne    1a6b <main+0x76b>
addl   $0x1,0x2e57(%rip)
lea    0x2e04(%rip),%rdi
xor    %esi,%esi
mov    %rax,%r15
call   10d0 <gettimeofday@plt>
test   %bpl,%bpl
mov    0x8(%rsp),%rbx
mov    %r15,%rbp
je     16a3 <main+0x3a3>
jmp    179d <main+0x49d>
lea    0x2ab8(%rip),%rbp
mov    %rbp,%rdi
call   1080 <strlen@plt>
mov    0x2781(%rip),%rcx
cmp    (%rcx),%eax
jge    1af9 <main+0x7f9>
mov    %rbp,%rdi
call   11f0 <get_txidx@plt>
mov    %rbp,%rdx
mov    %eax,%ebp
or     %r12d,%eax
jne    187b <main+0x57b>
mov    0x2df8(%rip),%r8d
lea    0x9c6(%rip),%rdi
mov    (%rsp),%esi
mov    %rdx,%rbx
mov    %rdx,%rcx
call   1140 <add_assignment@plt>
mov    $0x1,%r15d
test   %rax,%rax
jne    1a6b <main+0x76b>
mov    %rbx,%rdi
call   11f0 <get_txidx@plt>
mov    %eax,%ebp
mov    0x8(%rsp),%rbx
cmp    $0x10000,%ebp
jne    18a7 <main+0x5a7>
lea    0x944(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x26fd(%rip),%rax
mov    (%rax),%edi
call   1160 <fflush@plt>
jmp    1960 <main+0x660>
test   %ebp,%ebp
jle    1960 <main+0x660>
lea    0x2baa(%rip),%rdi
lea    0x2d33(%rip),%r15
mov    %r15,%rsi
call   1150 <parse_canframe@plt>
test   %rax,%rax
jne    1b12 <main+0x812>
mov    0x2713(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x20(%rsp)
mov    %ebp,0x18(%rsp)
mov    (%rsp),%edi
mov    %r15,%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
lea    0x18(%rsp),%r8
mov    $0x10,%r9d
call   10e0 <sendto@plt>
cmp    $0x4,%eax
jne    1b35 <main+0x835>
cmpl   $0x0,0x2d32(%rip)
je     1960 <main+0x660>
lea    0x29b9(%rip),%rbp
mov    %rbp,%rdi
call   1190 <get_txname@plt>
lea    0x919(%rip),%rdi
mov    %rax,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x265e(%rip),%rax
mov    (%rax),%edi
lea    0x2cad(%rip),%rsi
lea    0x7aa(%rip),%rdx
mov    $0x1,%ecx
call   1090 <fprint_long_canframe@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    $0x18f,%esi
mov    %rbx,%rdx
call   1110 <fgets@plt>
movzbl 0x27c9(%rip),%ecx
test   %rax,%rax
je     1995 <main+0x695>
cmp    $0x28,%cl
je     1995 <main+0x695>
mov    %r14,%rdi
call   1080 <strlen@plt>
cmp    $0x18e,%eax
jl     1960 <main+0x660>
jmp    1a4e <main+0x74e>
xor    %ebp,%ebp
test   %rax,%rax
je     17c4 <main+0x4c4>
mov    %r14,%rdi
lea    0x817(%rip),%rsi
lea    0x2c57(%rip),%rdx
lea    0x2c58(%rip),%rcx
lea    0x2911(%rip),%rbp
mov    %rbp,%r8
lea    0x2a97(%rip),%r9
call   1170 <sscanf@plt>
cmp    $0x4,%eax
jne    1ae4 <main+0x7e4>
test   %r13d,%r13d
je     1818 <main+0x518>
lea    0x2c11(%rip),%rdi
xor    %esi,%esi
call   10d0 <gettimeofday@plt>
mov    0x2c23(%rip),%rdi
sub    0x2c0c(%rip),%rdi
jg     1775 <main+0x475>
cmpl   $0x0,0x2c3f(%rip)
je     178f <main+0x48f>
call   1050 <abs@plt>
cmp    0x2c2e(%rip),%eax
jg     1775 <main+0x475>
jmp    178f <main+0x48f>
mov    0x2584(%rip),%rax
mov    (%rax),%edi
lea    0x70f(%rip),%rsi
xor    %eax,%eax
call   1120 <fprintf@plt>
mov    0x0(%rbp),%rdi
call   1130 <basename@plt>
mov    %eax,%edi
call   1200 <print_usage@plt>
jmp    1a65 <main+0x765>
mov    0x255b(%rip),%rax
mov    (%rax),%edi
lea    0x73b(%rip),%rsi
xor    %eax,%eax
call   1120 <fprintf@plt>
mov    $0x1,%r15d
mov    %r15d,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x649(%rip),%rdi
jmp    1aa8 <main+0x7a8>
mov    0x2523(%rip),%rax
mov    (%rax),%edi
lea    0x698(%rip),%rsi
jmp    1a35 <main+0x735>
lea    0x683(%rip),%rdi
jmp    1aa8 <main+0x7a8>
lea    0x681(%rip),%rdi
call   11b0 <perror@plt>
jmp    1a65 <main+0x765>
mov    (%rsp),%edi
call   10f0 <close@plt>
mov    %rbx,%rdi
call   1070 <fclose@plt>
xor    %r15d,%r15d
cmpl   $0x2,0x2b77(%rip)
jl     1a6b <main+0x76b>
mov    0x2b73(%rip),%esi
lea    0x770(%rip),%rdi
xor    %r15d,%r15d
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    1a6b <main+0x76b>
mov    0x24c5(%rip),%rax
mov    (%rax),%edi
lea    0x6dd(%rip),%rsi
jmp    1a5e <main+0x75e>
mov    0x24b0(%rip),%rax
mov    (%rax),%edi
lea    0x6ea(%rip),%rsi
lea    0x27c0(%rip),%rdx
jmp    1b29 <main+0x829>
mov    0x2497(%rip),%rax
mov    (%rax),%edi
lea    0x6f8(%rip),%rsi
lea    0x2937(%rip),%rdx
xor    %eax,%eax
call   1120 <fprintf@plt>
jmp    1a65 <main+0x765>
lea    0x6fc(%rip),%rdi
jmp    1aa8 <main+0x7a8>

LLVM IR (-O0):
%struct.can_frame = type { i32 }
%struct.timeval = type { i64, i32 }
%struct.sockaddr_can = type { i32, i8* }
%struct.timespec = type { i64, i64 }
%struct.sockaddr = type { i32 }
@main.buf = internal global [400 x i8] zeroinitializer
@main.device = internal global [400 x i8] zeroinitializer
@main.ascframe = internal global [400 x i8] zeroinitializer
@main.frame = internal global %struct.can_frame zeroinitializer
@main.today_tv = internal global %struct.timeval zeroinitializer
@main.log_tv = internal global %struct.timeval zeroinitializer
@main.last_log_tv = internal global %struct.timeval zeroinitializer
@main.diff_tv = internal global %struct.timeval zeroinitializer
@stdin = global i32* null
@main.verbose = internal global i32 0
@main.opt = internal global i32 0
@main.delay_loops = internal global i32 0
@main.skipgap = internal global i32 0
@main.loopback_disable = internal global i32 0
@main.infinite_loops = internal global i32 0
@main.loops = internal global i32 1
@.str = [13 x i8] c"I:l:tg:s:xv?\00"
@optarg = global i8* null
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [7 x i8] c"infile\00"
@stderr = global i32 0
@.str.3 = [34 x i8] c"Invalid argument for option -l !\0A\00"
@.str.4 = [34 x i8] c"Invalid argument for option -s !\0A\00"
@optind = global i32 0
@.str.5 = [16 x i8] c"infinite_loops\0A\00"
@.str.6 = [10 x i8] c"%d loops\0A\00"
@PF_CAN = global i32 0
@SOCK_RAW = global i32 0
@CAN_RAW = global i32 0
@.str.7 = [7 x i8] c"socket\00"
@AF_CAN = global i8* null
@SOL_CAN_RAW = global i32 0
@CAN_RAW_FILTER = global i32 0
@CAN_RAW_LOOPBACK = global i32 0
@.str.8 = [5 x i8] c"bind\00"
@.str.9 = [22 x i8] c"Assignment too long!\0A\00"
@.str.10 = [28 x i8] c"'=' missing in assignment!\0A\00"
@.str.11 = [5 x i8] c"user\00"
@.str.12 = [52 x i8] c">>>>>>>>> start reading file. remaining loops = %d\0A\00"
@.str.13 = [40 x i8] c"comment line too long for input buffer\0A\00"
@.str.14 = [16 x i8] c"(%ld.%ld) %s %s\00"
@.str.15 = [34 x i8] c"incorrect line format in logfile\0A\00"
@IFNAMSIZ = global i32 0
@.str.16 = [34 x i8] c"log interface name '%s' too long!\00"
@.str.17 = [5 x i8] c"auto\00"
@.str.18 = [3 x i8] c"%s\00"
@stdout = global i32 0
@.str.19 = [30 x i8] c"wrong CAN frame format: '%s'!\00"
@.str.20 = [7 x i8] c"sendto\00"
@.str.21 = [9 x i8] c"%s (%s) \00"
@.str.22 = [2 x i8] c"\0A\00"
@.str.23 = [16 x i8] c"%d delay_loops\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sockaddr_can
%7 = alloca %struct.timespec
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = load i32*, i32** @stdin
store i32* %20, i32** %9
store i64 1, i64* %10
store i32 1, i32* %11
br label %21
21: ; preds = %78, %2
%22 = load i32, i32* %4
%23 = load i8**, i8*** %5
%24 = call i32 @getopt(i32 %22, i8** %23, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 %24, i32* @main.opt
%25 = icmp ne i32 %24, -1
br i1 %25, label %26, label %79
26: ; preds = %21
%27 = load i32, i32* @main.opt
switch i32 %27, label %72 [
i32 73, label %28
i32 108, label %36
i32 116, label %52
i32 103, label %53
i32 115, label %57
i32 120, label %67
i32 118, label %68
i32 63, label %71
]
28: ; preds = %26
%29 = load i8*, i8** @optarg
%30 = call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %30, i32** %9
%31 = load i32*, i32** %9
%32 = icmp ne i32* %31, null
br i1 %32, label %35, label %33
33: ; preds = %28
%34 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %425
35: ; preds = %28
br label %78
36: ; preds = %26
%37 = load i8*, i8** @optarg
%38 = getelementptr inbounds i8, i8* %37, i64 0
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 105
br i1 %41, label %42, label %43
42: ; preds = %36
store i32 1, i32* @main.infinite_loops
br label %51
43: ; preds = %36
%44 = load i8*, i8** @optarg
%45 = call i32 @atoi(i8* %44)
store i32 %45, i32* @main.loops
%46 = icmp ne i32 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %43
%48 = load i32, i32* @stderr
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %425
50: ; preds = %43
br label %51
51: ; preds = %50, %42
br label %78
52: ; preds = %26
store i32 0, i32* %11
br label %78
53: ; preds = %26
%54 = load i8*, i8** @optarg
%55 = call i8* @strtoul(i8* %54, i32* null, i32 10)
%56 = ptrtoint i8* %55 to i64
store i64 %56, i64* %10
br label %78
57: ; preds = %26
%58 = load i8*, i8** @optarg
%59 = call i8* @strtoul(i8* %58, i32* null, i32 10)
%60 = ptrtoint i8* %59 to i32
store i32 %60, i32* @main.skipgap
%61 = load i32, i32* @main.skipgap
%62 = icmp slt i32 %61, 1
br i1 %62, label %63, label %66
63: ; preds = %57
%64 = load i32, i32* @stderr
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %425
66: ; preds = %57
br label %78
67: ; preds = %26
store i32 1, i32* @main.loopback_disable
br label %78
68: ; preds = %26
%69 = load i32, i32* @main.verbose
%70 = add nsw i32 %69, 1
store i32 %70, i32* @main.verbose
br label %78
71: ; preds = %26
br label %72
72: ; preds = %26, %71
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 0
%75 = load i8*, i8** %74
%76 = call i32 @basename(i8* %75)
%77 = call i32 @print_usage(i32 %76)
store i32 1, i32* %3
br label %425
78: ; preds = %68, %67, %66, %53, %52, %51, %35
br label %21
79: ; preds = %21
%80 = load i32, i32* %4
%81 = load i32, i32* @optind
%82 = sub nsw i32 %80, %81
store i32 %82, i32* %12
%83 = load i32*, i32** %9
%84 = load i32*, i32** @stdin
%85 = icmp eq i32* %83, %84
br i1 %85, label %86, label %87
86: ; preds = %79
store i32 0, i32* @main.infinite_loops
store i32 1, i32* @main.loops
br label %87
87: ; preds = %86, %79
%88 = load i32, i32* @main.verbose
%89 = icmp sgt i32 %88, 1
br i1 %89, label %90, label %99
90: ; preds = %87
%91 = load i32, i32* @main.infinite_loops
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %90
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %98
95: ; preds = %90
%96 = load i32, i32* @main.loops
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %96)
br label %98
98: ; preds = %95, %93
br label %99
99: ; preds = %98, %87
%100 = load i64, i64* %10
%101 = udiv i64 %100, 1000
%102 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
store i64 %101, i64* %102
%103 = load i64, i64* %10
%104 = urem i64 %103, 1000
%105 = mul i64 %104, 1000000
%106 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
store i64 %105, i64* %106
%107 = load i32, i32* @PF_CAN
%108 = load i32, i32* @SOCK_RAW
%109 = load i32, i32* @CAN_RAW
%110 = call i32 @socket(i32 %107, i32 %108, i32 %109)
store i32 %110, i32* %8
%111 = icmp slt i32 %110, 0
br i1 %111, label %112, label %114
112: ; preds = %99
%113 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %3
br label %425
114: ; preds = %99
%115 = load i8*, i8** @AF_CAN
%116 = getelementptr inbounds %struct.sockaddr_can, %struct.sockaddr_can* %6, i32 0, i32 1
store i8* %115, i8** %116
%117 = getelementptr inbounds %struct.sockaddr_can, %struct.sockaddr_can* %6, i32 0, i32 0
store i32 0, i32* %117
%118 = load i32, i32* %8
%119 = load i32, i32* @SOL_CAN_RAW
%120 = load i32, i32* @CAN_RAW_FILTER
%121 = call i32 @setsockopt(i32 %118, i32 %119, i32 %120, i32* null, i32 0)
%122 = load i32, i32* @main.loopback_disable
%123 = icmp ne i32 %122, 0
br i1 %123, label %124, label %129
124: ; preds = %114
store i32 0, i32* %19
%125 = load i32, i32* %8
%126 = load i32, i32* @SOL_CAN_RAW
%127 = load i32, i32* @CAN_RAW_LOOPBACK
%128 = call i32 @setsockopt(i32 %125, i32 %126, i32 %127, i32* %19, i32 4)
br label %129
129: ; preds = %124, %114
%130 = load i32, i32* %8
%131 = bitcast %struct.sockaddr_can* %6 to %struct.sockaddr*
%132 = call i64 @bind(i32 %130, %struct.sockaddr* %131, i32 16)
%133 = icmp slt i64 %132, 0
br i1 %133, label %134, label %136
134: ; preds = %129
%135 = 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 %425
136: ; preds = %129
%137 = load i32, i32* %12
%138 = icmp ne i32 %137, 0
br i1 %138, label %139, label %222
139: ; preds = %136
store i32 0, i32* %16
br label %140
140: ; preds = %218, %139
%141 = load i32, i32* %16
%142 = load i32, i32* %12
%143 = icmp slt i32 %141, %142
br i1 %143, label %144, label %221
144: ; preds = %140
%145 = load i8**, i8*** %5
%146 = load i32, i32* @optind
%147 = load i32, i32* %16
%148 = add nsw i32 %146, %147
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i8*, i8** %145, i64 %149
%151 = load i8*, i8** %150
%152 = call i32 @strlen(i8* %151)
%153 = icmp sge i32 %152, 400
br i1 %153, label %154, label %162
154: ; preds = %144
%155 = load i32, i32* @stderr
%156 = call i32 (i32, i8*, ...) @fprintf(i32 %155, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%157 = load i8**, i8*** %5
%158 = getelementptr inbounds i8*, i8** %157, i64 0
%159 = load i8*, i8** %158
%160 = call i32 @basename(i8* %159)
%161 = call i32 @print_usage(i32 %160)
store i32 1, i32* %3
br label %425
162: ; preds = %144
%163 = load i8**, i8*** %5
%164 = load i32, i32* @optind
%165 = load i32, i32* %16
%166 = add nsw i32 %164, %165
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds i8*, i8** %163, i64 %167
%169 = load i8*, i8** %168
%170 = call i32 @strcpy(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0), i8* %169)
store i32 0, i32* %17
br label %171
171: ; preds = %183, %162
%172 = load i32, i32* %17
%173 = icmp slt i32 %172, 400
br i1 %173, label %174, label %186
174: ; preds = %171
%175 = load i32, i32* %17
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds [400 x i8], [400 x i8]* @main.buf, i64 0, i64 %176
%178 = load i8, i8* %177
%179 = sext i8 %178 to i32
%180 = icmp eq i32 %179, 61
br i1 %180, label %181, label %182
181: ; preds = %174
br label %186
182: ; preds = %174
br label %183
183: ; preds = %182
%184 = load i32, i32* %17
%185 = add nsw i32 %184, 1
store i32 %185, i32* %17
br label %171
186: ; preds = %181, %171
%187 = load i32, i32* %17
%188 = icmp eq i32 %187, 400
br i1 %188, label %196, label %189
189: ; preds = %186
%190 = load i32, i32* %17
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds [400 x i8], [400 x i8]* @main.buf, i64 0, i64 %191
%193 = load i8, i8* %192
%194 = sext i8 %193 to i32
%195 = icmp ne i32 %194, 61
br i1 %195, label %196, label %204
196: ; preds = %189, %186
%197 = load i32, i32* @stderr
%198 = call i32 (i32, i8*, ...) @fprintf(i32 %197, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0))
%199 = load i8**, i8*** %5
%200 = getelementptr inbounds i8*, i8** %199, i64 0
%201 = load i8*, i8** %200
%202 = call i32 @basename(i8* %201)
%203 = call i32 @print_usage(i32 %202)
store i32 1, i32* %3
br label %425
204: ; preds = %189
%205 = load i32, i32* %17
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds [400 x i8], [400 x i8]* @main.buf, i64 0, i64 %206
store i8 0, i8* %207
%208 = load i32, i32* %8
%209 = load i32, i32* %17
%210 = add nsw i32 %209, 1
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds [400 x i8], [400 x i8]* @main.buf, i64 0, i64 %211
%213 = load i32, i32* @main.verbose
%214 = call i64 @add_assignment(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 %208, i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0), i8* %212, i32 %213)
%215 = icmp ne i64 %214, 0
br i1 %215, label %216, label %217
216: ; preds = %204
store i32 1, i32* %3
br label %425
217: ; preds = %204
br label %218
218: ; preds = %217
%219 = load i32, i32* %16
%220 = add nsw i32 %219, 1
store i32 %220, i32* %16
br label %140
221: ; preds = %140
br label %222
222: ; preds = %221, %136
br label %223
223: ; preds = %412, %222
%224 = load i32, i32* @main.infinite_loops
%225 = icmp ne i32 %224, 0
br i1 %225, label %230, label %226
226: ; preds = %223
%227 = load i32, i32* @main.loops
%228 = add nsw i32 %227, -1
store i32 %228, i32* @main.loops
%229 = icmp ne i32 %227, 0
br label %230
230: ; preds = %226, %223
%231 = phi i1 [ true, %223 ], [ %229, %226 ]
br i1 %231, label %232, label %413
232: ; preds = %230
%233 = load i32*, i32** %9
%234 = load i32*, i32** @stdin
%235 = icmp ne i32* %233, %234
br i1 %235, label %236, label %239
236: ; preds = %232
%237 = load i32*, i32** %9
%238 = call i32 @rewind(i32* %237)
br label %239
239: ; preds = %236, %232
%240 = load i32, i32* @main.verbose
%241 = icmp sgt i32 %240, 1
br i1 %241, label %242, label %245
242: ; preds = %239
%243 = load i32, i32* @main.loops
%244 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.12, i64 0, i64 0), i32 %243)
br label %245
245: ; preds = %242, %239
br label %246
246: ; preds = %262, %245
%247 = load i32*, i32** %9
%248 = call i8* @fgets(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0), i32 399, i32* %247)
store i8* %248, i8** %18
%249 = icmp ne i8* %248, null
br i1 %249, label %250, label %254
250: ; preds = %246
%251 = load i8, i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0)
%252 = sext i8 %251 to i32
%253 = icmp ne i32 %252, 40
br label %254
254: ; preds = %250, %246
%255 = phi i1 [ false, %246 ], [ %253, %250 ]
br i1 %255, label %256, label %263
256: ; preds = %254
%257 = call i32 @strlen(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0))
%258 = icmp sge i32 %257, 398
br i1 %258, label %259, label %262
259: ; preds = %256
%260 = load i32, i32* @stderr
%261 = call i32 (i32, i8*, ...) @fprintf(i32 %260, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0))
store i32 1, i32* %3
br label %425
262: ; preds = %256
br label %246
263: ; preds = %254
%264 = load i8*, i8** %18
%265 = icmp ne i8* %264, null
br i1 %265, label %267, label %266
266: ; preds = %263
br label %414
267: ; preds = %263
store i32 0, i32* %14
%268 = call i32 @sscanf(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @main.log_tv, i32 0, i32 0), i32* getelementptr inbounds (%struct.timeval, %struct.timeval* @main.log_tv, i32 0, i32 1), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.ascframe, i64 0, i64 0))
%269 = icmp ne i32 %268, 4
br i1 %269, label %270, label %273
270: ; preds = %267
%271 = load i32, i32* @stderr
%272 = call i32 (i32, i8*, ...) @fprintf(i32 %271, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0))
store i32 1, i32* %3
br label %425
273: ; preds = %267
%274 = load i32, i32* %11
%275 = icmp ne i32 %274, 0
br i1 %275, label %276, label %279
276: ; preds = %273
%277 = call i32 @gettimeofday(%struct.timeval* @main.today_tv, i32* null)
%278 = call i32 @create_diff_tv(%struct.timeval* @main.today_tv, %struct.timeval* @main.diff_tv, %struct.timeval* @main.log_tv)
br label %279
279: ; preds = %276, %273
br label %280
280: ; preds = %408, %279
%281 = load i32, i32* %14
%282 = icmp ne i32 %281, 0
%283 = xor i1 %282, true
br i1 %283, label %284, label %412
284: ; preds = %280
br label %285
285: ; preds = %403, %284
%286 = load i32, i32* %11
%287 = icmp ne i32 %286, 0
br i1 %287, label %288, label %291
288: ; preds = %285
%289 = call i64 @frames_to_send(%struct.timeval* @main.today_tv, %struct.timeval* @main.diff_tv, %struct.timeval* @main.log_tv)
%290 = icmp slt i64 %289, 0
br label %291
291: ; preds = %288, %285
%292 = phi i1 [ true, %285 ], [ %290, %288 ]
br i1 %292, label %293, label %404
293: ; preds = %291
%294 = call i32 @strlen(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0))
%295 = load i32, i32* @IFNAMSIZ
%296 = icmp sge i32 %294, %295
br i1 %296, label %297, label %300
297: ; preds = %293
%298 = load i32, i32* @stderr
%299 = call i32 (i32, i8*, ...) @fprintf(i32 %298, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0))
store i32 1, i32* %3
br label %425
300: ; preds = %293
%301 = call i32 @get_txidx(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0))
store i32 %301, i32* %13
%302 = load i32, i32* %13
%303 = icmp ne i32 %302, 0
br i1 %303, label %315, label %304
304: ; preds = %300
%305 = load i32, i32* %12
%306 = icmp ne i32 %305, 0
br i1 %306, label %315, label %307
307: ; preds = %304
%308 = load i32, i32* %8
%309 = load i32, i32* @main.verbose
%310 = call i64 @add_assignment(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i32 %308, i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0), i32 %309)
%311 = icmp ne i64 %310, 0
br i1 %311, label %312, label %313
312: ; preds = %307
store i32 1, i32* %3
br label %425
313: ; preds = %307
%314 = call i32 @get_txidx(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0))
store i32 %314, i32* %13
br label %315
315: ; preds = %313, %304, %300
%316 = load i32, i32* %13
%317 = icmp eq i32 %316, 65536
br i1 %317, label %318, label %322
318: ; preds = %315
%319 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0))
%320 = load i32, i32* @stdout
%321 = call i32 @fflush(i32 %320)
br label %354
322: ; preds = %315
%323 = load i32, i32* %13
%324 = icmp sgt i32 %323, 0
br i1 %324, label %325, label %353
325: ; preds = %322
%326 = call i64 @parse_canframe(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.ascframe, i64 0, i64 0), %struct.can_frame* @main.frame)
%327 = icmp ne i64 %326, 0
br i1 %327, label %328, label %331
328: ; preds = %325
%329 = load i32, i32* @stderr
%330 = call i32 (i32, i8*, ...) @fprintf(i32 %329, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.ascframe, i64 0, i64 0))
store i32 1, i32* %3
br label %425
331: ; preds = %325
%332 = load i8*, i8** @AF_CAN
%333 = getelementptr inbounds %struct.sockaddr_can, %struct.sockaddr_can* %6, i32 0, i32 1
store i8* %332, i8** %333
%334 = load i32, i32* %13
%335 = getelementptr inbounds %struct.sockaddr_can, %struct.sockaddr_can* %6, i32 0, i32 0
store i32 %334, i32* %335
%336 = load i32, i32* %8
%337 = bitcast %struct.sockaddr_can* %6 to %struct.sockaddr*
%338 = call i32 @sendto(i32 %336, %struct.can_frame* @main.frame, i32 4, i32 0, %struct.sockaddr* %337, i32 16)
store i32 %338, i32* %15
%339 = load i32, i32* %15
%340 = sext i32 %339 to i64
%341 = icmp ne i64 %340, 4
br i1 %341, label %342, label %344
342: ; preds = %331
%343 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0))
store i32 1, i32* %3
br label %425
344: ; preds = %331
%345 = load i32, i32* @main.verbose
%346 = icmp ne i32 %345, 0
br i1 %346, label %347, label %352
347: ; preds = %344
%348 = call i8* @get_txname(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0))
%349 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), i8* %348, i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0))
%350 = load i32, i32* @stdout
%351 = call i32 @fprint_long_canframe(i32 %350, %struct.can_frame* @main.frame, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0), i32 1)
br label %352
352: ; preds = %347, %344
br label %353
353: ; preds = %352, %322
br label %354
354: ; preds = %353, %318
br label %355
355: ; preds = %371, %354
%356 = load i32*, i32** %9
%357 = call i8* @fgets(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0), i32 399, i32* %356)
store i8* %357, i8** %18
%358 = icmp ne i8* %357, null
br i1 %358, label %359, label %363
359: ; preds = %355
%360 = load i8, i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0)
%361 = sext i8 %360 to i32
%362 = icmp ne i32 %361, 40
br label %363
363: ; preds = %359, %355
%364 = phi i1 [ false, %355 ], [ %362, %359 ]
br i1 %364, label %365, label %372
365: ; preds = %363
%366 = call i32 @strlen(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0))
%367 = icmp sge i32 %366, 398
br i1 %367, label %368, label %371
368: ; preds = %365
%369 = load i32, i32* @stderr
%370 = call i32 (i32, i8*, ...) @fprintf(i32 %369, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0))
store i32 1, i32* %3
br label %425
371: ; preds = %365
br label %355
372: ; preds = %363
%373 = load i8*, i8** %18
%374 = icmp ne i8* %373, null
br i1 %374, label %376, label %375
375: ; preds = %372
store i32 1, i32* %14
br label %404
376: ; preds = %372
%377 = call i32 @sscanf(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @main.log_tv, i32 0, i32 0), i32* getelementptr inbounds (%struct.timeval, %struct.timeval* @main.log_tv, i32 0, i32 1), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.ascframe, i64 0, i64 0))
%378 = icmp ne i32 %377, 4
br i1 %378, label %379, label %382
379: ; preds = %376
%380 = load i32, i32* @stderr
%381 = call i32 (i32, i8*, ...) @fprintf(i32 %380, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0))
store i32 1, i32* %3
br label %425
382: ; preds = %376
%383 = load i32, i32* %11
%384 = icmp ne i32 %383, 0
br i1 %384, label %385, label %403
385: ; preds = %382
%386 = call i32 @gettimeofday(%struct.timeval* @main.today_tv, i32* null)
%387 = load i64, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @main.last_log_tv, i32 0, i32 0)
%388 = load i64, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @main.log_tv, i32 0, i32 0)
%389 = icmp sgt i64 %387, %388
br i1 %389, label %400, label %390
390: ; preds = %385
%391 = load i32, i32* @main.skipgap
%392 = icmp ne i32 %391, 0
br i1 %392, label %393, label %402
393: ; preds = %390
%394 = load i64, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @main.last_log_tv, i32 0, i32 0)
%395 = load i64, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @main.log_tv, i32 0, i32 0)
%396 = sub nsw i64 %394, %395
%397 = call i32 @abs(i64 %396)
%398 = load i32, i32* @main.skipgap
%399 = icmp sgt i32 %397, %398
br i1 %399, label %400, label %402
400: ; preds = %393, %385
%401 = call i32 @create_diff_tv(%struct.timeval* @main.today_tv, %struct.timeval* @main.diff_tv, %struct.timeval* @main.log_tv)
br label %402
402: ; preds = %400, %393, %390
br label %403
403: ; preds = %402, %382
br label %285
404: ; preds = %375, %291
%405 = call i64 @nanosleep(%struct.timespec* %7, i32* null)
%406 = icmp ne i64 %405, 0
br i1 %406, label %407, label %408
407: ; preds = %404
store i32 1, i32* %3
br label %425
408: ; preds = %404
%409 = load i32, i32* @main.delay_loops
%410 = add nsw i32 %409, 1
store i32 %410, i32* @main.delay_loops
%411 = call i32 @gettimeofday(%struct.timeval* @main.today_tv, i32* null)
br label %280
412: ; preds = %280
br label %223
413: ; preds = %230
br label %414
414: ; preds = %413, %266
%415 = load i32, i32* %8
%416 = call i32 @close(i32 %415)
%417 = load i32*, i32** %9
%418 = call i32 @fclose(i32* %417)
%419 = load i32, i32* @main.verbose
%420 = icmp sgt i32 %419, 1
br i1 %420, label %421, label %424
421: ; preds = %414
%422 = load i32, i32* @main.delay_loops
%423 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.23, i64 0, i64 0), i32 %422)
br label %424
424: ; preds = %421, %414
store i32 0, i32* %3
br label %425
425: ; preds = %424, %407, %379, %368, %342, %328, %312, %297, %270, %259, %216, %196, %154, %134, %112, %72, %63, %47, %33
%426 = load i32, i32* %3
ret i32 %426
}

LLVM IR (-O2):
%struct.can_frame = type { i32 }
%struct.timeval = type { i64, i32 }
%struct.sockaddr_can = type { i32, i8* }
%struct.timespec = type { i64, i64 }
%struct.sockaddr = type { i32 }
@main.buf = internal global [400 x i8] zeroinitializer
@main.device = internal global [400 x i8] zeroinitializer
@main.ascframe = internal global [400 x i8] zeroinitializer
@main.frame = internal global %struct.can_frame zeroinitializer
@main.today_tv = internal global %struct.timeval zeroinitializer
@main.log_tv = internal global %struct.timeval zeroinitializer
@main.last_log_tv = internal unnamed_addr global %struct.timeval zeroinitializer
@main.diff_tv = internal global %struct.timeval zeroinitializer
@stdin = global i32* null
@main.verbose = internal unnamed_addr global i32 0
@main.delay_loops = internal unnamed_addr global i32 0
@main.skipgap = internal unnamed_addr global i32 0
@main.loopback_disable = internal unnamed_addr global i1 false
@main.infinite_loops = internal unnamed_addr global i1 false
@main.loops = internal unnamed_addr global i32 1
@.str = [13 x i8] c"I:l:tg:s:xv?\00"
@optarg = global i8* null
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [7 x i8] c"infile\00"
@stderr = global i32 0
@.str.3 = [34 x i8] c"Invalid argument for option -l !\0A\00"
@.str.4 = [34 x i8] c"Invalid argument for option -s !\0A\00"
@optind = global i32 0
@.str.6 = [10 x i8] c"%d loops\0A\00"
@PF_CAN = global i32 0
@SOCK_RAW = global i32 0
@CAN_RAW = global i32 0
@.str.7 = [7 x i8] c"socket\00"
@AF_CAN = global i8* null
@SOL_CAN_RAW = global i32 0
@CAN_RAW_FILTER = global i32 0
@CAN_RAW_LOOPBACK = global i32 0
@.str.8 = [5 x i8] c"bind\00"
@.str.9 = [22 x i8] c"Assignment too long!\0A\00"
@.str.10 = [28 x i8] c"'=' missing in assignment!\0A\00"
@.str.11 = [5 x i8] c"user\00"
@.str.12 = [52 x i8] c">>>>>>>>> start reading file. remaining loops = %d\0A\00"
@.str.13 = [40 x i8] c"comment line too long for input buffer\0A\00"
@.str.14 = [16 x i8] c"(%ld.%ld) %s %s\00"
@.str.15 = [34 x i8] c"incorrect line format in logfile\0A\00"
@IFNAMSIZ = global i32 0
@.str.16 = [34 x i8] c"log interface name '%s' too long!\00"
@.str.17 = [5 x i8] c"auto\00"
@.str.18 = [3 x i8] c"%s\00"
@stdout = global i32 0
@.str.19 = [30 x i8] c"wrong CAN frame format: '%s'!\00"
@.str.20 = [7 x i8] c"sendto\00"
@.str.21 = [9 x i8] c"%s (%s) \00"
@.str.22 = [2 x i8] c"\0A\00"
@.str.23 = [16 x i8] c"%d delay_loops\0A\00"
@str = [15 x i8] c"infinite_loops\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.sockaddr_can
%4 = alloca %struct.timespec
%5 = alloca i32
%6 = bitcast %struct.sockaddr_can* %3 to i8*
%7 = bitcast %struct.timespec* %4 to i8*
%8 = load i32*, i32** @stdin
br label %9
9: ; preds = %14, %2
%10 = phi i64 [ 1, %2 ], [ %15, %14 ]
%11 = phi i32 [ 1, %2 ], [ %16, %14 ]
%12 = phi i32* [ %8, %2 ], [ %17, %14 ]
%13 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
switch i32 %13, label %52 [
i32 -1, label %56
i32 73, label %18
i32 108, label %24
i32 116, label %14
i32 103, label %35
i32 115, label %39
i32 120, label %48
i32 118, label %49
]
14: ; preds = %9, %39, %28, %29, %18, %49, %48, %35
%15 = phi i64 [ %10, %49 ], [ %10, %48 ], [ %10, %39 ], [ %38, %35 ], [ %10, %28 ], [ %10, %29 ], [ %10, %18 ], [ %10, %9 ]
%16 = phi i32 [ %11, %49 ], [ %11, %48 ], [ %11, %39 ], [ %11, %35 ], [ %11, %28 ], [ %11, %29 ], [ %11, %18 ], [ 0, %9 ]
%17 = phi i32* [ %12, %49 ], [ %12, %48 ], [ %12, %39 ], [ %12, %35 ], [ %12, %28 ], [ %12, %29 ], [ %20, %18 ], [ %12, %9 ]
br label %9
18: ; preds = %9
%19 = load i8*, i8** @optarg
%20 = tail call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %14
22: ; preds = %18
%23 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %325
24: ; preds = %9
%25 = load i8*, i8** @optarg
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 105
br i1 %27, label %28, label %29
28: ; preds = %24
store i1 true, i1* @main.infinite_loops
br label %14
29: ; preds = %24
%30 = tail call i32 @atoi(i8* %25)
store i32 %30, i32* @main.loops
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %14
32: ; preds = %29
%33 = load i32, i32* @stderr
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %325
35: ; preds = %9
%36 = load i8*, i8** @optarg
%37 = tail call i8* @strtoul(i8* nocapture %36, i32* null, i32 10)
%38 = ptrtoint i8* %37 to i64
br label %14
39: ; preds = %9
%40 = load i8*, i8** @optarg
%41 = tail call i8* @strtoul(i8* nocapture %40, i32* null, i32 10)
%42 = ptrtoint i8* %41 to i64
%43 = trunc i64 %42 to i32
store i32 %43, i32* @main.skipgap
%44 = icmp slt i32 %43, 1
br i1 %44, label %45, label %14
45: ; preds = %39
%46 = load i32, i32* @stderr
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
br label %325
48: ; preds = %9
store i1 true, i1* @main.loopback_disable
br label %14
49: ; preds = %9
%50 = load i32, i32* @main.verbose
%51 = add nsw i32 %50, 1
store i32 %51, i32* @main.verbose
br label %14
52: ; preds = %9
%53 = load i8*, i8** %1
%54 = tail call i32 @basename(i8* %53)
%55 = tail call i32 @print_usage(i32 %54)
br label %325
56: ; preds = %9
%57 = load i32, i32* @optind
%58 = sub i32 %0, %57
%59 = load i32*, i32** @stdin
%60 = icmp eq i32* %12, %59
br i1 %60, label %61, label %62
61: ; preds = %56
store i1 false, i1* @main.infinite_loops
store i32 1, i32* @main.loops
br label %62
62: ; preds = %61, %56
%63 = load i32, i32* @main.verbose
%64 = icmp sgt i32 %63, 1
br i1 %64, label %65, label %72
65: ; preds = %62
%66 = load i1, i1* @main.infinite_loops
br i1 %66, label %67, label %69
67: ; preds = %65
%68 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %72
69: ; preds = %65
%70 = load i32, i32* @main.loops
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %70)
br label %72
72: ; preds = %67, %69, %62
%73 = udiv i64 %10, 1000
%74 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 0
store i64 %73, i64* %74
%75 = urem i64 %10, 1000
%76 = mul nuw nsw i64 %75, 1000000
%77 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 1
store i64 %76, i64* %77
%78 = load i32, i32* @PF_CAN
%79 = load i32, i32* @SOCK_RAW
%80 = load i32, i32* @CAN_RAW
%81 = tail call i32 @socket(i32 %78, i32 %79, i32 %80)
%82 = icmp slt i32 %81, 0
br i1 %82, label %83, label %85
83: ; preds = %72
%84 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %325
85: ; preds = %72
%86 = load i8*, i8** @AF_CAN
%87 = getelementptr inbounds %struct.sockaddr_can, %struct.sockaddr_can* %3, i64 0, i32 1
store i8* %86, i8** %87
%88 = getelementptr inbounds %struct.sockaddr_can, %struct.sockaddr_can* %3, i64 0, i32 0
store i32 0, i32* %88
%89 = load i32, i32* @SOL_CAN_RAW
%90 = load i32, i32* @CAN_RAW_FILTER
%91 = tail call i32 @setsockopt(i32 %81, i32 %89, i32 %90, i32* null, i32 0)
%92 = load i1, i1* @main.loopback_disable
br i1 %92, label %93, label %98
93: ; preds = %85
%94 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%95 = load i32, i32* @SOL_CAN_RAW
%96 = load i32, i32* @CAN_RAW_LOOPBACK
%97 = call i32 @setsockopt(i32 %81, i32 %95, i32 %96, i32* %5, i32 4)
br label %98
98: ; preds = %93, %85
%99 = bitcast %struct.sockaddr_can* %3 to %struct.sockaddr*
%100 = call i64 @bind(i32 %81, %struct.sockaddr* %99, i32 16)
%101 = icmp slt i64 %100, 0
br i1 %101, label %102, label %104
102: ; preds = %98
%103 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %325
104: ; preds = %98
%105 = icmp ne i32 %58, 0
%106 = icmp sgt i32 %58, 0
br i1 %106, label %109, label %179
107: ; preds = %171
%108 = icmp eq i32 %178, %58
br i1 %108, label %179, label %109
109: ; preds = %104, %107
%110 = phi i32 [ %178, %107 ], [ 0, %104 ]
%111 = load i32, i32* @optind
%112 = add nsw i32 %111, %110
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8*, i8** %1, i64 %113
%115 = load i8*, i8** %114
%116 = call i32 @strlen(i8* %115)
%117 = icmp sgt i32 %116, 399
br i1 %117, label %118, label %124
118: ; preds = %109
%119 = load i32, i32* @stderr
%120 = call i32 (i32, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%121 = load i8*, i8** %1
%122 = call i32 @basename(i8* %121)
%123 = call i32 @print_usage(i32 %122)
br label %325
124: ; preds = %109
%125 = load i32, i32* @optind
%126 = add nsw i32 %125, %110
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i8*, i8** %1, i64 %127
%129 = load i8*, i8** %128
%130 = call i32 @strcpy(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0), i8* %129)
br label %131
131: ; preds = %156, %124
%132 = phi i64 [ 0, %124 ], [ %157, %156 ]
%133 = getelementptr inbounds [400 x i8], [400 x i8]* @main.buf, i64 0, i64 %132
%134 = load i8, i8* %133
%135 = icmp eq i8 %134, 61
br i1 %135, label %159, label %136
136: ; preds = %131
%137 = add nuw nsw i64 %132, 1
%138 = getelementptr inbounds [400 x i8], [400 x i8]* @main.buf, i64 0, i64 %137
%139 = load i8, i8* %138
%140 = icmp eq i8 %139, 61
br i1 %140, label %159, label %141
141: ; preds = %136
%142 = add nuw nsw i64 %132, 2
%143 = getelementptr inbounds [400 x i8], [400 x i8]* @main.buf, i64 0, i64 %142
%144 = load i8, i8* %143
%145 = icmp eq i8 %144, 61
br i1 %145, label %159, label %146
146: ; preds = %141
%147 = add nuw nsw i64 %132, 3
%148 = getelementptr inbounds [400 x i8], [400 x i8]* @main.buf, i64 0, i64 %147
%149 = load i8, i8* %148
%150 = icmp eq i8 %149, 61
br i1 %150, label %159, label %151
151: ; preds = %146
%152 = add nuw nsw i64 %132, 4
%153 = getelementptr inbounds [400 x i8], [400 x i8]* @main.buf, i64 0, i64 %152
%154 = load i8, i8* %153
%155 = icmp eq i8 %154, 61
br i1 %155, label %159, label %156
156: ; preds = %151
%157 = add nuw nsw i64 %132, 5
%158 = icmp eq i64 %157, 400
br i1 %158, label %165, label %131
159: ; preds = %151, %146, %141, %136, %131
%160 = phi i64 [ %132, %131 ], [ %137, %136 ], [ %142, %141 ], [ %147, %146 ], [ %152, %151 ]
%161 = and i64 %160, 4294967295
%162 = getelementptr inbounds [400 x i8], [400 x i8]* @main.buf, i64 0, i64 %161
%163 = load i8, i8* %162
%164 = icmp eq i8 %163, 61
br i1 %164, label %171, label %165
165: ; preds = %159, %156
%166 = load i32, i32* @stderr
%167 = call i32 (i32, i8*, ...) @fprintf(i32 %166, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0))
%168 = load i8*, i8** %1
%169 = call i32 @basename(i8* %168)
%170 = call i32 @print_usage(i32 %169)
br label %325
171: ; preds = %159
store i8 0, i8* %162
%172 = add nuw i64 %160, 1
%173 = and i64 %172, 4294967295
%174 = getelementptr inbounds [400 x i8], [400 x i8]* @main.buf, i64 0, i64 %173
%175 = load i32, i32* @main.verbose
%176 = call i64 @add_assignment(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 %81, i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0), i8* %174, i32 %175)
%177 = icmp eq i64 %176, 0
%178 = add nuw nsw i32 %110, 1
br i1 %177, label %107, label %325
179: ; preds = %107, %104
%180 = icmp eq i32 %11, 0
br label %181
181: ; preds = %313, %179
%182 = load i1, i1* @main.infinite_loops
br i1 %182, label %187, label %183
183: ; preds = %181
%184 = load i32, i32* @main.loops
%185 = add nsw i32 %184, -1
store i32 %185, i32* @main.loops
%186 = icmp eq i32 %184, 0
br i1 %186, label %317, label %187
187: ; preds = %181, %183
%188 = load i32*, i32** @stdin
%189 = icmp eq i32* %12, %188
br i1 %189, label %192, label %190
190: ; preds = %187
%191 = call i32 @rewind(i32* %12)
br label %192
192: ; preds = %190, %187
%193 = load i32, i32* @main.verbose
%194 = icmp sgt i32 %193, 1
br i1 %194, label %195, label %198
195: ; preds = %192
%196 = load i32, i32* @main.loops
%197 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.12, i64 0, i64 0), i32 %196)
br label %198
198: ; preds = %195, %192
br label %199
199: ; preds = %198, %205
%200 = call i8* @fgets(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0), i32 399, i32* %12)
%201 = icmp ne i8* %200, null
%202 = load i8, i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0)
%203 = icmp ne i8 %202, 40
%204 = select i1 %201, i1 %203, i1 false
br i1 %204, label %205, label %211
205: ; preds = %199
%206 = call i32 @strlen(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0))
%207 = icmp sgt i32 %206, 397
br i1 %207, label %208, label %199
208: ; preds = %205
%209 = load i32, i32* @stderr
%210 = call i32 (i32, i8*, ...) @fprintf(i32 %209, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0))
br label %325
211: ; preds = %199
br i1 %201, label %212, label %317
212: ; preds = %211
%213 = call i32 @sscanf(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @main.log_tv, i64 0, i32 0), i32* getelementptr inbounds (%struct.timeval, %struct.timeval* @main.log_tv, i64 0, i32 1), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.ascframe, i64 0, i64 0))
%214 = icmp eq i32 %213, 4
br i1 %214, label %218, label %215
215: ; preds = %212
%216 = load i32, i32* @stderr
%217 = call i32 (i32, i8*, ...) @fprintf(i32 %216, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0))
br label %325
218: ; preds = %212
br i1 %180, label %228, label %219
219: ; preds = %218
%220 = call i32 @gettimeofday(%struct.timeval* @main.today_tv, i32* null)
br label %221
221: ; preds = %296, %304, %219
%222 = call i32 @create_diff_tv(%struct.timeval* @main.today_tv, %struct.timeval* @main.diff_tv, %struct.timeval* @main.log_tv)
br label %223
223: ; preds = %221, %301, %304
br label %224
224: ; preds = %223, %313
br i1 %180, label %228, label %225
225: ; preds = %224
%226 = call i64 @frames_to_send(%struct.timeval* @main.today_tv, %struct.timeval* @main.diff_tv, %struct.timeval* @main.log_tv)
%227 = icmp slt i64 %226, 0
br i1 %227, label %228, label %309
228: ; preds = %225, %224, %218
br label %229
229: ; preds = %228, %295
%230 = call i32 @strlen(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0))
%231 = load i32, i32* @IFNAMSIZ
%232 = icmp slt i32 %230, %231
br i1 %232, label %236, label %233
233: ; preds = %229
%234 = load i32, i32* @stderr
%235 = call i32 (i32, i8*, ...) @fprintf(i32 %234, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0))
br label %325
236: ; preds = %229
%237 = call i32 @get_txidx(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0))
%238 = icmp ne i32 %237, 0
%239 = select i1 %238, i1 true, i1 %105
br i1 %239, label %246, label %240
240: ; preds = %236
%241 = load i32, i32* @main.verbose
%242 = call i64 @add_assignment(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i32 %81, i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0), i32 %241)
%243 = icmp eq i64 %242, 0
br i1 %243, label %244, label %325
244: ; preds = %240
%245 = call i32 @get_txidx(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0))
br label %246
246: ; preds = %244, %236
%247 = phi i32 [ %237, %236 ], [ %245, %244 ]
%248 = icmp eq i32 %247, 65536
br i1 %248, label %249, label %253
249: ; preds = %246
%250 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0))
%251 = load i32, i32* @stdout
%252 = call i32 @fflush(i32 %251)
br label %275
253: ; preds = %246
%254 = icmp sgt i32 %247, 0
br i1 %254, label %255, label %275
255: ; preds = %253
%256 = call i64 @parse_canframe(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.ascframe, i64 0, i64 0), %struct.can_frame* @main.frame)
%257 = icmp eq i64 %256, 0
br i1 %257, label %261, label %258
258: ; preds = %255
%259 = load i32, i32* @stderr
%260 = call i32 (i32, i8*, ...) @fprintf(i32 %259, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.ascframe, i64 0, i64 0))
br label %325
261: ; preds = %255
%262 = load i8*, i8** @AF_CAN
store i8* %262, i8** %87
store i32 %247, i32* %88
%263 = call i32 @sendto(i32 %81, %struct.can_frame* @main.frame, i32 4, i32 0, %struct.sockaddr* %99, i32 16)
%264 = icmp eq i32 %263, 4
br i1 %264, label %267, label %265
265: ; preds = %261
%266 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0))
br label %325
267: ; preds = %261
%268 = load i32, i32* @main.verbose
%269 = icmp eq i32 %268, 0
br i1 %269, label %275, label %270
270: ; preds = %267
%271 = call i8* @get_txname(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0))
%272 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), i8* %271, i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0))
%273 = load i32, i32* @stdout
%274 = call i32 @fprint_long_canframe(i32 %273, %struct.can_frame* @main.frame, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0), i32 1)
br label %275
275: ; preds = %253, %270, %267, %249
br label %276
276: ; preds = %275, %282
%277 = call i8* @fgets(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0), i32 399, i32* %12)
%278 = icmp ne i8* %277, null
%279 = load i8, i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0)
%280 = icmp ne i8 %279, 40
%281 = select i1 %278, i1 %280, i1 false
br i1 %281, label %282, label %288
282: ; preds = %276
%283 = call i32 @strlen(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0))
%284 = icmp sgt i32 %283, 397
br i1 %284, label %285, label %276
285: ; preds = %282
%286 = load i32, i32* @stderr
%287 = call i32 (i32, i8*, ...) @fprintf(i32 %286, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0))
br label %325
288: ; preds = %276
br i1 %278, label %289, label %309
289: ; preds = %288
%290 = call i32 @sscanf(i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.buf, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @main.log_tv, i64 0, i32 0), i32* getelementptr inbounds (%struct.timeval, %struct.timeval* @main.log_tv, i64 0, i32 1), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.device, i64 0, i64 0), i8* getelementptr inbounds ([400 x i8], [400 x i8]* @main.ascframe, i64 0, i64 0))
%291 = icmp eq i32 %290, 4
br i1 %291, label %295, label %292
292: ; preds = %289
%293 = load i32, i32* @stderr
%294 = call i32 (i32, i8*, ...) @fprintf(i32 %293, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0))
br label %325
295: ; preds = %289
br i1 %180, label %229, label %296
296: ; preds = %295
%297 = call i32 @gettimeofday(%struct.timeval* @main.today_tv, i32* null)
%298 = load i64, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @main.last_log_tv, i64 0, i32 0)
%299 = load i64, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @main.log_tv, i64 0, i32 0)
%300 = icmp sgt i64 %298, %299
br i1 %300, label %221, label %301
301: ; preds = %296
%302 = load i32, i32* @main.skipgap
%303 = icmp eq i32 %302, 0
br i1 %303, label %223, label %304
304: ; preds = %301
%305 = sub nsw i64 %298, %299
%306 = call i32 @abs(i64 %305)
%307 = load i32, i32* @main.skipgap
%308 = icmp sgt i32 %306, %307
br i1 %308, label %221, label %223
309: ; preds = %288, %225
%310 = phi i1 [ true, %225 ], [ false, %288 ]
%311 = call i64 @nanosleep(%struct.timespec* %4, i32* null)
%312 = icmp eq i64 %311, 0
br i1 %312, label %313, label %325
313: ; preds = %309
%314 = load i32, i32* @main.delay_loops
%315 = add nsw i32 %314, 1
store i32 %315, i32* @main.delay_loops
%316 = call i32 @gettimeofday(%struct.timeval* @main.today_tv, i32* null)
br i1 %310, label %224, label %181
317: ; preds = %183, %211
%318 = call i32 @close(i32 %81)
%319 = call i32 @fclose(i32* %12)
%320 = load i32, i32* @main.verbose
%321 = icmp sgt i32 %320, 1
br i1 %321, label %322, label %325
322: ; preds = %317
%323 = load i32, i32* @main.delay_loops
%324 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.23, i64 0, i64 0), i32 %323)
br label %325
325: ; preds = %171, %309, %240, %317, %322, %292, %285, %265, %258, %233, %215, %208, %165, %118, %102, %83, %52, %45, %32, %22
%326 = phi i32 [ 1, %52 ], [ 1, %45 ], [ 1, %32 ], [ 1, %22 ], [ 1, %83 ], [ 1, %102 ], [ 1, %118 ], [ 1, %165 ], [ 1, %208 ], [ 1, %215 ], [ 1, %233 ], [ 1, %285 ], [ 1, %292 ], [ 1, %258 ], [ 1, %265 ], [ 0, %322 ], [ 0, %317 ], [ 1, %240 ], [ 1, %309 ], [ 1, %171 ]
ret i32 %326
}