#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 */

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int lace_compat_fd_spawnlp_wait(int, int, int, int /*<<< orphan*/ *,
                                char const *, char *, char *, char *, char *,
                                char *, char *, char *, char *, char *,
                                int /*<<< orphan*/ *);
void run_expectish_lace_tool_pipem_callback(int in_fd, int out_fd,
                                            const char *expectish_exe) {
  int istat;
  istat = lace_compat_fd_spawnlp_wait(
      in_fd, out_fd, 2, NULL, expectish_exe, "-", "SELECT", "*", "FROM",
      "TestCase", "WHERE", "TestCase.passing", "is", "TRUE;", NULL);
  assert(istat == 0);
}


x86 assembly (clang, -O0):
<run_expectish_lace_tool_pipem_callback>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %edi,-0x2c(%rbp)
mov    %esi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x38(%rbp),%r8
mov    $0x2,%edx
xor    %eax,%eax
mov    %eax,%ecx
lea    0xeab(%rip),%r9
lea    0xea6(%rip),%r13
lea    0xea6(%rip),%r12
lea    0xea1(%rip),%r15
lea    0xe9f(%rip),%r14
lea    0xea1(%rip),%rbx
lea    0xea0(%rip),%r11
lea    0xeaa(%rip),%r10
lea    0xea6(%rip),%rax
mov    %r13,(%rsp)
mov    %r12,0x8(%rsp)
mov    %r15,0x10(%rsp)
mov    %r14,0x18(%rsp)
mov    %rbx,0x20(%rsp)
mov    %r11,0x28(%rsp)
mov    %r10,0x30(%rsp)
mov    %rax,0x38(%rsp)
movq   $0x0,0x40(%rsp)
call   1030 <lace_compat_fd_spawnlp_wait@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_expectish_lace_tool_pipem_callback>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r8
sub    $0x8,%rsp
lea    0xefc(%rip),%rax
lea    0xef2(%rip),%r10
lea    0xeda(%rip),%r11
lea    0xecd(%rip),%rbx
lea    0xebd(%rip),%r14
lea    0xeb1(%rip),%r15
lea    0xea8(%rip),%r12
lea    0xe9a(%rip),%r13
lea    0xe91(%rip),%r9
mov    $0x2,%edx
xor    %ecx,%ecx
push   $0x0
push   %rax
push   %r10
push   %r11
push   %rbx
push   %r14
push   %r15
push   %r12
push   %r13
call   1030 <lace_compat_fd_spawnlp_wait@plt>
add    $0x50,%rsp
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [7 x i8] c"SELECT\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [5 x i8] c"FROM\00"
@.str.4 = [9 x i8] c"TestCase\00"
@.str.5 = [6 x i8] c"WHERE\00"
@.str.6 = [17 x i8] c"TestCase.passing\00"
@.str.7 = [3 x i8] c"is\00"
@.str.8 = [6 x i8] c"TRUE;\00"
define void @run_expectish_lace_tool_pipem_callback(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @lace_compat_fd_spawnlp_wait(i32 %8, i32 %9, i32 2, i32* null, i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32* null)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@.str.1 = [7 x i8] c"SELECT\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [5 x i8] c"FROM\00"
@.str.4 = [9 x i8] c"TestCase\00"
@.str.5 = [6 x i8] c"WHERE\00"
@.str.6 = [17 x i8] c"TestCase.passing\00"
@.str.7 = [3 x i8] c"is\00"
@.str.8 = [6 x i8] c"TRUE;\00"
define void @run_expectish_lace_tool_pipem_callback(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @lace_compat_fd_spawnlp_wait(i32 %0, i32 %1, i32 2, i32* null, i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32* null)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret void
}