#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 *prog_name) {
  fprintf(stderr, "\nProgram: mbrChunker v0.3.17\n");
  fprintf(stderr, "Author:  JD Durick <jd@vmforensics.org>\n");
  fprintf(stderr, "Website: http://vmforensics.org\n\n");
  fprintf(stderr, "Description:  mbrChunker is a *nix-based program that "
                  "allows you to mount raw disk images\n"
                  "as well as perform analysis on partition tables within the "
                  "master boot record.  Furthermore,\n"
                  "mbrChunker can search for hex patterns within any type of "
                  "binary file\n");
  fprintf(stderr,
          "Usage: %s -i <path to dd image> -v <output path of vmdk>...\n"
          "\nOPTIONS:\n"
          "   -i image file name that you will be analyzing\n"
          "   -v VMDK metadata file that you will be creating for your dd2vmdk "
          "conversion\n"
          "   -a creation of a metadata file to be created (file location "
          "required)\n"
          "   -x search for hex code patterns within your file (not 0x80, just "
          "80)\n",
          prog_name);
  fprintf(stderr,
          "Examples:\n"
          "%s -x 493961 -i /data/images/testsector.img\n",
          prog_name);
  fprintf(stderr,
          "%s -i <raw image path location> -v <vmdk output file location>\n",
          prog_name);
  fprintf(stderr,
          "%s -i <raw image path location> -a <output of analysis file>\n\n",
          prog_name);
}


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    0xedb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xeed(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xef8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xfdb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x1118(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x1134(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e10(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x1159(%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    0xee5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xefd(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf0e(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xffb(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x113f(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x1162(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x118e(%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 = [30 x i8] c"\0AProgram: mbrChunker v0.3.17\0A\00"
@.str.1 = [41 x i8] c"Author: JD Durick <jd@vmforensics.org>\0A\00"
@.str.2 = [34 x i8] c"Website: http://vmforensics.org\0A\0A\00"
@.str.3 = [254 x i8] c"Description: mbrChunker is a *nix-based program that allows you to mount raw disk images\0Aas well as perform analysis on partition tables within the master boot record. Furthermore,\0AmbrChunker can search for hex patterns within any type of binary file\0A\00"
@.str.4 = [344 x i8] c"Usage: %s -i <path to dd image> -v <output path of vmdk>...\0A\0AOPTIONS:\0A -i image file name that you will be analyzing\0A -v VMDK metadata file that you will be creating for your dd2vmdk conversion\0A -a creation of a metadata file to be created (file location required)\0A -x search for hex code patterns within your file (not 0x80, just 80)\0A\00"
@.str.5 = [55 x i8] c"Examples:\0A%s -x 493961 -i /data/images/testsector.img\0A\00"
@.str.6 = [64 x i8] c"%s -i <raw image path location> -v <vmdk output file location>\0A\00"
@.str.7 = [63 x i8] c"%s -i <raw image path location> -a <output of analysis file>\0A\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 ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %2
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([344 x i8], [344 x i8]* @.str.4, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %2
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), i8* %15)
%17 = load i32, i32* @stderr
%18 = load i8*, i8** %2
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.6, i64 0, i64 0), i8* %18)
%20 = load i32, i32* @stderr
%21 = load i8*, i8** %2
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0), i8* %21)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"\0AProgram: mbrChunker v0.3.17\0A\00"
@.str.1 = [41 x i8] c"Author: JD Durick <jd@vmforensics.org>\0A\00"
@.str.2 = [34 x i8] c"Website: http://vmforensics.org\0A\0A\00"
@.str.3 = [254 x i8] c"Description: mbrChunker is a *nix-based program that allows you to mount raw disk images\0Aas well as perform analysis on partition tables within the master boot record. Furthermore,\0AmbrChunker can search for hex patterns within any type of binary file\0A\00"
@.str.4 = [344 x i8] c"Usage: %s -i <path to dd image> -v <output path of vmdk>...\0A\0AOPTIONS:\0A -i image file name that you will be analyzing\0A -v VMDK metadata file that you will be creating for your dd2vmdk conversion\0A -a creation of a metadata file to be created (file location required)\0A -x search for hex code patterns within your file (not 0x80, just 80)\0A\00"
@.str.5 = [55 x i8] c"Examples:\0A%s -x 493961 -i /data/images/testsector.img\0A\00"
@.str.6 = [64 x i8] c"%s -i <raw image path location> -v <vmdk output file location>\0A\00"
@.str.7 = [63 x i8] c"%s -i <raw image path location> -a <output of analysis file>\0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([41 x i8], [41 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 ([34 x i8], [34 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 ([254 x i8], [254 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 ([344 x i8], [344 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 ([55 x i8], [55 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 ([64 x i8], [64 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 ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0), i8* %0)
ret void
}