// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movq 0x50(%rsp), %rax
movl %edi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %r9, 0x18(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x4f96
cmpq $0x0, 0x30(%rsp)
je 0x4f96
cmpq $0x0, 0x20(%rsp)
je 0x4f96
cmpq $0x0, 0x50(%rsp)
jne 0x4fa0
movb $0x0, 0x47(%rsp)
jmp 0x52e9
movq 0x50(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x4210
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x40(%rsp), %eax
jge 0x52e4
movq 0x38(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x4ea0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x5026
movq 0x38(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x182c2(%rip), %rdi     # 0x1d2c8
movb $0x0, %al
callq 0x4180
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x4bb0
movb $0x0, 0x47(%rsp)
jmp 0x52e9
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x182bd(%rip), %rsi     # 0x1d2f2
movl $0x6, %edx
callq 0x49e0
testb $0x1, %al
jne 0x5045
jmp 0x5085
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x182a3(%rip), %rdi     # 0x1d2f9
callq 0x4930
movb %al, %cl
movq 0x50(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x2(%rax)
movq 0x50(%rsp), %rax
testb $0x1, 0x2(%rax)
je 0x5080
movq 0x50(%rsp), %rax
movq $0x1, 0x8(%rax)
jmp 0x52d2
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x18271(%rip), %rsi     # 0x1d305
movl $0x6, %edx
callq 0x49e0
testb $0x1, %al
jne 0x50a7
jmp 0x51bf
jmp 0x50a9
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
cmpl 0x40(%rsp), %eax
jge 0x5176
movq 0x38(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
xorl %esi, %esi
leaq 0x18237(%rip), %rdx     # 0x1d30c
leaq 0x1823f(%rip), %rcx     # 0x1d31b
movl $0xb6, %r8d
callq 0x5300
testb $0x1, %al
jne 0x50ed
jmp 0x50a9
movq 0x38(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x5124
movq 0x38(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x4930
testb $0x1, %al
jne 0x5160
movq 0x38(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x181f1(%rip), %rdi     # 0x1d32a
leaq 0x181c5(%rip), %rsi     # 0x1d305
movb $0x0, %al
callq 0x4180
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x4bb0
movb $0x0, 0x47(%rsp)
jmp 0x52e9
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
jmp 0x50a9
movq 0x50(%rsp), %rcx
xorl %eax, %eax
cmpq 0x8(%rcx), %rax
jne 0x51b1
leaq 0x181d3(%rip), %rdi     # 0x1d35d
leaq 0x18174(%rip), %rsi     # 0x1d305
movb $0x0, %al
callq 0x4180
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x4bb0
movb $0x0, 0x47(%rsp)
jmp 0x52e9
movq 0x50(%rsp), %rax
movb $0x1, 0x2(%rax)
jmp 0x52d0
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x181bd(%rip), %rsi     # 0x1d38b
movl $0x6, %edx
callq 0x49e0
testb $0x1, %al
jne 0x51de
jmp 0x51f7
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x4a20
movb $0x0, 0x47(%rsp)
jmp 0x52e9
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1818c(%rip), %rsi     # 0x1d392
movl $0xc, %edx
callq 0x49e0
testb $0x1, %al
jne 0x5216
jmp 0x5223
movq 0x50(%rsp), %rax
movb $0x1, (%rax)
jmp 0x52cc
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1816d(%rip), %rsi     # 0x1d39f
movl $0x6, %edx
callq 0x49e0
testb $0x1, %al
jne 0x5242
jmp 0x524d
movq 0x50(%rsp), %rax
movb $0x1, 0x1(%rax)
jmp 0x52ca
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1814a(%rip), %rsi     # 0x1d3a6
movl $0x9, %edx
callq 0x49e0
testb $0x1, %al
jne 0x526c
jmp 0x5278
callq 0x4e60
movb $0x0, 0x47(%rsp)
jmp 0x52e9
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x18129(%rip), %rsi     # 0x1d3b0
movl $0x6, %edx
callq 0x49e0
testb $0x1, %al
jne 0x5297
jmp 0x52ad
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x4bb0
movb $0x0, 0x47(%rsp)
jmp 0x52e9
movq 0x8(%rsp), %rax
movq (%rax), %rsi
leaq 0x1800c(%rip), %rdi     # 0x1d2c8
movb $0x0, %al
callq 0x4180
movb $0x0, 0x47(%rsp)
jmp 0x52e9
jmp 0x52cc
jmp 0x52ce
jmp 0x52d0
jmp 0x52d2
jmp 0x52d4
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x4fb9
movb $0x1, 0x47(%rsp)
movb 0x47(%rsp), %al
andb $0x1, %al
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)