#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
int system(char *);
void fifo_execute_process(char *spool_filename, char *process,
                          char *fifo_filename) {
  char sys_string[1024];
  int results;
  sprintf(sys_string, "cat %s | %s | fifowrite.e %s &", spool_filename, process,
          fifo_filename);
  results = system(sys_string);
  fprintf(stderr, "sleeping...\n");
  sleep(1);
}


x86 assembly (clang, -O0):
<fifo_execute_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe8f(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x420(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x424(%rbp)
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifo_execute_process>:
push   %rbx
sub    $0x400,%rsp
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xea8(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
add    $0x400,%rsp
pop    %rbx
jmp    1060 <sleep@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"cat %s | %s | fifowrite.e %s &\00"
@stderr = global i32 0
@.str.1 = [13 x i8] c"sleeping...\0A\00"
define void @fifo_execute_process(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i8* %12)
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%15 = call i32 @system(i8* %14)
store i32 %15, i32* %8
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"cat %s | %s | fifowrite.e %s &\00"
@stderr = global i32 0
@.str.1 = [13 x i8] c"sleeping...\0A\00"
define void @fifo_execute_process(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%7 = call i32 @system(i8* %5)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @sleep(i32 1)
ret void
}