// File: /workspace/github_c_makefile_star2_O0/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_ExistsCoreCommand
static int Jim_ExistsCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
    Jim_Obj *objPtr;
    int result = 0;

    static const char * const options[] = {
        "-command", "-proc", "-alias", "-var", NULL
    };
    enum
    {
        OPT_COMMAND, OPT_PROC, OPT_ALIAS, OPT_VAR
    };
    int option;

    if (argc == 2) {
        option = OPT_VAR;
        objPtr = argv[1];
    }
    else if (argc == 3) {
        if (Jim_GetEnum(interp, argv[1], options, &option, NULL, JIM_ERRMSG | JIM_ENUM_ABBREV) != JIM_OK) {
            return JIM_ERR;
        }
        objPtr = argv[2];
    }
    else {
        Jim_WrongNumArgs(interp, 1, argv, "?option? name");
        return JIM_ERR;
    }

    if (option == OPT_VAR) {
        result = Jim_GetVariable(interp, objPtr, 0) != NULL;
    }
    else {

        Jim_Cmd *cmd = Jim_GetCommand(interp, objPtr, JIM_NONE);

        if (cmd) {
            switch (option) {
            case OPT_COMMAND:
                result = 1;
                break;

            case OPT_ALIAS:
                result = cmd->isproc == 0 && cmd->u.native.cmdProc == JimAliasCmd;
                break;

            case OPT_PROC:
                result = cmd->isproc;
                break;
            }
        }
    }
    Jim_SetResultBool(interp, result);
    return JIM_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x2c(%rbp)
cmpl $0x2, -0x14(%rbp)
jne 0x2ca85
movl $0x3, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x2caf8
cmpl $0x3, -0x14(%rbp)
jne 0x2cad1
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x1b292(%rip), %rdx     # 0x47d30
leaq -0x30(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
movl $0x3, %r9d
callq 0x8590
cmpl $0x0, %eax
je 0x2cac3
movl $0x1, -0x4(%rbp)
jmp 0x2cbfa
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x2caf6
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x1, %esi
leaq 0x10a0a(%rip), %rcx     # 0x3d4ef
callq 0x7880
movl $0x1, -0x4(%rbp)
jmp 0x2cbfa
jmp 0x2caf8
cmpl $0x3, -0x30(%rbp)
jne 0x2cb21
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0xa7b0
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2cba3
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0x6930
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x2cba1
movl -0x30(%rbp), %eax
movl %eax, -0x44(%rbp)
testl %eax, %eax
je 0x2cb5b
jmp 0x2cb47
movl -0x44(%rbp), %eax
subl $0x1, %eax
je 0x2cb95
jmp 0x2cb51
movl -0x44(%rbp), %eax
subl $0x2, %eax
je 0x2cb64
jmp 0x2cb9f
movl $0x1, -0x2c(%rbp)
jmp 0x2cb9f
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x4(%rcx)
movb %al, -0x45(%rbp)
jne 0x2cb88
movq -0x38(%rbp), %rax
leaq 0x1c22(%rip), %rcx      # 0x2e7a0
cmpq %rcx, 0x18(%rax)
sete %al
movb %al, -0x45(%rbp)
movb -0x45(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2cb9f
movq -0x38(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x2c(%rbp)
jmp 0x2cba1
jmp 0x2cba3
jmp 0x2cba5
movq -0x10(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x8d60
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x2cbe8
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)