// File: /workspace/github_cpp_makefile_star2_O1/RC2K7[P]SDisk-FileSystem/shell.cpp
// Function: Shell::type(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int Shell::type(string fileName)
{
    string fileBuffer = "";
    string blockBuffer = "";

    for ( int curBlock = getFirstBlock(fileName); curBlock != 0; curBlock = this->nextBlock(fileName, curBlock)) {
        this->readBlock(fileName, curBlock, blockBuffer);
        fileBuffer += blockBuffer;
    }

    fileBuffer = fileBuffer.substr(0, fileBuffer.find_first_of('#'));

    cout << fileBuffer << endl;

    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x37a5(%rip), %r15      # 0x70bc
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x2644
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x68(%rbp), %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x2644
leaq -0xb8(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0xc8(%rbp), %rdi
callq 0x41ce
leaq -0xc8(%rbp), %rsi
movq %r14, %rdi
callq 0x55f4
movl %eax, %r15d
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0x398c
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x21c0
testl %r15d, %r15d
je 0x3a5b
leaq -0xa8(%rbp), %r12
leaq -0x88(%rbp), %r13
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x41ce
movq %r14, %rdi
movq %r12, %rsi
movl %r15d, %edx
leaq -0x68(%rbp), %rcx
callq 0x5c5e
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x39f7
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0x2090
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x41ce
movq %r14, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x5e20
movl %eax, %r15d
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x3a52
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x21c0
testl %r15d, %r15d
jne 0x39a3
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
movl $0x23, %esi
xorl %edx, %edx
callq 0x2240
leaq -0xe8(%rbp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x21e0
leaq -0x48(%rbp), %rdi
leaq -0xe8(%rbp), %rbx
movq %rbx, %rsi
callq 0x2220
movq (%rbx), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x3ab3
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x650e(%rip), %rdi      # 0x9fd0
callq 0x21f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x3b0a
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3b23
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21c0
movl $0x1, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3b9d
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0x3ba0
movq -0xb8(%rbp), %rsi
jmp 0x3b93
jmp 0x3b9d
movq %rax, %rbx
jmp 0x3bb9
jmp 0x3b9d
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x3ba0
movq -0x98(%rbp), %rsi
jmp 0x3b93
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x3ba0
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x3ba0
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x3bb9
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3bd2
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x2300