// File: ridiculousfish[P]docopt_fish/docopt_fish_test.cpp
// Function: run_1_unused_argument_test(char const*, char const*, char const*, unsigned long, unsigned long)
static void run_1_unused_argument_test(const char *usage, const char *joined_argv, const char *joined_expected_unused, 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 */
    vector<size_t> unused_arg_idxs;
    argument_parser_t parser(usage_str, nullptr);
    parser.parse_arguments(argv, flags_default, nullptr, &unused_arg_idxs);
    
    /* Construct unused argument string */
    string_list_t unused_args_vec;
    for (size_t i=0; i < unused_arg_idxs.size(); i++) {
        size_t idx = unused_arg_idxs.at(i);
        unused_args_vec.push_back(argv.at(idx));
    }
    std::sort(unused_args_vec.begin(), unused_args_vec.end());
    const string_t actual_unused = join(unused_args_vec, ", ");
    
    /* Compare unused arguments */
    string_list_t expected_unused_vec = split(to_string(joined_expected_unused), ", ");
    sort(expected_unused_vec.begin(), expected_unused_vec.end());
    const string_t expected_unused = join(expected_unused_vec, ", ");
    
    if (expected_unused != actual_unused) {
        err("Test %lu.%lu: Wrong unused arguments. Expected '%ls', got '%ls'", test_idx, arg_idx, wide(expected_unused), wide(actual_unused));
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
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, -0x1c8(%rbp)
movl $0x20, %edx
callq 0x40670
movq -0x1c8(%rbp), %rdi
callq 0x19820
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x440d0
leaq 0xb80a(%rip), %rsi      # 0x4db36
leaq -0x70(%rbp), %rdi
callq 0x3af90
jmp 0x42337
movq -0x48(%rbp), %rsi
leaq -0x40(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x44090
movq %rax, -0x1d0(%rbp)
jmp 0x42351
movq -0x1d0(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8590
movq -0x8(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x8110
movq %rax, %rcx
movq -0x1e8(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x1e0(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x1d8(%rbp)
callq 0x8130
movq -0x1e8(%rbp), %rsi
movq -0x1e0(%rbp), %rdx
movq -0x1d8(%rbp), %rcx
leaq -0xa8(%rbp), %rdi
callq 0x43f20
jmp 0x423c2
leaq -0xa9(%rbp), %rdi
callq 0x85f0
leaq -0xc8(%rbp), %rdi
callq 0xcf10
xorl %eax, %eax
movl %eax, %edx
leaq -0xd0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0xab40
jmp 0x423f3
xorl %ecx, %ecx
movl %ecx, %r8d
leaq -0x100(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x40(%rbp), %rdx
leaq -0xc8(%rbp), %r9
callq 0xa850
jmp 0x42418
leaq -0x100(%rbp), %rdi
callq 0x19d50
leaq -0x118(%rbp), %rdi
callq 0x18ad0
movq $0x0, -0x120(%rbp)
movq -0x120(%rbp), %rax
movq %rax, -0x1f0(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x32820
movq %rax, %rcx
movq -0x1f0(%rbp), %rax
cmpq %rcx, %rax
jae 0x42557
movq -0x120(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x47110
movq %rax, -0x1f8(%rbp)
jmp 0x42484
movq -0x1f8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x44d80
movq %rax, -0x200(%rbp)
jmp 0x424ae
movq -0x200(%rbp), %rsi
leaq -0x118(%rbp), %rdi
callq 0x2bde0
jmp 0x424c3
jmp 0x424c5
movq -0x120(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x120(%rbp)
jmp 0x4243b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x427cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8590
jmp 0x427cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xa9(%rbp), %rdi
callq 0x85f0
jmp 0x427cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x427b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x427ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x4279f
leaq -0x118(%rbp), %rdi
movq %rdi, -0x208(%rbp)
callq 0x19820
movq -0x208(%rbp), %rdi
movq %rax, -0x130(%rbp)
callq 0x14b00
movq %rax, -0x138(%rbp)
movq -0x130(%rbp), %rdi
movq -0x138(%rbp), %rsi
callq 0x47150
jmp 0x42599
leaq 0xc5f2(%rip), %rdx      # 0x4eb92
leaq -0x158(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x3b130
jmp 0x425b5
movq -0x18(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0x3af90
jmp 0x425c7
leaq 0xc5c4(%rip), %rdx      # 0x4eb92
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x40c20
jmp 0x425e3
leaq -0x190(%rbp), %rdi
callq 0x8590
leaq -0x170(%rbp), %rdi
movq %rdi, -0x210(%rbp)
callq 0x19820
movq -0x210(%rbp), %rdi
movq %rax, -0x198(%rbp)
callq 0x14b00
movq %rax, -0x1a0(%rbp)
movq -0x198(%rbp), %rdi
movq -0x1a0(%rbp), %rsi
callq 0x47150
jmp 0x42631
leaq 0xc55a(%rip), %rdx      # 0x4eb92
leaq -0x1c0(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x3b130
jmp 0x4264d
leaq -0x1c0(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x470e0
testb $0x1, %al
jne 0x42669
jmp 0x42721
movq -0x20(%rbp), %rax
movq %rax, -0x228(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x220(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x3b6c0
movq %rax, -0x218(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x3b6c0
movq -0x228(%rbp), %rsi
movq -0x220(%rbp), %rdx
movq -0x218(%rbp), %rcx
movq %rax, %r8
leaq 0xcac3(%rip), %rdi      # 0x4f180
xorl %eax, %eax
callq 0x3b570
jmp 0x426c6
jmp 0x42721
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x42793
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x8590
jmp 0x42793
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x42787
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x8590
jmp 0x42787
leaq -0x1c0(%rbp), %rdi
callq 0x8590
leaq -0x170(%rbp), %rdi
callq 0x12f80
leaq -0x158(%rbp), %rdi
callq 0x8590
leaq -0x118(%rbp), %rdi
callq 0x12f80
leaq -0xd0(%rbp), %rdi
callq 0xac20
leaq -0xc8(%rbp), %rdi
callq 0xd160
leaq -0xa8(%rbp), %rdi
callq 0x8590
leaq -0x40(%rbp), %rdi
callq 0x12f80
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
leaq -0x170(%rbp), %rdi
callq 0x12f80
leaq -0x158(%rbp), %rdi
callq 0x8590
leaq -0x118(%rbp), %rdi
callq 0x12f80
leaq -0xd0(%rbp), %rdi
callq 0xac20
leaq -0xc8(%rbp), %rdi
callq 0xd160
leaq -0xa8(%rbp), %rdi
callq 0x8590
leaq -0x40(%rbp), %rdi
callq 0x12f80
movq -0x78(%rbp), %rdi
callq 0x85d0
nopw %cs:(%rax,%rax)