// File: ridiculousfish[P]docopt_fish/docopt_fish_test.cpp
// Function: run_1_suggestion_test(char const*, char const*, char const*, unsigned long, unsigned long)
static void run_1_suggestion_test(const char *usage, const char *joined_argv, const char *joined_expected_suggestions, size_t test_idx, size_t arg_idx) {
    using namespace docopt_fish;
    
    /* Separate argv by spaces */
    string_list_t argv = split_nonempty(joined_argv, ' ');
    
    /* Prepend the program name for every argument. Also append an empty string for the last (partial) argument */
    argv.insert(argv.begin(), to_string("prog"));
    argv.push_back(string_t());
    
    /* Usage as a string */
    const string_t usage_str(usage, usage + strlen(usage));
    
    std::vector<doc_error_t> errors;
    argument_parser_t parser(usage_str, &errors);
    
    if (! errors.empty()) {
        err("Suggestion test %lu.%lu was expected to succeed, but instead errored:", test_idx, arg_idx);
        for (size_t i=0; i < errors.size(); i++) {
            fprintf(stderr, "\terr: %ls\n", wide(errors.at(i).text));
        }
    } else {
        /* Get the suggested arguments, then sort and join them */
        suggestion_list_t suggestions = parser.suggest_next_argument(argv, flag_match_allow_incomplete);
        sort(suggestions.begin(), suggestions.end());
        const string_t sugg_string = join(suggestions, ", ");
        
        /* Split, sort, and join expected suggestions */
        string_list_t expected_vector = split(to_string(joined_expected_suggestions), ", ");
        sort(expected_vector.begin(), expected_vector.end());
        const string_t expected_string = join(expected_vector, ", ");
        
        if (sugg_string != expected_string) {
            err("Test %lu.%lu: Wrong suggestions. Expected '%ls', got '%ls'", test_idx, arg_idx, wide(expected_string), wide(sugg_string));
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x1d8(%rbp)
movl $0x20, %edx
callq 0x40670
movq -0x1d8(%rbp), %rdi
callq 0x19820
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x440d0
leaq 0xb2ea(%rip), %rsi      # 0x4db36
leaq -0x70(%rbp), %rdi
callq 0x3af90
jmp 0x42857
movq -0x48(%rbp), %rsi
leaq -0x40(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x44090
movq %rax, -0x1e0(%rbp)
jmp 0x42871
movq -0x1e0(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8590
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x8150
movq -0x1e8(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x18c20
jmp 0x428ad
leaq -0xa8(%rbp), %rdi
callq 0x8590
movq -0x8(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x8110
movq %rax, %rcx
movq -0x200(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x1f8(%rbp)
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x1f0(%rbp)
callq 0x8130
movq -0x200(%rbp), %rsi
movq -0x1f8(%rbp), %rdx
movq -0x1f0(%rbp), %rcx
leaq -0xc8(%rbp), %rdi
callq 0x43f20
jmp 0x42913
leaq -0xc9(%rbp), %rdi
callq 0x85f0
leaq -0xe8(%rbp), %rdi
movq %rdi, -0x208(%rbp)
callq 0xbe50
movq -0x208(%rbp), %rdx
leaq -0xf0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0xab40
jmp 0x4294e
leaq -0xe8(%rbp), %rdi
callq 0xbfd0
testb $0x1, %al
jne 0x42b43
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq 0xca06(%rip), %rdi      # 0x4f377
xorl %eax, %eax
callq 0x3b570
jmp 0x4297a
movq $0x0, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
movq %rax, -0x210(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0xf550
movq %rax, %rcx
movq -0x210(%rbp), %rax
cmpq %rcx, %rax
jae 0x42b3e
movq 0x35617(%rip), %rax     # 0x77fd0
movq (%rax), %rax
movq %rax, -0x220(%rbp)
movq -0xf8(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x44180
movq %rax, -0x218(%rbp)
jmp 0x429df
movq -0x218(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x230(%rbp)
leaq -0x119(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0x85e0
movq -0x230(%rbp), %rsi
movq -0x228(%rbp), %rdx
leaq -0x118(%rbp), %rdi
callq 0x2be70
jmp 0x42a20
leaq -0x118(%rbp), %rdi
callq 0x407f0
movq %rax, -0x238(%rbp)
jmp 0x42a35
movq -0x238(%rbp), %rdx
movq -0x220(%rbp), %rdi
leaq 0xc973(%rip), %rsi      # 0x4f3bd
movb $0x0, %al
callq 0x84b0
leaq -0x118(%rbp), %rdi
callq 0x81c0
leaq -0x119(%rbp), %rdi
callq 0x8380
movq -0xf8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf8(%rbp)
jmp 0x42985
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x42de8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8590
jmp 0x42de8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x8590
jmp 0x42de8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xc9(%rbp), %rdi
callq 0x85f0
jmp 0x42de8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x42dd0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x42dc4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x42b2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x81c0
leaq -0x119(%rbp), %rdi
callq 0x8380
jmp 0x42dc4
jmp 0x42d8e
leaq -0x138(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
leaq -0x40(%rbp), %rdx
movl $0x1, %ecx
callq 0xa620
jmp 0x42b61
leaq -0x138(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x15f00
movq -0x240(%rbp), %rdi
movq %rax, -0x140(%rbp)
callq 0x15d60
movq %rax, -0x148(%rbp)
movq -0x140(%rbp), %rdi
movq -0x148(%rbp), %rsi
callq 0x485a0
jmp 0x42ba3
leaq 0xbfe8(%rip), %rdx      # 0x4eb92
leaq -0x168(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x3b020
jmp 0x42bbf
movq -0x18(%rbp), %rsi
leaq -0x1a0(%rbp), %rdi
callq 0x3af90
jmp 0x42bd1
leaq 0xbfba(%rip), %rdx      # 0x4eb92
leaq -0x180(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x40c20
jmp 0x42bed
leaq -0x1a0(%rbp), %rdi
callq 0x8590
leaq -0x180(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x19820
movq -0x248(%rbp), %rdi
movq %rax, -0x1a8(%rbp)
callq 0x14b00
movq %rax, -0x1b0(%rbp)
movq -0x1a8(%rbp), %rdi
movq -0x1b0(%rbp), %rsi
callq 0x47150
jmp 0x42c3b
leaq 0xbf50(%rip), %rdx      # 0x4eb92
leaq -0x1d0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x3b130
jmp 0x42c57
leaq -0x168(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x470e0
testb $0x1, %al
jne 0x42c73
jmp 0x42d36
movq -0x20(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x258(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x3b6c0
movq %rax, -0x250(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x3b6c0
movq -0x260(%rbp), %rsi
movq -0x258(%rbp), %rdx
movq -0x250(%rbp), %rcx
movq %rax, %r8
leaq 0xc701(%rip), %rdi      # 0x4f3c8
xorl %eax, %eax
callq 0x3b570
jmp 0x42cd0
jmp 0x42d36
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x42d80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x42d74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x8590
jmp 0x42d74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x42d68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x8590
jmp 0x42d68
leaq -0x1d0(%rbp), %rdi
callq 0x8590
leaq -0x180(%rbp), %rdi
callq 0x12f80
leaq -0x168(%rbp), %rdi
callq 0x8590
leaq -0x138(%rbp), %rdi
callq 0x13c10
jmp 0x42d8e
leaq -0x180(%rbp), %rdi
callq 0x12f80
leaq -0x168(%rbp), %rdi
callq 0x8590
leaq -0x138(%rbp), %rdi
callq 0x13c10
jmp 0x42dc4
leaq -0xf0(%rbp), %rdi
callq 0xac20
leaq -0xe8(%rbp), %rdi
callq 0xc3d0
leaq -0xc8(%rbp), %rdi
callq 0x8590
leaq -0x40(%rbp), %rdi
callq 0x12f80
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
leaq -0xf0(%rbp), %rdi
callq 0xac20
leaq -0xe8(%rbp), %rdi
callq 0xc3d0
leaq -0xc8(%rbp), %rdi
callq 0x8590
leaq -0x40(%rbp), %rdi
callq 0x12f80
movq -0x78(%rbp), %rdi
callq 0x85d0
nopw (%rax,%rax)