// File: /workspace/github_c_makefile_star2_O3/aremmell[P]libsir/tests/tests_shared.c
// Function: parse_cmd_line
bool parse_cmd_line(int argc, char** argv, const sir_cl_arg* args, size_t num_args,
    sir_test* tests, size_t num_tests, sir_cl_config* config) {

    if (!argv || !args || !tests || !config)
        return false;

    (void)memset(config, 0, sizeof(sir_cl_config));

    for (int n = 1; n < argc; n++) {
        const sir_cl_arg* this_arg = find_cl_arg(argv[n], args, num_args);
        if (!this_arg) {
            ERROR_MSG("unknown option '%s'", argv[n]);
            print_usage_info(args, num_args);
            return false;
        }
        if (_sir_strsame(this_arg->flag, SIR_CL_PERFFLAG, strlen(SIR_CL_PERFFLAG))) {
            config->only = mark_test_to_run(SIR_CL_PERFNAME, tests, num_tests);
            if (config->only)
                config->to_run = 1;
        } else if (_sir_strsame(this_arg->flag, SIR_CL_ONLYFLAG, strlen(SIR_CL_ONLYFLAG))) {
            while (++n < argc) {
                if (!_sir_validstrnofail(argv[n]))
                    continue;
                if (*argv[n] == '-' || !mark_test_to_run(argv[n], tests, num_tests)) {
                    ERROR_MSG("invalid argument to %s: '%s'", SIR_CL_ONLYFLAG, argv[n]);
                    print_usage_info(args, num_args);
                    return false;
                }
                config->to_run++;
            }
            if (0 == config->to_run) {
                ERROR_MSG("value expected for '%s'", SIR_CL_ONLYFLAG);
                print_usage_info(args, num_args);
                return false;
            }
            config->only = true;
        } else if (_sir_strsame(this_arg->flag, SIR_CL_LISTFLAG, strlen(SIR_CL_LISTFLAG))) {
            print_test_list(tests, num_tests);
            return false;
        } else if (_sir_strsame(this_arg->flag, SIR_CL_LEAVELOGSFLAG, strlen(SIR_CL_LEAVELOGSFLAG))) {
            config->leave_logs = true;
        } else if (_sir_strsame(this_arg->flag, SIR_CL_WAITFLAG, strlen(SIR_CL_WAITFLAG))) {
            config->wait = true;
        } else if (_sir_strsame(this_arg->flag, SIR_CL_VERSIONFLAG, strlen(SIR_CL_VERSIONFLAG))) {
            print_libsir_version();
            return false;
        } else if (_sir_strsame(this_arg->flag, SIR_CL_HELPFLAG, strlen(SIR_CL_HELPFLAG))) {
            print_usage_info(args, num_args);
            return false;
        } else {
            ERROR_MSG("unknown option '%s'", this_arg->flag);
            return false;
        }
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x70(%rsp), %r13
movq %rdx, %xmm0
movq %rsi, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movq %r13, %xmm0
movq %r8, %xmm2
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
pxor %xmm0, %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
movdqa %xmm1, %xmm3
shufps $0xdd, %xmm2, %xmm3     # xmm3 = xmm3[1,3],xmm2[1,3]
shufps $0x88, %xmm2, %xmm1     # xmm1 = xmm1[0,2],xmm2[0,2]
andps %xmm3, %xmm1
movmskps %xmm1, %eax
testl %eax, %eax
je 0x3cca
xorl %ebp, %ebp
jmp 0x3ef2
movq %r8, 0x10(%rsp)
movq %r9, 0x18(%rsp)
movdqu %xmm0, (%r13)
movb $0x1, %bpl
cmpl $0x2, %edi
jl 0x3ef2
movq %rcx, %r14
movq %rdx, %r15
leal -0x1(%rdi), %eax
movl %eax, 0x24(%rsp)
movl $0x1, %ebp
movq %rsi, 0x8(%rsp)
movq %rdi, %r12
movslq %ebp, %rax
movq (%rsi,%rax,8), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3c20
testq %rax, %rax
je 0x3e90
movq (%rax), %rbx
movl $0x6, %edx
movq %rbx, %rdi
leaq 0xd5c2(%rip), %rsi      # 0x112f2
callq 0x30a0
testl %eax, %eax
je 0x3db3
movl $0x6, %edx
movq %rbx, %rdi
leaq 0xd5bd(%rip), %rsi      # 0x11305
callq 0x30a0
testl %eax, %eax
je 0x3de2
movl $0x6, %edx
movq %rbx, %rdi
leaq 0xd618(%rip), %rsi      # 0x1137c
callq 0x30a0
testl %eax, %eax
je 0x3f03
movl $0xc, %edx
movq %rbx, %rdi
leaq 0xd603(%rip), %rsi      # 0x11383
callq 0x30a0
testl %eax, %eax
je 0x3e5e
movl $0x6, %edx
movq %rbx, %rdi
leaq 0xd5f4(%rip), %rsi      # 0x11390
callq 0x30a0
testl %eax, %eax
jne 0x3f17
movb $0x1, 0x1(%r13)
jmp 0x3e63
leaq 0xd53f(%rip), %rdi      # 0x112f9
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x3838
movb %al, 0x2(%r13)
testb %al, %al
je 0x3e63
movq $0x1, 0x8(%r13)
jmp 0x3e63
leal 0x1(%rbp), %eax
movq %r12, %rdi
cmpl %edi, %eax
jge 0x3e77
movq %r15, 0x28(%rsp)
movq %r14, 0x30(%rsp)
cltq
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %rbx
movl 0x24(%rsp), %eax
movl %eax, %r15d
subl %ebp, %r15d
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rcx
testq %rcx, %rcx
je 0x3e45
movzbl (%rcx), %eax
testl %eax, %eax
je 0x3e45
cmpl $0x2d, %eax
je 0x3ec7
movq %rcx, %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x3838
testb %al, %al
je 0x3eb5
incq 0x8(%r13)
incq %r14
cmpl %r14d, %r15d
jne 0x3e12
movq %r12, %rdi
movl %edi, %ebp
movq 0x30(%rsp), %r14
movq 0x28(%rsp), %r15
jmp 0x3e79
movb $0x1, (%r13)
movq %r12, %rdi
movq 0x8(%rsp), %rsi
incl %ebp
cmpl %edi, %ebp
jl 0x3cfd
jmp 0x3eb0
movl %eax, %ebp
movq 0x8(%rsp), %rsi
cmpq $0x0, 0x8(%r13)
je 0x3f61
movb $0x1, 0x2(%r13)
jmp 0x3e6b
leaq 0xd431(%rip), %rsi      # 0x112c8
xorl %ebp, %ebp
movl $0x1, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3400
movq %r15, %rdi
movq %r14, %rsi
jmp 0x3eed
movb $0x1, %bpl
jmp 0x3ef2
incl %ebp
movslq %ebp, %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
movq (%rax,%r14,8), %rcx
leaq 0xd44d(%rip), %rsi      # 0x1131b
leaq 0xd430(%rip), %rdx      # 0x11305
xorl %ebp, %ebp
movl $0x1, %edi
xorl %eax, %eax
callq 0x3400
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x39f2
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x38ba
jmp 0x3cc3
leaq 0xd479(%rip), %rsi      # 0x11397
movl $0x9, %edx
movq %rbx, %rdi
callq 0x30a0
testl %eax, %eax
je 0x3f7b
leaq 0xd46b(%rip), %rsi      # 0x113a1
movl $0x6, %edx
movq %rbx, %rdi
callq 0x30a0
testl %eax, %eax
je 0x3f85
leaq 0xd37a(%rip), %rsi      # 0x112c8
xorl %ebp, %ebp
movl $0x1, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3400
jmp 0x3ef2
leaq 0xd3e6(%rip), %rsi      # 0x1134e
leaq 0xd396(%rip), %rdx      # 0x11305
xorl %ebp, %ebp
movl $0x1, %edi
jmp 0x3ea1
callq 0x3be7
jmp 0x3cc3
movq %r15, %rdi
movq %r14, %rsi
callq 0x39f2
jmp 0x3cc3