#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 */

/* Variables and functions */
int CGW_CRC8PRF_16U8;
int CGW_CRC8PRF_1U8;
int CGW_CRC8PRF_SFFID_XOR;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void print_usage(char *prg) {
  fprintf(stderr, "\nUsage: %s [options]\n\n", prg);
  fprintf(stderr, "Commands:  -A (add a new rule)\n");
  fprintf(stderr, "           -D (delete a rule)\n");
  fprintf(stderr, "           -F (flush / delete all rules)\n");
  fprintf(stderr, "           -L (list all rules)\n");
  fprintf(stderr, "Mandatory: -s <src_dev>  (source netdevice)\n");
  fprintf(stderr, "           -d <dst_dev>  (destination netdevice)\n");
  fprintf(stderr, "Options:   -t (preserve src_dev rx timestamp)\n");
  fprintf(stderr, "           -e (echo sent frames - recommended on vcanx)\n");
  fprintf(stderr, "           -f <filter> (set CAN filter)\n");
  fprintf(stderr, "           -m <mod> (set frame modifications)\n");
  fprintf(stderr,
          "           -x <from_idx>:<to_idx>:<result_idx>:<init_xor_val> (XOR "
          "checksum)\n");
  fprintf(
      stderr,
      "           -c <from>:<to>:<result>:<init_val>:<xor_val>:<crctab[256]> "
      "(CRC8 cs)\n");
  fprintf(stderr, "           -p <profile>:[<profile_data>] (CRC8 checksum "
                  "profile & parameters)\n");
  fprintf(stderr, "\nValues are given and expected in hexadecimal values. "
                  "Leading 0s can be omitted.\n");
  fprintf(stderr, "\n");
  fprintf(stderr, "<filter> is a <value><mask> CAN identifier filter\n");
  fprintf(stderr, "   <can_id>:<can_mask> (matches when <received_can_id> & "
                  "mask == can_id & mask)\n");
  fprintf(stderr, "   <can_id>~<can_mask> (matches when <received_can_id> & "
                  "mask != can_id & mask)\n");
  fprintf(stderr, "\n");
  fprintf(stderr,
          "<mod> is a CAN frame modification instruction consisting of\n");
  fprintf(stderr,
          "<instruction>:<can_frame-elements>:<can_id>.<can_dlc>.<can_data>\n");
  fprintf(stderr, " - <instruction> is one of 'AND' 'OR' 'XOR' 'SET'\n");
  fprintf(stderr, " - <can_frame-elements> is _one_ or _more_ of 'I'dentifier "
                  "'L'ength 'D'ata\n");
  fprintf(stderr,
          " - <can_id> is an u32 value containing the CAN Identifier\n");
  fprintf(
      stderr,
      " - <can_dlc> is an u8 value containing the data length code (0 .. 8)\n");
  fprintf(stderr, " - <can_data> is always eight(!) u8 values containing the "
                  "CAN frames data\n");
  fprintf(stderr, "The max. four modifications are performed in the order AND "
                  "-> OR -> XOR -> SET\n");
  fprintf(stderr, "\n");
  fprintf(stderr, "Example:\n");
  fprintf(stderr,
          "%s -A -s can0 -d vcan3 -e -f 123:C00007FF -m "
          "SET:IL:333.4.1122334455667788\n",
          prg);
  fprintf(stderr, "\n");
  fprintf(stderr, "Supported CRC 8 profiles:\n");
  fprintf(stderr, "Profile '%d' (1U8)       - add one additional u8 value\n",
          CGW_CRC8PRF_1U8);
  fprintf(stderr,
          "Profile '%d' (16U8)      - add u8 value from table[16] indexed by "
          "(data[1] & 0xF)\n",
          CGW_CRC8PRF_16U8);
  fprintf(stderr,
          "Profile '%d' (SFFID_XOR) - add u8 value (can_id & 0xFF) ^ (can_id "
          ">> 8 & 0xFF)\n",
          CGW_CRC8PRF_SFFID_XOR);
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
lea    0xef4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
lea    0xefd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
lea    0xf13(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e10(%rip),%rax
mov    (%rax),%edi
lea    0xf2e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2df9(%rip),%rax
mov    (%rax),%edi
lea    0xf46(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2de2(%rip),%rax
mov    (%rax),%edi
lea    0xf68(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
lea    0xf7a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2db4(%rip),%rax
mov    (%rax),%edi
lea    0xf92(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d9d(%rip),%rax
mov    (%rax),%edi
lea    0xfc9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
lea    0x1003(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d6f(%rip),%rax
mov    (%rax),%edi
lea    0x103b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d58(%rip),%rax
mov    (%rax),%edi
lea    0xd8c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
lea    0x105f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d2a(%rip),%rax
mov    (%rax),%edi
lea    0x107b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d13(%rip),%rax
mov    (%rax),%edi
lea    0x10b5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2cfc(%rip),%rax
mov    (%rax),%edi
lea    0xd30(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ce5(%rip),%rax
mov    (%rax),%edi
lea    0x10d8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2cce(%rip),%rax
mov    (%rax),%edi
lea    0x10fe(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2cb7(%rip),%rax
mov    (%rax),%edi
lea    0x1129(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ca0(%rip),%rax
mov    (%rax),%edi
lea    0x1145(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c89(%rip),%rax
mov    (%rax),%edi
lea    0x117a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c72(%rip),%rax
mov    (%rax),%edi
lea    0x119e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c5b(%rip),%rax
mov    (%rax),%edi
lea    0x11cd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c44(%rip),%rax
mov    (%rax),%edi
lea    0x1201(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c2d(%rip),%rax
mov    (%rax),%edi
lea    0xc61(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c16(%rip),%rax
mov    (%rax),%edi
lea    0x1223(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2bff(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x1212(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2be4(%rip),%rax
mov    (%rax),%edi
lea    0xc18(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2bcd(%rip),%rax
mov    (%rax),%edi
lea    0x1230(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2bb6(%rip),%rax
mov    (%rax),%edi
mov    0x2b9d(%rip),%rax
mov    (%rax),%edx
lea    0x122b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b96(%rip),%rax
mov    (%rax),%edi
mov    0x2b9d(%rip),%rax
mov    (%rax),%edx
lea    0x1243(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b76(%rip),%rax
mov    (%rax),%edi
mov    0x2b65(%rip),%rax
mov    (%rax),%edx
lea    0x1276(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b56(%rip),%rax
mov    (%rax),%edi
lea    0xb8a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2eb9(%rip),%rbx
mov    (%rbx),%edi
lea    0xed8(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefb(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf15(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf25(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf42(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf64(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf83(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfac(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfc5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfe4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1022(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1063(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10a2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xdfa(%rip),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10d1(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10f4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1135(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x116a(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1197(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x11c9(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x11ec(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1228(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1253(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1289(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x12c4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x12f8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x12f2(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x131f(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    0x2c93(%rip),%rax
mov    (%rax),%edx
lea    0x1321(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    0x2c9a(%rip),%rax
mov    (%rax),%edx
lea    0x1340(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    0x2c69(%rip),%rax
mov    (%rax),%edx
lea    0x137a(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"\0AUsage: %s [options]\0A\0A\00"
@.str.1 = [32 x i8] c"Commands: -A (add a new rule)\0A\00"
@.str.2 = [31 x i8] c" -D (delete a rule)\0A\00"
@.str.3 = [42 x i8] c" -F (flush / delete all rules)\0A\00"
@.str.4 = [32 x i8] c" -L (list all rules)\0A\00"
@.str.5 = [45 x i8] c"Mandatory: -s <src_dev> (source netdevice)\0A\00"
@.str.6 = [50 x i8] c" -d <dst_dev> (destination netdevice)\0A\00"
@.str.7 = [47 x i8] c"Options: -t (preserve src_dev rx timestamp)\0A\00"
@.str.8 = [57 x i8] c" -e (echo sent frames - recommended on vcanx)\0A\00"
@.str.9 = [41 x i8] c" -f <filter> (set CAN filter)\0A\00"
@.str.10 = [47 x i8] c" -m <mod> (set frame modifications)\0A\00"
@.str.11 = [78 x i8] c" -x <from_idx>:<to_idx>:<result_idx>:<init_xor_val> (XOR checksum)\0A\00"
@.str.12 = [81 x i8] c" -c <from>:<to>:<result>:<init_val>:<xor_val>:<crctab[256]> (CRC8 cs)\0A\00"
@.str.13 = [79 x i8] c" -p <profile>:[<profile_data>] (CRC8 checksum profile & parameters)\0A\00"
@.str.14 = [82 x i8] c"\0AValues are given and expected in hexadecimal values. Leading 0s can be omitted.\0A\00"
@.str.15 = [2 x i8] c"\0A\00"
@.str.16 = [51 x i8] c"<filter> is a <value><mask> CAN identifier filter\0A\00"
@.str.17 = [81 x i8] c" <can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask)\0A\00"
@.str.18 = [81 x i8] c" <can_id>~<can_mask> (matches when <received_can_id> & mask != can_id & mask)\0A\00"
@.str.19 = [61 x i8] c"<mod> is a CAN frame modification instruction consisting of\0A\00"
@.str.20 = [66 x i8] c"<instruction>:<can_frame-elements>:<can_id>.<can_dlc>.<can_data>\0A\00"
@.str.21 = [51 x i8] c" - <instruction> is one of 'AND' 'OR' 'XOR' 'SET'\0A\00"
@.str.22 = [76 x i8] c" - <can_frame-elements> is _one_ or _more_ of 'I'dentifier 'L'ength 'D'ata\0A\00"
@.str.23 = [59 x i8] c" - <can_id> is an u32 value containing the CAN Identifier\0A\00"
@.str.24 = [70 x i8] c" - <can_dlc> is an u8 value containing the data length code (0 .. 8)\0A\00"
@.str.25 = [75 x i8] c" - <can_data> is always eight(!) u8 values containing the CAN frames data\0A\00"
@.str.26 = [80 x i8] c"The max. four modifications are performed in the order AND -> OR -> XOR -> SET\0A\00"
@.str.27 = [10 x i8] c"Example:\0A\00"
@.str.28 = [76 x i8] c"%s -A -s can0 -d vcan3 -e -f 123:C00007FF -m SET:IL:333.4.1122334455667788\0A\00"
@.str.29 = [27 x i8] c"Supported CRC 8 profiles:\0A\00"
@.str.30 = [56 x i8] c"Profile '%d' (1U8) - add one additional u8 value\0A\00"
@CGW_CRC8PRF_1U8 = global i32 0
@.str.31 = [83 x i8] c"Profile '%d' (16U8) - add u8 value from table[16] indexed by (data[1] & 0xF)\0A\00"
@CGW_CRC8PRF_16U8 = global i32 0
@.str.32 = [80 x i8] c"Profile '%d' (SFFID_XOR) - add u8 value (can_id & 0xFF) ^ (can_id >> 8 & 0xFF)\0A\00"
@CGW_CRC8PRF_SFFID_XOR = global i32 0
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.8, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.11, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.12, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.13, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.14, i64 0, i64 0))
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.16, i64 0, i64 0))
%38 = load i32, i32* @stderr
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.17, i64 0, i64 0))
%40 = load i32, i32* @stderr
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.18, i64 0, i64 0))
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%44 = load i32, i32* @stderr
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.19, i64 0, i64 0))
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.20, i64 0, i64 0))
%48 = load i32, i32* @stderr
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.21, i64 0, i64 0))
%50 = load i32, i32* @stderr
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.22, i64 0, i64 0))
%52 = load i32, i32* @stderr
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.23, i64 0, i64 0))
%54 = load i32, i32* @stderr
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.24, i64 0, i64 0))
%56 = load i32, i32* @stderr
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.25, i64 0, i64 0))
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.26, i64 0, i64 0))
%60 = load i32, i32* @stderr
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%62 = load i32, i32* @stderr
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.27, i64 0, i64 0))
%64 = load i32, i32* @stderr
%65 = load i8*, i8** %2
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.28, i64 0, i64 0), i8* %65)
%67 = load i32, i32* @stderr
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%69 = load i32, i32* @stderr
%70 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.29, i64 0, i64 0))
%71 = load i32, i32* @stderr
%72 = load i32, i32* @CGW_CRC8PRF_1U8
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.30, i64 0, i64 0), i32 %72)
%74 = load i32, i32* @stderr
%75 = load i32, i32* @CGW_CRC8PRF_16U8
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.31, i64 0, i64 0), i32 %75)
%77 = load i32, i32* @stderr
%78 = load i32, i32* @CGW_CRC8PRF_SFFID_XOR
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.32, i64 0, i64 0), i32 %78)
%80 = load i32, i32* @stderr
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"\0AUsage: %s [options]\0A\0A\00"
@.str.1 = [32 x i8] c"Commands: -A (add a new rule)\0A\00"
@.str.2 = [31 x i8] c" -D (delete a rule)\0A\00"
@.str.3 = [42 x i8] c" -F (flush / delete all rules)\0A\00"
@.str.4 = [32 x i8] c" -L (list all rules)\0A\00"
@.str.5 = [45 x i8] c"Mandatory: -s <src_dev> (source netdevice)\0A\00"
@.str.6 = [50 x i8] c" -d <dst_dev> (destination netdevice)\0A\00"
@.str.7 = [47 x i8] c"Options: -t (preserve src_dev rx timestamp)\0A\00"
@.str.8 = [57 x i8] c" -e (echo sent frames - recommended on vcanx)\0A\00"
@.str.9 = [41 x i8] c" -f <filter> (set CAN filter)\0A\00"
@.str.10 = [47 x i8] c" -m <mod> (set frame modifications)\0A\00"
@.str.11 = [78 x i8] c" -x <from_idx>:<to_idx>:<result_idx>:<init_xor_val> (XOR checksum)\0A\00"
@.str.12 = [81 x i8] c" -c <from>:<to>:<result>:<init_val>:<xor_val>:<crctab[256]> (CRC8 cs)\0A\00"
@.str.13 = [79 x i8] c" -p <profile>:[<profile_data>] (CRC8 checksum profile & parameters)\0A\00"
@.str.14 = [82 x i8] c"\0AValues are given and expected in hexadecimal values. Leading 0s can be omitted.\0A\00"
@.str.15 = [2 x i8] c"\0A\00"
@.str.16 = [51 x i8] c"<filter> is a <value><mask> CAN identifier filter\0A\00"
@.str.17 = [81 x i8] c" <can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask)\0A\00"
@.str.18 = [81 x i8] c" <can_id>~<can_mask> (matches when <received_can_id> & mask != can_id & mask)\0A\00"
@.str.19 = [61 x i8] c"<mod> is a CAN frame modification instruction consisting of\0A\00"
@.str.20 = [66 x i8] c"<instruction>:<can_frame-elements>:<can_id>.<can_dlc>.<can_data>\0A\00"
@.str.21 = [51 x i8] c" - <instruction> is one of 'AND' 'OR' 'XOR' 'SET'\0A\00"
@.str.22 = [76 x i8] c" - <can_frame-elements> is _one_ or _more_ of 'I'dentifier 'L'ength 'D'ata\0A\00"
@.str.23 = [59 x i8] c" - <can_id> is an u32 value containing the CAN Identifier\0A\00"
@.str.24 = [70 x i8] c" - <can_dlc> is an u8 value containing the data length code (0 .. 8)\0A\00"
@.str.25 = [75 x i8] c" - <can_data> is always eight(!) u8 values containing the CAN frames data\0A\00"
@.str.26 = [80 x i8] c"The max. four modifications are performed in the order AND -> OR -> XOR -> SET\0A\00"
@.str.27 = [10 x i8] c"Example:\0A\00"
@.str.28 = [76 x i8] c"%s -A -s can0 -d vcan3 -e -f 123:C00007FF -m SET:IL:333.4.1122334455667788\0A\00"
@.str.29 = [27 x i8] c"Supported CRC 8 profiles:\0A\00"
@.str.30 = [56 x i8] c"Profile '%d' (1U8) - add one additional u8 value\0A\00"
@CGW_CRC8PRF_1U8 = global i32 0
@.str.31 = [83 x i8] c"Profile '%d' (16U8) - add u8 value from table[16] indexed by (data[1] & 0xF)\0A\00"
@CGW_CRC8PRF_16U8 = global i32 0
@.str.32 = [80 x i8] c"Profile '%d' (SFFID_XOR) - add u8 value (can_id & 0xFF) ^ (can_id >> 8 & 0xFF)\0A\00"
@CGW_CRC8PRF_SFFID_XOR = global i32 0
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.8, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.11, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.12, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.13, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.14, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = tail call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%34 = load i32, i32* @stderr
%35 = tail call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.16, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.17, i64 0, i64 0))
%38 = load i32, i32* @stderr
%39 = tail call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.18, i64 0, i64 0))
%40 = load i32, i32* @stderr
%41 = tail call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%42 = load i32, i32* @stderr
%43 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.19, i64 0, i64 0))
%44 = load i32, i32* @stderr
%45 = tail call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.20, i64 0, i64 0))
%46 = load i32, i32* @stderr
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.21, i64 0, i64 0))
%48 = load i32, i32* @stderr
%49 = tail call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.22, i64 0, i64 0))
%50 = load i32, i32* @stderr
%51 = tail call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.23, i64 0, i64 0))
%52 = load i32, i32* @stderr
%53 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.24, i64 0, i64 0))
%54 = load i32, i32* @stderr
%55 = tail call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.25, i64 0, i64 0))
%56 = load i32, i32* @stderr
%57 = tail call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.26, i64 0, i64 0))
%58 = load i32, i32* @stderr
%59 = tail call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%60 = load i32, i32* @stderr
%61 = tail call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.27, i64 0, i64 0))
%62 = load i32, i32* @stderr
%63 = tail call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.28, i64 0, i64 0), i8* %0)
%64 = load i32, i32* @stderr
%65 = tail call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%66 = load i32, i32* @stderr
%67 = tail call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.29, i64 0, i64 0))
%68 = load i32, i32* @stderr
%69 = load i32, i32* @CGW_CRC8PRF_1U8
%70 = tail call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.30, i64 0, i64 0), i32 %69)
%71 = load i32, i32* @stderr
%72 = load i32, i32* @CGW_CRC8PRF_16U8
%73 = tail call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.31, i64 0, i64 0), i32 %72)
%74 = load i32, i32* @stderr
%75 = load i32, i32* @CGW_CRC8PRF_SFFID_XOR
%76 = tail call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.32, i64 0, i64 0), i32 %75)
%77 = load i32, i32* @stderr
%78 = tail call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
ret void
}