// File: /workspace/github_c_makefile_star2_O0/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_GetEnum
int Jim_GetEnum(Jim_Interp *interp, Jim_Obj *objPtr,
    const char *const *tablePtr, int *indexPtr, const char *name, int flags)
{
    const char *bad = "bad ";
    const char *const *entryPtr = NULL;
    int i;
    int match = -1;
    int arglen;
    const char *arg;

    if (objPtr->typePtr == &getEnumObjType) {
        if (objPtr->internalRep.ptrIntValue.ptr == tablePtr && objPtr->internalRep.ptrIntValue.int1 == flags) {
            *indexPtr = objPtr->internalRep.ptrIntValue.int2;
            return JIM_OK;
        }
    }

    arg = Jim_GetString(objPtr, &arglen);

    *indexPtr = -1;

    for (entryPtr = tablePtr, i = 0; *entryPtr != NULL; entryPtr++, i++) {
        if (Jim_CompareStringImmediate(interp, objPtr, *entryPtr)) {

            match = i;
            goto found;
        }
        if (flags & JIM_ENUM_ABBREV) {
            if (strncmp(arg, *entryPtr, arglen) == 0) {
                if (*arg == '-' && arglen == 1) {
                    break;
                }
                if (match >= 0) {
                    bad = "ambiguous ";
                    goto ambiguous;
                }
                match = i;
            }
        }
    }


    if (match >= 0) {
  found:

        Jim_FreeIntRep(interp, objPtr);
        objPtr->typePtr = &getEnumObjType;
        objPtr->internalRep.ptrIntValue.ptr = (void *)tablePtr;
        objPtr->internalRep.ptrIntValue.int1 = flags;
        objPtr->internalRep.ptrIntValue.int2 = match;

        *indexPtr = match;
        return JIM_OK;
    }

  ambiguous:
    if (flags & JIM_ERRMSG) {
        JimSetFailedEnumResult(interp, arg, bad, "", tablePtr, name);
    }
    return JIM_ERR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
leaq 0x32bbf(%rip), %rax     # 0x3b176
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movl $0xffffffff, -0x50(%rbp) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
leaq 0x3e3db(%rip), %rcx     # 0x469b0
cmpq %rcx, 0x8(%rax)
jne 0x8610
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x20(%rbp), %rax
jne 0x860e
movq -0x18(%rbp), %rax
movl 0x20(%rax), %eax
cmpl -0x34(%rbp), %eax
jne 0x860e
movq -0x18(%rbp), %rax
movl 0x24(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x8788
jmp 0x8610
movq -0x18(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0x89b0
movq %rax, -0x60(%rbp)
movq -0x28(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x48(%rbp), %rax
cmpq $0x0, (%rax)
je 0x86db
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x48(%rbp), %rax
movq (%rax), %rdx
callq 0x77a0
cmpl $0x0, %eax
je 0x8669
movl -0x4c(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0x86e3
movl -0x34(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x86bf
movq -0x60(%rbp), %rdi
movq -0x48(%rbp), %rax
movq (%rax), %rsi
movslq -0x54(%rbp), %rdx
callq 0x60b0
cmpl $0x0, %eax
jne 0x86bd
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x86a1
cmpl $0x1, -0x54(%rbp)
jne 0x86a1
jmp 0x86db
cmpl $0x0, -0x50(%rbp)
jl 0x86b7
leaq 0x32acd(%rip), %rax     # 0x3b17b
movq %rax, -0x40(%rbp)
jmp 0x8756
movl -0x4c(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0x86bf
jmp 0x86c1
movq -0x48(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x48(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x863a
cmpl $0x0, -0x50(%rbp)
jl 0x8754
jmp 0x86e3
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x8713
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0x8713
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
movq -0x18(%rbp), %rax
leaq 0x3e292(%rip), %rcx     # 0x469b0
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x34(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x20(%rax)
movl -0x50(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
movl -0x50(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x8788
jmp 0x8756
movl -0x34(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x8781
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x20(%rbp), %r8
movq -0x30(%rbp), %r9
leaq 0x35236(%rip), %rcx     # 0x3d9b2
callq 0x143d0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)