// File: ridiculousfish[P]docopt_fish/docopt_fish.cpp
// Function: docopt_fish::docopt_impl::finalize_option_map[abi:cxx11](std::map<docopt_fish::rstring_t, docopt_fish::argument_t, std::less<docopt_fish::rstring_t>, std::allocator<std::pair<docopt_fish::rstring_t const, docopt_fish::argument_t>>> const&) const
argument_parser_t::argument_map_t finalize_option_map(const option_rmap_t &map) const {
        argument_parser_t::argument_map_t result;

        // Helper lambda to ensure our result map has a value for a given name
        // We merely invoke operator[]; this will do the insertion with the
        // default (empty) value if necessary. Re-use storage to avoid allocations.
        string_t name_storage;
        auto ensure_argument = [&](const rstring_t &name) -> argument_t & {
            name.copy_to(&name_storage);
            return result[name_storage];
        };

        // Turn our string_ts into std::strings
        for (const auto &kv : map) {
            result.insert({kv.first.std_string(), kv.second});
        }

        // Apply default values for any variables
        for (const option_t &opt : all_options) {
            if (opt.has_value() && !opt.default_value.empty()) {
                argument_t &var_arg = ensure_argument(opt.value);
                if (var_arg.values.empty()) {
                    var_arg.values.push_back(opt.default_value.std_string());
                }
            }
        }

        return result;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x140(%rbp)
movq %rdi, %rax
movq %rax, -0x150(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x148(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x19b30
leaq -0x40(%rbp), %rdi
callq 0x8150
movq -0x140(%rbp), %rdi
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq %rdi, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x19b50
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rdi
callq 0x19b80
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x19bb0
testb $0x1, %al
jne 0xda30
jmp 0xdb28
leaq -0x60(%rbp), %rdi
callq 0x19be0
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0x11390
jmp 0xda4f
movq -0x70(%rbp), %rdx
addq $0x18, %rdx
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x19c50
jmp 0xda6c
movq -0x140(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x19c10
movb %dl, -0x159(%rbp)
movq %rax, -0x158(%rbp)
jmp 0xda8e
movb -0x159(%rbp), %al
movq -0x158(%rbp), %rcx
movq %rcx, -0xf0(%rbp)
movb %al, -0xe8(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x19cb0
leaq -0xd0(%rbp), %rdi
callq 0x8590
leaq -0x60(%rbp), %rdi
callq 0x19ce0
jmp 0xda1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0xdc8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0xdb17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x19cb0
leaq -0xd0(%rbp), %rdi
callq 0x8590
jmp 0xdc8d
movq -0x148(%rbp), %rax
addq $0x68, %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rdi
callq 0x14c00
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rdi
callq 0x14c30
movq %rax, -0x108(%rbp)
leaq -0x100(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x14c60
testb $0x1, %al
jne 0xdb7c
jmp 0xdc78
leaq -0x100(%rbp), %rdi
callq 0xc8c0
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rdi
callq 0xc8e0
testb $0x1, %al
jne 0xdba4
jmp 0xdc65
movq -0x110(%rbp), %rdi
addq $0x60, %rdi
callq 0xbe30
testb $0x1, %al
jne 0xdc65
movq -0x110(%rbp), %rsi
addq $0x48, %rsi
leaq -0x50(%rbp), %rdi
callq 0x19d10
movq %rax, -0x168(%rbp)
jmp 0xdbd9
movq -0x168(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x118(%rbp), %rdi
callq 0x13730
testb $0x1, %al
jne 0xdbf9
jmp 0xdc63
movq -0x118(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x110(%rbp), %rsi
addq $0x60, %rsi
leaq -0x138(%rbp), %rdi
callq 0x11390
jmp 0xdc20
movq -0x170(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x18c20
jmp 0xdc35
leaq -0x138(%rbp), %rdi
callq 0x8590
jmp 0xdc63
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x8590
jmp 0xdc8d
jmp 0xdc65
jmp 0xdc67
leaq -0x100(%rbp), %rdi
callq 0x14d30
jmp 0xdb60
movb $0x1, -0x19(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x8590
testb $0x1, -0x19(%rbp)
jne 0xdcb0
jmp 0xdca4
leaq -0x40(%rbp), %rdi
callq 0x8590
movq -0x140(%rbp), %rdi
callq 0x19d50
jmp 0xdcc0
movq -0x140(%rbp), %rdi
callq 0x19d50
movq -0x150(%rbp), %rax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq -0xd8(%rbp), %rdi
callq 0x85d0
nopl (%rax)