// File: /workspace/github_cpp_makefile_star2_O3/demon386[P]git-store/./command.hpp
// Function: command::parse_args(int, char**)
po::variables_map parse_args(int argc, char* argv[]) {
    // Inspired by
    // http://www.hitmaroc.net/553491-4141-how-implement-subcommands-using-boost-program-options.html
    po::options_description commands("Subcommands: init,read,write");

    commands.add_options()
        ("help,h", "Help screen")
        ("command", po::value<std::string>(), "subcommand")
        ("subargs", po::value<std::vector<std::string>>(),
         "Positional arguments for subcommands");

    po::positional_options_description pos;
    pos.add("command", 1).
        add("subargs", -1);

    po::variables_map vm;

    po::parsed_options parsed = po::command_line_parser(argc, argv).
        options(commands).
        positional(pos).
        allow_unregistered().
        run();

    po::store(parsed, vm);

    // @todo should exists a better way to judge whether the first positional
    // cmd is given.
    try {
        std::string cmd = vm["command"].as<std::string>();
    } catch(...) {
        std::cout << commands << std::endl;
        std::exit(1);
    }
    std::string cmd = vm["command"].as<std::string>();

    if (!global_command_map().count(cmd)) {
        std::cout << "Unrecognized command: " << cmd << std::endl;
        std::cout << commands << std::endl;
        std::exit(-1);
    } else {
        const auto& callback = std::get<1>(global_command_map().at(cmd));
        po::options_description sub_opts("sub-options for `" + cmd + "`");
        callback(sub_opts);
        sub_opts.add_options()
            ("help,h", "Help screen");

        std::vector<std::string> opts = po::collect_unrecognized(parsed.options, po::include_positional);
        opts.erase(opts.begin());

        try {
            po::store(po::command_line_parser(opts).options(sub_opts).run(), vm);
        } catch (boost::program_options::unknown_option& e) {
            std::cout << "Unknown options!" << std::endl;
            std::cout << sub_opts << std::endl;
            std::exit(1);
        }
        if (vm.count("help")) {
            std::cout << sub_opts << std::endl;
            std::exit(0);
        }
    }
    return vm;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movq %rdx, %r12
movl %esi, %r13d
movq %rdi, -0x30(%rbp)
leaq -0xc0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xa510(%rip), %rsi      # 0x36e50
leaq 0xa525(%rip), %rdx      # 0x36e6c
leaq -0xd0(%rbp), %rdi
callq 0xf8ee
leaq 0x7206(%rip), %rax      # 0x33b60
movl (%rax), %r14d
movl %r14d, %r15d
shrl %r15d
leaq -0x230(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
movl %r14d, %edx
movl %r15d, %ecx
callq 0x16090
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x2c994
callq 0xb430
leaq -0x230(%rbp), %rdi
callq 0x16286
leaq -0xd0(%rbp), %rdi
movq %rax, (%rdi)
leaq 0xa4bc(%rip), %rsi      # 0x36e6d
leaq 0xa4bc(%rip), %rdx      # 0x36e74
callq 0x15d86
movq %rax, %rbx
xorl %edi, %edi
callq 0x2ea83
leaq 0xa4b5(%rip), %rsi      # 0x36e83
leaq 0xa4ab(%rip), %rcx      # 0x36e80
movq %rbx, %rdi
movq %rax, %rdx
callq 0x15f5e
movq %rax, %rbx
xorl %edi, %edi
callq 0x2f37f
leaq 0xa49a(%rip), %rsi      # 0x36e8b
leaq 0xa49b(%rip), %rcx      # 0x36e93
movq %rbx, %rdi
movq %rax, %rdx
callq 0x15f5e
leaq -0x268(%rbp), %rdi
callq 0x1c5f8
leaq 0xa46d(%rip), %rsi      # 0x36e83
leaq -0x268(%rbp), %rdi
movl $0x1, %edx
callq 0x1c61a
leaq 0xa45d(%rip), %rsi      # 0x36e8b
movq %rax, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1c61a
movq -0x30(%rbp), %rdi
callq 0x24d82
leaq -0xd0(%rbp), %rdi
movl %r13d, %esi
movq %r12, %rdx
callq 0x2e0d4
leaq -0xd0(%rbp), %rdi
leaq -0x230(%rbp), %rbx
movq %rbx, %rsi
callq 0xc4b4
leaq -0xd0(%rbp), %rdi
movq %rbx, 0x70(%rdi)
leaq -0x268(%rbp), %rsi
callq 0xc4be
leaq -0xd0(%rbp), %rdi
callq 0xc49e
leaq -0x1b0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2e162
leaq -0x80(%rbp), %rdi
callq 0xe3ec
leaq -0xa0(%rbp), %rdi
callq 0xe42e
leaq -0xd0(%rbp), %rdi
callq 0xe470
leaq -0x1b0(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x243c4
leaq -0x178(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0xa39c(%rip), %rsi      # 0x36e83
leaq 0xa39c(%rip), %rdx      # 0x36e8a
leaq -0x188(%rbp), %rdi
callq 0xf8ee
leaq -0x188(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x24d1c
movq %rax, %rdi
callq 0x30c12
leaq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rcx
movq %rcx, (%rdi)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0xf98c
movq -0x188(%rbp), %rdi
cmpq %r13, %rdi
je 0x2cb43
callq 0xb430
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x2cb5b
callq 0xb430
leaq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
movq %rax, (%rdi)
leaq 0xa310(%rip), %rsi      # 0x36e83
leaq 0xa310(%rip), %rdx      # 0x36e8a
callq 0xf8ee
leaq -0xd0(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x24d1c
movq %rax, %rdi
callq 0x30c12
leaq -0x40(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0xf98c
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x2cbca
callq 0xb430
movb 0x1fb78(%rip), %al      # 0x4c748
testb %al, %al
je 0x2cf26
leaq 0x1fb39(%rip), %rdi     # 0x4c718
leaq -0x50(%rbp), %rsi
callq 0x30cb6
leaq 0x1fb31(%rip), %rcx     # 0x4c720
cmpq %rcx, %rax
je 0x2cf30
movb 0x1fb4a(%rip), %al      # 0x4c748
testb %al, %al
je 0x2cf89
leaq 0x1fb0b(%rip), %rdi     # 0x4c718
leaq -0x50(%rbp), %rsi
callq 0x2e254
movq %rax, %r12
leaq 0xa2af(%rip), %rsi      # 0x36ecf
leaq -0x110(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x17287
leaq 0xa2a8(%rip), %rsi      # 0x36edf
leaq -0x110(%rbp), %rdi
callq 0xb880
movq %r13, -0x188(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2cc6c
movq %rdx, -0x188(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x178(%rbp)
jmp 0x2cc74
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0x188(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0xd0(%rbp), %rdi
movl %r14d, %edx
movl %r15d, %ecx
callq 0x16090
movq -0x188(%rbp), %rdi
cmpq %r13, %rdi
je 0x2ccb5
callq 0xb430
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ccca
callq 0xb430
cmpq $0x0, 0x10(%r12)
je 0x2cf93
leaq -0xd0(%rbp), %rsi
movq %r12, %rdi
callq *0x18(%r12)
leaq -0xd0(%rbp), %rdi
callq 0x16286
leaq -0x188(%rbp), %rdi
movq %rax, (%rdi)
leaq 0xa16b(%rip), %rsi      # 0x36e6d
leaq 0xa16b(%rip), %rdx      # 0x36e74
callq 0x15d86
leaq -0xe8(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
xorl %edx, %edx
callq 0x2e2b2
leaq -0xe8(%rbp), %rdi
movq (%rdi), %rsi
callq 0x11356
leaq -0x188(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x2e392
leaq -0x188(%rbp), %rdi
leaq -0xd0(%rbp), %rbx
movq %rbx, %rsi
callq 0xc4b4
leaq -0x188(%rbp), %rsi
movq %rbx, 0x70(%rsi)
leaq -0x110(%rbp), %rdi
callq 0x2e162
leaq -0x110(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x243c4
leaq -0x110(%rbp), %rdi
callq 0xe860
leaq -0x138(%rbp), %rdi
callq 0xe3ec
leaq -0x158(%rbp), %rdi
callq 0xe42e
leaq -0x188(%rbp), %rbx
movq %rbx, %rdi
callq 0xe470
movq %r13, (%rbx)
leaq 0xa131(%rip), %rsi      # 0x36ef2
leaq 0xa12e(%rip), %rdx      # 0x36ef6
leaq -0x188(%rbp), %rdi
callq 0xf8ee
movq -0x30(%rbp), %r14
leaq 0x10(%r14), %rdi
leaq -0x188(%rbp), %rsi
callq 0x2563c
movq %rax, %rbx
addq $0x18, %r14
movq -0x188(%rbp), %rdi
cmpq %r13, %rdi
je 0x2ce00
callq 0xb430
cmpq %r14, %rbx
jne 0x2cf98
leaq -0xe8(%rbp), %rdi
callq 0xe470
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
callq 0x18928
movq -0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x2ce49
callq 0xb430
xorl %eax, %eax
movq %rax, -0x90(%rbp)
movl %eax, -0x88(%rbp)
movq %rax, -0x80(%rbp)
movl %eax, -0x78(%rbp)
movq %rax, -0x70(%rbp)
leaq -0xa8(%rbp), %rbx
movq %rbx, %rdi
callq 0x1786c
movq -0x28(%rbx), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x2ce6d
callq 0xb430
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x2ce7f
callq 0xb430
leaq -0x1b0(%rbp), %rdi
callq 0xe860
leaq -0x240(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cea0
callq 0xb430
leaq -0x268(%rbp), %rdi
callq 0xe470
leaq -0x1c8(%rbp), %rbx
movq %rbx, %rdi
callq 0x18928
movq -0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x2ceec
callq 0xb430
xorl %eax, %eax
movq %rax, -0x1f0(%rbp)
movl %eax, -0x1e8(%rbp)
movq %rax, -0x1e0(%rbp)
movl %eax, -0x1d8(%rbp)
movq %rax, -0x1d0(%rbp)
leaq -0x208(%rbp), %rbx
movq %rbx, %rdi
callq 0x1786c
movq -0x28(%rbx), %rdi
leaq -0x220(%rbp), %rax
cmpq %rax, %rdi
je 0x2cf10
callq 0xb430
movq -0x30(%rbp), %rax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xbd28
jmp 0x2cbd8
movq 0x1f081(%rip), %rdi     # 0x4bfb8
leaq 0x9f7a(%rip), %rsi      # 0x36eb8
movl $0x16, %edx
callq 0xb500
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x1f061(%rip), %rdi     # 0x4bfb8
callq 0xb500
movq %rax, %rdi
callq 0xb230
movq 0x1f04d(%rip), %rdi     # 0x4bfb8
leaq -0x230(%rbp), %rsi
callq 0x165fa
movq %rax, %rdi
callq 0xb230
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xb540
callq 0xbd90
jmp 0x2cc06
callq 0xb1b0
movq 0x1f019(%rip), %rdi     # 0x4bfb8
leaq -0xd0(%rbp), %rsi
callq 0x165fa
movq %rax, %rdi
callq 0xb230
xorl %edi, %edi
callq 0xb540
jmp 0x2cffd
movq %rax, %r14
movq -0x188(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d104
callq 0xb430
jmp 0x2d104
jmp 0x2cffd
movq %rdx, %r15
movq %rax, %r14
leaq -0x110(%rbp), %rdi
callq 0xe860
jmp 0x2d09e
movq %rdx, %r15
movq %rax, %r14
jmp 0x2d0aa
movq %rax, %r14
jmp 0x2d104
jmp 0x2d114
movq %rax, %r14
movq -0x188(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d023
callq 0xb430
jmp 0x2d023
movq %rax, %r14
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d123
callq 0xb430
jmp 0x2d123
jmp 0x2d090
jmp 0x2d090
jmp 0x2d04f
movq %rax, %rbx
jmp 0x2d191
movq %rax, %r14
jmp 0x2d135
movq %rax, %r14
jmp 0x2d141
jmp 0x2d1ef
movq %rax, %r14
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x2d162
callq 0xb430
jmp 0x2d162
movq %rax, %r14
jmp 0x2d162
movq %rax, %r14
jmp 0x2d123
movq %rdx, %r15
movq %rax, %r14
leaq -0x188(%rbp), %rdi
callq 0x2e22a
cmpl $0x2, %r15d
jne 0x2d104
movq %r14, %rdi
callq 0xb1e0
movq 0x1eef9(%rip), %rdi     # 0x4bfb8
leaq 0x9e1b(%rip), %rsi      # 0x36ee1
movl $0x10, %edx
callq 0xb500
movq 0x1eee1(%rip), %rdi     # 0x4bfb8
callq 0xb230
movq 0x1eed5(%rip), %rdi     # 0x4bfb8
leaq -0xd0(%rbp), %rsi
callq 0x165fa
movq %rax, %rdi
callq 0xb230
jmp 0x2d1b4
movq %rax, %r14
callq 0xb780
leaq -0xe8(%rbp), %rdi
callq 0xe470
jmp 0x2d117
jmp 0x2d114
movq %rax, %r14
leaq -0xd0(%rbp), %rdi
callq 0x2e3de
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x2d135
callq 0xb430
leaq -0x1b0(%rbp), %rdi
callq 0xe860
movq -0x30(%rbp), %rdi
callq 0x25124
leaq -0x268(%rbp), %rdi
callq 0x2e424
leaq -0x230(%rbp), %rdi
callq 0x2e3de
movq %r14, %rdi
callq 0xb7f0
movq %rax, %r14
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
jmp 0x2d12b
movq %rax, %rbx
movq -0x188(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d191
callq 0xb430
movq %rbx, %rdi
callq 0xb1e0
movq 0x1ee18(%rip), %rdi     # 0x4bfb8
leaq -0x230(%rbp), %rsi
callq 0x165fa
movq %rax, %rdi
callq 0xb230
movl $0x1, %edi
callq 0xb540
movq %rax, %r14
callq 0xb780
jmp 0x2d135
movq %rax, %rdi
callq 0xe915
movq %rax, %r14
jmp 0x2d14a
movq %rax, %r14
leaq -0xd0(%rbp), %rdi
callq 0x2e22a
jmp 0x2d141
movq %rax, %r14
jmp 0x2d156