// File: /workspace/github_cpp_makefile_star2_O1/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 0x9d8c(%rip), %rsi      # 0x36e50
leaq 0x9da1(%rip), %rdx      # 0x36e6c
leaq -0xd0(%rbp), %rdi
callq 0xf97e
leaq 0x6a82(%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 0x161fe
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x2d118
callq 0xb430
leaq -0x230(%rbp), %rdi
callq 0x163f4
leaq -0xd0(%rbp), %rdi
movq %rax, (%rdi)
leaq 0x9d38(%rip), %rsi      # 0x36e6d
leaq 0x9d38(%rip), %rdx      # 0x36e74
callq 0x15ef4
movq %rax, %rbx
xorl %edi, %edi
callq 0x2f25f
leaq 0x9d31(%rip), %rsi      # 0x36e83
leaq 0x9d27(%rip), %rcx      # 0x36e80
movq %rbx, %rdi
movq %rax, %rdx
callq 0x160cc
movq %rax, %rbx
xorl %edi, %edi
callq 0x2fb61
leaq 0x9d16(%rip), %rsi      # 0x36e8b
leaq 0x9d17(%rip), %rcx      # 0x36e93
movq %rbx, %rdi
movq %rax, %rdx
callq 0x160cc
leaq -0x268(%rbp), %rdi
callq 0x1c758
leaq 0x9ce9(%rip), %rsi      # 0x36e83
leaq -0x268(%rbp), %rdi
movl $0x1, %edx
callq 0x1c77a
leaq 0x9cd9(%rip), %rsi      # 0x36e8b
movq %rax, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1c77a
movq -0x30(%rbp), %rdi
callq 0x24fa4
leaq -0xd0(%rbp), %rdi
movl %r13d, %esi
movq %r12, %rdx
callq 0x2e890
leaq -0xd0(%rbp), %rdi
leaq -0x230(%rbp), %rbx
movq %rbx, %rsi
callq 0xc4d0
leaq -0xd0(%rbp), %rdi
movq %rbx, 0x70(%rdi)
leaq -0x268(%rbp), %rsi
callq 0xc4da
leaq -0xd0(%rbp), %rdi
callq 0xc4ba
leaq -0x1b0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2e91e
leaq -0x80(%rbp), %rdi
callq 0xe49a
leaq -0xa0(%rbp), %rdi
callq 0xe4dc
leaq -0xd0(%rbp), %rdi
callq 0xe51e
leaq -0x1b0(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x245ac
leaq -0x178(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x9c18(%rip), %rsi      # 0x36e83
leaq 0x9c18(%rip), %rdx      # 0x36e8a
leaq -0x188(%rbp), %rdi
callq 0xf97e
leaq -0x188(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x24f3e
movq %rax, %rdi
callq 0x31436
leaq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rcx
movq %rcx, (%rdi)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0xfa18
movq -0x188(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d2c7
callq 0xb430
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x2d2df
callq 0xb430
leaq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
movq %rax, (%rdi)
leaq 0x9b8c(%rip), %rsi      # 0x36e83
leaq 0x9b8c(%rip), %rdx      # 0x36e8a
callq 0xf97e
leaq -0xd0(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x24f3e
movq %rax, %rdi
callq 0x31436
leaq -0x40(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0xfa18
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x2d34e
callq 0xb430
movb 0x1f3f4(%rip), %al      # 0x4c748
testb %al, %al
je 0x2d6aa
leaq 0x1f3b5(%rip), %rdi     # 0x4c718
leaq -0x50(%rbp), %rsi
callq 0x314da
leaq 0x1f3ad(%rip), %rcx     # 0x4c720
cmpq %rcx, %rax
je 0x2d6b4
movb 0x1f3c6(%rip), %al      # 0x4c748
testb %al, %al
je 0x2d70d
leaq 0x1f387(%rip), %rdi     # 0x4c718
leaq -0x50(%rbp), %rsi
callq 0x2ea20
movq %rax, %r12
leaq 0x9b2b(%rip), %rsi      # 0x36ecf
leaq -0x110(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x1739d
leaq 0x9b24(%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 0x2d3f0
movq %rdx, -0x188(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x178(%rbp)
jmp 0x2d3f8
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 0x161fe
movq -0x188(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d439
callq 0xb430
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d44e
callq 0xb430
cmpq $0x0, 0x10(%r12)
je 0x2d717
leaq -0xd0(%rbp), %rsi
movq %r12, %rdi
callq *0x18(%r12)
leaq -0xd0(%rbp), %rdi
callq 0x163f4
leaq -0x188(%rbp), %rdi
movq %rax, (%rdi)
leaq 0x99e7(%rip), %rsi      # 0x36e6d
leaq 0x99e7(%rip), %rdx      # 0x36e74
callq 0x15ef4
leaq -0xe8(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
xorl %edx, %edx
callq 0x2ea7e
leaq -0xe8(%rbp), %rdi
movq (%rdi), %rsi
callq 0x11450
leaq -0x188(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x2eb58
leaq -0x188(%rbp), %rdi
leaq -0xd0(%rbp), %rbx
movq %rbx, %rsi
callq 0xc4d0
leaq -0x188(%rbp), %rsi
movq %rbx, 0x70(%rsi)
leaq -0x110(%rbp), %rdi
callq 0x2e91e
leaq -0x110(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x245ac
leaq -0x110(%rbp), %rdi
callq 0xe8e2
leaq -0x138(%rbp), %rdi
callq 0xe49a
leaq -0x158(%rbp), %rdi
callq 0xe4dc
leaq -0x188(%rbp), %rbx
movq %rbx, %rdi
callq 0xe51e
movq %r13, (%rbx)
leaq 0x99ad(%rip), %rsi      # 0x36ef2
leaq 0x99aa(%rip), %rdx      # 0x36ef6
leaq -0x188(%rbp), %rdi
callq 0xf97e
movq -0x30(%rbp), %r14
leaq 0x10(%r14), %rdi
leaq -0x188(%rbp), %rsi
callq 0x2586a
movq %rax, %rbx
addq $0x18, %r14
movq -0x188(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d584
callq 0xb430
cmpq %r14, %rbx
jne 0x2d71c
leaq -0xe8(%rbp), %rdi
callq 0xe51e
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
callq 0x18a74
movq -0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x2d5cd
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 0x179c4
movq -0x28(%rbx), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x2d5f1
callq 0xb430
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x2d603
callq 0xb430
leaq -0x1b0(%rbp), %rdi
callq 0xe8e2
leaq -0x240(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d624
callq 0xb430
leaq -0x268(%rbp), %rdi
callq 0xe51e
leaq -0x1c8(%rbp), %rbx
movq %rbx, %rdi
callq 0x18a74
movq -0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x2d670
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 0x179c4
movq -0x28(%rbx), %rdi
leaq -0x220(%rbp), %rax
cmpq %rax, %rdi
je 0x2d694
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 0xbd34
jmp 0x2d35c
movq 0x1e8fd(%rip), %rdi     # 0x4bfb8
leaq 0x97f6(%rip), %rsi      # 0x36eb8
movl $0x16, %edx
callq 0xb500
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x1e8dd(%rip), %rdi     # 0x4bfb8
callq 0xb500
movq %rax, %rdi
callq 0xb230
movq 0x1e8c9(%rip), %rdi     # 0x4bfb8
leaq -0x230(%rbp), %rsi
callq 0x16702
movq %rax, %rdi
callq 0xb230
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xb540
callq 0xbd9c
jmp 0x2d38a
callq 0xb1b0
movq 0x1e895(%rip), %rdi     # 0x4bfb8
leaq -0xd0(%rbp), %rsi
callq 0x16702
movq %rax, %rdi
callq 0xb230
xorl %edi, %edi
callq 0xb540
jmp 0x2d781
movq %rax, %r14
movq -0x188(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d888
callq 0xb430
jmp 0x2d888
jmp 0x2d781
movq %rdx, %r15
movq %rax, %r14
leaq -0x110(%rbp), %rdi
callq 0xe8e2
jmp 0x2d822
movq %rdx, %r15
movq %rax, %r14
jmp 0x2d82e
movq %rax, %r14
jmp 0x2d888
jmp 0x2d898
movq %rax, %r14
movq -0x188(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d7a7
callq 0xb430
jmp 0x2d7a7
movq %rax, %r14
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d8a7
callq 0xb430
jmp 0x2d8a7
jmp 0x2d814
jmp 0x2d814
jmp 0x2d7d3
movq %rax, %rbx
jmp 0x2d915
movq %rax, %r14
jmp 0x2d8b9
movq %rax, %r14
jmp 0x2d8c5
jmp 0x2d973
movq %rax, %r14
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x2d8e6
callq 0xb430
jmp 0x2d8e6
movq %rax, %r14
jmp 0x2d8e6
movq %rax, %r14
jmp 0x2d8a7
movq %rdx, %r15
movq %rax, %r14
leaq -0x188(%rbp), %rdi
callq 0x2e9f6
cmpl $0x2, %r15d
jne 0x2d888
movq %r14, %rdi
callq 0xb1e0
movq 0x1e775(%rip), %rdi     # 0x4bfb8
leaq 0x9697(%rip), %rsi      # 0x36ee1
movl $0x10, %edx
callq 0xb500
movq 0x1e75d(%rip), %rdi     # 0x4bfb8
callq 0xb230
movq 0x1e751(%rip), %rdi     # 0x4bfb8
leaq -0xd0(%rbp), %rsi
callq 0x16702
movq %rax, %rdi
callq 0xb230
jmp 0x2d938
movq %rax, %r14
callq 0xb780
leaq -0xe8(%rbp), %rdi
callq 0xe51e
jmp 0x2d89b
jmp 0x2d898
movq %rax, %r14
leaq -0xd0(%rbp), %rdi
callq 0x2eba4
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x2d8b9
callq 0xb430
leaq -0x1b0(%rbp), %rdi
callq 0xe8e2
movq -0x30(%rbp), %rdi
callq 0x25348
leaq -0x268(%rbp), %rdi
callq 0x2ebea
leaq -0x230(%rbp), %rdi
callq 0x2eba4
movq %r14, %rdi
callq 0xb7f0
movq %rax, %r14
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
jmp 0x2d8af
movq %rax, %rbx
movq -0x188(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d915
callq 0xb430
movq %rbx, %rdi
callq 0xb1e0
movq 0x1e694(%rip), %rdi     # 0x4bfb8
leaq -0x230(%rbp), %rsi
callq 0x16702
movq %rax, %rdi
callq 0xb230
movl $0x1, %edi
callq 0xb540
movq %rax, %r14
callq 0xb780
jmp 0x2d8b9
movq %rax, %rdi
callq 0xe997
movq %rax, %r14
jmp 0x2d8ce
movq %rax, %r14
leaq -0xd0(%rbp), %rdi
callq 0x2e9f6
jmp 0x2d8c5
movq %rax, %r14
jmp 0x2d8da