#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void print_usage(char *prg) {
  fprintf(stderr, "\n%s: generate CAN frames\n\n", prg);
  fprintf(stderr, "Usage: %s [options] <CAN interface>\n", prg);
  fprintf(stderr,
          "Options: -g <ms>       (gap in milli seconds "
          "- default: %d ms)\n",
          200);
  fprintf(stderr, "         -e            (generate extended frame mode "
                  "(EFF) CAN frames)\n");
  fprintf(stderr, "         -I <mode>     (CAN ID"
                  " generation mode - see below)\n");
  fprintf(stderr, "         -L <mode>     (CAN data length code (dlc)"
                  " generation mode - see below)\n");
  fprintf(stderr, "         -D <mode>     (CAN data (payload)"
                  " generation mode - see below)\n");
  fprintf(stderr, "         -p <timeout>  (poll on -ENOBUFS to write frames"
                  " with <timeout> ms)\n");
  fprintf(stderr, "         -n <count>    (terminate after <count> CAN frames "
                  "- default infinite)\n");
  fprintf(stderr, "         -i            (ignore -ENOBUFS return values on"
                  " write() syscalls)\n");
  fprintf(stderr, "         -x            (disable local loopback of "
                  "generated CAN frames)\n");
  fprintf(stderr, "         -v            (increment verbose level for "
                  "printing sent CAN frames)\n\n");
  fprintf(stderr, "Generation modes:\n");
  fprintf(stderr, "'r'        => random values (default)\n");
  fprintf(stderr, "'i'        => increment values\n");
  fprintf(stderr, "<hexvalue> => fix value using <hexvalue>\n\n");
  fprintf(stderr, "When incrementing the CAN data the data length code "
                  "minimum is set to 1.\n");
  fprintf(stderr, "CAN IDs and data content are given and expected in "
                  "hexadecimal values.\n\n");
  fprintf(stderr, "Examples:\n");
  fprintf(stderr, "%s vcan0 -g 4 -I 42A -L 1 -D i -v -v   ", prg);
  fprintf(stderr, "(fixed CAN ID and length, inc. data)\n");
  fprintf(stderr, "%s vcan0 -e -L i -v -v -v              ", prg);
  fprintf(stderr, "(generate EFF frames, incr. length)\n");
  fprintf(stderr, "%s vcan0 -D 11223344DEADBEEF -L 8      ", prg);
  fprintf(stderr, "(fixed CAN data payload and length)\n");
  fprintf(stderr, "%s vcan0 -g 0 -i -x                    ", prg);
  fprintf(stderr, "(full load test ignoring -ENOBUFS)\n");
  fprintf(stderr, "%s vcan0 -g 0 -p 10 -x                 ", prg);
  fprintf(stderr, "(full load test with polling, 10ms timeout)\n");
  fprintf(stderr, "%s vcan0                               ", prg);
  fprintf(stderr, "(my favourite default :)\n\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
mov    $0xc8,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
lea    0xf02(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xf33(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
lea    0xf59(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
lea    0xf93(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
lea    0xfc5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
lea    0xffb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2de1(%rip),%rax
mov    (%rax),%edi
lea    0x1034(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
lea    0x1069(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2db3(%rip),%rax
mov    (%rax),%edi
lea    0x109b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d9c(%rip),%rax
mov    (%rax),%edi
lea    0x10d4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d85(%rip),%rax
mov    (%rax),%edi
lea    0x10d0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d6e(%rip),%rax
mov    (%rax),%edi
lea    0x10e0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d57(%rip),%rax
mov    (%rax),%edi
lea    0x10e9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d40(%rip),%rax
mov    (%rax),%edi
lea    0x10fd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d29(%rip),%rax
mov    (%rax),%edi
lea    0x1130(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d12(%rip),%rax
mov    (%rax),%edi
lea    0x1162(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2cfb(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x1152(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ce0(%rip),%rax
mov    (%rax),%edi
lea    0x1163(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2cc9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x116e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2cae(%rip),%rax
mov    (%rax),%edi
lea    0x117f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c97(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x1189(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c7c(%rip),%rax
mov    (%rax),%edi
lea    0x119a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c65(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x11a4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c4a(%rip),%rax
mov    (%rax),%edi
lea    0x11b5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c33(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x11be(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c18(%rip),%rax
mov    (%rax),%edi
lea    0x11cf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c01(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x11e1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2be6(%rip),%rax
mov    (%rax),%edi
lea    0x11f2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2ec2(%rip),%rbx
mov    (%rbx),%edi
lea    0xed9(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee1(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef3(%rip),%rsi
mov    $0xc8,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf1e(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf56(%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    0xfc4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xffd(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x103a(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x107a(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10b6(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10ef(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x112f(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1132(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1149(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1159(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1174(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x11ae(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x11e7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x11e2(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x11f7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x120d(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1222(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1237(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x124c(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1261(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1276(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x128a(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x129f(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x12bc(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x12d1(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"\0A%s: generate CAN frames\0A\0A\00"
@.str.1 = [37 x i8] c"Usage: %s [options] <CAN interface>\0A\00"
@.str.2 = [64 x i8] c"Options: -g <ms> (gap in milli seconds - default: %d ms)\0A\00"
@.str.3 = [72 x i8] c" -e (generate extended frame mode (EFF) CAN frames)\0A\00"
@.str.4 = [61 x i8] c" -I <mode> (CAN ID generation mode - see below)\0A\00"
@.str.5 = [81 x i8] c" -L <mode> (CAN data length code (dlc) generation mode - see below)\0A\00"
@.str.6 = [73 x i8] c" -D <mode> (CAN data (payload) generation mode - see below)\0A\00"
@.str.7 = [77 x i8] c" -p <timeout> (poll on -ENOBUFS to write frames with <timeout> ms)\0A\00"
@.str.8 = [80 x i8] c" -n <count> (terminate after <count> CAN frames - default infinite)\0A\00"
@.str.9 = [76 x i8] c" -i (ignore -ENOBUFS return values on write() syscalls)\0A\00"
@.str.10 = [73 x i8] c" -x (disable local loopback of generated CAN frames)\0A\00"
@.str.11 = [80 x i8] c" -v (increment verbose level for printing sent CAN frames)\0A\0A\00"
@.str.12 = [19 x i8] c"Generation modes:\0A\00"
@.str.13 = [39 x i8] c"'r' => random values (default)\0A\00"
@.str.14 = [32 x i8] c"'i' => increment values\0A\00"
@.str.15 = [43 x i8] c"<hexvalue> => fix value using <hexvalue>\0A\0A\00"
@.str.16 = [74 x i8] c"When incrementing the CAN data the data length code minimum is set to 1.\0A\00"
@.str.17 = [73 x i8] c"CAN IDs and data content are given and expected in hexadecimal values.\0A\0A\00"
@.str.18 = [11 x i8] c"Examples:\0A\00"
@.str.19 = [40 x i8] c"%s vcan0 -g 4 -I 42A -L 1 -D i -v -v \00"
@.str.20 = [38 x i8] c"(fixed CAN ID and length, inc. data)\0A\00"
@.str.21 = [40 x i8] c"%s vcan0 -e -L i -v -v -v \00"
@.str.22 = [37 x i8] c"(generate EFF frames, incr. length)\0A\00"
@.str.23 = [40 x i8] c"%s vcan0 -D 11223344DEADBEEF -L 8 \00"
@.str.24 = [37 x i8] c"(fixed CAN data payload and length)\0A\00"
@.str.25 = [40 x i8] c"%s vcan0 -g 0 -i -x \00"
@.str.26 = [36 x i8] c"(full load test ignoring -ENOBUFS)\0A\00"
@.str.27 = [40 x i8] c"%s vcan0 -g 0 -p 10 -x \00"
@.str.28 = [45 x i8] c"(full load test with polling, 10ms timeout)\0A\00"
@.str.29 = [40 x i8] c"%s vcan0 \00"
@.str.30 = [27 x i8] c"(my favourite default :)\0A\0A\00"
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 ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0), i32 200)
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.3, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.4, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.5, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.6, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.7, i64 0, i64 0))
%21 = load i32, i32* @stderr
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.8, i64 0, i64 0))
%23 = load i32, i32* @stderr
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.9, i64 0, i64 0))
%25 = load i32, i32* @stderr
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.10, i64 0, i64 0))
%27 = load i32, i32* @stderr
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.11, i64 0, i64 0))
%29 = load i32, i32* @stderr
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0))
%31 = load i32, i32* @stderr
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0))
%33 = load i32, i32* @stderr
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.14, i64 0, i64 0))
%35 = load i32, i32* @stderr
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.15, i64 0, i64 0))
%37 = load i32, i32* @stderr
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.16, i64 0, i64 0))
%39 = load i32, i32* @stderr
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.17, i64 0, i64 0))
%41 = load i32, i32* @stderr
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0))
%43 = load i32, i32* @stderr
%44 = load i8*, i8** %2
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.19, i64 0, i64 0), i8* %44)
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.20, i64 0, i64 0))
%48 = load i32, i32* @stderr
%49 = load i8*, i8** %2
%50 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.21, i64 0, i64 0), i8* %49)
%51 = load i32, i32* @stderr
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.22, i64 0, i64 0))
%53 = load i32, i32* @stderr
%54 = load i8*, i8** %2
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.23, i64 0, i64 0), i8* %54)
%56 = load i32, i32* @stderr
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.24, i64 0, i64 0))
%58 = load i32, i32* @stderr
%59 = load i8*, i8** %2
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.25, i64 0, i64 0), i8* %59)
%61 = load i32, i32* @stderr
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.26, i64 0, i64 0))
%63 = load i32, i32* @stderr
%64 = load i8*, i8** %2
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.27, i64 0, i64 0), i8* %64)
%66 = load i32, i32* @stderr
%67 = call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.28, i64 0, i64 0))
%68 = load i32, i32* @stderr
%69 = load i8*, i8** %2
%70 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.29, i64 0, i64 0), i8* %69)
%71 = load i32, i32* @stderr
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.30, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"\0A%s: generate CAN frames\0A\0A\00"
@.str.1 = [37 x i8] c"Usage: %s [options] <CAN interface>\0A\00"
@.str.2 = [64 x i8] c"Options: -g <ms> (gap in milli seconds - default: %d ms)\0A\00"
@.str.3 = [72 x i8] c" -e (generate extended frame mode (EFF) CAN frames)\0A\00"
@.str.4 = [61 x i8] c" -I <mode> (CAN ID generation mode - see below)\0A\00"
@.str.5 = [81 x i8] c" -L <mode> (CAN data length code (dlc) generation mode - see below)\0A\00"
@.str.6 = [73 x i8] c" -D <mode> (CAN data (payload) generation mode - see below)\0A\00"
@.str.7 = [77 x i8] c" -p <timeout> (poll on -ENOBUFS to write frames with <timeout> ms)\0A\00"
@.str.8 = [80 x i8] c" -n <count> (terminate after <count> CAN frames - default infinite)\0A\00"
@.str.9 = [76 x i8] c" -i (ignore -ENOBUFS return values on write() syscalls)\0A\00"
@.str.10 = [73 x i8] c" -x (disable local loopback of generated CAN frames)\0A\00"
@.str.11 = [80 x i8] c" -v (increment verbose level for printing sent CAN frames)\0A\0A\00"
@.str.12 = [19 x i8] c"Generation modes:\0A\00"
@.str.13 = [39 x i8] c"'r' => random values (default)\0A\00"
@.str.14 = [32 x i8] c"'i' => increment values\0A\00"
@.str.15 = [43 x i8] c"<hexvalue> => fix value using <hexvalue>\0A\0A\00"
@.str.16 = [74 x i8] c"When incrementing the CAN data the data length code minimum is set to 1.\0A\00"
@.str.17 = [73 x i8] c"CAN IDs and data content are given and expected in hexadecimal values.\0A\0A\00"
@.str.18 = [11 x i8] c"Examples:\0A\00"
@.str.19 = [40 x i8] c"%s vcan0 -g 4 -I 42A -L 1 -D i -v -v \00"
@.str.20 = [38 x i8] c"(fixed CAN ID and length, inc. data)\0A\00"
@.str.21 = [40 x i8] c"%s vcan0 -e -L i -v -v -v \00"
@.str.22 = [37 x i8] c"(generate EFF frames, incr. length)\0A\00"
@.str.23 = [40 x i8] c"%s vcan0 -D 11223344DEADBEEF -L 8 \00"
@.str.24 = [37 x i8] c"(fixed CAN data payload and length)\0A\00"
@.str.25 = [40 x i8] c"%s vcan0 -g 0 -i -x \00"
@.str.26 = [36 x i8] c"(full load test ignoring -ENOBUFS)\0A\00"
@.str.27 = [40 x i8] c"%s vcan0 -g 0 -p 10 -x \00"
@.str.28 = [45 x i8] c"(full load test with polling, 10ms timeout)\0A\00"
@.str.29 = [40 x i8] c"%s vcan0 \00"
@.str.30 = [27 x i8] c"(my favourite default :)\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 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 ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0), i32 200)
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([72 x i8], [72 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 ([61 x i8], [61 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 ([81 x i8], [81 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 ([73 x i8], [73 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 ([77 x i8], [77 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 ([80 x i8], [80 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 ([76 x i8], [76 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 ([73 x i8], [73 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 ([80 x i8], [80 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 ([19 x i8], [19 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 ([39 x i8], [39 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 ([32 x i8], [32 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 ([43 x i8], [43 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 ([74 x i8], [74 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 ([73 x i8], [73 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 ([11 x i8], [11 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 ([40 x i8], [40 x i8]* @.str.19, i64 0, i64 0), i8* %0)
%42 = load i32, i32* @stderr
%43 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([38 x i8], [38 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 ([40 x i8], [40 x i8]* @.str.21, i64 0, i64 0), i8* %0)
%46 = load i32, i32* @stderr
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.22, i64 0, i64 0))
%48 = load i32, i32* @stderr
%49 = tail call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.23, i64 0, i64 0), i8* %0)
%50 = load i32, i32* @stderr
%51 = tail call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.24, i64 0, i64 0))
%52 = load i32, i32* @stderr
%53 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.25, i64 0, i64 0), i8* %0)
%54 = load i32, i32* @stderr
%55 = tail call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.26, i64 0, i64 0))
%56 = load i32, i32* @stderr
%57 = tail call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.27, i64 0, i64 0), i8* %0)
%58 = load i32, i32* @stderr
%59 = tail call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.28, i64 0, i64 0))
%60 = load i32, i32* @stderr
%61 = tail call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.29, i64 0, i64 0), i8* %0)
%62 = load i32, i32* @stderr
%63 = tail call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.30, i64 0, i64 0))
ret void
}