// File: /workspace/github_c_makefile_star2_O3/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_EnvCoreCommand
static int Jim_EnvCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
    const char *key;
    const char *val;

    if (argc == 1) {
        char **e = Jim_GetEnviron();

        int i;
        Jim_Obj *listObjPtr = Jim_NewListObj(interp, NULL, 0);

        for (i = 0; e[i]; i++) {
            const char *equals = strchr(e[i], '=');

            if (equals) {
                Jim_ListAppendElement(interp, listObjPtr, Jim_NewStringObj(interp, e[i],
                        equals - e[i]));
                Jim_ListAppendElement(interp, listObjPtr, Jim_NewStringObj(interp, equals + 1, -1));
            }
        }

        Jim_SetResult(interp, listObjPtr);
        return JIM_OK;
    }

    if (argc > 3) {
        Jim_WrongNumArgs(interp, 1, argv, "varName ?default?");
        return JIM_ERR;
    }
    key = Jim_String(argv[1]);
    val = getenv(key);
    if (val == NULL) {
        if (argc < 3) {
            Jim_SetResultFormatted(interp, "environment variable \"%#s\" does not exist", argv[1]);
            return JIM_ERR;
        }
        val = Jim_String(argv[2]);
    }
    Jim_SetResult(interp, Jim_NewStringObj(interp, val, -1));
    return JIM_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x1, %esi
jne 0x21175
movq 0x15ee0(%rip), %rax     # 0x36fb8
movq (%rax), %r13
movq %rbx, %rdi
callq 0xae38
movq %rax, %r14
leaq 0x1427b(%rip), %rax     # 0x35368
movq %rax, 0x8(%r14)
movq $0x0, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r14)
movq (%r13), %r15
testq %r15, %r15
je 0x2116f
addq $0x8, %r13
movq %r15, %rdi
movl $0x3d, %esi
callq 0x61c0
testq %rax, %rax
je 0x21162
movq %rax, %r12
movl %r12d, %edx
subl %r15d, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7508
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x7683
incq %r12
movq %rbx, %rdi
movq %r12, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x7683
movq (%r13), %r15
addq $0x8, %r13
testq %r15, %r15
jne 0x2110d
incl 0x10(%r14)
jmp 0x211db
movq %rdx, %r14
movl %esi, %r15d
cmpl $0x4, %esi
jl 0x2119f
leaq 0xc1fa(%rip), %rcx      # 0x2d381
movl $0x1, %r15d
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x7446
jmp 0x211fa
movq 0x8(%r14), %r12
movq (%r12), %rdi
testq %rdi, %rdi
jne 0x211bb
movq 0x8(%r12), %rax
movq %r12, %rdi
callq *0x18(%rax)
movq (%r12), %rdi
callq 0x6030
testq %rax, %rax
je 0x2120c
movq %rbx, %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %rax, %r14
incl 0x10(%rax)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x211f4
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3, %r15d
jne 0x2122d
movq 0x10(%r14), %r14
movq (%r14), %rax
testq %rax, %rax
jne 0x211c5
movq 0x8(%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq (%r14), %rax
jmp 0x211c5
movq 0x8(%r14), %rdx
leaq 0xc15b(%rip), %rsi      # 0x2d393
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6923
movl $0x1, %r15d
jmp 0x211fa