// File: /workspace/github_c_makefile_star2_O0/alexgirao[P]aimant/bsd-getopt_long.c
// Function: pure_parse_long_options
static int pure_parse_long_options(char * const *nargv, const char *options,
                                   const struct pure_option *long_options,
                                   int *idx, int short_too)
{
    const char *current_argv, *has_equal;
    size_t current_argv_len;
    int i, match;
    
    current_argv = pure_place;
    match = -1;
    
    pure_optind++;
    
    if ((has_equal = strchr(current_argv, '=')) != NULL) {
        /* argument found (--option=arg) */
        current_argv_len = has_equal - current_argv;
        has_equal++;
    } else
        current_argv_len = strlen(current_argv);
    
    for (i = 0; long_options[i].name; i++) {
        /* find matching long option */
        if (strncmp(current_argv, long_options[i].name,
            current_argv_len))
            continue;
        
        if (strlen(long_options[i].name) == current_argv_len) {
            /* exact match */
            match = i;
            break;
        }
        /*
         * If this is a known short option, don't allow
         * a partial match of a single character.
         */
        if (short_too && current_argv_len == 1)
            continue;
        
        if (match == -1)    /* partial match */
            match = i;
        else {
            /* ambiguous abbreviation */
            if (PRINT_ERROR)
                fprintf(stderr, ambig, (int)current_argv_len,
                        current_argv);
            pure_optopt = 0;
            return BADCH;
        }
    }
    if (match != -1) {        /* option found */
        if (long_options[match].has_arg == no_argument
            && has_equal) {
            if (PRINT_ERROR)
                fprintf(stderr, noarg, (int)current_argv_len,
                        current_argv);
            /*
             * XXX: GNU sets pure_optopt to val regardless of flag
             */
            if (long_options[match].flag == NULL)
                pure_optopt = long_options[match].val;
            else
                pure_optopt = 0;
            return BADARG;
        }
        if (long_options[match].has_arg == required_argument ||
            long_options[match].has_arg == optional_argument) {
            if (has_equal)
                pure_optarg = has_equal;
            else if (long_options[match].has_arg ==
                     required_argument) {
                /*
                 * optional argument doesn't use next nargv
                 */
                pure_optarg = nargv[pure_optind++];
            }
        }
        if ((long_options[match].has_arg == required_argument)
            && (pure_optarg == NULL)) {
            /*
             * Missing argument; leading ':' indicates no error
             * should be generated.
             */
            if (PRINT_ERROR)
                fprintf(stderr, recargstring,
                        current_argv);
            /*
             * XXX: GNU sets pure_optopt to val regardless of flag
             */
            if (long_options[match].flag == NULL)
                pure_optopt = long_options[match].val;
            else
                pure_optopt = 0;
            --pure_optind;
            return BADARG;
        }
    } else {            /* unknown option */
        if (short_too) {
            --pure_optind;
            return -1;
        }
        if (PRINT_ERROR)
            fprintf(stderr, illoptstring, current_argv);
        pure_optopt = 0;
        return BADCH;
    }
    if (idx)
        *idx = match;
    if (long_options[match].flag) {
        *long_options[match].flag = long_options[match].val;
        return 0;
    } else
        return long_options[match].val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movq 0x4b55(%rip), %rax      # 0xb6f8
movq %rax, -0x38(%rbp)
movl $0xffffffff, -0x50(%rbp) # imm = 0xFFFFFFFF
movl 0x4b30(%rip), %eax      # 0xb6e4
addl $0x1, %eax
movl %eax, 0x4b27(%rip)      # 0xb6e4
movq -0x38(%rbp), %rdi
movl $0x3d, %esi
callq 0x2100
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
je 0x6bf2
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x6bff
movq -0x38(%rbp), %rdi
callq 0x20e0
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x6ce7
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movq -0x48(%rbp), %rdx
callq 0x2080
cmpl $0x0, %eax
je 0x6c48
jmp 0x6cd9
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x20e0
cmpq -0x48(%rbp), %rax
jne 0x6c6d
movl -0x4c(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0x6ce7
cmpl $0x0, -0x2c(%rbp)
je 0x6c7c
cmpq $0x1, -0x48(%rbp)
jne 0x6c7c
jmp 0x6cd9
cmpl $-0x1, -0x50(%rbp)
jne 0x6c8a
movl -0x4c(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0x6cd7
cmpl $0x0, 0x4a4f(%rip)      # 0xb6e0
je 0x6cc1
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
je 0x6cc1
movq 0x4352(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq 0x4a60(%rip), %rsi      # 0xb710
movq -0x48(%rbp), %rax
movl %eax, %edx
movq -0x38(%rbp), %rcx
movb $0x0, %al
callq 0x21c0
movl $0x0, 0x4a1d(%rip)      # 0xb6e8
movl $0x3f, -0x4(%rbp)
jmp 0x6fb1
jmp 0x6cd9
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x6c06
cmpl $-0x1, -0x50(%rbp)
je 0x6ee1
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x0, 0x8(%rax)
jne 0x6da5
cmpq $0x0, -0x40(%rbp)
je 0x6da5
cmpl $0x0, 0x49c4(%rip)      # 0xb6e0
je 0x6d4c
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
je 0x6d4c
movq 0x42c7(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq 0x49dd(%rip), %rsi      # 0xb718
movq -0x48(%rbp), %rax
movl %eax, %edx
movq -0x38(%rbp), %rcx
movb $0x0, %al
callq 0x21c0
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
jne 0x6d7c
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movl %eax, 0x496e(%rip)      # 0xb6e8
jmp 0x6d86
movl $0x0, 0x4962(%rip)      # 0xb6e8
movq -0x18(%rbp), %rax
movsbl (%rax), %edx
movl $0x3f, %eax
movl $0x3a, %ecx
cmpl $0x3a, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x6fb1
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x1, 0x8(%rax)
je 0x6dcf
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x2, 0x8(%rax)
jne 0x6e1f
cmpq $0x0, -0x40(%rbp)
je 0x6de3
movq -0x40(%rbp), %rax
movq %rax, 0x497f(%rip)      # 0xb760
jmp 0x6e1d
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x1, 0x8(%rax)
jne 0x6e1b
movq -0x10(%rbp), %rax
movl 0x48e2(%rip), %ecx      # 0xb6e4
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x48d7(%rip)      # 0xb6e4
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x4945(%rip)      # 0xb760
jmp 0x6e1d
jmp 0x6e1f
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x1, 0x8(%rax)
jne 0x6edf
cmpq $0x0, 0x4920(%rip)      # 0xb760
jne 0x6edf
cmpl $0x0, 0x4893(%rip)      # 0xb6e0
je 0x6e77
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
je 0x6e77
movq 0x4196(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq 0x48b4(%rip), %rsi      # 0xb720
movq -0x38(%rbp), %rdx
movb $0x0, %al
callq 0x21c0
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
jne 0x6ea7
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movl %eax, 0x4843(%rip)      # 0xb6e8
jmp 0x6eb1
movl $0x0, 0x4837(%rip)      # 0xb6e8
movl 0x482d(%rip), %eax      # 0xb6e4
addl $-0x1, %eax
movl %eax, 0x4824(%rip)      # 0xb6e4
movq -0x18(%rbp), %rax
movsbl (%rax), %edx
movl $0x3f, %eax
movl $0x3a, %ecx
cmpl $0x3a, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x6fb1
jmp 0x6f46
cmpl $0x0, -0x2c(%rbp)
je 0x6f02
movl 0x47f7(%rip), %eax      # 0xb6e4
addl $-0x1, %eax
movl %eax, 0x47ee(%rip)      # 0xb6e4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6fb1
cmpl $0x0, 0x47d7(%rip)      # 0xb6e0
je 0x6f33
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
je 0x6f33
movq 0x40da(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq 0x4800(%rip), %rsi      # 0xb728
movq -0x38(%rbp), %rdx
movb $0x0, %al
callq 0x21c0
movl $0x0, 0x47ab(%rip)      # 0xb6e8
movl $0x3f, -0x4(%rbp)
jmp 0x6fb1
cmpq $0x0, -0x28(%rbp)
je 0x6f56
movl -0x50(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
je 0x6f9c
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x18(%rax), %ecx
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x6fb1
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)