// File: ridiculousfish[P]docopt_fish/docopt_fish_test.cpp
// Function: run_1_argv_err_test(char const*, char const*, int, unsigned long, unsigned long)
static void run_1_argv_err_test(const char *usage, const char *joined_argv, int expected_error_code, size_t test_idx, size_t arg_idx) {
    /* Separate argv by spaces */
    string_list_t argv = split_nonempty(joined_argv, ' ');
    
    /* Prepend the program name for every argument */
    argv.insert(argv.begin(), to_string("prog"));
    
    /* Usage as a string */
    const string_t usage_str(usage, usage + strlen(usage));
    
    /* Perform the parsing */
    std::vector<doc_error_t> error_list;
    argument_parser_t parser(usage_str, &error_list);
    
    /* Check arguments */
    parser.parse_arguments(argv, 0, &error_list);
    
    /* Check errors */
    if (error_list.empty()) {
        err("Argv Err Test %lu.%lu: No errors reported for '%s' with argv '%s'. Expected error '%d'.", test_idx, arg_idx, usage, joined_argv, expected_error_code);
    } else if (error_list.front().code != expected_error_code) {
        err("Argv Err Test %lu.%lu: Wrong error code for '%s'. Expected '%d', got '%d' with text %ls", test_idx, arg_idx, usage, expected_error_code, error_list.front().code, wide(error_list.front().text));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x130(%rbp)
movl $0x20, %edx
callq 0x40670
movq -0x130(%rbp), %rdi
callq 0x19820
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x440d0
leaq 0x9f7b(%rip), %rsi      # 0x4db36
leaq -0x70(%rbp), %rdi
callq 0x3af90
jmp 0x43bc6
movq -0x48(%rbp), %rsi
leaq -0x40(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x44090
movq %rax, -0x138(%rbp)
jmp 0x43be0
movq -0x138(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8590
movq -0x8(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x8110
movq %rax, %rcx
movq -0x150(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x148(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x8130
movq -0x150(%rbp), %rsi
movq -0x148(%rbp), %rdx
movq -0x140(%rbp), %rcx
leaq -0xa8(%rbp), %rdi
callq 0x43f20
jmp 0x43c51
leaq -0xa9(%rbp), %rdi
callq 0x85f0
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0xbe50
movq -0x158(%rbp), %rdx
leaq -0xd0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0xab40
jmp 0x43c8c
xorl %ecx, %ecx
movl %ecx, %r9d
leaq -0x100(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x40(%rbp), %rdx
leaq -0xc8(%rbp), %r8
callq 0xa850
jmp 0x43cb1
leaq -0x100(%rbp), %rdi
callq 0x19d50
leaq -0xc8(%rbp), %rdi
callq 0xbfd0
testb $0x1, %al
jne 0x43cd2
jmp 0x43d65
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %r8
movl -0x14(%rbp), %r9d
leaq 0xbdb9(%rip), %rdi      # 0x4faa6
xorl %eax, %eax
callq 0x3b570
jmp 0x43cf6
jmp 0x43eae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x43f08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8590
jmp 0x43f08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xa9(%rbp), %rdi
callq 0x85f0
jmp 0x43f08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x43ef0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x43ee4
leaq -0xc8(%rbp), %rdi
callq 0x49b50
movl 0x10(%rax), %eax
cmpl -0x14(%rbp), %eax
je 0x43eac
movq -0x20(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x188(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x17c(%rbp)
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x49b50
movq -0x178(%rbp), %rdi
movl 0x10(%rax), %eax
movl %eax, -0x16c(%rbp)
callq 0x49b50
movq 0x18(%rax), %rax
movq %rax, -0x168(%rbp)
leaq -0x121(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x85e0
movq -0x168(%rbp), %rsi
movq -0x160(%rbp), %rdx
leaq -0x120(%rbp), %rdi
callq 0x2be70
jmp 0x43e09
leaq -0x120(%rbp), %rdi
callq 0x407f0
movq %rax, -0x1a0(%rbp)
jmp 0x43e1e
movl -0x16c(%rbp), %r9d
movl -0x17c(%rbp), %r8d
movq -0x188(%rbp), %rcx
movq -0x190(%rbp), %rdx
movq -0x198(%rbp), %rsi
movq -0x1a0(%rbp), %rdi
movq %rsp, %rax
movq %rdi, (%rax)
leaq 0xbca9(%rip), %rdi      # 0x4fafe
xorl %eax, %eax
callq 0x3b570
jmp 0x43e5e
leaq -0x120(%rbp), %rdi
callq 0x81c0
leaq -0x121(%rbp), %rdi
callq 0x8380
jmp 0x43eac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x43e9e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x81c0
leaq -0x121(%rbp), %rdi
callq 0x8380
jmp 0x43ee4
jmp 0x43eae
leaq -0xd0(%rbp), %rdi
callq 0xac20
leaq -0xc8(%rbp), %rdi
callq 0xc3d0
leaq -0xa8(%rbp), %rdi
callq 0x8590
leaq -0x40(%rbp), %rdi
callq 0x12f80
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
leaq -0xd0(%rbp), %rdi
callq 0xac20
leaq -0xc8(%rbp), %rdi
callq 0xc3d0
leaq -0xa8(%rbp), %rdi
callq 0x8590
leaq -0x40(%rbp), %rdi
callq 0x12f80
movq -0x78(%rbp), %rdi
callq 0x85d0
nopw (%rax,%rax)