// File: /workspace/github_c_makefile_star2_O3/msteveb[P]autosetup/./jimsh0.c
// Function: JimMakeErrorCode
static Jim_Obj *JimMakeErrorCode(Jim_Interp *interp, long pid, int waitStatus, Jim_Obj *errStrObj)
{
    Jim_Obj *errorCode = Jim_NewListObj(interp, NULL, 0);

    if (pid <= 0) {
        Jim_ListAppendElement(interp, errorCode, Jim_NewStringObj(interp, "NONE", -1));
        Jim_ListAppendElement(interp, errorCode, Jim_NewIntObj(interp, pid));
        Jim_ListAppendElement(interp, errorCode, Jim_NewIntObj(interp, -1));
    }
    else if (WIFEXITED(waitStatus)) {
        Jim_ListAppendElement(interp, errorCode, Jim_NewStringObj(interp, "CHILDSTATUS", -1));
        Jim_ListAppendElement(interp, errorCode, Jim_NewIntObj(interp, pid));
        Jim_ListAppendElement(interp, errorCode, Jim_NewIntObj(interp, WEXITSTATUS(waitStatus)));
    }
    else {
        const char *type;
        const char *action;
        const char *signame;

        if (WIFSIGNALED(waitStatus)) {
            type = "CHILDKILLED";
            action = "killed";
            signame = Jim_SignalId(WTERMSIG(waitStatus));
        }
        else {
            type = "CHILDSUSP";
            action = "suspended";
            signame = "none";
        }

        Jim_ListAppendElement(interp, errorCode, Jim_NewStringObj(interp, type, -1));

        if (errStrObj) {
            Jim_AppendStrings(interp, errStrObj, "child ", action, " by signal ", Jim_SignalId(WTERMSIG(waitStatus)), "\n", NULL);
        }

        Jim_ListAppendElement(interp, errorCode, Jim_NewIntObj(interp, pid));
        Jim_ListAppendElement(interp, errorCode, Jim_NewStringObj(interp, signame, -1));
    }
    return errorCode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r12
movl %edx, %r13d
movq %rsi, %r15
movq %rdi, %r14
callq 0xae38
movq %rax, %rbx
leaq 0x1e66e(%rip), %rax     # 0x35368
movq %rax, 0x8(%rbx)
movq $0x0, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
testq %r15, %r15
jle 0x16d65
movl %r13d, %ecx
andl $0x7f, %ecx
je 0x16dce
movl %ecx, %eax
shll $0x18, %eax
addl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x2000000, %eax        # imm = 0x2000000
movl %ecx, -0x3c(%rbp)
jl 0x16e43
leaq 0x14c7a(%rip), %rax     # 0x2b9b6
leaq 0x14c67(%rip), %r13     # 0x2b9aa
cmpl $0x2, %ecx
movq %rax, -0x30(%rbp)
je 0x16e62
cmpl $0xd, %ecx
jne 0x16e6f
leaq 0x14575(%rip), %rax     # 0x2b2d5
jmp 0x16e69
leaq 0x14c2d(%rip), %rsi     # 0x2b999
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7683
movq %r14, %rdi
callq 0xae38
leaq 0x1e55a(%rip), %r12     # 0x352f0
movq %r12, 0x8(%rax)
xorl %r13d, %r13d
movq %r13, (%rax)
movq %r15, 0x18(%rax)
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7683
movq %r14, %rdi
callq 0xae38
movq %r12, 0x8(%rax)
movq %r13, (%rax)
movq $-0x1, 0x18(%rax)
jmp 0x16f5a
leaq 0x14bc9(%rip), %rsi     # 0x2b99e
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7683
movq %r14, %rdi
callq 0xae38
leaq 0x1e4f1(%rip), %rcx     # 0x352f0
movq %rcx, 0x8(%rax)
xorl %r12d, %r12d
movq %r12, (%rax)
movq %r15, 0x18(%rax)
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7683
movl %r13d, %eax
movzbl %ah, %eax
movq %rax, %r15
movq %r14, %rdi
callq 0xae38
leaq 0x1e4bd(%rip), %rcx     # 0x352f0
movq %rcx, 0x8(%rax)
movq %r12, (%rax)
movq %r15, 0x18(%rax)
jmp 0x16f5a
leaq 0x146d3(%rip), %rax     # 0x2b51d
movq %rax, -0x38(%rbp)
leaq 0x14b72(%rip), %rax     # 0x2b9c7
movq %rax, -0x30(%rbp)
leaq 0x14b5d(%rip), %r13     # 0x2b9bd
jmp 0x16e8d
leaq 0x14465(%rip), %rax     # 0x2b2ce
movq %rax, -0x38(%rbp)
jmp 0x16e8d
leaq 0x20423(%rip), %rdi     # 0x37299
leaq 0x16270(%rip), %rdx     # 0x2d0ed
movl $0xa, %esi
movq %rdi, -0x38(%rbp)
xorl %eax, %eax
callq 0x61e0
movq %r14, %rdi
movq %r13, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7683
testq %r12, %r12
je 0x16f1d
movl -0x3c(%rbp), %ecx
cmpl $0x2, %ecx
je 0x16ec6
cmpl $0xd, %ecx
jne 0x16ecf
leaq 0x14411(%rip), %r13     # 0x2b2d5
jmp 0x16eec
leaq 0x14401(%rip), %r13     # 0x2b2ce
jmp 0x16eec
leaq 0x203c3(%rip), %r13     # 0x37299
leaq 0x16210(%rip), %rdx     # 0x2d0ed
movl $0xa, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x61e0
movq -0x30(%rbp), %rcx
leaq 0x14a8c(%rip), %r10     # 0x2b983
leaq 0x14ad3(%rip), %rdx     # 0x2b9d1
leaq 0x14ad3(%rip), %r8      # 0x2b9d8
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %r9
xorl %eax, %eax
pushq $0x0
pushq %r10
callq 0xafd1
addq $0x10, %rsp
movq %r14, %rdi
callq 0xae38
leaq 0x1e3c4(%rip), %rcx     # 0x352f0
movq %rcx, 0x8(%rax)
movq $0x0, (%rax)
movq %r15, 0x18(%rax)
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7683
movq %r14, %rdi
movq -0x38(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7683
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq