// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, -0x2c(%rbp)
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
movq 0x8(%rsi), %rax
leaq 0x2d9d8(%rip), %rcx     # 0x358b0
cmpq %rcx, %rax
jne 0x7ef8
cmpq %r14, 0x18(%r13)
jne 0x7ef8
movl -0x2c(%rbp), %ecx
cmpl %ecx, 0x20(%r13)
jne 0x7ef8
movl 0x24(%r13), %eax
movl %eax, (%r15)
jmp 0x7fdc
movq %r8, -0x50(%rbp)
movq (%r13), %rcx
movq %rcx, -0x38(%rbp)
testq %rcx, %rcx
jne 0x7f17
movq %r13, %rdi
callq *0x18(%rax)
movq (%r13), %rax
movq %rax, -0x38(%rbp)
movslq 0x14(%r13), %r12
movl $0xffffffff, (%r15)     # imm = 0xFFFFFFFF
movq (%r14), %rdx
leaq 0x2309d(%rip), %rax     # 0x2afc9
movq %rax, -0x40(%rbp)
testq %rdx, %rdx
je 0x7fee
movq %r15, -0x48(%rbp)
movl $0xffffffff, -0x30(%rbp) # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r13, %rsi
callq 0x73c6
testl %eax, %eax
jne 0x7fa1
testb $0x2, -0x2c(%rbp)
je 0x7f89
movq (%r14,%r15,8), %rsi
movq -0x38(%rbp), %rdi
movq %r12, %rdx
callq 0x60b0
testl %eax, %eax
jne 0x7f89
cmpl $0x1, %r12d
jne 0x7f7f
movq -0x38(%rbp), %rax
cmpb $0x2d, (%rax)
je 0x7f96
cmpl $0x0, -0x30(%rbp)
jns 0x7fe3
movl %r15d, -0x30(%rbp)
movq 0x8(%r14,%r15,8), %rdx
incq %r15
testq %rdx, %rdx
jne 0x7f47
movl -0x30(%rbp), %r15d
testl %r15d, %r15d
jns 0x7fa1
jmp 0x7fee
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x7fbb
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x7fbb
movq %rbx, %rdi
movq %r13, %rsi
callq *%rax
leaq 0x2d8ee(%rip), %rax     # 0x358b0
movq %rax, 0x8(%r13)
movq %r14, 0x18(%r13)
movl -0x2c(%rbp), %eax
movl %eax, 0x20(%r13)
movl %r15d, 0x24(%r13)
movq -0x48(%rbp), %rax
movl %r15d, (%rax)
xorl %eax, %eax
jmp 0x80bf
leaq 0x22fe4(%rip), %rax     # 0x2afce
movq %rax, -0x40(%rbp)
movl $0x1, %eax
testb $0x1, -0x2c(%rbp)
je 0x80bf
movq -0x50(%rbp), %rax
testq %rax, %rax
leaq 0x254e9(%rip), %rcx     # 0x2d4f4
cmovneq %rax, %rcx
leaq 0x254e5(%rip), %rsi     # 0x2d4fb
movq %rbx, %rdi
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %r8
xorl %eax, %eax
callq 0x6923
movq %r14, %rdi
callq 0x11898
movq %rax, %r14
movq (%rax), %rcx
testq %rcx, %rcx
je 0x80af
leaq 0x255af(%rip), %r12     # 0x2d5f1
leaq 0x254ca(%rip), %r15     # 0x2d513
xorl %r13d, %r13d
testq %r13, %r13
je 0x8074
cmpq $0x0, 0x8(%r14,%r13,8)
jne 0x8074
movq (%rbx), %rsi
movq %rbx, %rdi
leaq 0x254a9(%rip), %rdx     # 0x2d50f
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x86a0
movq (%r14,%r13,8), %rcx
movq (%rbx), %rsi
movq %rbx, %rdi
movq %r12, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xafd1
cmpq $0x0, 0x8(%r14,%r13,8)
je 0x80af
movq (%rbx), %rsi
movq %rbx, %rdi
movq %r15, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x86a0
movq 0x8(%r14,%r13,8), %rcx
incq %r13
testq %rcx, %rcx
jne 0x804c
movq %r14, %rdi
xorl %esi, %esi
callq *0x2f1ce(%rip)          # 0x37288
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq