// File: /workspace/github_cpp_makefile_star2_O3/RC2K7[P]SDisk-FileSystem/filesystem.cpp
// Function: FileSystem::initRoot()
int FileSystem::initRoot()
{
	stringstream ssBuffer;

    // FileSystem Was Just Created
	if (this->getStatusCode() == 1) {
        // Setup Root With Default Values
		for (int i = 0; i < this->rootSize; i++)
			ssBuffer << "....." << this->delimiter << "00000" << this->delimiter;
	} else { // FileSystem Previously Existed
		string temp;
		this->getBlock(0, temp);
		ssBuffer << temp;
	}

	vector<string>vecRoot = block(ssBuffer.str(), this->getBlockSize());
	ssBuffer.str(vecRoot[0]);

	{ // Local Scope
		int i;
		string entry;
		for (i = 0; i  < (this->rootSize * 2) && getline(ssBuffer, entry,
			this->delimiter); i++)
		{
			if (i % 2 == 0)
				this->rootFileName.push_back(entry);
			else
				this->rootFirstBlock.push_back(std::stoi(entry, nullptr, 10));
		}
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
leaq -0x238(%rbp), %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x660c
cmpl $0x1, %eax
movq %rbx, -0x58(%rbp)
jne 0x4769
cmpl $0x0, 0x2c(%rbx)
jle 0x47b4
xorl %r13d, %r13d
leaq -0x228(%rbp), %r14
leaq 0x2ae2(%rip), %rbx      # 0x71e9
leaq -0x50(%rbp), %r12
movl $0x5, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x21f0
movb $0x20, -0x50(%rbp)
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x21f0
movq %rax, %r15
movl $0x5, %edx
movq %rax, %rdi
leaq 0x2aae(%rip), %rsi      # 0x71ef
callq 0x21f0
movb $0x20, -0x50(%rbp)
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21f0
incl %r13d
movq -0x58(%rbp), %rax
cmpl 0x2c(%rax), %r13d
jl 0x470b
jmp 0x47b4
leaq -0x40(%rbp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq -0x50(%rbp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x641e
leaq -0x228(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x21f0
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x47b4
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21c0
leaq -0x220(%rbp), %r14
leaq -0x98(%rbp), %rdi
movq %r14, %rsi
callq 0x22c0
movq -0x58(%rbp), %r12
movq %r12, %rdi
callq 0x6602
leaq -0xb0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
movl %eax, %edx
callq 0x537e
leaq -0x88(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x480a
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0xb0(%rbp), %rsi
movq %r14, %rdi
callq 0x2290
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpl $0x0, 0x2c(%r12)
jle 0x4948
leaq 0x50(%r12), %rax
movq %rax, -0x68(%rbp)
leaq 0x38(%r12), %rax
movq %rax, -0x70(%rbp)
xorl %r15d, %r15d
leaq -0x238(%rbp), %r14
leaq -0x50(%rbp), %r13
movq %r14, %rdi
movq %r13, %rsi
movl $0x20, %edx
callq 0x2320
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x492f
testb $0x1, %r15b
jne 0x4891
movq -0x70(%rbp), %rdi
movq %r13, %rsi
callq 0x5f88
jmp 0x491c
movq %r14, %rbx
movq -0x50(%rbp), %r12
callq 0x2040
movq %rax, %r14
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, (%r14)
movq %r12, %rdi
leaq -0x78(%rbp), %rsi
movl $0xa, %edx
callq 0x2260
cmpq %r12, -0x78(%rbp)
je 0x4996
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x498a
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x498a
testl %ecx, %ecx
jne 0x48e9
movl -0x2c(%rbp), %ecx
movl %ecx, (%r14)
movl %eax, -0x5c(%rbp)
movq -0x58(%rbp), %r12
movq 0x58(%r12), %rsi
cmpq 0x60(%r12), %rsi
je 0x490c
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x58(%r12)
movq %rbx, %r14
jmp 0x491c
movq -0x68(%rbp), %rdi
leaq -0x5c(%rbp), %rdx
callq 0x61a4
movq %rbx, %r14
incl %r15d
movl 0x2c(%r12), %eax
addl %eax, %eax
cmpl %eax, %r15d
jl 0x4858
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x4948
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21c0
leaq -0xb0(%rbp), %rdi
callq 0x25da
movq 0x565d(%rip), %rsi      # 0x9fb8
leaq -0x238(%rbp), %rdi
callq 0x2130
leaq -0x1b8(%rbp), %rdi
callq 0x20a0
movl $0x1, %eax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2866(%rip), %rdi      # 0x71f7
callq 0x2270
leaq 0x285a(%rip), %rdi      # 0x71f7
callq 0x20f0
movq %rax, %rbx
jmp 0x4a10
jmp 0x4a1e
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x4a21
movq -0x40(%rbp), %rsi
jmp 0x49d9
jmp 0x4a1e
jmp 0x49f4
movq %rax, %rbx
leaq -0x88(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a21
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x4a21
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x49f7
movl -0x2c(%rbp), %eax
movl %eax, (%r14)
jmp 0x49f7
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x4a10
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21c0
leaq -0xb0(%rbp), %rdi
callq 0x25da
jmp 0x4a21
movq %rax, %rbx
movq 0x5590(%rip), %rsi      # 0x9fb8
leaq -0x238(%rbp), %rdi
callq 0x2130
leaq -0x1b8(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2300