// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %r8d, -0x3c(%rbp)
movq %rcx, -0x78(%rbp)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, -0x70(%rbp)
movq 0x47a0(%rip), %rbx      # 0x86e8
movl 0x4785(%rip), %r12d     # 0x86d4
leal 0x1(%r12), %eax
movl %eax, 0x477a(%rip)      # 0x86d4
movq %rbx, %rdi
movl $0x3d, %esi
callq 0x1100
testq %rax, %rax
movq %rbx, -0x38(%rbp)
je 0x3f7f
movq %rax, %r13
subq %rbx, %r13
incq %rax
movq %rax, -0x50(%rbp)
jmp 0x3f92
movq %rbx, %rdi
callq 0x10e0
movq %rax, %r13
movq $0x0, -0x50(%rbp)
movq %r15, %rcx
movq (%r15), %r15
testq %r15, %r15
je 0x4029
movq %r14, -0x48(%rbp)
movq %r12, -0x60(%rbp)
movslq %r12d, %rax
movq %rax, -0x68(%rbp)
cmpl $0x0, -0x3c(%rbp)
setne %al
cmpq $0x1, %r13
sete %dl
andb %al, %dl
movb %dl, -0x29(%rbp)
movq %rcx, -0x58(%rbp)
leaq 0x20(%rcx), %r14
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r12d, %r12d
movq -0x38(%rbp), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x1080
testl %eax, %eax
jne 0x4009
movq %r15, %rdi
callq 0x10e0
cmpq %r13, %rax
je 0x4078
cmpb $0x0, -0x29(%rbp)
jne 0x4009
cmpl $-0x1, %ebx
movl %r12d, %ebx
jne 0x4102
movq (%r14), %r15
incl %r12d
addq $0x20, %r14
testq %r15, %r15
jne 0x3fd3
cmpl $-0x1, %ebx
movq -0x48(%rbp), %r14
movq -0x60(%rbp), %r12
movq -0x58(%rbp), %rcx
jne 0x4087
cmpl $0x0, -0x3c(%rbp)
je 0x4040
movl %r12d, 0x469e(%rip)     # 0x86d4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x41b0
cmpl $0x0, 0x4689(%rip)      # 0x86d0
je 0x4118
cmpb $0x3a, (%r14)
je 0x4118
movq 0x3f9a(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
leaq 0x1f36(%rip), %rsi      # 0x5f9e
movq -0x38(%rbp), %rdx
xorl %eax, %eax
callq 0x11b0
jmp 0x4118
movl %r12d, %ebx
movq -0x48(%rbp), %r14
movq -0x60(%rbp), %r12
movq -0x58(%rbp), %rcx
movslq %ebx, %rax
shlq $0x5, %rax
leaq (%rcx,%rax), %r15
movl 0x8(%rcx,%rax), %eax
testl %eax, %eax
sete %cl
cmpq $0x0, -0x50(%rbp)
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x40e4
cmpl $0x0, 0x461f(%rip)      # 0x86d0
je 0x40bd
cmpb $0x3a, (%r14)
jne 0x41bf
xorl %eax, %eax
cmpq $0x0, 0x10(%r15)
jne 0x40ca
movl 0x18(%r15), %eax
movl %eax, 0x4608(%rip)      # 0x86d8
xorl %eax, %eax
cmpb $0x3a, (%r14)
setne %al
leal (%rax,%rax,4), %eax
addl $0x3a, %eax
jmp 0x41b0
leal -0x1(%rax), %ecx
cmpl $0x1, %ecx
ja 0x4194
movq -0x50(%rbp), %rcx
testq %rcx, %rcx
je 0x412c
movq %rcx, 0x4608(%rip)      # 0x8708
jmp 0x4154
cmpl $0x0, 0x45c7(%rip)      # 0x86d0
je 0x4118
movq -0x48(%rbp), %rax
cmpb $0x3a, (%rax)
jne 0x41e3
movl $0x0, 0x45b6(%rip)      # 0x86d8
movl $0x3f, %eax
jmp 0x41b0
cmpl $0x1, %eax
jne 0x4194
addl $0x2, %r12d
movl %r12d, 0x4598(%rip)     # 0x86d4
movq -0x70(%rbp), %rax
movq -0x68(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, 0x45b8(%rip)      # 0x8708
movl 0x8(%r15), %eax
cmpl $0x1, %eax
jne 0x4194
cmpq $0x0, 0x45a7(%rip)      # 0x8708
jne 0x4194
cmpl $0x0, 0x4566(%rip)      # 0x86d0
je 0x4176
cmpb $0x3a, (%r14)
jne 0x4207
xorl %eax, %eax
cmpq $0x0, 0x10(%r15)
jne 0x4183
movl 0x18(%r15), %eax
movl %eax, 0x454f(%rip)      # 0x86d8
decl 0x4545(%rip)            # 0x86d4
jmp 0x40d0
movq -0x78(%rbp), %rax
testq %rax, %rax
je 0x419f
movl %ebx, (%rax)
movq 0x10(%r15), %rcx
movl 0x18(%r15), %eax
testq %rcx, %rcx
je 0x41b0
movl %eax, (%rcx)
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3e32(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
leaq 0x1d82(%rip), %rsi      # 0x5f52
movl %r13d, %edx
movq -0x38(%rbp), %rcx
xorl %eax, %eax
callq 0x11b0
jmp 0x40bd
movq 0x3e0e(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
leaq 0x1d44(%rip), %rsi      # 0x5f38
movl %r13d, %edx
movq -0x38(%rbp), %rcx
xorl %eax, %eax
callq 0x11b0
jmp 0x4118
movq 0x3dea(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
leaq 0x1d63(%rip), %rsi      # 0x5f7b
movq -0x38(%rbp), %rdx
xorl %eax, %eax
callq 0x11b0
jmp 0x4176