#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 awkvar(char **);
int extract_variants(char **);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *,
                           char *);
int /*<<< orphan*/ getcwd(char *, int);
int merge_vcfs(char **);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int snplist_generation(char **);
int /*<<< orphan*/ sprintf(char *, char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
char *strrchr(char *, char);
int main(int argc, char *argv[]) {
  FILE *logfp;
  FILE *outfp;
  FILE *pfp;
  char filestring[50000];
  char *filelist;
  char cwd[255];
  char username[200];
  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";
  char sys_command[1000];
  char *stages[] = {"snplist", "extract",  "merge",   "complete",
                    "awkvar",  "pipeline", "awk_snp", "ext_mer"};
  j = -1;
  for (n = 0; n < 8; n++) {
    if (strcmp(argv[1], stages[n]) == 0) {
      j = n;
    }
  }
  if (j == -1) {
    printf("Function could not be determined.  Check and retry.\n");
    return 2;
  }
  switch (j) {
  case 0:
    printf("you want to start a new snplist run\n");
    return_status = snplist_generation(&argv[2]);
    break;
  case 1:
    printf("you want to start extracting a given list of snps from files\n");
    return_status = extract_variants(&argv[1]);
    break;
  case 2:
    printf("you want to start merging from a given group of zipped vcfs\n");
    return_status = merge_vcfs(&argv[1]);
    break;
  case 3:
    printf("you want to start a complete pipeline run\n");
    return_status = snplist_generation(&argv[1]);
    break;
  case 4:
    printf("you want to start a new snplist run\n");
    return_status = awkvar(&argv[2]);
    break;
  case 5:
    printf("you want to start a new pipeline run\n");
    filelist = strrchr(argv[2], '/');
    if (filelist == NULL) {
      getcwd(cwd, 255);
      sprintf(filestring, "%s/%s", cwd, argv[2]);
    } else {
      strcpy(filestring, argv[2]);
    }
    sprintf(sys_command, "whoami");
    pfp = popen("whoami", "r");
    fgets(username, 50000, pfp);
    username[strlen(username) - 1] = '\0';
    printf("username is %s\n", username);
    logfp = fopen(monitorfile, "a");
    fprintf(logfp, "%s\t1\t0\t%s\t%s\n", username, filestring, argv[3]);
    fclose(logfp);
    printf("now call the first stage of the pipeline which is awkvar\n");
    getcwd(cwd, 255);
    printf("current working directory is %s\n", cwd);
    break;
  case 6:
    printf("you want to start a snplist generation run\n");
    filelist = strrchr(argv[2], '/');
    if (filelist == NULL) {
      getcwd(cwd, 255);
      sprintf(filestring, "%s/%s", cwd, argv[2]);
    } else {
      strcpy(filestring, argv[2]);
    }
    sprintf(sys_command, "whoami");
    pfp = popen("whoami", "r");
    fgets(username, 50000, pfp);
    username[strlen(username) - 1] = '\0';
    printf("username is %s\n", username);
    logfp = fopen(monitorfile, "a");
    fprintf(logfp, "%s\t2\t0\t%s\t%s\n", username, filestring, argv[3]);
    fclose(logfp);
    printf("now call the first stage of the pipeline which is awkvar\n");
    getcwd(cwd, 255);
    printf("current working directory is %s\n", cwd);
    break;
  case 7:
    printf("you want to start a merge run\n");
    filelist = strrchr(argv[2], '/');
    if (filelist == NULL) {
      getcwd(cwd, 255);
      sprintf(filestring, "%s/%s", cwd, argv[2]);
    } else {
      strcpy(filestring, argv[2]);
    }
    sprintf(sys_command, "whoami");
    pfp = popen("whoami", "r");
    fgets(username, 50000, pfp);
    username[strlen(username) - 1] = '\0';
    printf("username is %s\n", username);
    logfp = fopen(monitorfile, "a");
    fprintf(logfp, "%s\t3\t0\t%s\t%s\n", username, filestring, argv[3]);
    fclose(logfp);
    printf("now call the first stage of the pipeline which is awkvar\n");
    getcwd(cwd, 255);
    printf("current working directory is %s\n", cwd);
    break;
  }
  printf("Return status from working function:\t%d\n", return_status);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xca00,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xc5c0(%rbp),%rdi
lea    0xde9(%rip),%rsi
mov    $0x2c,%edx
call   10e0 <memcpy@plt>
lea    -0xc9f0(%rbp),%rdi
lea    0x2b91(%rip),%rsi
mov    $0x40,%edx
call   10e0 <memcpy@plt>
movl   $0xffffffff,-0xc584(%rbp)
ff ff ff
movl   $0x0,-0xc58c(%rbp)
cmpl   $0x8,-0xc58c(%rbp)
jge    12c5 <main+0xb5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
movslq -0xc58c(%rbp),%rax
mov    -0xc9f0(%rbp,%rax,8),%rsi
ff
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
jne    12ac <main+0x9c>
mov    -0xc58c(%rbp),%eax
mov    %eax,-0xc584(%rbp)
jmp    12b1 <main+0xa1>
mov    -0xc58c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc58c(%rbp)
jmp    126d <main+0x5d>
cmpl   $0xffffffff,-0xc584(%rbp)
jne    12ec <main+0xdc>
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1841 <main+0x631>
mov    -0xc584(%rbp),%eax
mov    %rax,-0xc9f8(%rbp)
sub    $0x7,%rax
ja     1826 <main+0x616>
mov    -0xc9f8(%rbp),%rax
lea    0xcef(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
add    $0x10,%rdi
call   10f0 <snplist_generation@plt>
mov    %eax,-0xc590(%rbp)
jmp    1826 <main+0x616>
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   10b0 <extract_variants@plt>
mov    %eax,-0xc590(%rbp)
jmp    1826 <main+0x616>
lea    0xdb6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   1060 <merge_vcfs@plt>
mov    %eax,-0xc590(%rbp)
jmp    1826 <main+0x616>
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   10f0 <snplist_generation@plt>
mov    %eax,-0xc590(%rbp)
jmp    1826 <main+0x616>
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
add    $0x10,%rdi
call   1120 <awkvar@plt>
mov    %eax,-0xc590(%rbp)
jmp    1826 <main+0x616>
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
mov    %rax,-0xc388(%rbp)
cmpq   $0x0,-0xc388(%rbp)
jne    1447 <main+0x237>
lea    -0xc490(%rbp),%rdi
mov    $0xff,%esi
call   1090 <getcwd@plt>
lea    -0xc380(%rbp),%rdi
lea    -0xc490(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xd76(%rip),%rsi
mov    $0x0,%al
call   1130 <sprintf@plt>
jmp    145b <main+0x24b>
lea    -0xc380(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0xc9b0(%rbp),%rdi
lea    0xd4e(%rip),%rsi
mov    $0x0,%al
call   1130 <sprintf@plt>
lea    0xd40(%rip),%rdi
lea    0xbf2(%rip),%rsi
call   1100 <popen@plt>
mov    %rax,-0x28(%rbp)
lea    -0xc560(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0xc350,%esi
call   10a0 <fgets@plt>
lea    -0xc560(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0xc560(%rbp,%rax,1)
lea    -0xc560(%rbp),%rsi
lea    0xcfb(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xc5c0(%rbp),%rdi
lea    0xcf6(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0xc560(%rbp),%rdx
lea    -0xc380(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%r8
lea    0xcce(%rip),%rsi
call   10d0 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xcc7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xc490(%rbp),%rdi
mov    $0xff,%esi
call   1090 <getcwd@plt>
lea    -0xc490(%rbp),%rsi
lea    0xcdb(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1826 <main+0x616>
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
mov    %rax,-0xc388(%rbp)
cmpq   $0x0,-0xc388(%rbp)
jne    15b8 <main+0x3a8>
lea    -0xc490(%rbp),%rdi
mov    $0xff,%esi
call   1090 <getcwd@plt>
lea    -0xc380(%rbp),%rdi
lea    -0xc490(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xc05(%rip),%rsi
mov    $0x0,%al
call   1130 <sprintf@plt>
jmp    15cc <main+0x3bc>
lea    -0xc380(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0xc9b0(%rbp),%rdi
lea    0xbdd(%rip),%rsi
mov    $0x0,%al
call   1130 <sprintf@plt>
lea    0xbcf(%rip),%rdi
lea    0xa81(%rip),%rsi
call   1100 <popen@plt>
mov    %rax,-0x28(%rbp)
lea    -0xc560(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0xc350,%esi
call   10a0 <fgets@plt>
lea    -0xc560(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0xc560(%rbp,%rax,1)
lea    -0xc560(%rbp),%rsi
lea    0xb8a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xc5c0(%rbp),%rdi
lea    0xb85(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0xc560(%rbp),%rdx
lea    -0xc380(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%r8
lea    0xbf2(%rip),%rsi
call   10d0 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xb56(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xc490(%rbp),%rdi
mov    $0xff,%esi
call   1090 <getcwd@plt>
lea    -0xc490(%rbp),%rsi
lea    0xb6a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1826 <main+0x616>
lea    0xbb2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
mov    %rax,-0xc388(%rbp)
cmpq   $0x0,-0xc388(%rbp)
jne    1729 <main+0x519>
lea    -0xc490(%rbp),%rdi
mov    $0xff,%esi
call   1090 <getcwd@plt>
lea    -0xc380(%rbp),%rdi
lea    -0xc490(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xa94(%rip),%rsi
mov    $0x0,%al
call   1130 <sprintf@plt>
jmp    173d <main+0x52d>
lea    -0xc380(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0xc9b0(%rbp),%rdi
lea    0xa6c(%rip),%rsi
mov    $0x0,%al
call   1130 <sprintf@plt>
lea    0xa5e(%rip),%rdi
lea    0x910(%rip),%rsi
call   1100 <popen@plt>
mov    %rax,-0x28(%rbp)
lea    -0xc560(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0xc350,%esi
call   10a0 <fgets@plt>
lea    -0xc560(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0xc560(%rbp,%rax,1)
lea    -0xc560(%rbp),%rsi
lea    0xa19(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xc5c0(%rbp),%rdi
lea    0xa14(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0xc560(%rbp),%rdx
lea    -0xc380(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%r8
lea    0xaae(%rip),%rsi
call   10d0 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
lea    0x9e5(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xc490(%rbp),%rdi
mov    $0xff,%esi
call   1090 <getcwd@plt>
lea    -0xc490(%rbp),%rsi
lea    0x9f9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0xc590(%rbp),%esi
lea    0xa6d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xca00,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xc550,%rsp
mov    %rsi,%r15
movups 0xe23(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xe0b(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xdef(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x8(%rsi),%r14
mov    0x8(%rsi),%rdi
lea    0xe08(%rip),%rsi
call   10d0 <strcmp@plt>
neg    %rax
sbb    %ebp,%ebp
mov    0x8(%r15),%rdi
lea    0xdfb(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
mov    $0x1,%ebx
cmovne %ebp,%ebx
mov    0x8(%r15),%rdi
lea    0xde8(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
mov    $0x2,%r12d
cmove  %r12d,%ebx
mov    0x8(%r15),%rdi
lea    0xdd1(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
mov    $0x3,%ebp
cmovne %ebx,%ebp
mov    0x8(%r15),%rdi
lea    0xf0b(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
mov    $0x4,%ebx
cmovne %ebp,%ebx
mov    0x8(%r15),%rdi
lea    0xda4(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
mov    $0x5,%ebp
cmovne %ebx,%ebp
mov    0x8(%r15),%rdi
lea    0xd92(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
mov    $0x6,%ebx
cmovne %ebp,%ebx
mov    0x8(%r15),%rdi
lea    0xd7f(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
mov    $0x7,%eax
cmovne %ebx,%eax
add    $0x1,%eax
lea    0xcd9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf5e(%rip),%rdi
call   1040 <puts@plt>
jmp    13c3 <main+0x1b3>
lea    0xe86(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
jmp    1391 <main+0x181>
lea    0xedb(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   10c0 <extract_variants@plt>
jmp    13b0 <main+0x1a0>
lea    0xe89(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1070 <merge_vcfs@plt>
jmp    13b0 <main+0x1a0>
lea    0xeec(%rip),%rdi
call   1040 <puts@plt>
add    $0x10,%r15
mov    %r15,%rdi
call   10f0 <snplist_generation@plt>
jmp    13b0 <main+0x1a0>
lea    0xed2(%rip),%rdi
call   1040 <puts@plt>
add    $0x10,%r15
mov    %r15,%rdi
call   1120 <awkvar@plt>
lea    0xd47(%rip),%rdi
xor    %r12d,%r12d
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r12d,%eax
add    $0xc550,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd93(%rip),%rdi
call   1040 <puts@plt>
mov    0x10(%r15),%rbp
mov    %rbp,%rdi
mov    $0x2f,%esi
call   1090 <strrchr@plt>
test   %rax,%rax
je     1487 <main+0x277>
lea    0x200(%rsp),%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
jmp    14b6 <main+0x2a6>
lea    0xd2d(%rip),%rdi
call   1040 <puts@plt>
mov    0x10(%r15),%rbp
mov    %rbp,%rdi
mov    $0x2f,%esi
call   1090 <strrchr@plt>
test   %rax,%rax
je     1524 <main+0x314>
lea    0x200(%rsp),%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
jmp    1553 <main+0x343>
lea    0xcd4(%rip),%rdi
call   1040 <puts@plt>
mov    0x10(%r15),%rbp
mov    %rbp,%rdi
mov    $0x2f,%esi
call   1090 <strrchr@plt>
test   %rax,%rax
je     15c1 <main+0x3b1>
lea    0x200(%rsp),%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
jmp    15f0 <main+0x3e0>
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
mov    $0xff,%esi
call   10a0 <getcwd@plt>
mov    0x10(%r15),%rcx
lea    0xbf0(%rip),%rsi
lea    0x200(%rsp),%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1130 <sprintf@plt>
lea    0xbdd(%rip),%rdi
lea    0xd08(%rip),%rsi
call   1100 <popen@plt>
lea    0x130(%rsp),%r14
mov    %r14,%rdi
mov    $0xc350,%esi
mov    %rax,%rdx
call   10b0 <fgets@plt>
mov    %r14,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r14,1)
lea    0xba9(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xba8(%rip),%rsi
mov    %rsp,%rdi
call   1110 <fopen@plt>
mov    %rax,%rbp
mov    0x18(%r15),%r8
lea    0xb94(%rip),%rsi
jmp    1659 <main+0x449>
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
mov    $0xff,%esi
call   10a0 <getcwd@plt>
mov    0x10(%r15),%rcx
lea    0xb53(%rip),%rsi
lea    0x200(%rsp),%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1130 <sprintf@plt>
lea    0xb40(%rip),%rdi
lea    0xc6b(%rip),%rsi
call   1100 <popen@plt>
lea    0x130(%rsp),%r14
mov    %r14,%rdi
mov    $0xc350,%esi
mov    %rax,%rdx
call   10b0 <fgets@plt>
mov    %r14,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r14,1)
lea    0xb0c(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xb0b(%rip),%rsi
mov    %rsp,%rdi
call   1110 <fopen@plt>
mov    %rax,%rbp
mov    0x18(%r15),%r8
lea    0xb26(%rip),%rsi
jmp    1659 <main+0x449>
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
mov    $0xff,%esi
call   10a0 <getcwd@plt>
mov    0x10(%r15),%rcx
lea    0xab6(%rip),%rsi
lea    0x200(%rsp),%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1130 <sprintf@plt>
lea    0xaa3(%rip),%rdi
lea    0xbce(%rip),%rsi
call   1100 <popen@plt>
lea    0x130(%rsp),%r14
mov    %r14,%rdi
mov    $0xc350,%esi
mov    %rax,%rdx
call   10b0 <fgets@plt>
mov    %r14,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r14,1)
lea    0xa6f(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xa6e(%rip),%rsi
mov    %rsp,%rdi
call   1110 <fopen@plt>
mov    %rax,%rbp
mov    0x18(%r15),%r8
lea    0xa97(%rip),%rsi
lea    0x200(%rsp),%rcx
mov    %rax,%rdi
mov    %r14,%rdx
call   10e0 <fprintf@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
lea    0xb1a(%rip),%rdi
call   1040 <puts@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xff,%esi
call   10a0 <getcwd@plt>
lea    0xa28(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>

LLVM IR (-O0):
@__const.main.monitorfile = [44 x i8] c"/smoke/dvanbooven/running/vcf_merge/current\00"
@.str = [8 x i8] c"snplist\00"
@.str.1 = [8 x i8] c"extract\00"
@.str.2 = [6 x i8] c"merge\00"
@.str.3 = [9 x i8] c"complete\00"
@.str.4 = [7 x i8] c"awkvar\00"
@.str.5 = [9 x i8] c"pipeline\00"
@.str.6 = [8 x i8] c"awk_snp\00"
@.str.7 = [8 x i8] c"ext_mer\00"
@__const.main.stages = [8 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i32 0, i32 0)]
@.str.8 = [53 x i8] c"Function could not be determined. Check and retry.\0A\00"
@.str.9 = [37 x i8] c"you want to start a new snplist run\0A\00"
@.str.10 = [62 x i8] c"you want to start extracting a given list of snps from files\0A\00"
@.str.11 = [61 x i8] c"you want to start merging from a given group of zipped vcfs\0A\00"
@.str.12 = [43 x i8] c"you want to start a complete pipeline run\0A\00"
@.str.13 = [38 x i8] c"you want to start a new pipeline run\0A\00"
@.str.14 = [6 x i8] c"%s/%s\00"
@.str.15 = [7 x i8] c"whoami\00"
@.str.16 = [2 x i8] c"r\00"
@.str.17 = [16 x i8] c"username is %s\0A\00"
@.str.18 = [2 x i8] c"a\00"
@.str.19 = [14 x i8] c"%s\091\090\09%s\09%s\0A\00"
@.str.20 = [58 x i8] c"now call the first stage of the pipeline which is awkvar\0A\00"
@.str.21 = [33 x i8] c"current working directory is %s\0A\00"
@.str.22 = [44 x i8] c"you want to start a snplist generation run\0A\00"
@.str.23 = [14 x i8] c"%s\092\090\09%s\09%s\0A\00"
@.str.24 = [31 x i8] c"you want to start a merge run\0A\00"
@.str.25 = [14 x i8] c"%s\093\090\09%s\09%s\0A\00"
@.str.26 = [41 x i8] c"Return status from working function:\09%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca [50000 x i8]
%10 = alloca i8*
%11 = alloca [255 x i8]
%12 = alloca [200 x i8]
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca [44 x i8]
%22 = alloca [1000 x i8]
%23 = alloca [8 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%24 = bitcast [44 x i8]* %21 to i8*
%25 = bitcast [8 x i8*]* %23 to i8*
store i32 -1, i32* %17
store i32 0, i32* %19
br label %26
26: ; preds = %42, %2
%27 = load i32, i32* %19
%28 = icmp slt i32 %27, 8
br i1 %28, label %29, label %45
29: ; preds = %26
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = load i32, i32* %19
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [8 x i8*], [8 x i8*]* %23, i64 0, i64 %34
%36 = load i8*, i8** %35
%37 = call i64 @strcmp(i8* %32, i8* %36)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %29
%40 = load i32, i32* %19
store i32 %40, i32* %17
br label %41
41: ; preds = %39, %29
br label %42
42: ; preds = %41
%43 = load i32, i32* %19
%44 = add nsw i32 %43, 1
store i32 %44, i32* %19
br label %26
45: ; preds = %26
%46 = load i32, i32* %17
%47 = icmp eq i32 %46, -1
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.8, i64 0, i64 0))
store i32 2, i32* %3
br label %239
50: ; preds = %45
%51 = load i32, i32* %17
switch i32 %51, label %236 [
i32 0, label %52
i32 1, label %57
i32 2, label %62
i32 3, label %67
i32 4, label %72
i32 5, label %77
i32 6, label %130
i32 7, label %183
]
52: ; preds = %50
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0))
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 2
%56 = call i32 @snplist_generation(i8** %55)
store i32 %56, i32* %20
br label %236
57: ; preds = %50
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.10, i64 0, i64 0))
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 1
%61 = call i32 @extract_variants(i8** %60)
store i32 %61, i32* %20
br label %236
62: ; preds = %50
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.11, i64 0, i64 0))
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 1
%66 = call i32 @merge_vcfs(i8** %65)
store i32 %66, i32* %20
br label %236
67: ; preds = %50
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0))
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 1
%71 = call i32 @snplist_generation(i8** %70)
store i32 %71, i32* %20
br label %236
72: ; preds = %50
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0))
%74 = load i8**, i8*** %5
%75 = getelementptr inbounds i8*, i8** %74, i64 2
%76 = call i32 @awkvar(i8** %75)
store i32 %76, i32* %20
br label %236
77: ; preds = %50
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.13, i64 0, i64 0))
%79 = load i8**, i8*** %5
%80 = getelementptr inbounds i8*, i8** %79, i64 2
%81 = load i8*, i8** %80
%82 = call i8* @strrchr(i8* %81, i8 signext 47)
store i8* %82, i8** %10
%83 = load i8*, i8** %10
%84 = icmp eq i8* %83, null
br i1 %84, label %85, label %94
85: ; preds = %77
%86 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%87 = call i32 @getcwd(i8* %86, i32 255)
%88 = getelementptr inbounds [50000 x i8], [50000 x i8]* %9, i64 0, i64 0
%89 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%90 = load i8**, i8*** %5
%91 = getelementptr inbounds i8*, i8** %90, i64 2
%92 = load i8*, i8** %91
%93 = call i32 (i8*, i8*, ...) @sprintf(i8* %88, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %89, i8* %92)
br label %100
94: ; preds = %77
%95 = getelementptr inbounds [50000 x i8], [50000 x i8]* %9, i64 0, i64 0
%96 = load i8**, i8*** %5
%97 = getelementptr inbounds i8*, i8** %96, i64 2
%98 = load i8*, i8** %97
%99 = call i32 @strcpy(i8* %95, i8* %98)
br label %100
100: ; preds = %94, %85
%101 = getelementptr inbounds [1000 x i8], [1000 x i8]* %22, i64 0, i64 0
%102 = call i32 (i8*, i8*, ...) @sprintf(i8* %101, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%103 = call i32* @popen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
store i32* %103, i32** %8
%104 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%105 = load i32*, i32** %8
%106 = call i32 @fgets(i8* %104, i32 50000, i32* %105)
%107 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%108 = call i32 @strlen(i8* %107)
%109 = sub nsw i32 %108, 1
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 %110
store i8 0, i8* %111
%112 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i8* %112)
%114 = getelementptr inbounds [44 x i8], [44 x i8]* %21, i64 0, i64 0
%115 = call i32* @fopen(i8* %114, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
store i32* %115, i32** %6
%116 = load i32*, i32** %6
%117 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%118 = getelementptr inbounds [50000 x i8], [50000 x i8]* %9, i64 0, i64 0
%119 = load i8**, i8*** %5
%120 = getelementptr inbounds i8*, i8** %119, i64 3
%121 = load i8*, i8** %120
%122 = call i32 @fprintf(i32* %116, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0), i8* %117, i8* %118, i8* %121)
%123 = load i32*, i32** %6
%124 = call i32 @fclose(i32* %123)
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.20, i64 0, i64 0))
%126 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%127 = call i32 @getcwd(i8* %126, i32 255)
%128 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0), i8* %128)
br label %236
130: ; preds = %50
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.22, i64 0, i64 0))
%132 = load i8**, i8*** %5
%133 = getelementptr inbounds i8*, i8** %132, i64 2
%134 = load i8*, i8** %133
%135 = call i8* @strrchr(i8* %134, i8 signext 47)
store i8* %135, i8** %10
%136 = load i8*, i8** %10
%137 = icmp eq i8* %136, null
br i1 %137, label %138, label %147
138: ; preds = %130
%139 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%140 = call i32 @getcwd(i8* %139, i32 255)
%141 = getelementptr inbounds [50000 x i8], [50000 x i8]* %9, i64 0, i64 0
%142 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%143 = load i8**, i8*** %5
%144 = getelementptr inbounds i8*, i8** %143, i64 2
%145 = load i8*, i8** %144
%146 = call i32 (i8*, i8*, ...) @sprintf(i8* %141, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %142, i8* %145)
br label %153
147: ; preds = %130
%148 = getelementptr inbounds [50000 x i8], [50000 x i8]* %9, i64 0, i64 0
%149 = load i8**, i8*** %5
%150 = getelementptr inbounds i8*, i8** %149, i64 2
%151 = load i8*, i8** %150
%152 = call i32 @strcpy(i8* %148, i8* %151)
br label %153
153: ; preds = %147, %138
%154 = getelementptr inbounds [1000 x i8], [1000 x i8]* %22, i64 0, i64 0
%155 = call i32 (i8*, i8*, ...) @sprintf(i8* %154, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%156 = call i32* @popen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
store i32* %156, i32** %8
%157 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%158 = load i32*, i32** %8
%159 = call i32 @fgets(i8* %157, i32 50000, i32* %158)
%160 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%161 = call i32 @strlen(i8* %160)
%162 = sub nsw i32 %161, 1
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 %163
store i8 0, i8* %164
%165 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i8* %165)
%167 = getelementptr inbounds [44 x i8], [44 x i8]* %21, i64 0, i64 0
%168 = call i32* @fopen(i8* %167, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
store i32* %168, i32** %6
%169 = load i32*, i32** %6
%170 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%171 = getelementptr inbounds [50000 x i8], [50000 x i8]* %9, i64 0, i64 0
%172 = load i8**, i8*** %5
%173 = getelementptr inbounds i8*, i8** %172, i64 3
%174 = load i8*, i8** %173
%175 = call i32 @fprintf(i32* %169, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.23, i64 0, i64 0), i8* %170, i8* %171, i8* %174)
%176 = load i32*, i32** %6
%177 = call i32 @fclose(i32* %176)
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.20, i64 0, i64 0))
%179 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%180 = call i32 @getcwd(i8* %179, i32 255)
%181 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0), i8* %181)
br label %236
183: ; preds = %50
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.24, i64 0, i64 0))
%185 = load i8**, i8*** %5
%186 = getelementptr inbounds i8*, i8** %185, i64 2
%187 = load i8*, i8** %186
%188 = call i8* @strrchr(i8* %187, i8 signext 47)
store i8* %188, i8** %10
%189 = load i8*, i8** %10
%190 = icmp eq i8* %189, null
br i1 %190, label %191, label %200
191: ; preds = %183
%192 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%193 = call i32 @getcwd(i8* %192, i32 255)
%194 = getelementptr inbounds [50000 x i8], [50000 x i8]* %9, i64 0, i64 0
%195 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%196 = load i8**, i8*** %5
%197 = getelementptr inbounds i8*, i8** %196, i64 2
%198 = load i8*, i8** %197
%199 = call i32 (i8*, i8*, ...) @sprintf(i8* %194, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %195, i8* %198)
br label %206
200: ; preds = %183
%201 = getelementptr inbounds [50000 x i8], [50000 x i8]* %9, i64 0, i64 0
%202 = load i8**, i8*** %5
%203 = getelementptr inbounds i8*, i8** %202, i64 2
%204 = load i8*, i8** %203
%205 = call i32 @strcpy(i8* %201, i8* %204)
br label %206
206: ; preds = %200, %191
%207 = getelementptr inbounds [1000 x i8], [1000 x i8]* %22, i64 0, i64 0
%208 = call i32 (i8*, i8*, ...) @sprintf(i8* %207, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%209 = call i32* @popen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
store i32* %209, i32** %8
%210 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%211 = load i32*, i32** %8
%212 = call i32 @fgets(i8* %210, i32 50000, i32* %211)
%213 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%214 = call i32 @strlen(i8* %213)
%215 = sub nsw i32 %214, 1
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 %216
store i8 0, i8* %217
%218 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%219 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i8* %218)
%220 = getelementptr inbounds [44 x i8], [44 x i8]* %21, i64 0, i64 0
%221 = call i32* @fopen(i8* %220, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
store i32* %221, i32** %6
%222 = load i32*, i32** %6
%223 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%224 = getelementptr inbounds [50000 x i8], [50000 x i8]* %9, i64 0, i64 0
%225 = load i8**, i8*** %5
%226 = getelementptr inbounds i8*, i8** %225, i64 3
%227 = load i8*, i8** %226
%228 = call i32 @fprintf(i32* %222, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0), i8* %223, i8* %224, i8* %227)
%229 = load i32*, i32** %6
%230 = call i32 @fclose(i32* %229)
%231 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.20, i64 0, i64 0))
%232 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%233 = call i32 @getcwd(i8* %232, i32 255)
%234 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%235 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0), i8* %234)
br label %236
236: ; preds = %50, %206, %153, %100, %72, %67, %62, %57, %52
%237 = load i32, i32* %20
%238 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.26, i64 0, i64 0), i32 %237)
store i32 0, i32* %3
br label %239
239: ; preds = %236, %48
%240 = load i32, i32* %3
ret i32 %240
}

LLVM IR (-O2):
@__const.main.monitorfile = [44 x i8] c"/smoke/dvanbooven/running/vcf_merge/current\00"
@.str = [8 x i8] c"snplist\00"
@.str.1 = [8 x i8] c"extract\00"
@.str.2 = [6 x i8] c"merge\00"
@.str.3 = [9 x i8] c"complete\00"
@.str.4 = [7 x i8] c"awkvar\00"
@.str.5 = [9 x i8] c"pipeline\00"
@.str.6 = [8 x i8] c"awk_snp\00"
@.str.7 = [8 x i8] c"ext_mer\00"
@.str.14 = [6 x i8] c"%s/%s\00"
@.str.15 = [7 x i8] c"whoami\00"
@.str.16 = [2 x i8] c"r\00"
@.str.17 = [16 x i8] c"username is %s\0A\00"
@.str.18 = [2 x i8] c"a\00"
@.str.19 = [14 x i8] c"%s\091\090\09%s\09%s\0A\00"
@.str.21 = [33 x i8] c"current working directory is %s\0A\00"
@.str.23 = [14 x i8] c"%s\092\090\09%s\09%s\0A\00"
@.str.25 = [14 x i8] c"%s\093\090\09%s\09%s\0A\00"
@.str.26 = [41 x i8] c"Return status from working function:\09%d\0A\00"
@str = [30 x i8] c"you want to start a merge run\00"
@str.28 = [43 x i8] c"you want to start a snplist generation run\00"
@str.30 = [37 x i8] c"you want to start a new pipeline run\00"
@str.31 = [57 x i8] c"now call the first stage of the pipeline which is awkvar\00"
@str.33 = [42 x i8] c"you want to start a complete pipeline run\00"
@str.34 = [60 x i8] c"you want to start merging from a given group of zipped vcfs\00"
@str.35 = [61 x i8] c"you want to start extracting a given list of snps from files\00"
@str.36 = [36 x i8] c"you want to start a new snplist run\00"
@str.37 = [52 x i8] c"Function could not be determined. Check and retry.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [50000 x i8]
%4 = alloca [255 x i8]
%5 = alloca [200 x i8]
%6 = alloca [44 x i8]
%7 = getelementptr inbounds [50000 x i8], [50000 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [44 x i8], [44 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
%15 = sext i1 %14 to i32
%16 = load i8*, i8** %11
%17 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
%19 = select i1 %18, i32 1, i32 %15
%20 = load i8*, i8** %11
%21 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
%23 = select i1 %22, i32 2, i32 %19
%24 = load i8*, i8** %11
%25 = tail call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
%27 = select i1 %26, i32 3, i32 %23
%28 = load i8*, i8** %11
%29 = tail call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
%31 = select i1 %30, i32 4, i32 %27
%32 = load i8*, i8** %11
%33 = tail call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
%35 = select i1 %34, i32 5, i32 %31
%36 = load i8*, i8** %11
%37 = tail call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
%39 = select i1 %38, i32 6, i32 %35
%40 = load i8*, i8** %11
%41 = tail call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
%43 = select i1 %42, i32 7, i32 %39
switch i32 %43, label %147 [
i32 -1, label %44
i32 0, label %46
i32 1, label %50
i32 2, label %53
i32 3, label %56
i32 4, label %59
i32 5, label %63
i32 6, label %91
i32 7, label %119
]
44: ; preds = %2
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.37, i64 0, i64 0))
br label %151
46: ; preds = %2
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.36, i64 0, i64 0))
%48 = getelementptr inbounds i8*, i8** %1, i64 2
%49 = tail call i32 @snplist_generation(i8** %48)
br label %148
50: ; preds = %2
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.35, i64 0, i64 0))
%52 = tail call i32 @extract_variants(i8** %11)
br label %148
53: ; preds = %2
%54 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.34, i64 0, i64 0))
%55 = tail call i32 @merge_vcfs(i8** %11)
br label %148
56: ; preds = %2
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.33, i64 0, i64 0))
%58 = tail call i32 @snplist_generation(i8** %11)
br label %148
59: ; preds = %2
%60 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.36, i64 0, i64 0))
%61 = getelementptr inbounds i8*, i8** %1, i64 2
%62 = tail call i32 @awkvar(i8** %61)
br label %148
63: ; preds = %2
%64 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.30, i64 0, i64 0))
%65 = getelementptr inbounds i8*, i8** %1, i64 2
%66 = load i8*, i8** %65
%67 = tail call i8* @strrchr(i8* dereferenceable(1) %66, i8 signext 47)
%68 = icmp eq i8* %67, null
br i1 %68, label %69, label %73
69: ; preds = %63
%70 = call i32 @getcwd(i8* %8, i32 255)
%71 = load i8*, i8** %65
%72 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %8, i8* %71)
br label %75
73: ; preds = %63
%74 = call i32 @strcpy(i8* %7, i8* %66)
br label %75
75: ; preds = %73, %69
%76 = call i32* @popen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%77 = call i32 @fgets(i8* %9, i32 50000, i32* %76)
%78 = call i32 @strlen(i8* %9)
%79 = add nsw i32 %78, -1
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 %80
store i8 0, i8* %81
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i8* %9)
%83 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%84 = getelementptr inbounds i8*, i8** %1, i64 3
%85 = load i8*, i8** %84
%86 = call i32 @fprintf(i32* %83, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0), i8* %9, i8* %7, i8* %85)
%87 = call i32 @fclose(i32* %83)
%88 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.31, i64 0, i64 0))
%89 = call i32 @getcwd(i8* %8, i32 255)
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0), i8* %8)
unreachable
91: ; preds = %2
%92 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.28, i64 0, i64 0))
%93 = getelementptr inbounds i8*, i8** %1, i64 2
%94 = load i8*, i8** %93
%95 = tail call i8* @strrchr(i8* dereferenceable(1) %94, i8 signext 47)
%96 = icmp eq i8* %95, null
br i1 %96, label %97, label %101
97: ; preds = %91
%98 = call i32 @getcwd(i8* %8, i32 255)
%99 = load i8*, i8** %93
%100 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %8, i8* %99)
br label %103
101: ; preds = %91
%102 = call i32 @strcpy(i8* %7, i8* %94)
br label %103
103: ; preds = %101, %97
%104 = call i32* @popen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%105 = call i32 @fgets(i8* %9, i32 50000, i32* %104)
%106 = call i32 @strlen(i8* %9)
%107 = add nsw i32 %106, -1
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 %108
store i8 0, i8* %109
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i8* %9)
%111 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%112 = getelementptr inbounds i8*, i8** %1, i64 3
%113 = load i8*, i8** %112
%114 = call i32 @fprintf(i32* %111, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.23, i64 0, i64 0), i8* %9, i8* %7, i8* %113)
%115 = call i32 @fclose(i32* %111)
%116 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.31, i64 0, i64 0))
%117 = call i32 @getcwd(i8* %8, i32 255)
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0), i8* %8)
unreachable
119: ; preds = %2
%120 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%121 = getelementptr inbounds i8*, i8** %1, i64 2
%122 = load i8*, i8** %121
%123 = tail call i8* @strrchr(i8* dereferenceable(1) %122, i8 signext 47)
%124 = icmp eq i8* %123, null
br i1 %124, label %125, label %129
125: ; preds = %119
%126 = call i32 @getcwd(i8* %8, i32 255)
%127 = load i8*, i8** %121
%128 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8* %8, i8* %127)
br label %131
129: ; preds = %119
%130 = call i32 @strcpy(i8* %7, i8* %122)
br label %131
131: ; preds = %129, %125
%132 = call i32* @popen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%133 = call i32 @fgets(i8* %9, i32 50000, i32* %132)
%134 = call i32 @strlen(i8* %9)
%135 = add nsw i32 %134, -1
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 %136
store i8 0, i8* %137
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i8* %9)
%139 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%140 = getelementptr inbounds i8*, i8** %1, i64 3
%141 = load i8*, i8** %140
%142 = call i32 @fprintf(i32* %139, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0), i8* %9, i8* %7, i8* %141)
%143 = call i32 @fclose(i32* %139)
%144 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.31, i64 0, i64 0))
%145 = call i32 @getcwd(i8* %8, i32 255)
%146 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.21, i64 0, i64 0), i8* %8)
unreachable
147: ; preds = %2
unreachable
148: ; preds = %59, %56, %53, %50, %46
%149 = phi i32 [ %62, %59 ], [ %58, %56 ], [ %55, %53 ], [ %52, %50 ], [ %49, %46 ]
%150 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.26, i64 0, i64 0), i32 %149)
br label %151
151: ; preds = %148, %44
%152 = phi i32 [ 2, %44 ], [ 0, %148 ]
ret i32 %152
}