// File: CYLMos[P]Read_the_tar_file/MyTar.cpp
// Function: MyTar::showContent()
void MyTar::showContent(){
    cout << "Total " << this->getFileNum() << " " << (this->getFileNum() > 1 ? "files." : "file.") << endl;
    cout << left << setw(12) << "filemode" << setw(32) << "username" << setw(32) << "groupname" << setw(6) << "size" << setw(100) << "filename" << endl;

    for(int i = 0; i < this->getFileNum(); i++){
        struct TarHeader buffer = this->tarVector.at(i);

        /// Check the file is directory and output the file mode.
        cout << left << setw(12) << (buffer.type == '5' ? 'd' : '-') + this->getFileMode(atoi(buffer.filemode));

        /// Output the user name.
        cout << left << setw(32) << buffer.username;

        /// Output the group name.
        cout << left << setw(32) << buffer.groupname;

        /// Output the file size.
        cout << left << setw(6) << this->hex2Dec(buffer.filesize, sizeof(buffer.filesize));
        //cout << left << setw(6) << this->hex2Dec(atoi(buffer.filesize));

        /// Output the file name.
        cout << left << setw(100) << buffer.filename << endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x320, %rsp            # imm = 0x320
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movq 0x5427(%rip), %rdi      # 0x7fd8
leaq 0x2491(%rip), %rsi      # 0x5049
callq 0x21b0
movq -0x2c0(%rbp), %rdi
movq %rax, -0x2c8(%rbp)
callq 0x3050
movq -0x2c8(%rbp), %rdi
movl %eax, %esi
callq 0x2320
movq %rax, %rdi
leaq 0x2466(%rip), %rsi      # 0x504e
callq 0x21b0
movq -0x2c0(%rbp), %rdi
movq %rax, -0x2b8(%rbp)
callq 0x3050
movq -0x2b8(%rbp), %rdi
movl %eax, %ecx
leaq 0x2447(%rip), %rsi      # 0x5057
leaq 0x2439(%rip), %rax      # 0x5050
cmpl $0x1, %ecx
cmovgq %rax, %rsi
callq 0x21b0
movq %rax, %rdi
movq 0x539b(%rip), %rsi      # 0x7fc8
callq 0x21e0
movq 0x539f(%rip), %rdi      # 0x7fd8
leaq 0xa70(%rip), %rsi       # 0x36b0
callq 0x2090
movq %rax, -0x2b0(%rbp)
movl $0xc, %edi
callq 0x36e0
movq -0x2b0(%rbp), %rdi
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %esi
callq 0x2240
movq %rax, %rdi
leaq 0x23eb(%rip), %rsi      # 0x505d
callq 0x21b0
movq %rax, -0x2a8(%rbp)
movl $0x20, %edi
callq 0x36e0
movq -0x2a8(%rbp), %rdi
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %esi
callq 0x2240
movq %rax, %rdi
leaq 0x23c2(%rip), %rsi      # 0x5066
callq 0x21b0
movq %rax, -0x2a0(%rbp)
movl $0x20, %edi
callq 0x36e0
movq -0x2a0(%rbp), %rdi
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
callq 0x2240
movq %rax, %rdi
leaq 0x2399(%rip), %rsi      # 0x506f
callq 0x21b0
movq %rax, -0x298(%rbp)
movl $0x6, %edi
callq 0x36e0
movq -0x298(%rbp), %rdi
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
callq 0x2240
movq %rax, %rdi
leaq 0x2371(%rip), %rsi      # 0x5079
callq 0x21b0
movq %rax, -0x290(%rbp)
movl $0x64, %edi
callq 0x36e0
movq -0x290(%rbp), %rdi
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %esi
callq 0x2240
movq %rax, %rdi
leaq 0x2344(%rip), %rsi      # 0x507e
callq 0x21b0
movq %rax, %rdi
movq 0x527f(%rip), %rsi      # 0x7fc8
callq 0x21e0
movl $0x0, -0x20(%rbp)
movq -0x2c0(%rbp), %rdi
movl -0x20(%rbp), %eax
movl %eax, -0x2cc(%rbp)
callq 0x3050
movl %eax, %ecx
movl -0x2cc(%rbp), %eax
cmpl %ecx, %eax
jge 0x302c
movq -0x2c0(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
movslq -0x20(%rbp), %rsi
callq 0x3700
movq %rax, %rsi
leaq -0x220(%rbp), %rdi
movl $0x200, %edx            # imm = 0x200
callq 0x2170
movq 0x522c(%rip), %rdi      # 0x7fd8
leaq 0x8fd(%rip), %rsi       # 0x36b0
callq 0x2090
movq %rax, -0x2f0(%rbp)
movl $0xc, %edi
callq 0x36e0
movq -0x2f0(%rbp), %rdi
movl %eax, -0x224(%rbp)
movl -0x224(%rbp), %esi
callq 0x2240
movq %rax, -0x2e8(%rbp)
movb -0x184(%rbp), %al
movb %al, -0x2d9(%rbp)
leaq -0x1bc(%rbp), %rdi
callq 0x22e0
movq -0x2c0(%rbp), %rsi
movl %eax, %edx
leaq -0x268(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x3170
movb -0x2d9(%rbp), %al
movq -0x2d8(%rbp), %rdx
subb $0x35, %al
movl $0x64, %eax
movl $0x2d, %esi
cmovel %eax, %esi
leaq -0x248(%rbp), %rdi
callq 0x3740
jmp 0x2e46
movq -0x2e8(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x21a0
jmp 0x2e5b
leaq -0x248(%rbp), %rdi
callq 0x2100
leaq -0x268(%rbp), %rdi
callq 0x2100
movq 0x515e(%rip), %rdi      # 0x7fd8
leaq 0x82f(%rip), %rsi       # 0x36b0
callq 0x2090
movq %rax, -0x318(%rbp)
movl $0x20, %edi
callq 0x36e0
movq -0x318(%rbp), %rdi
movl %eax, -0x278(%rbp)
movl -0x278(%rbp), %esi
callq 0x2240
movq %rax, %rdi
leaq -0x220(%rbp), %rsi
addq $0x109, %rsi            # imm = 0x109
callq 0x21b0
movq 0x510c(%rip), %rdi      # 0x7fd8
leaq 0x7dd(%rip), %rsi       # 0x36b0
callq 0x2090
movq %rax, -0x310(%rbp)
movl $0x20, %edi
callq 0x36e0
movq -0x310(%rbp), %rdi
movl %eax, -0x27c(%rbp)
movl -0x27c(%rbp), %esi
callq 0x2240
movq %rax, %rdi
leaq -0x220(%rbp), %rsi
addq $0x129, %rsi            # imm = 0x129
callq 0x21b0
movq 0x50ba(%rip), %rdi      # 0x7fd8
leaq 0x78b(%rip), %rsi       # 0x36b0
callq 0x2090
movq %rax, -0x308(%rbp)
movl $0x6, %edi
callq 0x36e0
movq -0x308(%rbp), %rdi
movl %eax, -0x280(%rbp)
movl -0x280(%rbp), %esi
callq 0x2240
movq -0x2c0(%rbp), %rdi
movq %rax, -0x300(%rbp)
leaq -0x220(%rbp), %rsi
addq $0x7c, %rsi
movl $0xc, %edx
callq 0x2aa0
movq -0x300(%rbp), %rdi
movl %eax, %esi
callq 0x2320
movq 0x504d(%rip), %rdi      # 0x7fd8
leaq 0x71e(%rip), %rsi       # 0x36b0
callq 0x2090
movq %rax, -0x2f8(%rbp)
movl $0x64, %edi
callq 0x36e0
movq -0x2f8(%rbp), %rdi
movl %eax, -0x284(%rbp)
movl -0x284(%rbp), %esi
callq 0x2240
movq %rax, %rdi
leaq -0x220(%rbp), %rsi
callq 0x21b0
movq %rax, %rdi
movq 0x4fef(%rip), %rsi      # 0x7fc8
callq 0x21e0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x2d55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
jmp 0x301e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x270(%rbp)
movl %eax, -0x274(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x2100
leaq -0x268(%rbp), %rdi
callq 0x2100
jmp 0x3035
addq $0x320, %rsp            # imm = 0x320
popq %rbp
retq
movq -0x270(%rbp), %rdi
callq 0x2350
nopw %cs:(%rax,%rax)