#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*/ compactFiles();
int /*<<< orphan*/ createFile(char *, int);
int /*<<< orphan*/ deleteFile(char *);
int /*<<< orphan*/ displayDisk();
int /*<<< orphan*/ initialiseFileSystem();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ readBlock(char *, int, int *);
int /*<<< orphan*/ showHistory();
int /*<<< orphan*/ writeBlock(char *, int, int);
int main(int argc, const char **argv) {
  initialiseFileSystem();
  createFile("doge.png", 26);
  createFile("test.exe", 11);
  createFile("snjs.sh", 1);
  createFile("snjs.sh1", 100);
  deleteFile("doge.png");
  createFile("danielWest.exe", 10);
  createFile("asjad.psd", 150);
  deleteFile("snjs.sh");
  createFile("wordflow.app", 1);
  createFile("doges.png2", 70);
  createFile("blah.osd", 430);
  createFile("4chan.biz", 154);
  writeBlock("doges.png2", 1, 420);
  displayDisk();
  compactFiles();
  int pointerToData;
  readBlock("doges.png2", 1, &pointerToData);
  printf("\n%d\n", pointerToData);
  displayDisk();
  showHistory();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <initialiseFileSystem@plt>
lea    0xe4c(%rip),%rdi
mov    $0x1a,%esi
call   1060 <createFile@plt>
lea    0xe44(%rip),%rdi
mov    $0xb,%esi
call   1060 <createFile@plt>
lea    0xe3c(%rip),%rdi
mov    $0x1,%esi
call   1060 <createFile@plt>
lea    0xe33(%rip),%rdi
mov    $0x64,%esi
call   1060 <createFile@plt>
lea    0xe08(%rip),%rdi
call   1070 <deleteFile@plt>
lea    0xe1f(%rip),%rdi
mov    $0xa,%esi
call   1060 <createFile@plt>
lea    0xe1d(%rip),%rdi
mov    $0x96,%esi
call   1060 <createFile@plt>
lea    0xdec(%rip),%rdi
call   1070 <deleteFile@plt>
lea    0xe0a(%rip),%rdi
mov    $0x1,%esi
call   1060 <createFile@plt>
lea    0xe06(%rip),%rdi
mov    $0x46,%esi
call   1060 <createFile@plt>
lea    0xe00(%rip),%rdi
mov    $0x1ae,%esi
call   1060 <createFile@plt>
lea    0xdf8(%rip),%rdi
mov    $0x9a,%esi
call   1060 <createFile@plt>
lea    0xdd3(%rip),%rdi
mov    $0x1,%esi
mov    $0x1a4,%edx
call   10a0 <writeBlock@plt>
mov    $0x0,%al
call   1030 <displayDisk@plt>
mov    $0x0,%al
call   1090 <compactFiles@plt>
lea    0xdaf(%rip),%rdi
mov    $0x1,%esi
lea    -0x14(%rbp),%rdx
call   1080 <readBlock@plt>
mov    -0x14(%rbp),%esi
lea    0xdb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <displayDisk@plt>
mov    $0x0,%al
call   10b0 <showHistory@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <initialiseFileSystem@plt>
lea    0xe5e(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1a,%esi
call   1060 <createFile@plt>
lea    0xe53(%rip),%rdi
mov    $0xb,%esi
call   1060 <createFile@plt>
lea    0xe4b(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
call   1060 <createFile@plt>
lea    0xe3f(%rip),%rdi
mov    $0x64,%esi
call   1060 <createFile@plt>
mov    %rbx,%rdi
call   1070 <deleteFile@plt>
lea    0xe2f(%rip),%rdi
mov    $0xa,%esi
call   1060 <createFile@plt>
lea    0xe2d(%rip),%rdi
mov    $0x96,%esi
call   1060 <createFile@plt>
mov    %r14,%rdi
call   1070 <deleteFile@plt>
lea    0xe1e(%rip),%rdi
mov    $0x1,%esi
call   1060 <createFile@plt>
lea    0xe1a(%rip),%rbx
mov    %rbx,%rdi
mov    $0x46,%esi
call   1060 <createFile@plt>
lea    0xe11(%rip),%rdi
mov    $0x1ae,%esi
call   1060 <createFile@plt>
lea    0xe09(%rip),%rdi
mov    $0x9a,%esi
call   1060 <createFile@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1a4,%edx
call   10a0 <writeBlock@plt>
xor    %eax,%eax
call   1030 <displayDisk@plt>
xor    %eax,%eax
call   1090 <compactFiles@plt>
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1080 <readBlock@plt>
mov    0x4(%rsp),%esi
lea    0xdcc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <displayDisk@plt>
xor    %eax,%eax
call   10b0 <showHistory@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"doge.png\00"
@.str.1 = [9 x i8] c"test.exe\00"
@.str.2 = [8 x i8] c"snjs.sh\00"
@.str.3 = [9 x i8] c"snjs.sh1\00"
@.str.4 = [15 x i8] c"danielWest.exe\00"
@.str.5 = [10 x i8] c"asjad.psd\00"
@.str.6 = [13 x i8] c"wordflow.app\00"
@.str.7 = [11 x i8] c"doges.png2\00"
@.str.8 = [9 x i8] c"blah.osd\00"
@.str.9 = [10 x i8] c"4chan.biz\00"
@.str.10 = [5 x i8] c"\0A%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @initialiseFileSystem()
%8 = call i32 @createFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 26)
%9 = call i32 @createFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 11)
%10 = call i32 @createFile(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 1)
%11 = call i32 @createFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 100)
%12 = call i32 @deleteFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @createFile(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 10)
%14 = call i32 @createFile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 150)
%15 = call i32 @deleteFile(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @createFile(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 1)
%17 = call i32 @createFile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 70)
%18 = call i32 @createFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 430)
%19 = call i32 @createFile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 154)
%20 = call i32 @writeBlock(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 1, i32 420)
%21 = call i32 (...) @displayDisk()
%22 = call i32 (...) @compactFiles()
%23 = call i32 @readBlock(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 1, i32* %6)
%24 = load i32, i32* %6
%25 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 %24)
%26 = call i32 (...) @displayDisk()
%27 = call i32 (...) @showHistory()
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"doge.png\00"
@.str.1 = [9 x i8] c"test.exe\00"
@.str.2 = [8 x i8] c"snjs.sh\00"
@.str.3 = [9 x i8] c"snjs.sh1\00"
@.str.4 = [15 x i8] c"danielWest.exe\00"
@.str.5 = [10 x i8] c"asjad.psd\00"
@.str.6 = [13 x i8] c"wordflow.app\00"
@.str.7 = [11 x i8] c"doges.png2\00"
@.str.8 = [9 x i8] c"blah.osd\00"
@.str.9 = [10 x i8] c"4chan.biz\00"
@.str.10 = [5 x i8] c"\0A%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = tail call i32 (...) @initialiseFileSystem()
%5 = tail call i32 @createFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 26)
%6 = tail call i32 @createFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 11)
%7 = tail call i32 @createFile(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 1)
%8 = tail call i32 @createFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 100)
%9 = tail call i32 @deleteFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @createFile(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 10)
%11 = tail call i32 @createFile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 150)
%12 = tail call i32 @deleteFile(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 @createFile(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 1)
%14 = tail call i32 @createFile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 70)
%15 = tail call i32 @createFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 430)
%16 = tail call i32 @createFile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 154)
%17 = tail call i32 @writeBlock(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 1, i32 420)
%18 = tail call i32 (...) @displayDisk()
%19 = tail call i32 (...) @compactFiles()
%20 = bitcast i32* %3 to i8*
%21 = call i32 @readBlock(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 1, i32* %3)
%22 = load i32, i32* %3
%23 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 %22)
%24 = call i32 (...) @displayDisk()
%25 = call i32 (...) @showHistory()
ret i32 0
}