// File: /workspace/github_cpp_makefile_star2_O2/Se6[P]CmdLineArgs/test.cpp
// Function: getParamsTest(int, int&)
void getParamsTest(int test_no, int& failures) {

    const char* argv[] = {"test", "--values", "4,3 ", "2", "1" };
    int argc = nelem(argv);
    
    vector<int> values;
    vector<int> zeValues = {4, 3, 2, 1};
    
    try{
        CmdLineArgs cl(argc, const_cast<char**>(argv), "Test of command line arguments");
        values = cl.getParams("values", zeValues, true, "4 ints");
    } catch (const exception& error) {
        cout << "Test " << test_no << ": Unparsed failure: " << error.what() << endl;
        ++failures;
		return;
	}
    
    if( values != zeValues ) {
        cout << "Test " << test_no << ": Vector of int parameter failure. Got ";
        for(auto n: values)
            cout << n << " ";
        cout << " instead of ";
        for(auto n: zeValues)
            cout << n << " ";
        cout << "\n";
        ++failures;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %rbx
movl %edi, %ebp
xorps %xmm0, %xmm0
andq $0x0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps 0x2bdb(%rip), %xmm0     # 0x8020
leaq 0xa0(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x30(%rsp), %rdi
pushq $0x4
popq %rdx
leaq 0x48(%rsp), %rcx
callq 0x5fe8
leaq 0x2d1c(%rip), %rsi      # 0x8185
leaq 0x48(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x5788
leaq 0x6901(%rip), %rdx      # 0xbd80
leaq 0xa0(%rsp), %rdi
pushq $0x5
popq %rsi
leaq 0x48(%rsp), %rcx
pushq $0x1
popq %r8
callq 0x35e8
leaq 0x48(%rsp), %rdi
callq 0x30e0
leaq 0x2dad(%rip), %rsi      # 0x8256
leaq 0x48(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5788
leaq 0x2efe(%rip), %rsi      # 0x83bd
leaq 0x68(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x5788
movl $0x2c, (%rsp)
leaq 0x88(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x30(%rsp), %rcx
pushq $0x1
popq %r8
leaq 0x68(%rsp), %r9
callq 0x601e
leaq 0x10(%rsp), %r14
leaq 0x88(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x7af0
movq %r15, %rdi
callq 0x6b42
leaq 0x68(%rsp), %rdi
callq 0x30e0
leaq 0x48(%rsp), %rdi
callq 0x30e0
leaq 0xa0(%rsp), %rdi
callq 0x6044
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x6077
testb %al, %al
je 0x561b
movq 0x6a76(%rip), %rdi      # 0xbfd0
leaq 0x2cfc(%rip), %rsi      # 0x825d
callq 0x3210
movq %rax, %rdi
movl %ebp, %esi
callq 0x3380
leaq 0x2de6(%rip), %rsi      # 0x835d
movq %rax, %rdi
callq 0x3210
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r13
movq 0x6a40(%rip), %r14      # 0xbfd0
leaq 0x2b23(%rip), %r15      # 0x80ba
cmpq %r13, %r12
je 0x55b9
movl (%r12), %esi
movq %r14, %rdi
callq 0x3380
movq %rax, %rdi
movq %r15, %rsi
callq 0x3210
addq $0x4, %r12
jmp 0x5597
movq 0x6a10(%rip), %rdi      # 0xbfd0
leaq 0x2dbe(%rip), %rsi      # 0x8385
callq 0x3210
movq 0x30(%rsp), %r12
movq 0x38(%rsp), %r13
movq 0x69f3(%rip), %r14      # 0xbfd0
leaq 0x2ad6(%rip), %r15      # 0x80ba
cmpq %r13, %r12
je 0x5606
movl (%r12), %esi
movq %r14, %rdi
callq 0x3380
movq %rax, %rdi
movq %r15, %rsi
callq 0x3210
addq $0x4, %r12
jmp 0x55e4
movq 0x69c3(%rip), %rdi      # 0xbfd0
leaq 0x2b5c(%rip), %rsi      # 0x8170
callq 0x3210
incl (%rbx)
leaq 0x30(%rsp), %rdi
callq 0x6b42
leaq 0x10(%rsp), %rdi
callq 0x6b42
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r15
movq %rax, %r14
leaq 0x68(%rsp), %rdi
callq 0x30e0
jmp 0x5659
movq %rdx, %r15
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x30e0
jmp 0x566b
movq %rdx, %r15
movq %rax, %r14
leaq 0xa0(%rsp), %rdi
callq 0x6044
jmp 0x5692
movq %rdx, %r15
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x30e0
jmp 0x5692
movq %rdx, %r15
movq %rax, %r14
cmpl $0x1, %r15d
jne 0x571e
movq %r14, %rdi
callq 0x30b0
movq %rax, %r14
movq 0x6922(%rip), %rdi      # 0xbfd0
leaq 0x2ba8(%rip), %rsi      # 0x825d
callq 0x3210
movq %rax, %rdi
movl %ebp, %esi
callq 0x3380
leaq 0x2b98(%rip), %rsi      # 0x8263
movq %rax, %rdi
callq 0x3210
movq %rax, %r15
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x3210
movq %rax, %rdi
callq 0x3100
incl (%rbx)
callq 0x3340
jmp 0x561b
jmp 0x571b
movq %rax, %r14
callq 0x3340
jmp 0x571e
movq %rax, %rdi
callq 0x606c
movq %rax, %r14
jmp 0x5728
jmp 0x571b
jmp 0x571b
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x6b42
leaq 0x10(%rsp), %rdi
callq 0x6b42
movq %r14, %rdi
callq 0x3390