// File: /workspace/github_cpp_makefile_star2_O1/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 0x6618
cmpl $0x1, %eax
movq %rbx, -0x58(%rbp)
jne 0x4715
cmpl $0x0, 0x2c(%rbx)
jle 0x4760
xorl %r13d, %r13d
leaq -0x228(%rbp), %r14
leaq 0x2b36(%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 0x2b02(%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 0x46b7
jmp 0x4760
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 0x642a
leaq -0x228(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x21f0
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x4760
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 0x660e
leaq -0xb0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
movl %eax, %edx
callq 0x5342
leaq -0x88(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x47b6
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 0x48db
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 0x48db
testb $0x1, %r15b
jne 0x483d
movq -0x70(%rbp), %rdi
movq %r13, %rsi
callq 0x5f6c
jmp 0x48c8
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 0x4942
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x4936
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x4936
testl %ecx, %ecx
jne 0x4895
movl -0x2c(%rbp), %ecx
movl %ecx, (%r14)
movl %eax, -0x5c(%rbp)
movq -0x58(%rbp), %r12
movq 0x58(%r12), %rsi
cmpq 0x60(%r12), %rsi
je 0x48b8
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x58(%r12)
movq %rbx, %r14
jmp 0x48c8
movq -0x68(%rbp), %rdi
leaq -0x5c(%rbp), %rdx
callq 0x61b0
movq %rbx, %r14
incl %r15d
movl 0x2c(%r12), %eax
addl %eax, %eax
cmpl %eax, %r15d
jl 0x4804
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x48f4
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21c0
leaq -0xb0(%rbp), %rdi
callq 0x25da
movq 0x56b1(%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 0x28ba(%rip), %rdi      # 0x71f7
callq 0x2270
leaq 0x28ae(%rip), %rdi      # 0x71f7
callq 0x20f0
movq %rax, %rbx
jmp 0x49bc
jmp 0x49ca
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x49cd
movq -0x40(%rbp), %rsi
jmp 0x4985
jmp 0x49ca
jmp 0x49a0
movq %rax, %rbx
leaq -0x88(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x49cd
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x49cd
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x49a3
movl -0x2c(%rbp), %eax
movl %eax, (%r14)
jmp 0x49a3
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x49bc
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21c0
leaq -0xb0(%rbp), %rdi
callq 0x25da
jmp 0x49cd
movq %rax, %rbx
movq 0x55e4(%rip), %rsi      # 0x9fb8
leaq -0x238(%rbp), %rdi
callq 0x2130
leaq -0x1b8(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2300