#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*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *app, char *msg) {
  printf("Simulates UDS responses\n");
  if (msg)
    printf("%s\n", msg);
  printf("Usage: %s [options] <can_interface>\n", app);
  printf("\t-z\t\tIncrease fuzz level\n");
  printf("\t-v\t\tVerbose\n");
  printf("\t-l <logfile>\tLog output to file instead of STDOUT\n");
  printf("\t-c\t\tDon't fuzz ISOTP Spec, just data\n");
  printf("\t-F\t\tDisable flow control (Functional Addressing)\n");
  printf("\t-V <vin>\tSpecify VIN (Default: %s)\n", "WAUZZZ8V9FA149850");
  printf("\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
je     115b <usage+0x3b>
mov    -0x10(%rbp),%rsi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf3e(%rip),%rdi
lea    0xf5c(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xf0b(%rip),%rdi
call   1040 <puts@plt>
test   %rbx,%rbx
je     1163 <usage+0x23>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xe96(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xef9(%rip),%rdi
call   1040 <puts@plt>
lea    0xf06(%rip),%rdi
call   1040 <puts@plt>
lea    0xf07(%rip),%rdi
call   1040 <puts@plt>
lea    0xf2e(%rip),%rdi
call   1040 <puts@plt>
lea    0xf48(%rip),%rdi
call   1040 <puts@plt>
lea    0xe6e(%rip),%rdi
lea    0xe8c(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Simulates UDS responses\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [37 x i8] c"Usage: %s [options] <can_interface>\0A\00"
@.str.3 = [26 x i8] c"\09-z\09\09Increase fuzz level\0A\00"
@.str.4 = [14 x i8] c"\09-v\09\09Verbose\0A\00"
@.str.5 = [52 x i8] c"\09-l <logfile>\09Log output to file instead of STDOUT\0A\00"
@.str.6 = [39 x i8] c"\09-c\09\09Don't fuzz ISOTP Spec, just data\0A\00"
@.str.7 = [51 x i8] c"\09-F\09\09Disable flow control (Functional Addressing)\0A\00"
@.str.8 = [37 x i8] c"\09-V <vin>\09Specify VIN (Default: %s)\0A\00"
@.str.9 = [18 x i8] c"WAUZZZ8V9FA149850\00"
@.str.10 = [2 x i8] c"\0A\00"
define void @usage(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %2
%12 = load i8*, i8** %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.2 = [37 x i8] c"Usage: %s [options] <can_interface>\0A\00"
@.str.8 = [37 x i8] c"\09-V <vin>\09Specify VIN (Default: %s)\0A\00"
@.str.9 = [18 x i8] c"WAUZZZ8V9FA149850\00"
@str = [24 x i8] c"Simulates UDS responses\00"
@str.11 = [25 x i8] c"\09-z\09\09Increase fuzz level\00"
@str.12 = [13 x i8] c"\09-v\09\09Verbose\00"
@str.13 = [51 x i8] c"\09-l <logfile>\09Log output to file instead of STDOUT\00"
@str.14 = [38 x i8] c"\09-c\09\09Don't fuzz ISOTP Spec, just data\00"
@str.15 = [50 x i8] c"\09-F\09\09Disable flow control (Functional Addressing)\00"
define void @usage(i8* %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = icmp eq i8* %1, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* %1)
br label %7
7: ; preds = %5, %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.11, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.12, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.13, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.14, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.15, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%15 = tail call i32 @putchar(i32 10)
%16 = tail call i32 @exit(i32 1)
unreachable
}