#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 dirent {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int check_file(char *);
int check_logs(char *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
char *strtok_r(char *, char *, char **);
int main(int argc, char *argv[]) {
  DIR *dir;
  struct dirent *ent;
  char *filename;
  char *filelist;
  char *status;
  char *working_dir;
  char *username;
  char *ptype;
  FILE *logp;
  FILE *filelistfp;
  FILE *jobptr;
  FILE *outptr;
  char *end_str;
  char description[100];
  char sample[50];
  char read1[1000];
  char read2[1000];
  char current_command[1000];
  char dir_trunk[1000];
  char filestring[50000];
  char current_directory[1000];
  char rmdup_job_file[1000];
  char snplist_job_file[1000];
  char sys_command[1000];
  char run_dir[1000];
  int i;
  int awkvar_started;
  int awkvar_finished;
  int snplist_started;
  int snplist_finished;
  int extract_started;
  int extract_finished;
  int merge_started;
  int merge_finished;
  int check_status;
  i = 0;
  filelistfp = fopen("/hihg/smoke/pipelines/vcf", "r");
  if (filelistfp == NULL) {
    printf("The current pipeline runs list could not be opened.  Exiting \n");
    return 2;
  }
  fgets(filestring, 50000, filelistfp);
  while (fgets(filestring, 50000, filelistfp) != NULL) {
    username = strtok_r(filestring, "\t\n", &end_str);
    ptype = strtok_r(NULL, "\t\n", &end_str);
    status = strtok_r(NULL, "\t\n", &end_str);
    filelist = strtok_r(NULL, "\t\n", &end_str);
    working_dir = strtok_r(NULL, "\t\n", &end_str);
    printf("status is %s\n", status);
    if (strcmp(status, "0") == 0) {
      printf("we have a 0 status running pipeline job\n");
      sprintf(current_directory, "%s/Variants/logs/.started", working_dir);
      awkvar_started = check_file(current_directory);
      sprintf(current_directory, "%s/Variants/logs/.finished", working_dir);
      awkvar_finished = check_file(current_directory);
      sprintf(current_directory, "%s/Positions/logs/.started", working_dir);
      snplist_started = check_file(current_directory);
      sprintf(current_directory, "%s/Positions/logs/.finished", working_dir);
      snplist_finished = check_file(current_directory);
      sprintf(current_directory, "%s/VCF_files/logs/.started", working_dir);
      extract_started = check_file(current_directory);
      sprintf(current_directory, "%s/VCF_files/logs/.finished", working_dir);
      extract_finished = check_file(current_directory);
      sprintf(current_directory, "%s/final/logs/.started", working_dir);
      merge_started = check_file(current_directory);
      sprintf(current_directory, "%s/final/logs/.finished", working_dir);
      merge_finished = check_file(current_directory);
      if (awkvar_started == 1 && awkvar_finished == 0) {
        check_status = check_logs(working_dir);
      }
    } else {
      printf("we have a finished pipeline run\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe810,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0xe7e4(%rbp)
lea    0xe56(%rip),%rdi
lea    0xe69(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    11df <main+0x5f>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1458 <main+0x2d8>
lea    -0xd430(%rbp),%rdi
mov    -0x60(%rbp),%rdx
mov    $0xc350,%esi
call   1060 <fgets@plt>
lea    -0xd430(%rbp),%rdi
mov    -0x60(%rbp),%rdx
mov    $0xc350,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     1451 <main+0x2d1>
lea    -0xd430(%rbp),%rdi
lea    0xe3a(%rip),%rsi
lea    -0x78(%rbp),%rdx
call   1050 <strtok_r@plt>
mov    %rax,-0x48(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe22(%rip),%rsi
lea    -0x78(%rbp),%rdx
call   1050 <strtok_r@plt>
mov    %rax,-0x50(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe0a(%rip),%rsi
lea    -0x78(%rbp),%rdx
call   1050 <strtok_r@plt>
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xdf2(%rip),%rsi
lea    -0x78(%rbp),%rdx
call   1050 <strtok_r@plt>
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xdda(%rip),%rsi
lea    -0x78(%rbp),%rdx
call   1050 <strtok_r@plt>
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rdi
lea    0xdc1(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    143e <main+0x2be>
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xd820(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xdbd(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0xd820(%rbp),%rdi
call   1080 <check_file@plt>
mov    %eax,-0xe7e8(%rbp)
lea    -0xd820(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xdae(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0xd820(%rbp),%rdi
call   1080 <check_file@plt>
mov    %eax,-0xe7ec(%rbp)
lea    -0xd820(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xda0(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0xd820(%rbp),%rdi
call   1080 <check_file@plt>
mov    %eax,-0xe7f0(%rbp)
lea    -0xd820(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xd92(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0xd820(%rbp),%rdi
call   1080 <check_file@plt>
mov    %eax,-0xe7f4(%rbp)
lea    -0xd820(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xd85(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0xd820(%rbp),%rdi
call   1080 <check_file@plt>
mov    %eax,-0xe7f8(%rbp)
lea    -0xd820(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xd77(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0xd820(%rbp),%rdi
call   1080 <check_file@plt>
mov    %eax,-0xe7fc(%rbp)
lea    -0xd820(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xd6a(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0xd820(%rbp),%rdi
call   1080 <check_file@plt>
mov    %eax,-0xe800(%rbp)
lea    -0xd820(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xd58(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0xd820(%rbp),%rdi
call   1080 <check_file@plt>
mov    %eax,-0xe804(%rbp)
cmpl   $0x1,-0xe7e8(%rbp)
jne    1439 <main+0x2b9>
cmpl   $0x0,-0xe7ec(%rbp)
jne    1439 <main+0x2b9>
mov    -0x40(%rbp),%rdi
call   1030 <check_logs@plt>
mov    %eax,-0xe808(%rbp)
jmp    144c <main+0x2cc>
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11f4 <main+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xe810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc758,%rsp
lea    0xe58(%rip),%rdi
lea    0xe6b(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     13c5 <main+0x235>
mov    %rax,%r15
lea    0x400(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xc350,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
mov    $0xc350,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     13c1 <main+0x231>
lea    0xe24(%rip),%r12
lea    0x400(%rsp),%rbx
lea    0x8(%rsp),%r14
lea    0x10(%rsp),%r13
jmp    123d <main+0xad>
nopl   0x0(%rax)
lea    0xeea(%rip),%rdi
call   1040 <puts@plt>
lea    0x400(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xc350,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     13c1 <main+0x231>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1060 <strtok_r@plt>
xor    %edi,%edi
mov    %r12,%rsi
mov    %r14,%rdx
call   1060 <strtok_r@plt>
xor    %edi,%edi
mov    %r12,%rsi
mov    %r14,%rdx
call   1060 <strtok_r@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    %r12,%rsi
mov    %r14,%rdx
call   1060 <strtok_r@plt>
xor    %edi,%edi
mov    %r12,%rsi
mov    %r14,%rdx
call   1060 <strtok_r@plt>
mov    %rax,%rbp
lea    0xd93(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
lea    0xd8d(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    1210 <main+0x80>
lea    0xe6c(%rip),%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
lea    0xd6b(%rip),%rsi
mov    %rbp,%rdx
call   10b0 <sprintf@plt>
mov    %r13,%rdi
call   1090 <check_file@plt>
mov    %r15,%rbx
mov    %eax,%r15d
mov    %r13,%rdi
lea    0xd65(%rip),%rsi
mov    %rbp,%rdx
call   10b0 <sprintf@plt>
mov    %r13,%rdi
call   1090 <check_file@plt>
mov    %eax,0x4(%rsp)
mov    %r13,%rdi
lea    0xd62(%rip),%rsi
mov    %rbp,%rdx
call   10b0 <sprintf@plt>
mov    %r13,%rdi
call   1090 <check_file@plt>
mov    %r13,%rdi
lea    0xd63(%rip),%rsi
mov    %rbp,%rdx
call   10b0 <sprintf@plt>
mov    %r13,%rdi
call   1090 <check_file@plt>
mov    %r13,%rdi
lea    0xd65(%rip),%rsi
mov    %rbp,%rdx
call   10b0 <sprintf@plt>
mov    %r13,%rdi
call   1090 <check_file@plt>
mov    %r13,%rdi
lea    0xd66(%rip),%rsi
mov    %rbp,%rdx
call   10b0 <sprintf@plt>
mov    %r13,%rdi
call   1090 <check_file@plt>
mov    %r13,%rdi
lea    0xd68(%rip),%rsi
mov    %rbp,%rdx
call   10b0 <sprintf@plt>
mov    %r13,%rdi
call   1090 <check_file@plt>
mov    %r13,%rdi
lea    0xd65(%rip),%rsi
mov    %rbp,%rdx
call   10b0 <sprintf@plt>
mov    %r13,%rdi
call   1090 <check_file@plt>
cmp    $0x1,%r15d
mov    %rbx,%r15
lea    0x400(%rsp),%rbx
jne    1224 <main+0x94>
cmpl   $0x0,0x4(%rsp)
jne    1224 <main+0x94>
mov    %rbp,%rdi
call   1030 <check_logs@plt>
jmp    1224 <main+0x94>
xor    %eax,%eax
jmp    13d6 <main+0x246>
lea    0xd7d(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%eax
add    $0xc758,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [26 x i8] c"/hihg/smoke/pipelines/vcf\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [63 x i8] c"The current pipeline runs list could not be opened. Exiting \0A\00"
@.str.3 = [3 x i8] c"\09\0A\00"
@.str.4 = [14 x i8] c"status is %s\0A\00"
@.str.5 = [2 x i8] c"0\00"
@.str.6 = [41 x i8] c"we have a 0 status running pipeline job\0A\00"
@.str.7 = [26 x i8] c"%s/Variants/logs/.started\00"
@.str.8 = [27 x i8] c"%s/Variants/logs/.finished\00"
@.str.9 = [27 x i8] c"%s/Positions/logs/.started\00"
@.str.10 = [28 x i8] c"%s/Positions/logs/.finished\00"
@.str.11 = [27 x i8] c"%s/VCF_files/logs/.started\00"
@.str.12 = [28 x i8] c"%s/VCF_files/logs/.finished\00"
@.str.13 = [23 x i8] c"%s/final/logs/.started\00"
@.str.14 = [24 x i8] c"%s/final/logs/.finished\00"
@.str.15 = [33 x i8] c"we have a finished pipeline run\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca %struct.dirent*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i8*
%19 = alloca [100 x i8]
%20 = alloca [50 x i8]
%21 = alloca [1000 x i8]
%22 = alloca [1000 x i8]
%23 = alloca [1000 x i8]
%24 = alloca [1000 x i8]
%25 = alloca [50000 x i8]
%26 = alloca [1000 x i8]
%27 = alloca [1000 x i8]
%28 = alloca [1000 x i8]
%29 = alloca [1000 x i8]
%30 = alloca [1000 x i8]
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%37 = alloca i32
%38 = alloca i32
%39 = alloca i32
%40 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %31
%41 = call i32* @fopen(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %41, i32** %15
%42 = load i32*, i32** %15
%43 = icmp eq i32* %42, null
br i1 %43, label %44, label %46
44: ; preds = %2
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
store i32 2, i32* %3
br label %122
46: ; preds = %2
%47 = getelementptr inbounds [50000 x i8], [50000 x i8]* %25, i64 0, i64 0
%48 = load i32*, i32** %15
%49 = call i32* @fgets(i8* %47, i32 50000, i32* %48)
br label %50
50: ; preds = %120, %46
%51 = getelementptr inbounds [50000 x i8], [50000 x i8]* %25, i64 0, i64 0
%52 = load i32*, i32** %15
%53 = call i32* @fgets(i8* %51, i32 50000, i32* %52)
%54 = icmp ne i32* %53, null
br i1 %54, label %55, label %121
55: ; preds = %50
%56 = getelementptr inbounds [50000 x i8], [50000 x i8]* %25, i64 0, i64 0
%57 = call i8* @strtok_r(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %18)
store i8* %57, i8** %12
%58 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %18)
store i8* %58, i8** %13
%59 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %18)
store i8* %59, i8** %10
%60 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %18)
store i8* %60, i8** %9
%61 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %18)
store i8* %61, i8** %11
%62 = load i8*, i8** %10
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %62)
%64 = load i8*, i8** %10
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %118
67: ; preds = %55
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0))
%69 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%70 = load i8*, i8** %11
%71 = call i32 @sprintf(i8* %69, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %70)
%72 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%73 = call i32 @check_file(i8* %72)
store i32 %73, i32* %32
%74 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%75 = load i8*, i8** %11
%76 = call i32 @sprintf(i8* %74, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i8* %75)
%77 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%78 = call i32 @check_file(i8* %77)
store i32 %78, i32* %33
%79 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%80 = load i8*, i8** %11
%81 = call i32 @sprintf(i8* %79, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %80)
%82 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%83 = call i32 @check_file(i8* %82)
store i32 %83, i32* %34
%84 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%85 = load i8*, i8** %11
%86 = call i32 @sprintf(i8* %84, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i8* %85)
%87 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%88 = call i32 @check_file(i8* %87)
store i32 %88, i32* %35
%89 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%90 = load i8*, i8** %11
%91 = call i32 @sprintf(i8* %89, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i8* %90)
%92 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%93 = call i32 @check_file(i8* %92)
store i32 %93, i32* %36
%94 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%95 = load i8*, i8** %11
%96 = call i32 @sprintf(i8* %94, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0), i8* %95)
%97 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%98 = call i32 @check_file(i8* %97)
store i32 %98, i32* %37
%99 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%100 = load i8*, i8** %11
%101 = call i32 @sprintf(i8* %99, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), i8* %100)
%102 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%103 = call i32 @check_file(i8* %102)
store i32 %103, i32* %38
%104 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%105 = load i8*, i8** %11
%106 = call i32 @sprintf(i8* %104, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0), i8* %105)
%107 = getelementptr inbounds [1000 x i8], [1000 x i8]* %26, i64 0, i64 0
%108 = call i32 @check_file(i8* %107)
store i32 %108, i32* %39
%109 = load i32, i32* %32
%110 = icmp eq i32 %109, 1
br i1 %110, label %111, label %117
111: ; preds = %67
%112 = load i32, i32* %33
%113 = icmp eq i32 %112, 0
br i1 %113, label %114, label %117
114: ; preds = %111
%115 = load i8*, i8** %11
%116 = call i32 @check_logs(i8* %115)
store i32 %116, i32* %40
br label %117
117: ; preds = %114, %111, %67
br label %120
118: ; preds = %55
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.15, i64 0, i64 0))
br label %120
120: ; preds = %118, %117
br label %50
121: ; preds = %50
store i32 0, i32* %3
br label %122
122: ; preds = %121, %44
%123 = load i32, i32* %3
ret i32 %123
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [26 x i8] c"/hihg/smoke/pipelines/vcf\00"
@.str.1 = [2 x i8] c"r\00"
@.str.3 = [3 x i8] c"\09\0A\00"
@.str.4 = [14 x i8] c"status is %s\0A\00"
@.str.5 = [2 x i8] c"0\00"
@.str.7 = [26 x i8] c"%s/Variants/logs/.started\00"
@.str.8 = [27 x i8] c"%s/Variants/logs/.finished\00"
@.str.9 = [27 x i8] c"%s/Positions/logs/.started\00"
@.str.10 = [28 x i8] c"%s/Positions/logs/.finished\00"
@.str.11 = [27 x i8] c"%s/VCF_files/logs/.started\00"
@.str.12 = [28 x i8] c"%s/VCF_files/logs/.finished\00"
@.str.13 = [23 x i8] c"%s/final/logs/.started\00"
@.str.14 = [24 x i8] c"%s/final/logs/.finished\00"
@str = [32 x i8] c"we have a finished pipeline run\00"
@str.16 = [40 x i8] c"we have a 0 status running pipeline job\00"
@str.17 = [62 x i8] c"The current pipeline runs list could not be opened. Exiting \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8*
%4 = alloca [50000 x i8]
%5 = alloca [1000 x i8]
%6 = bitcast i8** %3 to i8*
%7 = getelementptr inbounds [50000 x i8], [50000 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.17, i64 0, i64 0))
br label %54
13: ; preds = %2
%14 = call i32* @fgets(i8* %7, i32 50000, i32* %9)
%15 = call i32* @fgets(i8* %7, i32 50000, i32* %9)
%16 = icmp eq i32* %15, null
br i1 %16, label %54, label %17
17: ; preds = %13, %51
%18 = call i8* @strtok_r(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %3)
%19 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %3)
%20 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %3)
%21 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %3)
%22 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %3)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %20)
%24 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %49
26: ; preds = %17
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.16, i64 0, i64 0))
%28 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %22)
%29 = call i32 @check_file(i8* %8)
%30 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i8* %22)
%31 = call i32 @check_file(i8* %8)
%32 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %22)
%33 = call i32 @check_file(i8* %8)
%34 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i8* %22)
%35 = call i32 @check_file(i8* %8)
%36 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i8* %22)
%37 = call i32 @check_file(i8* %8)
%38 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0), i8* %22)
%39 = call i32 @check_file(i8* %8)
%40 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), i8* %22)
%41 = call i32 @check_file(i8* %8)
%42 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0), i8* %22)
%43 = call i32 @check_file(i8* %8)
%44 = icmp eq i32 %29, 1
%45 = icmp eq i32 %31, 0
%46 = select i1 %44, i1 %45, i1 false
br i1 %46, label %47, label %51
47: ; preds = %26
%48 = call i32 @check_logs(i8* %22)
br label %51
49: ; preds = %17
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %51
51: ; preds = %26, %47, %49
%52 = call i32* @fgets(i8* %7, i32 50000, i32* %9)
%53 = icmp eq i32* %52, null
br i1 %53, label %54, label %17
54: ; preds = %51, %13, %11
%55 = phi i32 [ 2, %11 ], [ 0, %13 ], [ 0, %51 ]
ret i32 %55
}