#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct plProc {
  int dummy;
};
struct pipeline {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ plProcExecChild(struct plProc *, int, int, int);
int /*<<< orphan*/ plProcMemWrite(struct plProc *, int, int, void *, size_t);
void execProcChild(struct pipeline *pl, struct plProc *proc, int procStdinFd,
                   int procStdoutFd, int stderrFd, void *otherEndBuf,
                   size_t otherEndBufSize) {
  if (otherEndBuf != NULL)
    plProcMemWrite(proc, procStdoutFd, stderrFd, otherEndBuf, otherEndBufSize);
  else
    plProcExecChild(proc, procStdinFd, procStdoutFd, stderrFd);
}


x86 assembly (clang, -O0):
<execProcChild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1169 <execProcChild+0x49>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    0x10(%rbp),%r8
call   1040 <plProcMemWrite@plt>
jmp    117b <execProcChild+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1030 <plProcExecChild@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execProcChild>:
mov    %rsi,%rdi
test   %r9,%r9
je     113d <execProcChild+0x1d>
mov    0x8(%rsp),%rax
mov    %ecx,%esi
mov    %r8d,%edx
mov    %r9,%rcx
mov    %rax,%r8
jmp    1040 <plProcMemWrite@plt>
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
jmp    1030 <plProcExecChild@plt>

LLVM IR (-O0):
%struct.pipeline = type { i32 }
%struct.plProc = type { i32 }
define void @execProcChild(%struct.pipeline* %0, %struct.plProc* %1, i32 %2, i32 %3, i32 %4, i8* %5, i64 %6) {
%8 = alloca %struct.pipeline*
%9 = alloca %struct.plProc*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i64
store %struct.pipeline* %0, %struct.pipeline** %8
store %struct.plProc* %1, %struct.plProc** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store i64 %6, i64* %14
%15 = load i8*, i8** %13
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %24
17: ; preds = %7
%18 = load %struct.plProc*, %struct.plProc** %9
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = load i8*, i8** %13
%22 = load i64, i64* %14
%23 = call i32 @plProcMemWrite(%struct.plProc* %18, i32 %19, i32 %20, i8* %21, i64 %22)
br label %30
24: ; preds = %7
%25 = load %struct.plProc*, %struct.plProc** %9
%26 = load i32, i32* %10
%27 = load i32, i32* %11
%28 = load i32, i32* %12
%29 = call i32 @plProcExecChild(%struct.plProc* %25, i32 %26, i32 %27, i32 %28)
br label %30
30: ; preds = %24, %17
ret void
}

LLVM IR (-O2):
%struct.pipeline = type { i32 }
%struct.plProc = type { i32 }
define void @execProcChild(%struct.pipeline* nocapture readnone %0, %struct.plProc* %1, i32 %2, i32 %3, i32 %4, i8* %5, i64 %6) {
%8 = icmp eq i8* %5, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @plProcMemWrite(%struct.plProc* %1, i32 %3, i32 %4, i8* %5, i64 %6)
br label %13
11: ; preds = %7
%12 = tail call i32 @plProcExecChild(%struct.plProc* %1, i32 %2, i32 %3, i32 %4)
br label %13
13: ; preds = %11, %9
ret void
}