// File: /workspace/github_cpp_makefile_star2_O3/ridiculousfish[P]docopt_fish/docopt_fish_test.cpp
// Function: run_1_annotated_suggestion_test(unsigned long, unsigned long, char const*, std::pair<char const*, unsigned long>, std::vector<docopt_fish::annotated_option_t, std::allocator<docopt_fish::annotated_option_t>> const&)
static void run_1_annotated_suggestion_test(unsigned long test_idx, unsigned long arg_idx, const char *joined_argv, std::pair<const char *, size_t> expected_token_and_offset, const std::vector<annotated_option_t> &dopts) {
    
    // Separate argv by spaces
    // Ensure we have at least one argument (partial last)
    string_list_t argv = split(to_string(joined_argv), " ");
    if (argv.empty()) argv.push_back(string_t());
    
    // Prepend the program name for every test case
    argv.insert(argv.begin(), to_string("prog"));
    
    /* Perform the parsing */
    std::vector<doc_error_t> error_list;
    vector<size_t> unused_args;
    argument_parser_t parser;
    parser.set_options(dopts);
    suggestion_list_t results = parser.suggest_next_argument(argv, 0);
    
    const char *joined_expected_results = expected_token_and_offset.first;
    
    bool expects_error = ! strcmp(joined_expected_results, ERROR_EXPECTED);
    bool did_error = ! unused_args.empty() || ! error_list.empty();
    
    if (expects_error && ! did_error) {
        err("Direct option suggestion test %lu.%lu was expected to fail, but did not", test_idx, arg_idx);
    } else if (did_error && ! expects_error) {
        err("Direct option suggestion test %lu.%lu was expected to succeed, but instead errored", test_idx, arg_idx);
        for (size_t i=0; i < error_list.size(); i++) {
            fprintf(stderr, "\t%ls\n", wide(error_list.at(i).text));
        }
    } else if (! did_error && ! expects_error) {
        // joined_expected_results is a space-separated list
        string_t expected = to_string(joined_expected_results);
        string_t actual = join(results, " ");
        if (expected != actual) {
            if (expected != actual) {
                err("Annotated suggestion test %lu.%lu: Wrong suggestions. Expected '%ls', got '%ls'", test_idx, arg_idx, wide(expected), wide(actual));
            }
        }
        
        // Verify offsets
        size_t expected_offset = expected_token_and_offset.second;
        for (const suggestion_t &s : results) {
            if (s.offset != expected_offset) {
                err("Annotated suggestion test %lu.%lu: Wrong offset. Expected %lu, got %lu", test_idx, arg_idx, expected_offset, s.offset);
                break;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r8, 0x40(%rsp)
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x60b0
leaq (%rax,%r13), %rdx
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rsp, %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x1fe82
leaq 0x36b1(%rip), %rdx      # 0x20cea
leaq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x1ca07
movq (%rsp), %rdi
movq %r12, %rbp
cmpq %r12, %rdi
je 0x1d664
movq 0x10(%rsp), %rax
leaq 0x4(,%rax,4), %rsi
callq 0x6200
movq 0x28(%rsp), %r13
cmpq 0x30(%rsp), %r13
movq %rbx, %r12
jne 0x1d6b2
movq %rsp, %rsi
movq %rbp, (%rsi)
movq $0x0, 0x8(%rsi)
movl $0x0, 0x10(%rsi)
leaq 0x28(%rsp), %rdi
callq 0xcdb8
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x1d6ad
movq 0x10(%rsp), %rax
leaq 0x4(,%rax,4), %rsi
callq 0x6200
movq 0x28(%rsp), %r13
movq %rsp, %rdi
movq %rbp, (%rdi)
leaq 0x52b7(%rip), %rsi      # 0x22976
leaq 0x52b4(%rip), %rdx      # 0x2297a
callq 0x1fe82
leaq 0x28(%rsp), %rdi
movq %rsp, %rdx
movq %r13, %rsi
callq 0x1d988
movq %r12, %r13
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x1d6f9
movq 0x10(%rsp), %rax
leaq 0x4(,%rax,4), %rsi
callq 0x6200
leaq 0x20(%rsp), %rdi
callq 0x8354
leaq 0x80(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x1e362
leaq 0x20(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x821e
leaq 0x80(%rsp), %rdi
callq 0xa76c
leaq 0x48(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x28(%rsp), %rdx
xorl %ecx, %ecx
callq 0x7e6e
leaq 0x429a(%rip), %rsi      # 0x219eb
movq %r15, %rdi
callq 0x62b0
testl %eax, %eax
je 0x1d7b8
movq %r15, %rdi
callq 0x60b0
leaq (%rax,%r15), %rdx
movq %rsp, %rdi
movq %rbp, (%rdi)
movq %r15, %rsi
callq 0x1fe82
leaq 0x356c(%rip), %rdx      # 0x20cea
leaq 0x60(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x16413
movq 0x8(%rsp), %rdx
cmpq 0x68(%rsp), %rdx
jne 0x1d7d3
testq %rdx, %rdx
je 0x1d7f8
movq 0x60(%rsp), %r15
movq (%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x61d0
testl %eax, %eax
jne 0x1d7dc
jmp 0x1d7f8
leaq 0x6529(%rip), %rdi      # 0x23ce8
movl $0x2, %esi
movq %r13, %rdx
xorl %eax, %eax
callq 0x168f6
jmp 0x1d86f
movq (%rsp), %r12
movq 0x60(%rsp), %r15
leaq 0x654d(%rip), %rdi      # 0x23d30
movl $0x2, %esi
movq %r13, %rdx
movq %r12, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x168f6
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
cmpq %rcx, %rax
je 0x1d834
movq 0x88(%rax), %r8
cmpq %r14, %r8
jne 0x1d81b
addq $0x90, %rax
jmp 0x1d802
leaq 0x655e(%rip), %rdi      # 0x23d80
movl $0x2, %esi
movq %r13, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x168f6
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1d854
movq 0x70(%rsp), %rax
leaq 0x4(,%rax,4), %rsi
callq 0x6200
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x1d86f
movq 0x10(%rsp), %rax
leaq 0x4(,%rax,4), %rsi
callq 0x6200
leaq 0x48(%rsp), %rdi
callq 0xb5cc
leaq 0x20(%rsp), %rdi
callq 0x8414
leaq 0x28(%rsp), %rdi
callq 0xb1e0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1d8f5
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x1d8c4
movq 0x10(%rsp), %rax
leaq 0x4(,%rax,4), %rsi
callq 0x6200
jmp 0x1d8c4
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0xb5cc
jmp 0x1d8e7
jmp 0x1d8e4
movq %rax, %r14
leaq 0x80(%rsp), %rdi
callq 0xa76c
jmp 0x1d8e7
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x8414
jmp 0x1d918
jmp 0x1d915
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x1d918
movq 0x10(%rsp), %rax
leaq 0x4(,%rax,4), %rsi
callq 0x6200
jmp 0x1d918
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0xb1e0
movq %r14, %rdi
callq 0x6360
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x1d922
movq 0x10(%rsp), %rax
leaq 0x4(,%rax,4), %rsi
callq 0x6200
jmp 0x1d922