#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, "           -i (allow to route to incoming interface)\n");
  fprintf(stderr,
          "           -u <uid> (user defined modification identifier)\n");
  fprintf(stderr,
          "           -l <hops> (limit the number of frame hops / routings)\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    0xf87(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2db4(%rip),%rax
mov    (%rax),%edi
lea    0xfac(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d9d(%rip),%rax
mov    (%rax),%edi
lea    0xfd7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
lea    0xfe9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d6f(%rip),%rax
mov    (%rax),%edi
lea    0x1001(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d58(%rip),%rax
mov    (%rax),%edi
lea    0x1038(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
lea    0x1072(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d2a(%rip),%rax
mov    (%rax),%edi
lea    0x10aa(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d13(%rip),%rax
mov    (%rax),%edi
lea    0xd47(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2cfc(%rip),%rax
mov    (%rax),%edi
lea    0x10ce(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ce5(%rip),%rax
mov    (%rax),%edi
lea    0x10ea(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2cce(%rip),%rax
mov    (%rax),%edi
lea    0x1124(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2cb7(%rip),%rax
mov    (%rax),%edi
lea    0xceb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ca0(%rip),%rax
mov    (%rax),%edi
lea    0x1147(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c89(%rip),%rax
mov    (%rax),%edi
lea    0x116d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c72(%rip),%rax
mov    (%rax),%edi
lea    0x1198(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c5b(%rip),%rax
mov    (%rax),%edi
lea    0x11b4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c44(%rip),%rax
mov    (%rax),%edi
lea    0x11e9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c2d(%rip),%rax
mov    (%rax),%edi
lea    0x120d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c16(%rip),%rax
mov    (%rax),%edi
lea    0x123c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2bff(%rip),%rax
mov    (%rax),%edi
lea    0x1270(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2be8(%rip),%rax
mov    (%rax),%edi
lea    0xc1c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2bd1(%rip),%rax
mov    (%rax),%edi
lea    0x1292(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2bba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x1281(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b9f(%rip),%rax
mov    (%rax),%edi
lea    0xbd3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b88(%rip),%rax
mov    (%rax),%edi
lea    0x129f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b71(%rip),%rax
mov    (%rax),%edi
mov    0x2b58(%rip),%rax
mov    (%rax),%edx
lea    0x129a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b51(%rip),%rax
mov    (%rax),%edi
mov    0x2b58(%rip),%rax
mov    (%rax),%edx
lea    0x12b2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b31(%rip),%rax
mov    (%rax),%edi
mov    0x2b20(%rip),%rax
mov    (%rax),%edx
lea    0x12e5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b11(%rip),%rax
mov    (%rax),%edi
lea    0xb45(%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    0xfd2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xffe(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1030(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1049(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1068(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10a6(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10e7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1126(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xdca(%rip),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1155(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1178(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x11b9(%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    0x11ee(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x121b(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x124d(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1270(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x12ac(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x12d7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x130d(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1348(%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    0x137c(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1376(%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    0x13a3(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    0x2c63(%rip),%rax
mov    (%rax),%edx
lea    0x13a5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    0x2c6a(%rip),%rax
mov    (%rax),%edx
lea    0x13c4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    0x2c39(%rip),%rax
mov    (%rax),%edx
lea    0x13fe(%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 = [54 x i8] c" -i (allow to route to incoming interface)\0A\00"
@.str.10 = [60 x i8] c" -u <uid> (user defined modification identifier)\0A\00"
@.str.11 = [66 x i8] c" -l <hops> (limit the number of frame hops / routings)\0A\00"
@.str.12 = [41 x i8] c" -f <filter> (set CAN filter)\0A\00"
@.str.13 = [47 x i8] c" -m <mod> (set frame modifications)\0A\00"
@.str.14 = [78 x i8] c" -x <from_idx>:<to_idx>:<result_idx>:<init_xor_val> (XOR checksum)\0A\00"
@.str.15 = [81 x i8] c" -c <from>:<to>:<result>:<init_val>:<xor_val>:<crctab[256]> (CRC8 cs)\0A\00"
@.str.16 = [79 x i8] c" -p <profile>:[<profile_data>] (CRC8 checksum profile & parameters)\0A\00"
@.str.17 = [82 x i8] c"\0AValues are given and expected in hexadecimal values. Leading 0s can be omitted.\0A\00"
@.str.18 = [2 x i8] c"\0A\00"
@.str.19 = [51 x i8] c"<filter> is a <value><mask> CAN identifier filter\0A\00"
@.str.20 = [81 x i8] c" <can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask)\0A\00"
@.str.21 = [81 x i8] c" <can_id>~<can_mask> (matches when <received_can_id> & mask != can_id & mask)\0A\00"
@.str.22 = [61 x i8] c"<mod> is a CAN frame modification instruction consisting of\0A\00"
@.str.23 = [66 x i8] c"<instruction>:<can_frame-elements>:<can_id>.<can_dlc>.<can_data>\0A\00"
@.str.24 = [51 x i8] c" - <instruction> is one of 'AND' 'OR' 'XOR' 'SET'\0A\00"
@.str.25 = [76 x i8] c" - <can_frame-elements> is _one_ or _more_ of 'I'dentifier 'L'ength 'D'ata\0A\00"
@.str.26 = [59 x i8] c" - <can_id> is an u32 value containing the CAN Identifier\0A\00"
@.str.27 = [70 x i8] c" - <can_dlc> is an u8 value containing the data length code (0 .. 8)\0A\00"
@.str.28 = [75 x i8] c" - <can_data> is always eight(!) u8 values containing the CAN frames data\0A\00"
@.str.29 = [80 x i8] c"The max. four modifications are performed in the order AND -> OR -> XOR -> SET\0A\00"
@.str.30 = [10 x i8] c"Example:\0A\00"
@.str.31 = [76 x i8] c"%s -A -s can0 -d vcan3 -e -f 123:C00007FF -m SET:IL:333.4.1122334455667788\0A\00"
@.str.32 = [27 x i8] c"Supported CRC 8 profiles:\0A\00"
@.str.33 = [56 x i8] c"Profile '%d' (1U8) - add one additional u8 value\0A\00"
@CGW_CRC8PRF_1U8 = global i32 0
@.str.34 = [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.35 = [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 ([54 x i8], [54 x i8]* @.str.9, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.10, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.11, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.13, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.14, i64 0, i64 0))
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.15, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.16, i64 0, i64 0))
%38 = load i32, i32* @stderr
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.17, i64 0, i64 0))
%40 = load i32, i32* @stderr
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.19, i64 0, i64 0))
%44 = load i32, i32* @stderr
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.20, i64 0, i64 0))
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.21, i64 0, i64 0))
%48 = load i32, i32* @stderr
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%50 = load i32, i32* @stderr
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.22, i64 0, i64 0))
%52 = load i32, i32* @stderr
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.23, i64 0, i64 0))
%54 = load i32, i32* @stderr
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.24, i64 0, i64 0))
%56 = load i32, i32* @stderr
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.25, i64 0, i64 0))
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.26, i64 0, i64 0))
%60 = load i32, i32* @stderr
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.27, i64 0, i64 0))
%62 = load i32, i32* @stderr
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.28, i64 0, i64 0))
%64 = load i32, i32* @stderr
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.29, i64 0, i64 0))
%66 = load i32, i32* @stderr
%67 = call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%68 = load i32, i32* @stderr
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.30, i64 0, i64 0))
%70 = load i32, i32* @stderr
%71 = load i8*, i8** %2
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.31, i64 0, i64 0), i8* %71)
%73 = load i32, i32* @stderr
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%75 = load i32, i32* @stderr
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.32, i64 0, i64 0))
%77 = load i32, i32* @stderr
%78 = load i32, i32* @CGW_CRC8PRF_1U8
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.33, i64 0, i64 0), i32 %78)
%80 = load i32, i32* @stderr
%81 = load i32, i32* @CGW_CRC8PRF_16U8
%82 = call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.34, i64 0, i64 0), i32 %81)
%83 = load i32, i32* @stderr
%84 = load i32, i32* @CGW_CRC8PRF_SFFID_XOR
%85 = call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.35, i64 0, i64 0), i32 %84)
%86 = load i32, i32* @stderr
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, 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 = [54 x i8] c" -i (allow to route to incoming interface)\0A\00"
@.str.10 = [60 x i8] c" -u <uid> (user defined modification identifier)\0A\00"
@.str.11 = [66 x i8] c" -l <hops> (limit the number of frame hops / routings)\0A\00"
@.str.12 = [41 x i8] c" -f <filter> (set CAN filter)\0A\00"
@.str.13 = [47 x i8] c" -m <mod> (set frame modifications)\0A\00"
@.str.14 = [78 x i8] c" -x <from_idx>:<to_idx>:<result_idx>:<init_xor_val> (XOR checksum)\0A\00"
@.str.15 = [81 x i8] c" -c <from>:<to>:<result>:<init_val>:<xor_val>:<crctab[256]> (CRC8 cs)\0A\00"
@.str.16 = [79 x i8] c" -p <profile>:[<profile_data>] (CRC8 checksum profile & parameters)\0A\00"
@.str.17 = [82 x i8] c"\0AValues are given and expected in hexadecimal values. Leading 0s can be omitted.\0A\00"
@.str.18 = [2 x i8] c"\0A\00"
@.str.19 = [51 x i8] c"<filter> is a <value><mask> CAN identifier filter\0A\00"
@.str.20 = [81 x i8] c" <can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask)\0A\00"
@.str.21 = [81 x i8] c" <can_id>~<can_mask> (matches when <received_can_id> & mask != can_id & mask)\0A\00"
@.str.22 = [61 x i8] c"<mod> is a CAN frame modification instruction consisting of\0A\00"
@.str.23 = [66 x i8] c"<instruction>:<can_frame-elements>:<can_id>.<can_dlc>.<can_data>\0A\00"
@.str.24 = [51 x i8] c" - <instruction> is one of 'AND' 'OR' 'XOR' 'SET'\0A\00"
@.str.25 = [76 x i8] c" - <can_frame-elements> is _one_ or _more_ of 'I'dentifier 'L'ength 'D'ata\0A\00"
@.str.26 = [59 x i8] c" - <can_id> is an u32 value containing the CAN Identifier\0A\00"
@.str.27 = [70 x i8] c" - <can_dlc> is an u8 value containing the data length code (0 .. 8)\0A\00"
@.str.28 = [75 x i8] c" - <can_data> is always eight(!) u8 values containing the CAN frames data\0A\00"
@.str.29 = [80 x i8] c"The max. four modifications are performed in the order AND -> OR -> XOR -> SET\0A\00"
@.str.30 = [10 x i8] c"Example:\0A\00"
@.str.31 = [76 x i8] c"%s -A -s can0 -d vcan3 -e -f 123:C00007FF -m SET:IL:333.4.1122334455667788\0A\00"
@.str.32 = [27 x i8] c"Supported CRC 8 profiles:\0A\00"
@.str.33 = [56 x i8] c"Profile '%d' (1U8) - add one additional u8 value\0A\00"
@CGW_CRC8PRF_1U8 = global i32 0
@.str.34 = [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.35 = [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 ([54 x i8], [54 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 ([60 x i8], [60 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 ([66 x i8], [66 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 ([41 x i8], [41 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 ([47 x i8], [47 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 ([78 x i8], [78 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 ([81 x i8], [81 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 ([79 x i8], [79 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 ([82 x i8], [82 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 ([2 x i8], [2 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 ([51 x i8], [51 x i8]* @.str.19, i64 0, i64 0))
%42 = load i32, i32* @stderr
%43 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.20, i64 0, i64 0))
%44 = load i32, i32* @stderr
%45 = tail call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.21, i64 0, i64 0))
%46 = load i32, i32* @stderr
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%48 = load i32, i32* @stderr
%49 = tail call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([61 x i8], [61 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 ([66 x i8], [66 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 ([51 x i8], [51 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 ([76 x i8], [76 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 ([59 x i8], [59 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 ([70 x i8], [70 x i8]* @.str.27, i64 0, i64 0))
%60 = load i32, i32* @stderr
%61 = tail call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.28, i64 0, i64 0))
%62 = load i32, i32* @stderr
%63 = tail call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.29, i64 0, i64 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.18, i64 0, i64 0))
%66 = load i32, i32* @stderr
%67 = tail call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.30, i64 0, i64 0))
%68 = load i32, i32* @stderr
%69 = tail call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.31, i64 0, i64 0), i8* %0)
%70 = load i32, i32* @stderr
%71 = tail call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%72 = load i32, i32* @stderr
%73 = tail call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.32, i64 0, i64 0))
%74 = load i32, i32* @stderr
%75 = load i32, i32* @CGW_CRC8PRF_1U8
%76 = tail call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.33, i64 0, i64 0), i32 %75)
%77 = load i32, i32* @stderr
%78 = load i32, i32* @CGW_CRC8PRF_16U8
%79 = tail call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.34, i64 0, i64 0), i32 %78)
%80 = load i32, i32* @stderr
%81 = load i32, i32* @CGW_CRC8PRF_SFFID_XOR
%82 = tail call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.35, i64 0, i64 0), i32 %81)
%83 = load i32, i32* @stderr
%84 = tail call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
ret void
}