// File: demon386[P]git-store/main.cpp
// Function: main
int main(int argc, char *argv[])
{
    check_git_cmd_available();
    command::add_subcommand("init", "Initialize git repo.");
    command::add_subcommand("write", "Write content into git repo.",
            [](po::options_description& subopts) {
            subopts.add_options()
            ("tree,t", "give tree's hash even given just one file")
            ("delete,d", "delete added files");
            });
    command::add_subcommand("read", "read content into current dir.");

    const po::variables_map options = command::parse_args(argc, argv);

    std::map<std::string, ProcessFuncT> process_func_map = {
        {"init", process_init_cmd},
        {"write", process_write_cmd},
        {"read", process_read_cmd}
    };

    const auto& cmd = options["command"].as<std::string>();
    auto func = process_func_map.at(cmd);
    func(options);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x390, %rsp            # imm = 0x390
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x55710
leaq -0x31(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0xdb50
movq -0x2f8(%rbp), %rdx
leaq 0xdd87(%rip), %rsi      # 0x642e3
leaq -0x30(%rbp), %rdi
callq 0xd8b0
jmp 0x56567
leaq -0x69(%rbp), %rdi
movq %rdi, -0x300(%rbp)
callq 0xdb50
movq -0x300(%rbp), %rdx
leaq 0xdd63(%rip), %rsi      # 0x642e8
leaq -0x68(%rbp), %rdi
callq 0xd8b0
jmp 0x56590
leaq -0x30(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x54a60
jmp 0x5659f
leaq -0x68(%rbp), %rdi
callq 0xdca8
leaq -0x69(%rbp), %rdi
callq 0xd6b0
leaq -0x30(%rbp), %rdi
callq 0xdca8
leaq -0x31(%rbp), %rdi
callq 0xd6b0
leaq -0x91(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0xdb50
movq -0x308(%rbp), %rdx
leaq 0xdb00(%rip), %rsi      # 0x640e4
leaq -0x90(%rbp), %rdi
callq 0xd8b0
jmp 0x565f2
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0xdb50
movq -0x310(%rbp), %rdx
leaq 0xdcea(%rip), %rsi      # 0x642fd
leaq -0xb8(%rbp), %rdi
callq 0xd8b0
jmp 0x56621
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x318(%rbp)
leaq -0xe1(%rbp), %rsi
callq 0x56bb0
movq -0x318(%rbp), %rdx
leaq -0x90(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x549c0
jmp 0x56657
leaq -0xe0(%rbp), %rdi
callq 0x57210
leaq -0xb8(%rbp), %rdi
callq 0xdca8
leaq -0xb9(%rbp), %rdi
callq 0xd6b0
leaq -0x90(%rbp), %rdi
callq 0xdca8
leaq -0x91(%rbp), %rdi
callq 0xd6b0
leaq -0x109(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0xdb50
movq -0x320(%rbp), %rdx
leaq 0xdc66(%rip), %rsi      # 0x6431a
leaq -0x108(%rbp), %rdi
callq 0xd8b0
jmp 0x566c2
leaq -0x131(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0xdb50
movq -0x328(%rbp), %rdx
leaq 0xdc3c(%rip), %rsi      # 0x6431f
leaq -0x130(%rbp), %rdi
callq 0xd8b0
jmp 0x566f1
leaq -0x108(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x54a60
jmp 0x56706
leaq -0x130(%rbp), %rdi
callq 0xdca8
leaq -0x131(%rbp), %rdi
callq 0xd6b0
leaq -0x108(%rbp), %rdi
callq 0xdca8
leaq -0x109(%rbp), %rdi
callq 0xd6b0
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0x1d8(%rbp), %rdi
callq 0x54b30
leaq -0x290(%rbp), %rdi
movq %rdi, -0x298(%rbp)
leaq -0xf8e(%rip), %rax      # 0x557d0
movq %rax, -0x2a0(%rbp)
leaq 0xdb77(%rip), %rsi      # 0x642e3
leaq -0x2a0(%rbp), %rdx
callq 0x57a30
jmp 0x5677a
leaq -0x268(%rbp), %rdi
movq %rdi, -0x298(%rbp)
leaq -0xf0f(%rip), %rax      # 0x55880
movq %rax, -0x2a8(%rbp)
leaq 0xd947(%rip), %rsi      # 0x640e4
leaq -0x2a8(%rbp), %rdx
callq 0x57ab0
jmp 0x567ab
leaq -0x240(%rbp), %rdi
movq %rdi, -0x298(%rbp)
leaq -0x780(%rip), %rax      # 0x56040
movq %rax, -0x2b0(%rbp)
leaq 0xdb4c(%rip), %rsi      # 0x6431a
leaq -0x2b0(%rbp), %rdx
callq 0x57a30
jmp 0x567dc
leaq -0x290(%rbp), %rax
movq %rax, -0x218(%rbp)
movq $0x3, -0x210(%rbp)
leaq -0x2b2(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x57b50
movq -0x330(%rbp), %r8
movq -0x218(%rbp), %rsi
movq -0x210(%rbp), %rdx
leaq -0x208(%rbp), %rdi
leaq -0x2b1(%rbp), %rcx
callq 0x57b70
jmp 0x56832
leaq -0x2b2(%rbp), %rdi
callq 0x57c40
leaq -0x290(%rbp), %rax
movq %rax, -0x340(%rbp)
addq $0x78, %rax
movq %rax, -0x338(%rbp)
movq -0x338(%rbp), %rdi
addq $-0x28, %rdi
movq %rdi, -0x348(%rbp)
callq 0x57b30
movq -0x340(%rbp), %rcx
movq -0x348(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x338(%rbp)
jne 0x56857
leaq -0x2e1(%rbp), %rdi
movq %rdi, -0x350(%rbp)
callq 0xdb50
movq -0x350(%rbp), %rdx
leaq 0xd857(%rip), %rsi      # 0x64100
leaq -0x2e0(%rbp), %rdi
callq 0xd8b0
jmp 0x568b7
leaq -0x1d8(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x57490
movq %rax, -0x358(%rbp)
jmp 0x568d3
movq -0x358(%rbp), %rdi
callq 0x574c0
movq %rax, -0x360(%rbp)
jmp 0x568e8
leaq -0x2e0(%rbp), %rdi
callq 0xdca8
leaq -0x2e1(%rbp), %rdi
callq 0xd6b0
movq -0x360(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movq -0x2c0(%rbp), %rsi
leaq -0x208(%rbp), %rdi
callq 0x57c60
movq %rax, -0x368(%rbp)
jmp 0x5692a
movq -0x368(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x2f0(%rbp)
movq -0x2f0(%rbp), %rax
leaq -0x1d8(%rbp), %rdi
callq *%rax
jmp 0x5694d
movl $0x0, -0x4(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x57d00
leaq -0x1d8(%rbp), %rdi
callq 0x45360
movl -0x4(%rbp), %eax
addq $0x390, %rsp            # imm = 0x390
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x569bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x569a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0xdca8
leaq -0x69(%rbp), %rdi
callq 0xd6b0
leaq -0x30(%rbp), %rdi
callq 0xdca8
leaq -0x31(%rbp), %rdi
callq 0xd6b0
jmp 0x56ba7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x56a21
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x56a09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x57210
leaq -0xb8(%rbp), %rdi
callq 0xdca8
leaq -0xb9(%rbp), %rdi
callq 0xd6b0
leaq -0x90(%rbp), %rdi
callq 0xdca8
leaq -0x91(%rbp), %rdi
callq 0xd6b0
jmp 0x56ba7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x56a7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x56a66
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x130(%rbp), %rdi
callq 0xdca8
leaq -0x131(%rbp), %rdi
callq 0xd6b0
leaq -0x108(%rbp), %rdi
callq 0xdca8
leaq -0x109(%rbp), %rdi
callq 0xd6b0
jmp 0x56ba7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movq -0x298(%rbp), %rax
leaq -0x290(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x370(%rbp)
je 0x56ae6
movq -0x370(%rbp), %rdi
addq $-0x28, %rdi
movq %rdi, -0x378(%rbp)
callq 0x57b30
movq -0x378(%rbp), %rax
leaq -0x290(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x370(%rbp)
jne 0x56ab5
jmp 0x56b9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2b2(%rbp), %rdi
callq 0x57c40
leaq -0x290(%rbp), %rax
movq %rax, -0x388(%rbp)
addq $0x78, %rax
movq %rax, -0x380(%rbp)
movq -0x380(%rbp), %rdi
addq $-0x28, %rdi
movq %rdi, -0x390(%rbp)
callq 0x57b30
movq -0x388(%rbp), %rcx
movq -0x390(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x380(%rbp)
jne 0x56b1c
jmp 0x56b9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x56b75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0xdca8
leaq -0x2e1(%rbp), %rdi
callq 0xd6b0
jmp 0x56b8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x57d00
leaq -0x1d8(%rbp), %rdi
callq 0x45360
movq -0x40(%rbp), %rdi
callq 0xdb30