// File: /workspace/github_c_makefile_star2_O3/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_ExecCmd
static int Jim_ExecCmd(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
    int outputId;
    int errorId;
    phandle_t *pidPtr;
    int numPids, result;
    int child_siginfo = 1;
    Jim_Obj *childErrObj;
    Jim_Obj *errStrObj;
    struct WaitInfoTable *table = Jim_CmdPrivData(interp);

    if (argc > 1 && Jim_CompareStringImmediate(interp, argv[argc - 1], "&")) {
        Jim_Obj *listObj;
        int i;

        argc--;
        numPids = JimCreatePipeline(interp, argc - 1, argv + 1, &pidPtr, NULL, NULL, NULL);
        if (numPids < 0) {
            return JIM_ERR;
        }

        listObj = Jim_NewListObj(interp, NULL, 0);
        for (i = 0; i < numPids; i++) {
            Jim_ListAppendElement(interp, listObj, Jim_NewIntObj(interp, JimProcessPid(pidPtr[i])));
        }
        Jim_SetResult(interp, listObj);
        JimDetachPids(table, numPids, pidPtr);
        Jim_Free(pidPtr);
        return JIM_OK;
    }

    numPids =
        JimCreatePipeline(interp, argc - 1, argv + 1, &pidPtr, NULL, &outputId, &errorId);

    if (numPids < 0) {
        return JIM_ERR;
    }

    result = JIM_OK;

    errStrObj = Jim_NewStringObj(interp, "", 0);


    if (outputId != -1) {
        if (JimAppendStreamToString(interp, outputId, errStrObj) < 0) {
            result = JIM_ERR;
            Jim_SetResultErrno(interp, "error reading from output pipe");
        }
    }


    childErrObj = Jim_NewStringObj(interp, "", 0);
    Jim_IncrRefCount(childErrObj);

    if (JimCleanupChildren(interp, numPids, pidPtr, childErrObj) != JIM_OK) {
        result = JIM_ERR;
    }

    if (errorId != -1) {
        int ret;
        Jim_Lseek(errorId, 0, SEEK_SET);
        ret = JimAppendStreamToString(interp, errorId, errStrObj);
        if (ret < 0) {
            Jim_SetResultErrno(interp, "error reading from error pipe");
            result = JIM_ERR;
        }
        else if (ret > 0) {

            child_siginfo = 0;
        }
    }

    if (child_siginfo) {

        Jim_AppendObj(interp, errStrObj, childErrObj);
    }
    Jim_DecrRefCount(interp, childErrObj);


    Jim_RemoveTrailingNewline(errStrObj);


    Jim_SetResult(interp, errStrObj);

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %r13
cmpl $0x2, %esi
jl 0x9f21
movq 0x1b8(%r13), %rbx
movl %r15d, %eax
movq -0x8(%r14,%rax,8), %rsi
leaq 0x220b6(%rip), %rdx     # 0x2be98
movq %r13, %rdi
callq 0x73c6
testl %eax, %eax
je 0x9f21
addl $-0x2, %r15d
addq $0x8, %r14
leaq -0x50(%rbp), %rcx
movq %r13, %rdi
movl %r15d, %esi
movq %r14, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x15d31
testl %eax, %eax
js 0xa054
movl %eax, %r14d
movq %rbx, -0x48(%rbp)
movq %r13, %rdi
callq 0xae38
movq %rax, %r12
leaq 0x2b535(%rip), %rax     # 0x35368
movq %rax, 0x8(%r12)
movq $0x0, (%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r12)
movl %r14d, %ebx
movl %r14d, -0x40(%rbp)
testl %r14d, %r14d
je 0x9ea2
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
xorl %r14d, %r14d
movq %r12, %r15
movq -0x30(%rbp), %rax
movslq (%rax,%r14,4), %r12
movq %r13, %rdi
callq 0xae38
leaq 0x2b476(%rip), %rcx     # 0x352f0
movq %rcx, 0x8(%rax)
movq $0x0, (%rax)
movq %r12, 0x18(%rax)
movq %r15, %r12
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x7683
incq %r14
cmpq %r14, %rbx
jne 0x9e60
incl 0x10(%r12)
movq (%r13), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x9ec1
movq %r13, %rdi
callq 0x758c
movq %r12, (%r13)
movq -0x50(%rbp), %rdi
cmpl $0x0, -0x40(%rbp)
movq -0x48(%rbp), %r10
je 0x9f11
movl 0xc(%r10), %eax
movq %rax, %rcx
shlq $0x2, %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
testl %eax, %eax
jle 0x9f09
movl (%rdi,%rdx,4), %r8d
movq (%r10), %rsi
xorl %r9d, %r9d
cmpl (%rsi,%r9), %r8d
je 0x9f03
addq $0xc, %r9
cmpq %r9, %rcx
jne 0x9ef2
jmp 0x9f09
orb $0x2, 0x8(%rsi,%r9)
incq %rdx
cmpq %rbx, %rdx
jne 0x9ee4
xorl %r12d, %r12d
xorl %esi, %esi
callq *0x2d36c(%rip)          # 0x37288
jmp 0xa12d
decl %r15d
addq $0x8, %r14
leaq -0x50(%rbp), %rcx
leaq -0x54(%rbp), %r8
leaq -0x34(%rbp), %r9
movq %r13, %rdi
movl %r15d, %esi
movq %r14, %rdx
callq 0x15d31
testl %eax, %eax
js 0xa054
movl %eax, %r14d
movq %r13, %rdi
callq 0xae38
movq %rax, %r15
leaq 0x2d339(%rip), %rbx     # 0x37298
movq %rbx, (%rax)
movl $0x0, 0x14(%rax)
movq $0x0, 0x8(%rax)
movl -0x54(%rbp), %esi
cmpl $-0x1, %esi
je 0x9f84
movq %r13, %rdi
movq %r15, %rdx
callq 0x16b72
movq %r13, %rdi
callq 0xae38
movq %rbx, (%rax)
movl $0x0, 0x14(%rax)
movq $0x0, 0x8(%rax)
movq %rax, -0x48(%rbp)
incl 0x10(%rax)
movq -0x50(%rbp), %r12
testl %r14d, %r14d
je 0xa080
movq %r15, -0x60(%rbp)
movq %r13, -0x40(%rbp)
movq 0x1b8(%r13), %r13
movl %r14d, %r15d
xorl %ebx, %ebx
movl $0x0, -0x30(%rbp)
movl $0x0, -0x38(%rbp)
movl (%r12,%rbx,4), %r14d
movq %r13, %rdi
movl %r14d, %esi
callq 0x16c79
testl %eax, %eax
je 0x9ff1
incq %rbx
cmpq %rbx, %r15
jne 0x9fcd
jmp 0xa05f
movl %r14d, %edi
leaq -0x38(%rbp), %rsi
xorl %edx, %edx
callq 0x6420
testl %eax, %eax
jle 0x9fe7
movl -0x38(%rbp), %edx
testl $0xff7f, %edx           # imm = 0xFF7F
je 0x9fe7
movslq %eax, %rsi
movq -0x40(%rbp), %r14
movq %r14, %rdi
movq -0x48(%rbp), %rcx
callq 0x16cce
movq 0x58(%r14), %rcx
movq %rcx, -0x30(%rbp)
movq 0x60(%r14), %rcx
movq %rcx, 0x58(%r14)
movq %r14, %rdi
leaq 0x21954(%rip), %rsi     # 0x2b98f
movq %rax, %rdx
callq 0xc425
movq -0x30(%rbp), %rax
movq %rax, 0x58(%r14)
movl $0x1, -0x30(%rbp)
jmp 0x9fe7
movl $0x1, %r12d
jmp 0xa12d
movq %r12, %rdi
xorl %esi, %esi
callq *0x2d21e(%rip)          # 0x37288
movl $0x1, %r12d
cmpl $0x0, -0x30(%rbp)
movq -0x40(%rbp), %r13
movq -0x60(%rbp), %r15
jne 0xa08e
jmp 0xa08b
movq %r12, %rdi
xorl %esi, %esi
callq *0x2d1fd(%rip)          # 0x37288
xorl %r12d, %r12d
movl -0x34(%rbp), %edi
cmpl $-0x1, %edi
movq -0x48(%rbp), %rbx
je 0xa0b5
xorl %esi, %esi
xorl %edx, %edx
callq 0x64a0
movl -0x34(%rbp), %esi
movq %r13, %rdi
movq %r15, %rdx
callq 0x16b72
testl %eax, %eax
jne 0xa0c3
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xaf90
movl 0x10(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rbx)
cmpl $0x1, %eax
jg 0xa0dc
movq %r13, %rdi
movq %rbx, %rsi
callq 0x758c
movq (%r15), %rax
testq %rax, %rax
jne 0xa0f1
movq 0x8(%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movq (%r15), %rax
movslq 0x14(%r15), %rcx
testq %rcx, %rcx
jle 0xa10b
cmpb $0xa, -0x1(%rax,%rcx)
jne 0xa10b
decl %ecx
movl %ecx, 0x14(%r15)
movb $0x0, (%rax,%rcx)
incl 0x10(%r15)
movq (%r13), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0xa129
movq %r13, %rdi
callq 0x758c
movq %r15, (%r13)
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq