// File: /workspace/github_c_makefile_star2_O0/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
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x1, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movq 0x1b8(%rax), %rax
movq %rax, -0x58(%rbp)
cmpl $0x1, -0x14(%rbp)
jle 0xafbb
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x313d8(%rip), %rdx     # 0x3c25a
callq 0x77a0
cmpl $0x0, %eax
je 0xafbb
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl $0x1, %esi
movq -0x20(%rbp), %rdx
addq $0x8, %rdx
leaq -0x30(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
movq $0x0, (%rsp)
callq 0x1aac0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0xaed9
movl $0x1, -0x4(%rbp)
jmp 0xb171
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x7b50
movq %rax, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xaf47
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movslq -0x64(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
callq 0x8d60
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq %rax, %rdx
callq 0x7bd0
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0xaef3
jmp 0xaf49
movq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0xaf83
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x70(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x58(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x30(%rbp), %rdx
callq 0x1baa0
movq 0x3d2eb(%rip), %rax     # 0x48290
movq -0x30(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
movl $0x0, -0x4(%rbp)
jmp 0xb171
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
subl $0x1, %esi
movq -0x20(%rbp), %rdx
addq $0x8, %rdx
leaq -0x30(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
leaq -0x24(%rbp), %r9
leaq -0x28(%rbp), %rax
movq %rax, (%rsp)
callq 0x1aac0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0xaffc
movl $0x1, -0x4(%rbp)
jmp 0xb171
movl $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x329a4(%rip), %rsi     # 0x3d9b2
xorl %edx, %edx
callq 0x7990
movq %rax, -0x50(%rbp)
cmpl $-0x1, -0x24(%rbp)
je 0xb04d
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x50(%rbp), %rdx
callq 0x1bb30
cmpl $0x0, %eax
jge 0xb04b
movl $0x1, -0x38(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x30b64(%rip), %rsi     # 0x3bbaa
callq 0x16620
jmp 0xb04d
movq -0x10(%rbp), %rdi
leaq 0x3295a(%rip), %rsi     # 0x3d9b2
xorl %edx, %edx
callq 0x7990
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x30(%rbp), %rdx
movq -0x48(%rbp), %rcx
callq 0x1bbc0
cmpl $0x0, %eax
je 0xb090
movl $0x1, -0x38(%rbp)
cmpl $-0x1, -0x28(%rbp)
je 0xb0e7
movl -0x28(%rbp), %edi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x64b0
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %esi
movq -0x50(%rbp), %rdx
callq 0x1bb30
movl %eax, -0x74(%rbp)
cmpl $0x0, -0x74(%rbp)
jge 0xb0d6
movq -0x10(%rbp), %rdi
leaq 0x30b01(%rip), %rsi     # 0x3bbc9
callq 0x16620
movl $0x1, -0x38(%rbp)
jmp 0xb0e5
cmpl $0x0, -0x74(%rbp)
jle 0xb0e3
movl $0x0, -0x3c(%rbp)
jmp 0xb0e5
jmp 0xb0e7
cmpl $0x0, -0x3c(%rbp)
je 0xb0fe
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0xc9e0
movq -0x48(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0xb11d
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x7a10
movq -0x50(%rbp), %rdi
callq 0x1bc70
movq -0x50(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0xb160
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x80(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl -0x38(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)