#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 usage(char *cmd) {
  fprintf(stderr,
          "This is cache simulator that support L1, L2 cache with stream "
          "buffer and victim buffer. There are lots of options to set and some "
          "of options are quite important. So, If you don't set option "
          "properly, It may not work as your intention. Therefore I recommand "
          "you to write options on \".config\" file.\n");
  fprintf(stderr, "(This options below are only support L1 cache. So, to use "
                  "L2 cache, you SHOULD write options on \".config\" file.)\n");
  fprintf(stderr,
          "usage:	%s -l <block size> -k <associate> -n <num of set> -f "
          "<file path>\n",
          cmd);
  fprintf(stderr, "\t%s -h		: show help\n", cmd);
  fprintf(stderr, "\t%s -f <file path>	: file path\n", cmd);
  fprintf(stderr, "\t%s -l <block size>	: block size (byte)\n", cmd);
  fprintf(stderr, "\t%s -k <associate>	: associate (number)\n", cmd);
  fprintf(stderr, "\t%s -n <num of set>	: num of set (number)\n", cmd);
  fprintf(stderr, "\t%s -s <stream buf>	: stream buf (number)\n", cmd);
  fprintf(stderr, "\t%s -v <victim buf>	: victim buf (number)\n", cmd);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xfe7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x103e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x106c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x1066(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x106b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e23(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x1079(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x1087(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ded(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x1097(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dd2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x10a7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xff1(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x1052(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x1087(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x1088(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x1094(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x10a9(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x10be(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x10d5(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x10ec(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [298 x i8] c"This is cache simulator that support L1, L2 cache with stream buffer and victim buffer. There are lots of options to set and some of options are quite important. So, If you don't set option properly, It may not work as your intention. Therefore I recommand you to write options on \22.config\22 file.\0A\00"
@.str.1 = [114 x i8] c"(This options below are only support L1 cache. So, to use L2 cache, you SHOULD write options on \22.config\22 file.)\0A\00"
@.str.2 = [73 x i8] c"usage:\09%s -l <block size> -k <associate> -n <num of set> -f <file path>\0A\00"
@.str.3 = [21 x i8] c"\09%s -h\09\09: show help\0A\00"
@.str.4 = [32 x i8] c"\09%s -f <file path>\09: file path\0A\00"
@.str.5 = [41 x i8] c"\09%s -l <block size>\09: block size (byte)\0A\00"
@.str.6 = [41 x i8] c"\09%s -k <associate>\09: associate (number)\0A\00"
@.str.7 = [43 x i8] c"\09%s -n <num of set>\09: num of set (number)\0A\00"
@.str.8 = [43 x i8] c"\09%s -s <stream buf>\09: stream buf (number)\0A\00"
@.str.9 = [43 x i8] c"\09%s -v <victim buf>\09: victim buf (number)\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([298 x i8], [298 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %2
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %2
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %2
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %2
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i8* %17)
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %2
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0), i8* %20)
%22 = load i32, i32* @stderr
%23 = load i8*, i8** %2
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i8* %23)
%25 = load i32, i32* @stderr
%26 = load i8*, i8** %2
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0), i8* %26)
%28 = load i32, i32* @stderr
%29 = load i8*, i8** %2
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0), i8* %29)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [298 x i8] c"This is cache simulator that support L1, L2 cache with stream buffer and victim buffer. There are lots of options to set and some of options are quite important. So, If you don't set option properly, It may not work as your intention. Therefore I recommand you to write options on \22.config\22 file.\0A\00"
@.str.1 = [114 x i8] c"(This options below are only support L1 cache. So, to use L2 cache, you SHOULD write options on \22.config\22 file.)\0A\00"
@.str.2 = [73 x i8] c"usage:\09%s -l <block size> -k <associate> -n <num of set> -f <file path>\0A\00"
@.str.3 = [21 x i8] c"\09%s -h\09\09: show help\0A\00"
@.str.4 = [32 x i8] c"\09%s -f <file path>\09: file path\0A\00"
@.str.5 = [41 x i8] c"\09%s -l <block size>\09: block size (byte)\0A\00"
@.str.6 = [41 x i8] c"\09%s -k <associate>\09: associate (number)\0A\00"
@.str.7 = [43 x i8] c"\09%s -n <num of set>\09: num of set (number)\0A\00"
@.str.8 = [43 x i8] c"\09%s -s <stream buf>\09: stream buf (number)\0A\00"
@.str.9 = [43 x i8] c"\09%s -v <victim buf>\09: victim buf (number)\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([298 x i8], [298 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([114 x i8], [114 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 ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %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), i8* %0)
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i8* %0)
%14 = load i32, i32* @stderr
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0), i8* %0)
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i8* %0)
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0), i8* %0)
%20 = load i32, i32* @stderr
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0), i8* %0)
ret void
}