// File: /workspace/github_c_makefile_star2_O3/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
movq %rsi, %r14
movl %edi, %r15d
movq (%rsi), %r12
cmpl $0x2, %edi
jl 0x1353a
movq 0x8(%r14), %rbx
leaq 0x17e3d(%rip), %rsi     # 0x2b350
movq %rbx, %rdi
callq 0x62e0
testl %eax, %eax
je 0x13663
leaq 0x17e30(%rip), %rsi     # 0x2b35a
movq %rbx, %rdi
callq 0x62e0
testl %eax, %eax
je 0x136d1
callq 0xc948
movq %rax, %rbx
movq %rax, %rdi
callq 0x1172a
movq %rbx, %rdi
callq 0xa43c
leaq 0x17e08(%rip), %rsi     # 0x2b361
movq %rbx, %rdi
movq %r12, %rdx
callq 0xc4a3
cmpl $0x1, %r15d
leaq 0x189f1(%rip), %rdx     # 0x2bf60
leaq 0x1877d(%rip), %r12     # 0x2bcf3
cmovneq %r12, %rdx
leaq 0x17859(%rip), %rsi     # 0x2adda
movq %rbx, %rdi
callq 0xc4a3
leaq 0x17ddc(%rip), %rsi     # 0x2b36c
movq %rbx, %rdi
movq %r12, %rdx
callq 0xc4a3
leaq 0x14354(%rip), %rsi     # 0x278f6
leaq 0x1435b(%rip), %rcx     # 0x27904
movq %rbx, %rdi
movl $0x1, %edx
callq 0x6661
cmpl $0x1, %r15d
jne 0x135f9
cmpl $0x6, %eax
je 0x136b4
cmpl $0x1, %eax
je 0x13767
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x13774
xorl %edi, %edi
callq 0x6110
testl %eax, %eax
je 0x1367d
movq %rbx, %rdi
callq 0x131ea
movl %eax, %r14d
jmp 0x136a8
movq 0x8(%r14), %rsi
cmpl $0x3, %r15d
jl 0x13618
cmpb $0x2d, (%rsi)
jne 0x13618
cmpb $0x65, 0x1(%rsi)
jne 0x13618
cmpb $0x0, 0x2(%rsi)
je 0x136de
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
leaq 0x17d3a(%rip), %rsi     # 0x2b366
movq %rbx, %rdi
movq %rax, %rdx
callq 0xc425
addl $-0x2, %r15d
leaq 0x10(%r14), %rdx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x13774
movq 0x8(%r14), %rsi
cmpb $0x2d, (%rsi)
jne 0x13659
cmpb $0x0, 0x1(%rsi)
je 0x1367d
movq %rbx, %rdi
callq 0x10f95
jmp 0x1369c
leaq 0x17cb4(%rip), %rdi     # 0x2b31e
xorl %r14d, %r14d
xorl %esi, %esi
movl $0x54, %edx
xorl %eax, %eax
callq 0x61d0
jmp 0x136c5
leaq 0x17cf6(%rip), %rsi     # 0x2b37a
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %rbx, %rdi
movq %rax, %rsi
callq 0x908a
movl %eax, %r14d
cmpl $0x1, %eax
je 0x13754
cmpl $0x1, %r14d
je 0x136bd
cmpl $0x6, %r14d
jne 0x136ba
movl 0x30(%rbx), %r14d
jmp 0x136bd
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0xcdb9
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x13435
xorl %r14d, %r14d
jmp 0x136c5
addl $-0x3, %r15d
leaq 0x18(%r14), %rdx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x13774
movq 0x10(%r14), %rsi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %rbx, %rdi
movq %rax, %rsi
callq 0x908a
cmpl $0x1, %eax
je 0x13754
movl %eax, %r14d
movq (%rbx), %r15
movq (%r15), %rdi
testq %rdi, %rdi
jne 0x1372d
movq 0x8(%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movq (%r15), %rdi
movslq 0x14(%r15), %rsi
movq 0x23840(%rip), %rax     # 0x36f78
movq (%rax), %rcx
movl $0x1, %edx
callq 0x6490
movl $0xa, %edi
callq 0x6050
jmp 0x136a8
movq %rbx, %rdi
callq 0x6500
movl $0x1, %r14d
jmp 0x136bd
movq %rbx, %rdi
callq 0x6500
jmp 0x135ce