// File: /workspace/github_c_makefile_star2_O0/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_InteractivePrompt
int Jim_InteractivePrompt(Jim_Interp *interp)
{
    int retcode = JIM_OK;
    char *history_file = NULL;
#ifdef USE_LINENOISE
    const char *home;

    home = getenv("HOME");
    if (home && isatty(STDIN_FILENO)) {
        int history_len = strlen(home) + sizeof("/.jim_history");
        history_file = Jim_Alloc(history_len);
        snprintf(history_file, history_len, "%s/.jim_history", home);
        Jim_HistoryLoad(history_file);
    }

    Jim_HistorySetCompletion(interp, Jim_NewStringObj(interp, "tcl::autocomplete", -1));
    Jim_HistorySetHints(interp, Jim_NewStringObj(interp, "tcl::stdhint", -1));
#endif

    printf("Welcome to Jim version %d.%d\n",
        JIM_VERSION / 100, JIM_VERSION % 100);
    Jim_SetVariableStrWithStr(interp, JIM_INTERACTIVE, "1");

    while (1) {
        Jim_Obj *scriptObjPtr;
        const char *result;
        int reslen;
        char prompt[20];

        if (retcode != JIM_OK) {
            const char *retcodestr = Jim_ReturnCode(retcode);

            if (*retcodestr == '?') {
                snprintf(prompt, sizeof(prompt) - 3, "[%d] . ", retcode);
            }
            else {
                snprintf(prompt, sizeof(prompt) - 3, "[%s] . ", retcodestr);
            }
        }
        else {
            strcpy(prompt, ". ");
        }

        scriptObjPtr = Jim_NewStringObj(interp, "", 0);
        Jim_IncrRefCount(scriptObjPtr);
        while (1) {
            char state;
            char *line;

            line = Jim_HistoryGetline(interp, prompt);
            if (line == NULL) {
                if (errno == EINTR) {
                    continue;
                }
                Jim_DecrRefCount(interp, scriptObjPtr);
                retcode = JIM_OK;
                goto out;
            }
            if (Jim_Length(scriptObjPtr) != 0) {

                Jim_AppendString(interp, scriptObjPtr, "\n", 1);
            }
            Jim_AppendString(interp, scriptObjPtr, line, -1);
            Jim_Free(line);
            if (Jim_ScriptIsComplete(interp, scriptObjPtr, &state))
                break;

            snprintf(prompt, sizeof(prompt), "%c> ", state);
        }
#ifdef USE_LINENOISE
        if (strcmp(Jim_String(scriptObjPtr), "h") == 0) {

            Jim_HistoryShow();
            Jim_DecrRefCount(interp, scriptObjPtr);
            continue;
        }

        Jim_HistoryAdd(Jim_String(scriptObjPtr));
        if (history_file) {
            Jim_HistorySave(history_file);
        }
#endif
        retcode = Jim_EvalObj(interp, scriptObjPtr);
        Jim_DecrRefCount(interp, scriptObjPtr);

        if (retcode == JIM_EXIT) {
            break;
        }
        if (retcode == JIM_ERR) {
            Jim_MakeErrorMessage(interp);
        }
        result = Jim_GetString(Jim_GetResult(interp), &reslen);
        if (reslen) {
            if (fwrite(result, reslen, 1, stdout) == 0) {

            }
            putchar('\n');
        }
    }
  out:
    Jim_Free(history_file);

    return retcode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
leaq 0x24a08(%rip), %rdi     # 0x3b48a
xorl %esi, %esi
movl $0x54, %edx
movb $0x0, %al
callq 0x61e0
movq -0x8(%rbp), %rdi
leaq 0x244e2(%rip), %rsi     # 0x3af7d
leaq 0x25880(%rip), %rdx     # 0x3c322
callq 0xdfa0
cmpl $0x0, -0xc(%rbp)
je 0x16afe
movl -0xc(%rbp), %edi
callq 0x11b50
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3f, %eax
jne 0x16ae1
leaq -0x40(%rbp), %rdi
movl -0xc(%rbp), %ecx
movl $0x11, %esi
leaq 0x249d0(%rip), %rdx     # 0x3b4a8
movb $0x0, %al
callq 0x61f0
jmp 0x16afc
leaq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rcx
movl $0x11, %esi
leaq 0x249bb(%rip), %rdx     # 0x3b4b0
movb $0x0, %al
callq 0x61f0
jmp 0x16b0e
leaq -0x40(%rbp), %rdi
leaq 0x249a4(%rip), %rsi     # 0x3b4ad
callq 0x60d0
movq -0x8(%rbp), %rdi
leaq 0x26e99(%rip), %rsi     # 0x3d9b2
xorl %edx, %edx
callq 0x7990
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x16910
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x16b80
callq 0x6080
cmpl $0x4, (%rax)
jne 0x16b55
jmp 0x16b31
movq -0x20(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x16b74
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x7a10
movl $0x0, -0xc(%rbp)
jmp 0x16c9b
movq -0x20(%rbp), %rdi
callq 0xc700
cmpl $0x0, %eax
je 0x16ba7
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x24b0c(%rip), %rdx     # 0x3b6a9
movl $0x1, %ecx
callq 0x8db0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x58(%rbp), %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x8db0
movq 0x316cc(%rip), %rax     # 0x48290
movq -0x58(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x49(%rbp), %rdx
callq 0xd310
cmpl $0x0, %eax
je 0x16be6
jmp 0x16c06
leaq -0x40(%rbp), %rdi
movsbl -0x49(%rbp), %ecx
movl $0x14, %esi
leaq 0x248be(%rip), %rdx     # 0x3b4b8
movb $0x0, %al
callq 0x61f0
jmp 0x16b31
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x9b80
movl %eax, -0xc(%rbp)
movq -0x20(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x16c35
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x7a10
cmpl $0x6, -0xc(%rbp)
jne 0x16c3d
jmp 0x16c99
cmpl $0x1, -0xc(%rbp)
jne 0x16c4c
movq -0x8(%rbp), %rdi
callq 0x141c0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x89b0
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x16c94
movq -0x28(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
movq 0x31303(%rip), %rax     # 0x47f78
movq (%rax), %rcx
movl $0x1, %edx
callq 0x64a0
cmpq $0x0, %rax
jne 0x16c8a
jmp 0x16c8a
movl $0xa, %edi
callq 0x6050
jmp 0x16aa7
jmp 0x16c9b
movq 0x315ee(%rip), %rax     # 0x48290
movq -0x18(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
movl -0xc(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)