// File: /workspace/github_c_makefile_star2_O2/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 $0x38, %rsp
movl %r9d, %r15d
movq %r8, -0x50(%rbp)
movq %rcx, %r14
movq %rdx, -0x38(%rbp)
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x29de0(%rip), %rax     # 0x31950
cmpq %rax, 0x8(%rsi)
jne 0x7b92
movq -0x38(%rbp), %rax
cmpq %rax, 0x18(%r13)
jne 0x7b92
cmpl %r15d, 0x20(%r13)
jne 0x7b92
movl 0x24(%r13), %eax
movl %eax, (%r14)
jmp 0x7c6b
leaq -0x44(%rbp), %rsi
movq %r13, %rdi
callq 0x7fc7
movq %r14, -0x58(%rbp)
orl $-0x1, (%r14)
movq %rax, -0x40(%rbp)
pushq $-0x1
popq %rax
movl %eax, -0x2c(%rbp)
xorl %r12d, %r12d
movq -0x38(%rbp), %rax
movq (%rax,%r12,8), %rdx
testq %rdx, %rdx
je 0x7c1a
movq %rbx, %rdi
movq %r13, %rsi
callq 0x7223
testl %eax, %eax
jne 0x7c2c
testb $0x2, %r15b
je 0x7c15
movl %r15d, %r14d
movq -0x38(%rbp), %rax
movq (%rax,%r12,8), %rsi
movl -0x44(%rbp), %r15d
movslq %r15d, %rdx
movq -0x40(%rbp), %rdi
callq 0x60b0
testl %eax, %eax
je 0x7bf9
movl %r14d, %r15d
jmp 0x7c15
cmpl $0x1, %r15d
movl %r14d, %r15d
jne 0x7c0b
movq -0x40(%rbp), %rax
cmpb $0x2d, (%rax)
je 0x7c1a
cmpl $0x0, -0x2c(%rbp)
jns 0x7c7c
movl %r12d, -0x2c(%rbp)
incq %r12
jmp 0x7bb3
movl -0x2c(%rbp), %r14d
testl %r14d, %r14d
jns 0x7c2f
leaq 0x1f3ef(%rip), %rdx     # 0x27019
jmp 0x7c83
movl %r12d, %r14d
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x7c49
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x7c49
movq %rbx, %rdi
movq %r13, %rsi
callq *%rax
leaq 0x29d00(%rip), %rax     # 0x31950
movq %rax, 0x8(%r13)
movq -0x38(%rbp), %rax
movq %rax, 0x18(%r13)
movl %r15d, 0x20(%r13)
movl %r14d, 0x24(%r13)
movq -0x58(%rbp), %rax
movl %r14d, (%rax)
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f39b(%rip), %rdx     # 0x2701e
pushq $0x1
popq %rax
testb $0x1, %r15b
je 0x7c6d
movq -0x50(%rbp), %rax
testq %rax, %rax
leaq 0x218aa(%rip), %rcx     # 0x29544
cmovneq %rax, %rcx
leaq 0x218a6(%rip), %rsi     # 0x2954b
movq %rbx, %rdi
movq -0x40(%rbp), %r8
xorl %eax, %eax
callq 0x68a7
movq -0x38(%rbp), %rdi
callq 0x10597
movq %rax, %r14
pushq $0x1
popq %r13
pushq $-0x1
popq %r12
leaq 0x21973(%rip), %r15     # 0x29641
movq -0x8(%r14,%r13,8), %rcx
testq %rcx, %rcx
je 0x7d33
cmpq $0x1, %r13
je 0x7cff
cmpq $0x0, (%r14,%r13,8)
jne 0x7cff
movq (%rbx), %rsi
movq %rbx, %rdi
leaq 0x2186d(%rip), %rdx     # 0x2955f
movl %r12d, %ecx
callq 0x823a
movq -0x8(%r14,%r13,8), %rcx
movq (%rbx), %rsi
movq %rbx, %rdi
movq %r15, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xa731
cmpq $0x0, (%r14,%r13,8)
je 0x7d2e
movq (%rbx), %rsi
movq %rbx, %rdi
leaq 0x2183d(%rip), %rdx     # 0x29563
movl %r12d, %ecx
callq 0x823a
incq %r13
jmp 0x7cce
movq %r14, %rdi
xorl %esi, %esi
callq *0x2b54a(%rip)          # 0x33288
pushq $0x1
popq %rax
jmp 0x7c6d