// File: /workspace/github_c_makefile_star2_O1/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 0xae58
movq %rax, %rbx
leaq 0x1f149(%rip), %rax     # 0x36358
movq %rax, 0x8(%rbx)
movq $0x0, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
testq %r15, %r15
jle 0x1727a
movl %r13d, %ecx
andl $0x7f, %ecx
je 0x172e3
movl %ecx, %eax
shll $0x18, %eax
addl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x2000000, %eax        # imm = 0x2000000
movl %ecx, -0x3c(%rbp)
jl 0x17358
leaq 0x157c3(%rip), %rax     # 0x2ca14
leaq 0x157b0(%rip), %r13     # 0x2ca08
cmpl $0x2, %ecx
movq %rax, -0x30(%rbp)
je 0x17377
cmpl $0xd, %ecx
jne 0x17384
leaq 0x150b8(%rip), %rax     # 0x2c32d
jmp 0x1737e
leaq 0x15776(%rip), %rsi     # 0x2c9f7
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7695
movq %r14, %rdi
callq 0xae58
leaq 0x1f035(%rip), %r12     # 0x362e0
movq %r12, 0x8(%rax)
xorl %r13d, %r13d
movq %r13, (%rax)
movq %r15, 0x18(%rax)
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7695
movq %r14, %rdi
callq 0xae58
movq %r12, 0x8(%rax)
movq %r13, (%rax)
movq $-0x1, 0x18(%rax)
jmp 0x1746f
leaq 0x15712(%rip), %rsi     # 0x2c9fc
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7695
movq %r14, %rdi
callq 0xae58
leaq 0x1efcc(%rip), %rcx     # 0x362e0
movq %rcx, 0x8(%rax)
xorl %r12d, %r12d
movq %r12, (%rax)
movq %r15, 0x18(%rax)
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7695
movl %r13d, %eax
movzbl %ah, %eax
movq %rax, %r15
movq %r14, %rdi
callq 0xae58
leaq 0x1ef98(%rip), %rcx     # 0x362e0
movq %rcx, 0x8(%rax)
movq %r12, (%rax)
movq %r15, 0x18(%rax)
jmp 0x1746f
leaq 0x15219(%rip), %rax     # 0x2c578
movq %rax, -0x38(%rbp)
leaq 0x156bb(%rip), %rax     # 0x2ca25
movq %rax, -0x30(%rbp)
leaq 0x156a6(%rip), %r13     # 0x2ca1b
jmp 0x173a2
leaq 0x14fa8(%rip), %rax     # 0x2c326
movq %rax, -0x38(%rbp)
jmp 0x173a2
leaq 0x20f0e(%rip), %rdi     # 0x38299
leaq 0x16dbd(%rip), %rdx     # 0x2e14f
movl $0xa, %esi
movq %rdi, -0x38(%rbp)
xorl %eax, %eax
callq 0x61e0
movq %r14, %rdi
movq %r13, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7695
testq %r12, %r12
je 0x17432
movl -0x3c(%rbp), %ecx
cmpl $0x2, %ecx
je 0x173db
cmpl $0xd, %ecx
jne 0x173e4
leaq 0x14f54(%rip), %r13     # 0x2c32d
jmp 0x17401
leaq 0x14f44(%rip), %r13     # 0x2c326
jmp 0x17401
leaq 0x20eae(%rip), %r13     # 0x38299
leaq 0x16d5d(%rip), %rdx     # 0x2e14f
movl $0xa, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x61e0
movq -0x30(%rbp), %rcx
leaq 0x155d5(%rip), %r10     # 0x2c9e1
leaq 0x1561c(%rip), %rdx     # 0x2ca2f
leaq 0x1561c(%rip), %r8      # 0x2ca36
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %r9
xorl %eax, %eax
pushq $0x0
pushq %r10
callq 0xafef
addq $0x10, %rsp
movq %r14, %rdi
callq 0xae58
leaq 0x1ee9f(%rip), %rcx     # 0x362e0
movq %rcx, 0x8(%rax)
movq $0x0, (%rax)
movq %r15, 0x18(%rax)
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7695
movq %r14, %rdi
movq -0x38(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7695
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq