// File: /workspace/github_c_makefile_star2_O2/msteveb[P]autosetup/./jimsh0.c
// Function: main
int main(int argc, char *const argv[])
{
    int retcode;
    Jim_Interp *interp;
    char *const orig_argv0 = argv[0];


    if (argc > 1 && strcmp(argv[1], "--version") == 0) {
        printf("%d.%d\n", JIM_VERSION / 100, JIM_VERSION % 100);
        return 0;
    }
    else if (argc > 1 && strcmp(argv[1], "--help") == 0) {
        usage(argv[0]);
        return 0;
    }


    interp = Jim_CreateInterp();
    Jim_RegisterCoreCommands(interp);


    if (Jim_InitStaticExtensions(interp) != JIM_OK) {
        JimPrintErrorMessage(interp);
    }

    Jim_SetVariableStrWithStr(interp, "jim::argv0", orig_argv0);
    Jim_SetVariableStrWithStr(interp, JIM_INTERACTIVE, argc == 1 ? "1" : "0");
#ifdef USE_LINENOISE
    Jim_SetVariableStrWithStr(interp, "jim::lineedit", "1");
#else
    Jim_SetVariableStrWithStr(interp, "jim::lineedit", "0");
#endif
    retcode = Jim_initjimshInit(interp);

    if (argc == 1) {

        if (retcode == JIM_ERR) {
            JimPrintErrorMessage(interp);
        }
        if (retcode != JIM_EXIT) {
            JimSetArgv(interp, 0, NULL);
            if (!isatty(STDIN_FILENO)) {

                goto eval_stdin;
            }
            retcode = Jim_InteractivePrompt(interp);
        }
    }
    else {

        if (argc > 2 && strcmp(argv[1], "-e") == 0) {

            JimSetArgv(interp, argc - 3, argv + 3);
            retcode = Jim_Eval(interp, argv[2]);
            if (retcode != JIM_ERR) {
                int len;
                const char *msg = Jim_GetString(Jim_GetResult(interp), &len);
                if (fwrite(msg, len, 1, stdout) == 0) {

                }
                putchar('\n');
            }
        }
        else {
            Jim_SetVariableStr(interp, "argv0", Jim_NewStringObj(interp, argv[1], -1));
            JimSetArgv(interp, argc - 2, argv + 2);
            if (strcmp(argv[1], "-") == 0) {
eval_stdin:
                retcode = Jim_Eval(interp, "eval [info source [stdin read] stdin 1]");
            } else {
                retcode = Jim_EvalFile(interp, argv[1]);
            }
        }
        if (retcode == JIM_ERR) {
            JimPrintErrorMessage(interp);
        }
    }
    if (retcode == JIM_EXIT) {
        retcode = Jim_GetExitCode(interp);
    }
    else if (retcode == JIM_ERR) {
        retcode = 1;
    }
    else {
        retcode = 0;
    }
    Jim_FreeInterp(interp);
    return retcode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movl %edi, %r15d
movq (%rsi), %r12
cmpl $0x2, %edi
jl 0x11ed3
movq 0x8(%r14), %rbx
leaq 0x154f4(%rip), %rsi     # 0x273a0
movq %rbx, %rdi
callq 0x62e0
testl %eax, %eax
je 0x11feb
leaq 0x154e7(%rip), %rsi     # 0x273aa
movq %rbx, %rdi
callq 0x62e0
testl %eax, %eax
je 0x1202b
callq 0xbe17
movq %rax, %rbx
movq %rax, %rdi
callq 0x10462
movq %rbx, %rdi
callq 0x9cc0
leaq 0x154bf(%rip), %rsi     # 0x273b1
movq %rbx, %rdi
movq %r12, %rdx
callq 0xb9a9
cmpl $0x1, %r15d
leaq 0x160a8(%rip), %rdx     # 0x27fb0
leaq 0x15e34(%rip), %r12     # 0x27d43
cmovneq %r12, %rdx
leaq 0x14f10(%rip), %rsi     # 0x26e2a
movq %rbx, %rdi
callq 0xb9a9
leaq 0x15493(%rip), %rsi     # 0x273bc
movq %rbx, %rdi
movq %r12, %rdx
callq 0xb9a9
movq %rbx, %rdi
callq 0x668f
cmpl $0x1, %r15d
jne 0x11f83
cmpl $0x6, %eax
je 0x1209a
cmpl $0x1, %eax
jne 0x11f58
movq %rbx, %rdi
callq 0x120bb
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x120f4
xorl %edi, %edi
callq 0x6110
testl %eax, %eax
je 0x12006
movq %rbx, %rdi
callq 0x11bd5
movl %eax, %r14d
jmp 0x1208e
movq 0x8(%r14), %rsi
cmpl $0x3, %r15d
jl 0x11fa2
cmpb $0x2d, (%rsi)
jne 0x11fa2
cmpb $0x65, 0x1(%rsi)
jne 0x11fa2
cmpb $0x0, 0x2(%rsi)
je 0x12038
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x7363
leaq 0x15402(%rip), %rsi     # 0x273b6
movq %rbx, %rdi
movq %rax, %rdx
callq 0xb92d
addl $-0x2, %r15d
leaq 0x10(%r14), %rdx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x120f4
movq 0x8(%r14), %rsi
cmpb $0x2d, (%rsi)
jne 0x11fe1
cmpb $0x0, 0x1(%rsi)
je 0x12006
movq %rbx, %rdi
callq 0xfd51
jmp 0x12015
leaq 0x1537c(%rip), %rdi     # 0x2736e
xorl %r14d, %r14d
pushq $0x54
popq %rdx
xorl %esi, %esi
xorl %eax, %eax
callq 0x61d0
jmp 0x120ab
leaq 0x153bd(%rip), %rsi     # 0x273ca
movq %rbx, %rdi
callq 0xfce7
movl %eax, %r14d
cmpl $0x1, %eax
jne 0x1208e
movq %rbx, %rdi
callq 0x120bb
pushq $0x1
popq %r14
jmp 0x120a3
movq %r12, %rdi
callq 0x11dcf
xorl %r14d, %r14d
jmp 0x120ab
addl $-0x3, %r15d
leaq 0x18(%r14), %rdx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x120f4
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0xfce7
cmpl $0x1, %eax
je 0x1201d
movl %eax, %r14d
movq (%rbx), %rdi
leaq -0x24(%rbp), %r15
movq %r15, %rsi
callq 0x7fc7
movslq (%r15), %rsi
movq 0x20f00(%rip), %rcx     # 0x32f78
movq (%rcx), %rcx
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x6490
pushq $0xa
popq %rdi
callq 0x6050
cmpl $0x1, %r14d
je 0x120a3
cmpl $0x6, %r14d
jne 0x120a0
movl 0x30(%rbx), %r14d
jmp 0x120a3
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0xc20b
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq