// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
cmpl $0x1, -0x8(%rbp)
jle 0x16e01
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x248d5(%rip), %rsi     # 0x3b6ab
callq 0x6300
cmpl $0x0, %eax
jne 0x16e01
leaq 0x246e4(%rip), %rdi     # 0x3b4cb
xorl %esi, %esi
movl $0x54, %edx
movb $0x0, %al
callq 0x61e0
movl $0x0, -0x4(%rbp)
jmp 0x17083
cmpl $0x1, -0x8(%rbp)
jle 0x16e38
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x2489f(%rip), %rsi     # 0x3b6b5
callq 0x6300
cmpl $0x0, %eax
jne 0x16e38
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x16cc0
movl $0x0, -0x4(%rbp)
jmp 0x17083
jmp 0x16e3a
callq 0xe6f0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x14140
movq -0x20(%rbp), %rdi
callq 0xb550
cmpl $0x0, %eax
je 0x16e63
movq -0x20(%rbp), %rdi
callq 0x17090
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x2484a(%rip), %rsi     # 0x3b6bc
callq 0xdfa0
movq -0x20(%rbp), %rdi
movl -0x8(%rbp), %ecx
leaq 0x23e8f(%rip), %rdx     # 0x3ad14
leaq 0x25496(%rip), %rax     # 0x3c322
cmpl $0x1, %ecx
cmoveq %rax, %rdx
leaq 0x240e3(%rip), %rsi     # 0x3af7d
callq 0xdfa0
movq -0x20(%rbp), %rdi
leaq 0x2481d(%rip), %rsi     # 0x3b6c7
leaq 0x23e63(%rip), %rdx     # 0x3ad14
callq 0xdfa0
movq -0x20(%rbp), %rdi
callq 0x6730
movl %eax, -0x14(%rbp)
cmpl $0x1, -0x8(%rbp)
jne 0x16f0e
cmpl $0x1, -0x14(%rbp)
jne 0x16ed7
movq -0x20(%rbp), %rdi
callq 0x17090
cmpl $0x6, -0x14(%rbp)
je 0x16f09
movq -0x20(%rbp), %rdi
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x170e0
xorl %edi, %edi
callq 0x6120
cmpl $0x0, %eax
jne 0x16efd
jmp 0x1700c
movq -0x20(%rbp), %rdi
callq 0x16a60
movl %eax, -0x14(%rbp)
jmp 0x17048
cmpl $0x2, -0x8(%rbp)
jle 0x16fa9
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x247ae(%rip), %rsi     # 0x3b6d5
callq 0x6300
cmpl $0x0, %eax
jne 0x16fa9
movq -0x20(%rbp), %rdi
movl -0x8(%rbp), %esi
subl $0x3, %esi
movq -0x10(%rbp), %rdx
addq $0x18, %rdx
callq 0x170e0
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x13830
movl %eax, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
je 0x16fa4
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x89b0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
movq 0x30ff3(%rip), %rax     # 0x47f78
movq (%rax), %rcx
movl $0x1, %edx
callq 0x64a0
cmpq $0x0, %rax
jne 0x16f9a
jmp 0x16f9a
movl $0xa, %edi
callq 0x6050
jmp 0x17037
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7990
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0x246ec(%rip), %rsi     # 0x3b6c1
callq 0xdec0
movq -0x20(%rbp), %rdi
movl -0x8(%rbp), %esi
subl $0x2, %esi
movq -0x10(%rbp), %rdx
addq $0x10, %rdx
callq 0x170e0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x25270(%rip), %rsi     # 0x3c270
callq 0x6300
cmpl $0x0, %eax
jne 0x17021
jmp 0x1700c
movq -0x20(%rbp), %rdi
leaq 0x246c1(%rip), %rsi     # 0x3b6d8
callq 0x13830
movl %eax, -0x14(%rbp)
jmp 0x17035
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x13930
movl %eax, -0x14(%rbp)
jmp 0x17037
cmpl $0x1, -0x14(%rbp)
jne 0x17046
movq -0x20(%rbp), %rdi
callq 0x17090
jmp 0x17048
cmpl $0x6, -0x14(%rbp)
jne 0x1705c
movq -0x20(%rbp), %rdi
callq 0xf620
movl %eax, -0x14(%rbp)
jmp 0x17074
cmpl $0x1, -0x14(%rbp)
jne 0x1706b
movl $0x1, -0x14(%rbp)
jmp 0x17072
movl $0x0, -0x14(%rbp)
jmp 0x17074
movq -0x20(%rbp), %rdi
callq 0xeca0
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)