// File: /workspace/github_c_makefile_star2_O1/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 0x13957
movq 0x8(%r14), %rbx
leaq 0x18a78(%rip), %rsi     # 0x2c3a8
movq %rbx, %rdi
callq 0x62e0
testl %eax, %eax
je 0x13a92
leaq 0x18a6b(%rip), %rsi     # 0x2c3b2
movq %rbx, %rdi
callq 0x62e0
testl %eax, %eax
je 0x13b01
callq 0xc923
movq %rax, %rbx
movq %rax, %rdi
callq 0x11853
movq %rbx, %rdi
callq 0xa457
leaq 0x18a43(%rip), %rsi     # 0x2c3b9
movq %rbx, %rdi
movq %r12, %rdx
callq 0xc488
cmpl $0x1, %r15d
leaq 0x19632(%rip), %rdx     # 0x2cfbe
leaq 0x193be(%rip), %r12     # 0x2cd51
cmovneq %r12, %rdx
leaq 0x18494(%rip), %rsi     # 0x2be32
movq %rbx, %rdi
callq 0xc488
leaq 0x18a17(%rip), %rsi     # 0x2c3c4
movq %rbx, %rdi
movq %r12, %rdx
callq 0xc488
leaq 0x14f8f(%rip), %rsi     # 0x2894e
leaq 0x14f96(%rip), %rcx     # 0x2895c
movq %rbx, %rdi
movl $0x1, %edx
callq 0x6661
cmpl $0x1, %r15d
jne 0x13a1a
movl %eax, %r12d
cmpl $0x6, %eax
je 0x13ad8
cmpl $0x1, %r12d
je 0x13b9e
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x13bab
xorl %edi, %edi
callq 0x6110
testl %eax, %eax
je 0x13aac
movq %rbx, %rdi
callq 0x135de
movl %eax, %r12d
jmp 0x13ad8
cmpl $0x3, %r15d
jl 0x13a38
movq 0x8(%r14), %rdi
leaq 0x189a7(%rip), %rsi     # 0x2c3d2
callq 0x62e0
testl %eax, %eax
je 0x13b0e
movq 0x8(%r14), %rsi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
leaq 0x1896e(%rip), %rsi     # 0x2c3be
movq %rbx, %rdi
movq %rax, %rdx
callq 0xc40a
addl $-0x2, %r15d
leaq 0x10(%r14), %rdx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x13bab
movq 0x8(%r14), %r14
leaq 0x19493(%rip), %rsi     # 0x2cf0c
movq %r14, %rdi
callq 0x62e0
testl %eax, %eax
je 0x13aac
movq %rbx, %rdi
movq %r14, %rsi
callq 0x110aa
jmp 0x13acb
leaq 0x188dd(%rip), %rdi     # 0x2c376
xorl %r12d, %r12d
xorl %esi, %esi
movl $0x54, %edx
xorl %eax, %eax
callq 0x61d0
jmp 0x13af5
leaq 0x18922(%rip), %rsi     # 0x2c3d5
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %rbx, %rdi
movq %rax, %rsi
callq 0x9078
movl %eax, %r12d
cmpl $0x1, %r12d
je 0x13b8b
cmpl $0x1, %r12d
je 0x13aed
cmpl $0x6, %r12d
jne 0x13aea
movl 0x30(%rbx), %r12d
jmp 0x13aed
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0xcd94
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x13852
xorl %r12d, %r12d
jmp 0x13af5
addl $-0x3, %r15d
leaq 0x18(%r14), %rdx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x13bab
movq 0x10(%r14), %rsi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %rbx, %rdi
movq %rax, %rsi
callq 0x9078
movl $0x1, %r12d
cmpl $0x1, %eax
je 0x13ace
movl %eax, %r14d
movq (%rbx), %r15
cmpq $0x0, (%r15)
jne 0x13b5e
movq 0x8(%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movslq 0x14(%r15), %rsi
movq (%r15), %rdi
movq 0x2440c(%rip), %rax     # 0x37f78
movq (%rax), %rcx
movl $0x1, %edx
callq 0x6490
movl $0xa, %edi
callq 0x6050
movl %r14d, %r12d
jmp 0x13ace
movq %rbx, %rdi
callq 0x6500
movl $0x1, %r12d
jmp 0x13ad8
movq %rbx, %rdi
callq 0x6500
jmp 0x139ef