// File: /workspace/github_c_makefile_star2_O1/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, -0x30(%rbp)
movq %r8, -0x40(%rbp)
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
movq 0x8(%rsi), %rax
leaq 0x2e9d9(%rip), %rcx     # 0x368a0
cmpq %rcx, %rax
jne 0x7ee7
cmpq %r14, 0x18(%r13)
jne 0x7ee7
movl -0x30(%rbp), %ecx
cmpl %ecx, 0x20(%r13)
jne 0x7ee7
movl 0x24(%r13), %eax
movl %eax, (%r15)
jmp 0x8091
cmpq $0x0, (%r13)
jne 0x7ef4
movq %r13, %rdi
callq *0x18(%rax)
movslq 0x14(%r13), %r12
movq (%r13), %rax
movq %rax, -0x38(%rbp)
movq %r15, -0x48(%rbp)
movl $0xffffffff, (%r15)     # imm = 0xFFFFFFFF
movq (%r14), %rdx
testq %rdx, %rdx
je 0x7f76
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r13, %rsi
callq 0x73d6
testl %eax, %eax
jne 0x8056
testb $0x2, -0x30(%rbp)
je 0x7f67
movq (%r14,%r15,8), %rsi
movq -0x38(%rbp), %rdi
movq %r12, %rdx
callq 0x60b0
testl %eax, %eax
jne 0x7f67
cmpl $0x1, %r12d
jne 0x7f59
movq -0x38(%rbp), %rax
cmpb $0x2d, (%rax)
je 0x7f7d
cmpl $0x0, -0x2c(%rbp)
jns 0x80a6
movl %r15d, -0x2c(%rbp)
movq 0x8(%r14,%r15,8), %rdx
incq %r15
testq %rdx, %rdx
jne 0x7f1d
jmp 0x7f7d
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movl -0x2c(%rbp), %r15d
testl %r15d, %r15d
jns 0x8056
leaq 0x24090(%rip), %rdx     # 0x2c021
movl $0x1, %r13d
testb $0x1, -0x30(%rbp)
je 0x8094
movq -0x40(%rbp), %rax
testq %rax, %rax
leaq 0x265a7(%rip), %rcx     # 0x2e556
cmovneq %rax, %rcx
leaq 0x265a3(%rip), %rsi     # 0x2e55d
movq %rbx, %rdi
movq -0x38(%rbp), %r8
xorl %eax, %eax
callq 0x692d
movq %r14, %rdi
callq 0x119c1
movq %rax, %r14
cmpq $0x0, (%rax)
je 0x8049
leaq 0x26673(%rip), %r12     # 0x2e653
xorl %r15d, %r15d
testq %r15, %r15
je 0x8007
cmpq $0x0, 0x8(%r14,%r15,8)
jne 0x8007
movq (%rbx), %rsi
movq %rbx, %rdi
leaq 0x26574(%rip), %rdx     # 0x2e571
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x8653
movq (%rbx), %rsi
movq (%r14,%r15,8), %rcx
movq %rbx, %rdi
movq %r12, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xafef
cmpq $0x0, 0x8(%r14,%r15,8)
je 0x803d
movq (%rbx), %rsi
movq %rbx, %rdi
leaq 0x26542(%rip), %rdx     # 0x2e575
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x8653
cmpq $0x0, 0x8(%r14,%r15,8)
leaq 0x1(%r15), %r15
jne 0x7fe3
movq %r14, %rdi
xorl %esi, %esi
callq *0x30234(%rip)          # 0x38288
jmp 0x8094
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x8070
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x8070
movq %rbx, %rdi
movq %r13, %rsi
callq *%rax
leaq 0x2e829(%rip), %rax     # 0x368a0
movq %rax, 0x8(%r13)
movq %r14, 0x18(%r13)
movl -0x30(%rbp), %eax
movl %eax, 0x20(%r13)
movl %r15d, 0x24(%r13)
movq -0x48(%rbp), %rax
movl %r15d, (%rax)
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x23f79(%rip), %rdx     # 0x2c026
jmp 0x7f91