// File: demon386[P]git-store/main.cpp
// Function: process_read_cmd(boost::program_options::variables_map const&)
void process_read_cmd(const po::variables_map& options) {
    if (!options.count("subargs")) {
        return;
    }
    auto subargs = options["subargs"].as<std::vector<std::string>>();
    if (subargs.size() != 1) {
        std::cout << "should given exactly one SHA-1" << std::endl;
    }
    subprocess::run_cmd("git reset --mixed");
    int ret = subprocess::run_cmd("git read-tree " + subargs.at(0));
    if (ret == 0) {
        subprocess::run_cmd("git checkout-index -a");
        subprocess::run_cmd("git reset --mixed");
    } else {
        std::cerr << "Trying to find blob object with this SHA-1" << std::endl;
        subprocess::run_cmd("git show " + subargs.at(0));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x148(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0xdb50
movq -0x140(%rbp), %rdx
leaq 0xe08c(%rip), %rsi      # 0x64108
leaq -0x28(%rbp), %rdi
callq 0xd8b0
jmp 0x56087
movq -0x148(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x44d90
movq %rax, -0x150(%rbp)
jmp 0x560a0
movq -0x150(%rbp), %rax
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
movb %al, -0x151(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xdca8
leaq -0x29(%rbp), %rdi
callq 0xd6b0
movb -0x151(%rbp), %al
testb $0x1, %al
jne 0x560d4
jmp 0x5610a
jmp 0x56500
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x560fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xdca8
leaq -0x29(%rbp), %rdi
callq 0xd6b0
jmp 0x56512
movq -0x8(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0xdb50
movq -0x160(%rbp), %rdx
leaq 0xdfd5(%rip), %rsi      # 0x64108
leaq -0x78(%rbp), %rdi
callq 0xd8b0
jmp 0x5613e
movq -0x168(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x57490
movq %rax, -0x170(%rbp)
jmp 0x56157
movq -0x170(%rbp), %rdi
callq 0x57830
movq %rax, -0x178(%rbp)
jmp 0x5616c
movq -0x178(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x19a40
jmp 0x5617e
leaq -0x78(%rbp), %rdi
callq 0xdca8
leaq -0x79(%rbp), %rdi
callq 0xd6b0
leaq -0x58(%rbp), %rdi
callq 0x124d0
cmpq $0x1, %rax
je 0x56214
movq 0x37e0a(%rip), %rdi     # 0x8dfb0
leaq 0xe0bd(%rip), %rsi      # 0x6426a
callq 0xd610
movq %rax, -0x180(%rbp)
jmp 0x561bb
movq -0x180(%rbp), %rdi
movq 0x37da7(%rip), %rsi     # 0x8df70
callq 0xd670
jmp 0x561d0
jmp 0x56214
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x561f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0xdca8
leaq -0x79(%rbp), %rdi
callq 0xd6b0
jmp 0x56512
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x56509
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0xdb50
movq -0x188(%rbp), %rdx
leaq 0xe014(%rip), %rsi      # 0x64249
leaq -0xa0(%rbp), %rdi
callq 0xd8b0
jmp 0x56243
leaq -0xa0(%rbp), %rdi
movl $0x1, %esi
callq 0x55650
jmp 0x56256
leaq -0xa0(%rbp), %rdi
callq 0xdca8
leaq -0xa1(%rbp), %rdi
callq 0xd6b0
xorl %eax, %eax
movl %eax, %esi
leaq -0x58(%rbp), %rdi
callq 0x579f0
movq %rax, -0x190(%rbp)
jmp 0x56284
movq -0x190(%rbp), %rdx
leaq 0xdff7(%rip), %rsi      # 0x64289
leaq -0xc8(%rbp), %rdi
callq 0x267b0
jmp 0x562a0
leaq -0xc8(%rbp), %rdi
movl $0x1, %esi
callq 0x55650
movl %eax, -0x194(%rbp)
jmp 0x562b9
leaq -0xc8(%rbp), %rdi
callq 0xdca8
movl -0x194(%rbp), %eax
movl %eax, -0xa8(%rbp)
cmpl $0x0, -0xa8(%rbp)
jne 0x56459
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0xdb50
movq -0x1a0(%rbp), %rdx
leaq 0xdf99(%rip), %rsi      # 0x64298
leaq -0xe8(%rbp), %rdi
callq 0xd8b0
jmp 0x5630d
leaq -0xe8(%rbp), %rdi
movl $0x1, %esi
callq 0x55650
jmp 0x56320
leaq -0xe8(%rbp), %rdi
callq 0xdca8
leaq -0xe9(%rbp), %rdi
callq 0xd6b0
leaq -0x111(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
callq 0xdb50
movq -0x1a8(%rbp), %rdx
leaq 0xdef0(%rip), %rsi      # 0x64249
leaq -0x110(%rbp), %rdi
callq 0xd8b0
jmp 0x56367
leaq -0x110(%rbp), %rdi
movl $0x1, %esi
callq 0x55650
jmp 0x5637a
leaq -0x110(%rbp), %rdi
callq 0xdca8
leaq -0x111(%rbp), %rdi
callq 0xd6b0
jmp 0x564f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x563bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0xdca8
leaq -0xa1(%rbp), %rdi
callq 0xd6b0
jmp 0x56509
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0xdca8
jmp 0x56509
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x56411
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0xdca8
leaq -0xe9(%rbp), %rdi
callq 0xd6b0
jmp 0x56509
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x56448
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0xdca8
leaq -0x111(%rbp), %rdi
callq 0xd6b0
jmp 0x56509
movq 0x37b90(%rip), %rdi     # 0x8dff0
leaq 0xde47(%rip), %rsi      # 0x642ae
callq 0xd610
movq %rax, -0x1b0(%rbp)
jmp 0x56475
movq -0x1b0(%rbp), %rdi
movq 0x37aed(%rip), %rsi     # 0x8df70
callq 0xd670
jmp 0x5648a
xorl %eax, %eax
movl %eax, %esi
leaq -0x58(%rbp), %rdi
callq 0x579f0
movq %rax, -0x1b8(%rbp)
jmp 0x564a0
movq -0x1b8(%rbp), %rdx
leaq 0xde2b(%rip), %rsi      # 0x642d9
leaq -0x138(%rbp), %rdi
callq 0x267b0
jmp 0x564bc
leaq -0x138(%rbp), %rdi
movl $0x1, %esi
callq 0x55650
jmp 0x564cf
leaq -0x138(%rbp), %rdi
callq 0xdca8
jmp 0x564f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x138(%rbp), %rdi
callq 0xdca8
jmp 0x56509
leaq -0x58(%rbp), %rdi
callq 0x11db0
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
leaq -0x58(%rbp), %rdi
callq 0x11db0
movq -0x38(%rbp), %rdi
callq 0xdb30
nopl (%rax,%rax)