// File: 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
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x105c7(%rip), %rax     # 0x17d90
movq %rax, -0x20(%rbp)
movaps 0x105ac(%rip), %xmm0    # 0x17d80
movaps %xmm0, -0x30(%rbp)
movaps 0x10591(%rip), %xmm0    # 0x17d70
movaps %xmm0, -0x40(%rbp)
movl $0x5, -0x44(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x8c60
movl $0x4, -0x98(%rbp)
movl $0x3, -0x94(%rbp)
movl $0x2, -0x90(%rbp)
movl $0x1, -0x8c(%rbp)
leaq -0x98(%rbp), %rax
movq %rax, -0x88(%rbp)
movq $0x4, -0x80(%rbp)
leaq -0x99(%rbp), %rdi
movq %rdi, -0x208(%rbp)
callq 0x97b0
movq -0x208(%rbp), %rcx
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0x97d0
jmp 0x7861
leaq -0x99(%rbp), %rdi
callq 0x9850
movl -0x44(%rbp), %eax
movl %eax, -0x21c(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x218(%rbp)
leaq -0x141(%rbp), %rdi
movq %rdi, -0x210(%rbp)
callq 0x3500
movq -0x210(%rbp), %rdx
leaq 0x98b7(%rip), %rsi      # 0x11159
leaq -0x140(%rbp), %rdi
callq 0x7f20
jmp 0x78b0
movq -0x218(%rbp), %rdx
movl -0x21c(%rbp), %esi
leaq -0x120(%rbp), %rdi
leaq -0x140(%rbp), %rcx
movl $0x1, %r8d
callq 0x3850
jmp 0x78d8
leaq -0x140(%rbp), %rdi
callq 0x31d0
leaq -0x141(%rbp), %rdi
callq 0x3350
leaq -0x181(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0x3500
movq -0x228(%rbp), %rdx
leaq 0x9919(%rip), %rsi      # 0x1122a
leaq -0x180(%rbp), %rdi
callq 0x7f20
jmp 0x791f
leaq -0x1a9(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x3500
movq -0x230(%rbp), %rdx
leaq 0x9a51(%rip), %rsi      # 0x11391
leaq -0x1a8(%rbp), %rdi
callq 0x7f20
jmp 0x794e
movq %rsp, %rax
movl $0x2c, (%rax)
leaq -0x160(%rbp), %rdi
leaq -0x120(%rbp), %rsi
leaq -0x180(%rbp), %rdx
leaq -0x78(%rbp), %rcx
movl $0x1, %r8d
leaq -0x1a8(%rbp), %r9
callq 0x9870
jmp 0x7984
leaq -0x60(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x98e0
leaq -0x160(%rbp), %rdi
callq 0x9910
leaq -0x1a8(%rbp), %rdi
callq 0x31d0
leaq -0x1a9(%rbp), %rdi
callq 0x3350
leaq -0x180(%rbp), %rdi
callq 0x31d0
leaq -0x181(%rbp), %rdi
callq 0x3350
leaq -0x120(%rbp), %rdi
callq 0x9970
jmp 0x7bc2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x99(%rbp), %rdi
callq 0x9850
jmp 0x7dce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7a36
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x31d0
leaq -0x141(%rbp), %rdi
callq 0x3350
jmp 0x7aba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7aa2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7a8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x31d0
leaq -0x1a9(%rbp), %rdi
callq 0x3350
leaq -0x180(%rbp), %rdi
callq 0x31d0
leaq -0x181(%rbp), %rdi
callq 0x3350
leaq -0x120(%rbp), %rdi
callq 0x9970
movl -0xac(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x7dc5
movq -0xa8(%rbp), %rdi
callq 0x3130
movq %rax, -0x1b8(%rbp)
movq 0x104e1(%rip), %rdi     # 0x17fc8
leaq 0x9743(%rip), %rsi      # 0x11231
callq 0x32e0
movq %rax, -0x238(%rbp)
jmp 0x7afc
movq -0x238(%rbp), %rdi
movl -0x4(%rbp), %esi
callq 0x34e0
movq %rax, -0x240(%rbp)
jmp 0x7b14
movq -0x240(%rbp), %rdi
leaq 0x9715(%rip), %rsi      # 0x11237
callq 0x32e0
movq %rax, -0x248(%rbp)
jmp 0x7b30
movq -0x1b8(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq -0x248(%rbp), %rdi
movq %rax, %rsi
callq 0x32e0
movq %rax, -0x250(%rbp)
jmp 0x7b58
movq -0x250(%rbp), %rdi
movq 0x1044a(%rip), %rsi     # 0x17fb0
callq 0x3330
jmp 0x7b6d
movq -0x10(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movl $0x1, -0x1bc(%rbp)
callq 0x3490
jmp 0x7ba1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
callq 0x3490
jmp 0x7bbd
jmp 0x7daa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7dc5
jmp 0x7dc5
leaq -0x60(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x99d0
movb %al, -0x251(%rbp)
jmp 0x7bd7
movb -0x251(%rbp), %al
testb $0x1, %al
jne 0x7be6
jmp 0x7da0
movq 0x103db(%rip), %rdi     # 0x17fc8
leaq 0x963d(%rip), %rsi      # 0x11231
callq 0x32e0
movq %rax, -0x260(%rbp)
jmp 0x7c02
movq -0x260(%rbp), %rdi
movl -0x4(%rbp), %esi
callq 0x34e0
movq %rax, -0x268(%rbp)
jmp 0x7c1a
movq -0x268(%rbp), %rdi
leaq 0x9709(%rip), %rsi      # 0x11331
callq 0x32e0
jmp 0x7c2f
leaq -0x60(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rdi
callq 0x9a00
movq %rax, -0x1d0(%rbp)
movq -0x1c8(%rbp), %rdi
callq 0x9a30
movq %rax, -0x1d8(%rbp)
leaq -0x1d0(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x9a60
testb $0x1, %al
jne 0x7c79
jmp 0x7ccd
leaq -0x1d0(%rbp), %rdi
callq 0x9aa0
movl (%rax), %eax
movl %eax, -0x1dc(%rbp)
movl -0x1dc(%rbp), %esi
movq 0x1032e(%rip), %rdi     # 0x17fc8
callq 0x34e0
movq %rax, -0x270(%rbp)
jmp 0x7ca8
movq -0x270(%rbp), %rdi
leaq 0x93d8(%rip), %rsi      # 0x1108e
callq 0x32e0
jmp 0x7cbd
jmp 0x7cbf
leaq -0x1d0(%rbp), %rdi
callq 0x9ac0
jmp 0x7c60
movq 0x102f4(%rip), %rdi     # 0x17fc8
leaq 0x967e(%rip), %rsi      # 0x11359
callq 0x32e0
jmp 0x7ce2
leaq -0x78(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq -0x1e8(%rbp), %rdi
callq 0x9a00
movq %rax, -0x1f0(%rbp)
movq -0x1e8(%rbp), %rdi
callq 0x9a30
movq %rax, -0x1f8(%rbp)
leaq -0x1f0(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x9a60
testb $0x1, %al
jne 0x7d2c
jmp 0x7d80
leaq -0x1f0(%rbp), %rdi
callq 0x9aa0
movl (%rax), %eax
movl %eax, -0x1fc(%rbp)
movl -0x1fc(%rbp), %esi
movq 0x1027b(%rip), %rdi     # 0x17fc8
callq 0x34e0
movq %rax, -0x278(%rbp)
jmp 0x7d5b
movq -0x278(%rbp), %rdi
leaq 0x9325(%rip), %rsi      # 0x1108e
callq 0x32e0
jmp 0x7d70
jmp 0x7d72
leaq -0x1f0(%rbp), %rdi
callq 0x9ac0
jmp 0x7d13
movq 0x10241(%rip), %rdi     # 0x17fc8
leaq 0x93b6(%rip), %rsi      # 0x11144
callq 0x32e0
jmp 0x7d95
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl $0x0, -0x1bc(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x9910
leaq -0x60(%rbp), %rdi
callq 0x9910
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
leaq -0x78(%rbp), %rdi
callq 0x9910
leaq -0x60(%rbp), %rdi
callq 0x9910
movq -0xa8(%rbp), %rdi
callq 0x34f0
movq %rax, %rdi
callq 0x99c0
nopl (%rax,%rax)