#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ printf(char *, ...);
int pipeline(int argc, char *argv[]) {
  FILE *logfp;
  FILE *outfp;
  char filestring[50000];
  char *pfilestring;
  char *pfilestring2;
  char *end_str;
  long i;
  int j;
  int k;
  int n;
  int return_status;
  char monitorfile[] = "/smoke/dvanbooven/running/vcf_merge/current";
  j = -1;
  printf("within our pipeline file\n");
  logfp = fopen(monitorfile, "a");
  fprintf(logfp, "hello world\n");
  fclose(logfp);
  printf("Return status from working function:\t%d\n", return_status);
  return 0;
}


x86 assembly (clang, -O0):
<pipeline>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc3d0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xc3d0(%rbp),%rdi
lea    0xe90(%rip),%rsi
mov    $0x2c,%edx
call   1060 <memcpy@plt>
movl   $0xffffffff,-0xc394(%rbp)
ff ff ff
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xc3d0(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0xc3a0(%rbp),%esi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xc3d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipeline>:
push   %rbx
sub    $0x30,%rsp
movups 0xec0(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xea8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe8c(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xea1(%rip),%rsi
mov    %rsp,%rdi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xe91(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1070 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xe7d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.pipeline.monitorfile = [44 x i8] c"/smoke/dvanbooven/running/vcf_merge/current\00"
@.str = [26 x i8] c"within our pipeline file\0A\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [13 x i8] c"hello world\0A\00"
@.str.3 = [41 x i8] c"Return status from working function:\09%d\0A\00"
define i32 @pipeline(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca [50000 x i8]
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca [44 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%17 = bitcast [44 x i8]* %16 to i8*
store i32 -1, i32* %12
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%19 = getelementptr inbounds [44 x i8], [44 x i8]* %16, i64 0, i64 0
%20 = call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %20, i32** %5
%21 = load i32*, i32** %5
%22 = call i32 @fprintf(i32* %21, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%23 = load i32*, i32** %5
%24 = call i32 @fclose(i32* %23)
%25 = load i32, i32* %15
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %25)
ret i32 0
}

LLVM IR (-O2):
@__const.pipeline.monitorfile = [44 x i8] c"/smoke/dvanbooven/running/vcf_merge/current\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [13 x i8] c"hello world\0A\00"
@.str.3 = [41 x i8] c"Return status from working function:\09%d\0A\00"
@str = [25 x i8] c"within our pipeline file\00"
define i32 @pipeline(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [44 x i8]
%4 = getelementptr inbounds [44 x i8], [44 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%6 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 12, i64 1, i32* %6)
%8 = tail call i32 @fclose(i32* %6)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 undef)
ret i32 0
}