#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*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
float log(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(int argc, char *argv[]) {
  int arg_len = 1000;
  char species[arg_len];
  strcpy(species, argv[1]);
  char analysis[arg_len];
  strcpy(analysis, argv[2]);
  char base_dir[arg_len];
  strcpy(base_dir, argv[3]);
  char upstream_len[arg_len];
  strcpy(upstream_len, argv[4]);
  char log_file_name[arg_len];
  strcpy(log_file_name, base_dir);
  strcat(log_file_name, "/Analysis/log.txt");
  FILE *log_file = fopen(log_file_name, "a");
  char output_file_name[arg_len];
  strcpy(output_file_name, base_dir);
  strcat(output_file_name, "/Analysis/");
  strcat(output_file_name, analysis);
  strcat(output_file_name, "/");
  strcat(output_file_name, species);
  strcat(output_file_name, "_");
  strcat(output_file_name, analysis);
  strcat(output_file_name, "/");
  strcat(output_file_name, species);
  strcat(output_file_name, "_di_upstream_");
  strcat(output_file_name, upstream_len);
  strcat(output_file_name, ".csv");
  FILE *output = fopen(output_file_name, "w");
  fprintf(output, "Isolate_1,Isolate_2,SNPs,Sites,Divergence\n");
  char isolates_file_name[arg_len];
  strcpy(isolates_file_name, base_dir);
  strcat(isolates_file_name, "/Analysis/Core_genome_alignment/");
  strcat(isolates_file_name, species);
  strcat(isolates_file_name, "_Core_genome_alignment/");
  strcat(isolates_file_name, species);
  strcat(isolates_file_name, "_isolates.txt");
  char isolate_name[arg_len];
  int isolate_count;
  isolate_count = 0;
  FILE *isolates_file = fopen(isolates_file_name, "r");
  if (isolates_file != NULL) {
    while (fgets(isolate_name, sizeof isolate_name, isolates_file) != NULL) {
      isolate_count++;
    }
    fclose(isolates_file);
  } else {
    perror(isolates_file_name);
  }
  char isolate_name_array[isolate_count][arg_len];
  char isolate_file_name_array[isolate_count][arg_len];
  isolate_count = 0;
  FILE *isolates_file_2 = fopen(isolates_file_name, "r");
  if (isolates_file_2 != NULL) {
    while (fgets(isolate_name, sizeof isolate_name, isolates_file_2) != NULL) {
      int isolate_name_len;
      isolate_name_len = strlen(isolate_name);
      if (isolate_name[(isolate_name_len - 1)] == '\n') {
        isolate_name[(isolate_name_len - 1)] = '\0';
      }
      strcpy(isolate_name_array[isolate_count], isolate_name);
      strcpy(isolate_file_name_array[isolate_count], base_dir);
      strcat(isolate_file_name_array[isolate_count], "/Analysis/");
      strcat(isolate_file_name_array[isolate_count], analysis);
      strcat(isolate_file_name_array[isolate_count], "/");
      strcat(isolate_file_name_array[isolate_count], species);
      strcat(isolate_file_name_array[isolate_count], "_");
      strcat(isolate_file_name_array[isolate_count], analysis);
      strcat(isolate_file_name_array[isolate_count],
             "/Intergenic_files_upstream_");
      strcat(isolate_file_name_array[isolate_count], upstream_len);
      strcat(isolate_file_name_array[isolate_count], "/");
      strcat(isolate_file_name_array[isolate_count], isolate_name);
      strcat(isolate_file_name_array[isolate_count], ".fasta");
      isolate_count++;
    }
    fclose(isolates_file_2);
  } else {
    perror(isolates_file_name);
  }
  int a;
  int b;
  int i;
  int genome_max = 1000000;
  char genome1[genome_max];
  char genome2[genome_max];
  int count;
  count = 0;
  for (a = 0; a < isolate_count; a++) {
    FILE *file1 = fopen(isolate_file_name_array[a], "r");
    if (file1 != NULL) {
      char line1[genome_max];
      while (fgets(line1, sizeof line1, file1) != NULL) {
        if (line1[0] != '>') {
          int line1_len = strlen(line1);
          line1_len = (line1_len - 1);
          if (line1[line1_len] == '\n') {
            line1[line1_len] = '\0';
          }
          strcpy(genome1, line1);
          fclose(file1);
        }
      }
    } else {
      perror(isolate_file_name_array[a]);
    }
    for (b = 0; b < isolate_count; b++) {
      if (a > b) {
        FILE *file2 = fopen(isolate_file_name_array[b], "r");
        if (file2 != NULL) {
          char line2[genome_max];
          while (fgets(line2, sizeof line2, file2) != NULL) {
            if (line2[0] != '>') {
              int line2_len = strlen(line2);
              line2_len = (line2_len - 1);
              if (line2[line2_len] == '\n') {
                line2[line2_len] = '\0';
              }
              strcpy(genome2, line2);
              fclose(file2);
            }
          }
        } else {
          perror(isolate_file_name_array[b]);
        }
        int genome_len;
        genome_len = strlen(genome1);
        int snp;
        snp = 0;
        int n;
        n = 0;
        for (i = 0; i < genome_len; i++) {
          if (genome1[i] == 'N' || genome2[i] == 'N') {
            n++;
          } else {
            if (genome1[i] != genome2[i]) {
              snp++;
            }
          }
        }
        int sites;
        sites = (genome_len - n);
        float div;
        div = ((float)snp / sites);
        float JC_div;
        JC_div = (((float)-3 / 4) * (log(1 - (((float)4 / 3) * div))));
        fprintf(output, "%s,%s,%i,%i,%0.6f\n", isolate_name_array[a],
                isolate_name_array[b], snp, sites, JC_div);
        count++;
      }
    }
  }
  printf("%s di upstream %s calculated.\n", species, upstream_len);
  fprintf(log_file, "%s di upstream %s calculated.\n", species, upstream_len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3e8,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x150(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%eax
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x178(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%eax
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x158(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%eax
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x168(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x158(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x180(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x48(%rbp)
call   1030 <strcpy@plt>
mov    -0x180(%rbp),%rdi
lea    0xd4d(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x180(%rbp),%rdi
lea    0xe01(%rip),%rsi
call   10a0 <fopen@plt>
mov    -0x158(%rbp),%rsi
mov    %rax,-0x50(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x160(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x58(%rbp)
call   1030 <strcpy@plt>
mov    -0x160(%rbp),%rdi
lea    0xd07(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x178(%rbp),%rsi
mov    -0x160(%rbp),%rdi
call   10c0 <strcat@plt>
mov    -0x160(%rbp),%rdi
lea    0xcea(%rip),%rsi
mov    %rsi,-0x170(%rbp)
call   10c0 <strcat@plt>
mov    -0x160(%rbp),%rdi
mov    -0x150(%rbp),%rsi
call   10c0 <strcat@plt>
mov    -0x160(%rbp),%rdi
lea    0xccb(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x178(%rbp),%rsi
mov    -0x160(%rbp),%rdi
call   10c0 <strcat@plt>
mov    -0x170(%rbp),%rsi
mov    -0x160(%rbp),%rdi
call   10c0 <strcat@plt>
mov    -0x160(%rbp),%rdi
mov    -0x150(%rbp),%rsi
call   10c0 <strcat@plt>
mov    -0x160(%rbp),%rdi
lea    0xc73(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x168(%rbp),%rsi
mov    -0x160(%rbp),%rdi
call   10c0 <strcat@plt>
mov    -0x160(%rbp),%rdi
lea    0xc5b(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x160(%rbp),%rdi
lea    0xc4d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
lea    0xc3b(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    -0x158(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x148(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x68(%rbp)
call   1030 <strcpy@plt>
mov    -0x148(%rbp),%rdi
lea    0xc23(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x150(%rbp),%rsi
mov    -0x148(%rbp),%rdi
call   10c0 <strcat@plt>
mov    -0x148(%rbp),%rdi
lea    0xc1e(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x150(%rbp),%rsi
mov    -0x148(%rbp),%rdi
call   10c0 <strcat@plt>
mov    -0x148(%rbp),%rdi
lea    0xc10(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x148(%rbp),%rdi
mov    -0x14(%rbp),%eax
mov    %rax,-0x140(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x138(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
lea    0xbdb(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x80(%rbp)
cmpq   $0x0,-0x80(%rbp)
je     152d <main+0x38d>
jmp    14ee <main+0x34e>
mov    -0x138(%rbp),%rdi
mov    -0x140(%rbp),%rax
mov    %eax,%esi
mov    -0x80(%rbp),%rdx
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     151f <main+0x37f>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    14ee <main+0x34e>
mov    -0x80(%rbp),%rdi
call   1040 <fclose@plt>
jmp    1539 <main+0x399>
mov    -0x148(%rbp),%rdi
call   10b0 <perror@plt>
mov    -0x148(%rbp),%rdi
mov    -0x74(%rbp),%eax
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
mov    %rax,-0x1a0(%rbp)
mov    %rcx,%rsi
imul   %rax,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x198(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x88(%rbp)
mov    %rax,-0x90(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
mov    %rax,-0x190(%rbp)
mov    %rcx,%rsi
imul   %rax,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x188(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x98(%rbp)
mov    %rax,-0xa0(%rbp)
movl   $0x0,-0x74(%rbp)
lea    0xaea(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0xa8(%rbp)
cmpq   $0x0,-0xa8(%rbp)
je     1856 <main+0x6b6>
jmp    15e5 <main+0x445>
mov    -0x138(%rbp),%rdi
mov    -0x140(%rbp),%rax
mov    %eax,%esi
mov    -0xa8(%rbp),%rdx
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1845 <main+0x6a5>
mov    -0x138(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x138(%rbp),%rax
mov    %ecx,-0xac(%rbp)
mov    -0xac(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1656 <main+0x4b6>
mov    -0x138(%rbp),%rax
mov    -0xac(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x138(%rbp),%rsi
mov    -0x198(%rbp),%rdi
mov    -0x1a0(%rbp),%rcx
movslq -0x74(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
call   1030 <strcpy@plt>
mov    -0x158(%rbp),%rsi
mov    -0x190(%rbp),%rcx
mov    -0x188(%rbp),%rdi
movslq -0x74(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
call   1030 <strcpy@plt>
mov    -0x190(%rbp),%rcx
mov    -0x188(%rbp),%rdi
movslq -0x74(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
lea    0x95e(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x178(%rbp),%rsi
mov    -0x190(%rbp),%rcx
mov    -0x188(%rbp),%rdi
movslq -0x74(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
call   10c0 <strcat@plt>
mov    -0x190(%rbp),%rcx
mov    -0x188(%rbp),%rdi
movslq -0x74(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
lea    0x91d(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x150(%rbp),%rsi
mov    -0x190(%rbp),%rcx
mov    -0x188(%rbp),%rdi
movslq -0x74(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
call   10c0 <strcat@plt>
mov    -0x190(%rbp),%rcx
mov    -0x188(%rbp),%rdi
movslq -0x74(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
lea    0x8e1(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x178(%rbp),%rsi
mov    -0x190(%rbp),%rcx
mov    -0x188(%rbp),%rdi
movslq -0x74(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
call   10c0 <strcat@plt>
mov    -0x190(%rbp),%rcx
mov    -0x188(%rbp),%rdi
movslq -0x74(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
lea    0x914(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x168(%rbp),%rsi
mov    -0x190(%rbp),%rcx
mov    -0x188(%rbp),%rdi
movslq -0x74(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
call   10c0 <strcat@plt>
mov    -0x190(%rbp),%rcx
mov    -0x188(%rbp),%rdi
movslq -0x74(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
lea    0x83f(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x138(%rbp),%rsi
mov    -0x190(%rbp),%rcx
mov    -0x188(%rbp),%rdi
movslq -0x74(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
call   10c0 <strcat@plt>
mov    -0x190(%rbp),%rcx
mov    -0x188(%rbp),%rdi
movslq -0x74(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
lea    0x89c(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    15e5 <main+0x445>
mov    -0xa8(%rbp),%rdi
call   1040 <fclose@plt>
jmp    1862 <main+0x6c2>
mov    -0x148(%rbp),%rdi
call   10b0 <perror@plt>
movl   $0xf4240,-0xbc(%rbp)
mov    -0xbc(%rbp),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x1b0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xc8(%rbp)
mov    -0xbc(%rbp),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x1a8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xd0(%rbp)
movl   $0x0,-0xd4(%rbp)
movl   $0x0,-0xb0(%rbp)
mov    -0xb0(%rbp),%eax
cmp    -0x74(%rbp),%eax
jge    1d9d <main+0xbfd>
mov    -0x188(%rbp),%rdi
mov    -0x190(%rbp),%rcx
movslq -0xb0(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
lea    0x7ae(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0xe0(%rbp)
cmpq   $0x0,-0xe0(%rbp)
je     1a11 <main+0x871>
mov    -0xbc(%rbp),%eax
mov    %rax,-0x1c0(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0xe8(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x1b8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xf0(%rbp)
mov    -0x1b8(%rbp),%rdi
mov    -0x1c0(%rbp),%rax
mov    %eax,%esi
mov    -0xe0(%rbp),%rdx
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1a02 <main+0x862>
mov    -0x1b8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3e,%eax
je     19fd <main+0x85d>
mov    -0x1b8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x1b8(%rbp),%rax
mov    %ecx,-0xf4(%rbp)
mov    -0xf4(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,-0xf4(%rbp)
movslq -0xf4(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    19de <main+0x83e>
mov    -0x1b8(%rbp),%rax
movslq -0xf4(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x1b8(%rbp),%rsi
mov    -0x1b0(%rbp),%rdi
call   1030 <strcpy@plt>
mov    -0xe0(%rbp),%rdi
call   1040 <fclose@plt>
jmp    1955 <main+0x7b5>
mov    -0xe8(%rbp),%rax
mov    %rax,%rsp
jmp    1a32 <main+0x892>
mov    -0x188(%rbp),%rdi
mov    -0x190(%rbp),%rcx
movslq -0xb0(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
call   10b0 <perror@plt>
movl   $0x0,-0xb4(%rbp)
mov    -0xb4(%rbp),%eax
cmp    -0x74(%rbp),%eax
jge    1d84 <main+0xbe4>
mov    -0xb0(%rbp),%eax
cmp    -0xb4(%rbp),%eax
jle    1d6b <main+0xbcb>
mov    -0x188(%rbp),%rdi
mov    -0x190(%rbp),%rcx
movslq -0xb4(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
lea    0x630(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x100(%rbp)
cmpq   $0x0,-0x100(%rbp)
je     1b8f <main+0x9ef>
mov    -0xbc(%rbp),%eax
mov    %rax,-0x1d0(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x108(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x1c8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x110(%rbp)
mov    -0x1c8(%rbp),%rdi
mov    -0x1d0(%rbp),%rax
mov    %eax,%esi
mov    -0x100(%rbp),%rdx
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1b80 <main+0x9e0>
mov    -0x1c8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3e,%eax
je     1b7b <main+0x9db>
mov    -0x1c8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c8(%rbp),%rax
mov    %ecx,-0x114(%rbp)
mov    -0x114(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,-0x114(%rbp)
movslq -0x114(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1b5c <main+0x9bc>
mov    -0x1c8(%rbp),%rax
movslq -0x114(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x1c8(%rbp),%rsi
mov    -0x1a8(%rbp),%rdi
call   1030 <strcpy@plt>
mov    -0x100(%rbp),%rdi
call   1040 <fclose@plt>
jmp    1ad3 <main+0x933>
mov    -0x108(%rbp),%rax
mov    %rax,%rsp
jmp    1bb0 <main+0xa10>
mov    -0x188(%rbp),%rdi
mov    -0x190(%rbp),%rcx
movslq -0xb4(%rbp),%rax
imul   %rcx,%rax
add    %rax,%rdi
call   10b0 <perror@plt>
mov    -0x1b0(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x118(%rbp)
movl   $0x0,-0x11c(%rbp)
movl   $0x0,-0x120(%rbp)
movl   $0x0,-0xb8(%rbp)
mov    -0xb8(%rbp),%eax
cmp    -0x118(%rbp),%eax
jge    1c95 <main+0xaf5>
mov    -0x1b0(%rbp),%rax
movslq -0xb8(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x4e,%eax
je     1c28 <main+0xa88>
mov    -0x1a8(%rbp),%rax
movslq -0xb8(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x4e,%eax
jne    1c3c <main+0xa9c>
mov    -0x120(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x120(%rbp)
jmp    1c7c <main+0xadc>
mov    -0x1a8(%rbp),%rcx
mov    -0x1b0(%rbp),%rax
movslq -0xb8(%rbp),%rdx
movsbl (%rax,%rdx,1),%eax
movslq -0xb8(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1c77 <main+0xad7>
mov    -0x11c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x11c(%rbp)
jmp    1c7c <main+0xadc>
jmp    1c81 <main+0xae1>
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    1be0 <main+0xa40>
mov    -0x118(%rbp),%eax
sub    -0x120(%rbp),%eax
mov    %eax,-0x124(%rbp)
cvtsi2ssl -0x11c(%rbp),%xmm0
ff
cvtsi2ssl -0x124(%rbp),%xmm1
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x128(%rbp)
ff
movss  -0x128(%rbp),%xmm0
ff
movss  0x331(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0x329(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1090 <log@plt>
mov    -0x1a0(%rbp),%rsi
mov    -0x198(%rbp),%rcx
movaps %xmm0,%xmm1
movss  0x2fb(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x12c(%rbp)
ff
mov    -0x60(%rbp),%rdi
movslq -0xb0(%rbp),%rax
imul   %rsi,%rax
mov    %rcx,%rdx
add    %rax,%rdx
movslq -0xb4(%rbp),%rax
imul   %rsi,%rax
add    %rax,%rcx
mov    -0x11c(%rbp),%r8d
mov    -0x124(%rbp),%r9d
movss  -0x12c(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0x380(%rip),%rsi
mov    $0x1,%al
call   1080 <fprintf@plt>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1d70 <main+0xbd0>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    1a3c <main+0x89c>
jmp    1d89 <main+0xbe9>
mov    -0xb0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb0(%rbp)
jmp    18d0 <main+0x730>
mov    -0x168(%rbp),%rdx
mov    -0x150(%rbp),%rsi
lea    0x336(%rip),%rdi
call   1060 <printf@plt>
mov    -0x150(%rbp),%rdx
mov    -0x168(%rbp),%rcx
mov    -0x50(%rbp),%rdi
lea    0x318(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1fc8,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
lea    -0x1420(%rbp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    0x10(%rbx),%rsi
lea    -0x1030(%rbp),%r13
mov    %r13,%rdi
call   1030 <strcpy@plt>
mov    0x18(%rbx),%rsi
lea    -0x1810(%rbp),%r12
mov    %r12,%rdi
call   1030 <strcpy@plt>
mov    0x20(%rbx),%rsi
lea    -0x850(%rbp),%rdi
call   1030 <strcpy@plt>
lea    -0x1ff0(%rbp),%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
lea    0xde3(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <strcat@plt>
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <fopen@plt>
mov    %rax,-0x58(%rbp)
lea    -0x1c00(%rbp),%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
lea    0xdc1(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <strcat@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10c0 <strcat@plt>
lea    0xdb0(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   10c0 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10c0 <strcat@plt>
lea    0xda1(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <strcat@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10c0 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   10c0 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10c0 <strcat@plt>
lea    0xd65(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <strcat@plt>
mov    %rbx,%rdi
lea    -0x850(%rbp),%rsi
call   10c0 <strcat@plt>
lea    0xd55(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <strcat@plt>
lea    0xd4b(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <fopen@plt>
lea    0xd3e(%rip),%rdi
mov    $0x2a,%esi
mov    $0x1,%edx
mov    %rax,-0x60(%rbp)
mov    %rax,%rcx
call   10d0 <fwrite@plt>
lea    -0x460(%rbp),%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
lea    0xd3a(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10c0 <strcat@plt>
lea    0xd41(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10c0 <strcat@plt>
lea    0xd3f(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <strcat@plt>
lea    0xd3e(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1858 <main+0x6a8>
mov    %rax,%r15
mov    $0xffffffff,%ebx
lea    -0xc40(%rbp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    $0x3e8,%esi
mov    %r15,%rdx
call   1070 <fgets@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    13a0 <main+0x1f0>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    %ebx,%eax
imul   $0x3e8,%rax,%rax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
lea    0xcbe(%rip),%rsi
lea    -0x460(%rbp),%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     186b <main+0x6bb>
lea    -0xc40(%rbp),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
mov    %rax,-0x30(%rbp)
mov    %rax,%rdx
call   1070 <fgets@plt>
xor    %r15d,%r15d
test   %rax,%rax
je     154a <main+0x39a>
mov    -0x40(%rbp),%r12
mov    -0x38(%rbp),%r14
jmp    1528 <main+0x378>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
lea    -0x1810(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
lea    0xbba(%rip),%rsi
call   10c0 <strcat@plt>
mov    %r14,%rdi
lea    -0x1030(%rbp),%rsi
call   10c0 <strcat@plt>
mov    %r14,%rdi
mov    %rbx,%r13
lea    0xba2(%rip),%rbx
mov    %rbx,%rsi
call   10c0 <strcat@plt>
mov    %r14,%rdi
lea    -0x1420(%rbp),%rsi
call   10c0 <strcat@plt>
mov    %r14,%rdi
lea    0xb8f(%rip),%rsi
call   10c0 <strcat@plt>
mov    %r14,%rdi
lea    -0x1030(%rbp),%rsi
call   10c0 <strcat@plt>
mov    %r14,%rdi
lea    0xbee(%rip),%rsi
call   10c0 <strcat@plt>
mov    %r14,%rdi
lea    -0x850(%rbp),%rsi
call   10c0 <strcat@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r13,%rbx
call   10c0 <strcat@plt>
mov    %r14,%rdi
mov    %r13,%rsi
call   10c0 <strcat@plt>
mov    %r14,%rdi
lea    0xbd3(%rip),%rsi
call   10c0 <strcat@plt>
mov    %r13,%rdi
mov    $0x3e8,%esi
mov    -0x30(%rbp),%rdx
call   1070 <fgets@plt>
add    $0x3e8,%r14
add    $0x3e8,%r12
add    $0x1,%r15d
test   %rax,%rax
je     154a <main+0x39a>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1440 <main+0x290>
movb   $0x0,-0xc41(%rbp,%rax,1)
jmp    1440 <main+0x290>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
mov    %rsp,%r13
add    $0xfffffffffff0bdc0,%r13
mov    %r13,%rsp
mov    %rsp,%r12
add    $0xfffffffffff0bdc0,%r12
mov    %r12,%rsp
test   %r15d,%r15d
je     1877 <main+0x6c7>
mov    %r15d,%eax
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
jmp    159e <main+0x3ee>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
cmp    -0x30(%rbp),%rax
je     1877 <main+0x6c7>
mov    %rax,-0x48(%rbp)
imul   $0x3e8,%rax,%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,-0x50(%rbp)
lea    (%rax,%rcx,1),%rbx
mov    %rbx,%rdi
lea    0xaf1(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     184b <main+0x69b>
mov    %rax,%r14
mov    %rsp,%r15
mov    %rsp,%rbx
add    $0xfffffffffff0bdc0,%rbx
mov    %rbx,%rsp
jmp    1603 <main+0x453>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
mov    $0xf4240,%esi
mov    %r14,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1640 <main+0x490>
cmpb   $0x3e,(%rbx)
je     1603 <main+0x453>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    15f0 <main+0x440>
movb   $0x0,-0x1(%rbx,%rax,1)
jmp    15f0 <main+0x440>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rsp
mov    -0x48(%rbp),%rax
mov    -0x50(%rbp),%rcx
add    -0x40(%rbp),%rcx
mov    %rcx,-0x50(%rbp)
xor    %r15d,%r15d
jmp    16cf <main+0x51f>
xor    %r14d,%r14d
xor    %esi,%esi
sub    %esi,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %r14d,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
mulss  0x986(%rip),%xmm0
addss  0x982(%rip),%xmm0
cvttss2si %xmm0,%edi
mov    %eax,%ebx
call   1090 <log@plt>
mulss  0x973(%rip),%xmm0
mov    -0x70(%rbp),%rcx
add    -0x40(%rbp),%rcx
cvtss2sd %xmm0,%xmm0
mov    -0x60(%rbp),%rdi
lea    0xa29(%rip),%rsi
mov    -0x50(%rbp),%rdx
mov    %r14d,%r8d
mov    %ebx,%r9d
mov    $0x1,%al
call   1080 <fprintf@plt>
mov    -0x48(%rbp),%rax
add    $0x1,%r15
cmp    -0x30(%rbp),%r15
je     1590 <main+0x3e0>
cmp    %r15,%rax
jbe    16c1 <main+0x511>
imul   $0x3e8,%r15,%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,-0x70(%rbp)
lea    (%rax,%rcx,1),%rbx
mov    %rbx,%rdi
lea    0x9bf(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     183e <main+0x68e>
mov    %rax,%r14
mov    %rsp,-0x68(%rbp)
mov    %rsp,%rbx
add    $0xfffffffffff0bdc0,%rbx
mov    %rbx,%rsp
jmp    1733 <main+0x583>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
mov    $0xf4240,%esi
mov    %r14,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1770 <main+0x5c0>
cmpb   $0x3e,(%rbx)
je     1733 <main+0x583>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1720 <main+0x570>
movb   $0x0,-0x1(%rbx,%rax,1)
jmp    1720 <main+0x570>
cs nopw 0x0(%rax,%rax,1)
nop
mov    -0x68(%rbp),%rsp
mov    %r13,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    1658 <main+0x4a8>
mov    %eax,%r8d
cmp    $0x1,%eax
jne    17b8 <main+0x608>
xor    %ecx,%ecx
xor    %esi,%esi
xor    %r14d,%r14d
test   $0x1,%r8b
je     165d <main+0x4ad>
mov    0x0(%r13,%rcx,1),%dl
cmp    $0x4e,%dl
je     17b0 <main+0x600>
mov    (%r12,%rcx,1),%cl
cmp    $0x4e,%cl
jne    182e <main+0x67e>
add    $0x1,%esi
jmp    165d <main+0x4ad>
mov    %r8d,%r9d
and    $0xfffffffe,%r9d
xor    %ecx,%ecx
xor    %esi,%esi
xor    %r14d,%r14d
jmp    17dc <main+0x62c>
nopl   0x0(%rax,%rax,1)
add    $0x1,%esi
add    $0x2,%rcx
cmp    %rcx,%r9
je     1793 <main+0x5e3>
movzbl 0x0(%r13,%rcx,1),%edx
cmp    $0x4e,%dl
je     17f1 <main+0x641>
movzbl (%r12,%rcx,1),%ebx
cmp    $0x4e,%bl
jne    1800 <main+0x650>
add    $0x1,%esi
jmp    180b <main+0x65b>
cs nopw 0x0(%rax,%rax,1)
xor    %edi,%edi
cmp    %bl,%dl
setne  %dil
add    %edi,%r14d
movzbl 0x1(%r13,%rcx,1),%edx
cmp    $0x4e,%dl
je     17d0 <main+0x620>
movzbl 0x1(%r12,%rcx,1),%ebx
cmp    $0x4e,%bl
je     17d0 <main+0x620>
xor    %edi,%edi
cmp    %bl,%dl
setne  %dil
add    %edi,%r14d
jmp    17d3 <main+0x623>
xor    %edi,%edi
cmp    %cl,%dl
setne  %dil
add    %edi,%r14d
jmp    165d <main+0x4ad>
mov    %rbx,%rdi
call   10b0 <perror@plt>
jmp    1774 <main+0x5c4>
mov    %rbx,%rdi
call   10b0 <perror@plt>
jmp    1643 <main+0x493>
lea    -0x460(%rbp),%rdi
call   10b0 <perror@plt>
xor    %ebx,%ebx
jmp    13c0 <main+0x210>
lea    -0x460(%rbp),%rdi
call   10b0 <perror@plt>
lea    0x86a(%rip),%rbx
lea    -0x1420(%rbp),%r14
lea    -0x850(%rbp),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <printf@plt>
mov    -0x58(%rbp),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   1080 <fprintf@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/Analysis/log.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [11 x i8] c"/Analysis/\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [2 x i8] c"_\00"
@.str.5 = [14 x i8] c"_di_upstream_\00"
@.str.6 = [5 x i8] c".csv\00"
@.str.7 = [2 x i8] c"w\00"
@.str.8 = [43 x i8] c"Isolate_1,Isolate_2,SNPs,Sites,Divergence\0A\00"
@.str.9 = [33 x i8] c"/Analysis/Core_genome_alignment/\00"
@.str.10 = [24 x i8] c"_Core_genome_alignment/\00"
@.str.11 = [14 x i8] c"_isolates.txt\00"
@.str.12 = [2 x i8] c"r\00"
@.str.13 = [28 x i8] c"/Intergenic_files_upstream_\00"
@.str.14 = [7 x i8] c".fasta\00"
@.str.15 = [19 x i8] c"%s,%s,%i,%i,%0.6f\0A\00"
@.str.16 = [31 x i8] c"%s di upstream %s calculated.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i32*
%14 = alloca i64
%15 = alloca i32*
%16 = alloca i64
%17 = alloca i64
%18 = alloca i32
%19 = alloca i32*
%20 = alloca i64
%21 = alloca i64
%22 = alloca i64
%23 = alloca i64
%24 = alloca i32*
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i64
%31 = alloca i64
%32 = alloca i32
%33 = alloca i32*
%34 = alloca i8*
%35 = alloca i64
%36 = alloca i32
%37 = alloca i32*
%38 = alloca i8*
%39 = alloca i64
%40 = alloca i32
%41 = alloca i32
%42 = alloca i32
%43 = alloca i32
%44 = alloca i32
%45 = alloca float
%46 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1000, i32* %6
%47 = load i32, i32* %6
%48 = zext i32 %47 to i64
%49 = call i8* @llvm.stacksave()
store i8* %49, i8** %7
%50 = alloca i8, i64 %48
store i64 %48, i64* %8
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 1
%53 = load i8*, i8** %52
%54 = call i32 @strcpy(i8* %50, i8* %53)
%55 = load i32, i32* %6
%56 = zext i32 %55 to i64
%57 = alloca i8, i64 %56
store i64 %56, i64* %9
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 2
%60 = load i8*, i8** %59
%61 = call i32 @strcpy(i8* %57, i8* %60)
%62 = load i32, i32* %6
%63 = zext i32 %62 to i64
%64 = alloca i8, i64 %63
store i64 %63, i64* %10
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 3
%67 = load i8*, i8** %66
%68 = call i32 @strcpy(i8* %64, i8* %67)
%69 = load i32, i32* %6
%70 = zext i32 %69 to i64
%71 = alloca i8, i64 %70
store i64 %70, i64* %11
%72 = load i8**, i8*** %5
%73 = getelementptr inbounds i8*, i8** %72, i64 4
%74 = load i8*, i8** %73
%75 = call i32 @strcpy(i8* %71, i8* %74)
%76 = load i32, i32* %6
%77 = zext i32 %76 to i64
%78 = alloca i8, i64 %77
store i64 %77, i64* %12
%79 = call i32 @strcpy(i8* %78, i8* %64)
%80 = call i32 @strcat(i8* %78, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%81 = call i32* @fopen(i8* %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %81, i32** %13
%82 = load i32, i32* %6
%83 = zext i32 %82 to i64
%84 = alloca i8, i64 %83
store i64 %83, i64* %14
%85 = call i32 @strcpy(i8* %84, i8* %64)
%86 = call i32 @strcat(i8* %84, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%87 = call i32 @strcat(i8* %84, i8* %57)
%88 = call i32 @strcat(i8* %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%89 = call i32 @strcat(i8* %84, i8* %50)
%90 = call i32 @strcat(i8* %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%91 = call i32 @strcat(i8* %84, i8* %57)
%92 = call i32 @strcat(i8* %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%93 = call i32 @strcat(i8* %84, i8* %50)
%94 = call i32 @strcat(i8* %84, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%95 = call i32 @strcat(i8* %84, i8* %71)
%96 = call i32 @strcat(i8* %84, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%97 = call i32* @fopen(i8* %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %97, i32** %15
%98 = load i32*, i32** %15
%99 = call i32 (i32*, i8*, ...) @fprintf(i32* %98, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
%100 = load i32, i32* %6
%101 = zext i32 %100 to i64
%102 = alloca i8, i64 %101
store i64 %101, i64* %16
%103 = call i32 @strcpy(i8* %102, i8* %64)
%104 = call i32 @strcat(i8* %102, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
%105 = call i32 @strcat(i8* %102, i8* %50)
%106 = call i32 @strcat(i8* %102, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
%107 = call i32 @strcat(i8* %102, i8* %50)
%108 = call i32 @strcat(i8* %102, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
%109 = load i32, i32* %6
%110 = zext i32 %109 to i64
%111 = alloca i8, i64 %110
store i64 %110, i64* %17
store i32 0, i32* %18
%112 = call i32* @fopen(i8* %102, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i32* %112, i32** %19
%113 = load i32*, i32** %19
%114 = icmp ne i32* %113, null
br i1 %114, label %115, label %127
115: ; preds = %2
br label %116
116: ; preds = %121, %115
%117 = trunc i64 %110 to i32
%118 = load i32*, i32** %19
%119 = call i32* @fgets(i8* %111, i32 %117, i32* %118)
%120 = icmp ne i32* %119, null
br i1 %120, label %121, label %124
121: ; preds = %116
%122 = load i32, i32* %18
%123 = add nsw i32 %122, 1
store i32 %123, i32* %18
br label %116
124: ; preds = %116
%125 = load i32*, i32** %19
%126 = call i32 @fclose(i32* %125)
br label %129
127: ; preds = %2
%128 = call i32 @perror(i8* %102)
br label %129
129: ; preds = %127, %124
%130 = load i32, i32* %18
%131 = zext i32 %130 to i64
%132 = load i32, i32* %6
%133 = zext i32 %132 to i64
%134 = mul nuw i64 %131, %133
%135 = alloca i8, i64 %134
store i64 %131, i64* %20
store i64 %133, i64* %21
%136 = load i32, i32* %18
%137 = zext i32 %136 to i64
%138 = load i32, i32* %6
%139 = zext i32 %138 to i64
%140 = mul nuw i64 %137, %139
%141 = alloca i8, i64 %140
store i64 %137, i64* %22
store i64 %139, i64* %23
store i32 0, i32* %18
%142 = call i32* @fopen(i8* %102, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i32* %142, i32** %24
%143 = load i32*, i32** %24
%144 = icmp ne i32* %143, null
br i1 %144, label %145, label %236
145: ; preds = %129
br label %146
146: ; preds = %165, %145
%147 = trunc i64 %110 to i32
%148 = load i32*, i32** %24
%149 = call i32* @fgets(i8* %111, i32 %147, i32* %148)
%150 = icmp ne i32* %149, null
br i1 %150, label %151, label %233
151: ; preds = %146
%152 = call i32 @strlen(i8* %111)
store i32 %152, i32* %25
%153 = load i32, i32* %25
%154 = sub nsw i32 %153, 1
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i8, i8* %111, i64 %155
%157 = load i8, i8* %156
%158 = sext i8 %157 to i32
%159 = icmp eq i32 %158, 10
br i1 %159, label %160, label %165
160: ; preds = %151
%161 = load i32, i32* %25
%162 = sub nsw i32 %161, 1
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds i8, i8* %111, i64 %163
store i8 0, i8* %164
br label %165
165: ; preds = %160, %151
%166 = load i32, i32* %18
%167 = sext i32 %166 to i64
%168 = mul nsw i64 %167, %133
%169 = getelementptr inbounds i8, i8* %135, i64 %168
%170 = call i32 @strcpy(i8* %169, i8* %111)
%171 = load i32, i32* %18
%172 = sext i32 %171 to i64
%173 = mul nsw i64 %172, %139
%174 = getelementptr inbounds i8, i8* %141, i64 %173
%175 = call i32 @strcpy(i8* %174, i8* %64)
%176 = load i32, i32* %18
%177 = sext i32 %176 to i64
%178 = mul nsw i64 %177, %139
%179 = getelementptr inbounds i8, i8* %141, i64 %178
%180 = call i32 @strcat(i8* %179, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%181 = load i32, i32* %18
%182 = sext i32 %181 to i64
%183 = mul nsw i64 %182, %139
%184 = getelementptr inbounds i8, i8* %141, i64 %183
%185 = call i32 @strcat(i8* %184, i8* %57)
%186 = load i32, i32* %18
%187 = sext i32 %186 to i64
%188 = mul nsw i64 %187, %139
%189 = getelementptr inbounds i8, i8* %141, i64 %188
%190 = call i32 @strcat(i8* %189, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%191 = load i32, i32* %18
%192 = sext i32 %191 to i64
%193 = mul nsw i64 %192, %139
%194 = getelementptr inbounds i8, i8* %141, i64 %193
%195 = call i32 @strcat(i8* %194, i8* %50)
%196 = load i32, i32* %18
%197 = sext i32 %196 to i64
%198 = mul nsw i64 %197, %139
%199 = getelementptr inbounds i8, i8* %141, i64 %198
%200 = call i32 @strcat(i8* %199, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%201 = load i32, i32* %18
%202 = sext i32 %201 to i64
%203 = mul nsw i64 %202, %139
%204 = getelementptr inbounds i8, i8* %141, i64 %203
%205 = call i32 @strcat(i8* %204, i8* %57)
%206 = load i32, i32* %18
%207 = sext i32 %206 to i64
%208 = mul nsw i64 %207, %139
%209 = getelementptr inbounds i8, i8* %141, i64 %208
%210 = call i32 @strcat(i8* %209, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
%211 = load i32, i32* %18
%212 = sext i32 %211 to i64
%213 = mul nsw i64 %212, %139
%214 = getelementptr inbounds i8, i8* %141, i64 %213
%215 = call i32 @strcat(i8* %214, i8* %71)
%216 = load i32, i32* %18
%217 = sext i32 %216 to i64
%218 = mul nsw i64 %217, %139
%219 = getelementptr inbounds i8, i8* %141, i64 %218
%220 = call i32 @strcat(i8* %219, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%221 = load i32, i32* %18
%222 = sext i32 %221 to i64
%223 = mul nsw i64 %222, %139
%224 = getelementptr inbounds i8, i8* %141, i64 %223
%225 = call i32 @strcat(i8* %224, i8* %111)
%226 = load i32, i32* %18
%227 = sext i32 %226 to i64
%228 = mul nsw i64 %227, %139
%229 = getelementptr inbounds i8, i8* %141, i64 %228
%230 = call i32 @strcat(i8* %229, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%231 = load i32, i32* %18
%232 = add nsw i32 %231, 1
store i32 %232, i32* %18
br label %146
233: ; preds = %146
%234 = load i32*, i32** %24
%235 = call i32 @fclose(i32* %234)
br label %238
236: ; preds = %129
%237 = call i32 @perror(i8* %102)
br label %238
238: ; preds = %236, %233
store i32 1000000, i32* %29
%239 = load i32, i32* %29
%240 = zext i32 %239 to i64
%241 = alloca i8, i64 %240
store i64 %240, i64* %30
%242 = load i32, i32* %29
%243 = zext i32 %242 to i64
%244 = alloca i8, i64 %243
store i64 %243, i64* %31
store i32 0, i32* %32
store i32 0, i32* %26
br label %245
245: ; preds = %436, %238
%246 = load i32, i32* %26
%247 = load i32, i32* %18
%248 = icmp slt i32 %246, %247
br i1 %248, label %249, label %439
249: ; preds = %245
%250 = load i32, i32* %26
%251 = sext i32 %250 to i64
%252 = mul nsw i64 %251, %139
%253 = getelementptr inbounds i8, i8* %141, i64 %252
%254 = call i32* @fopen(i8* %253, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i32* %254, i32** %33
%255 = load i32*, i32** %33
%256 = icmp ne i32* %255, null
br i1 %256, label %257, label %293
257: ; preds = %249
%258 = load i32, i32* %29
%259 = zext i32 %258 to i64
%260 = call i8* @llvm.stacksave()
store i8* %260, i8** %34
%261 = alloca i8, i64 %259
store i64 %259, i64* %35
br label %262
262: ; preds = %290, %257
%263 = trunc i64 %259 to i32
%264 = load i32*, i32** %33
%265 = call i32* @fgets(i8* %261, i32 %263, i32* %264)
%266 = icmp ne i32* %265, null
br i1 %266, label %267, label %291
267: ; preds = %262
%268 = getelementptr inbounds i8, i8* %261, i64 0
%269 = load i8, i8* %268
%270 = sext i8 %269 to i32
%271 = icmp ne i32 %270, 62
br i1 %271, label %272, label %290
272: ; preds = %267
%273 = call i32 @strlen(i8* %261)
store i32 %273, i32* %36
%274 = load i32, i32* %36
%275 = sub nsw i32 %274, 1
store i32 %275, i32* %36
%276 = load i32, i32* %36
%277 = sext i32 %276 to i64
%278 = getelementptr inbounds i8, i8* %261, i64 %277
%279 = load i8, i8* %278
%280 = sext i8 %279 to i32
%281 = icmp eq i32 %280, 10
br i1 %281, label %282, label %286
282: ; preds = %272
%283 = load i32, i32* %36
%284 = sext i32 %283 to i64
%285 = getelementptr inbounds i8, i8* %261, i64 %284
store i8 0, i8* %285
br label %286
286: ; preds = %282, %272
%287 = call i32 @strcpy(i8* %241, i8* %261)
%288 = load i32*, i32** %33
%289 = call i32 @fclose(i32* %288)
br label %290
290: ; preds = %286, %267
br label %262
291: ; preds = %262
%292 = load i8*, i8** %34
br label %299
293: ; preds = %249
%294 = load i32, i32* %26
%295 = sext i32 %294 to i64
%296 = mul nsw i64 %295, %139
%297 = getelementptr inbounds i8, i8* %141, i64 %296
%298 = call i32 @perror(i8* %297)
br label %299
299: ; preds = %293, %291
store i32 0, i32* %27
br label %300
300: ; preds = %432, %299
%301 = load i32, i32* %27
%302 = load i32, i32* %18
%303 = icmp slt i32 %301, %302
br i1 %303, label %304, label %435
304: ; preds = %300
%305 = load i32, i32* %26
%306 = load i32, i32* %27
%307 = icmp sgt i32 %305, %306
br i1 %307, label %308, label %431
308: ; preds = %304
%309 = load i32, i32* %27
%310 = sext i32 %309 to i64
%311 = mul nsw i64 %310, %139
%312 = getelementptr inbounds i8, i8* %141, i64 %311
%313 = call i32* @fopen(i8* %312, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i32* %313, i32** %37
%314 = load i32*, i32** %37
%315 = icmp ne i32* %314, null
br i1 %315, label %316, label %352
316: ; preds = %308
%317 = load i32, i32* %29
%318 = zext i32 %317 to i64
%319 = call i8* @llvm.stacksave()
store i8* %319, i8** %38
%320 = alloca i8, i64 %318
store i64 %318, i64* %39
br label %321
321: ; preds = %349, %316
%322 = trunc i64 %318 to i32
%323 = load i32*, i32** %37
%324 = call i32* @fgets(i8* %320, i32 %322, i32* %323)
%325 = icmp ne i32* %324, null
br i1 %325, label %326, label %350
326: ; preds = %321
%327 = getelementptr inbounds i8, i8* %320, i64 0
%328 = load i8, i8* %327
%329 = sext i8 %328 to i32
%330 = icmp ne i32 %329, 62
br i1 %330, label %331, label %349
331: ; preds = %326
%332 = call i32 @strlen(i8* %320)
store i32 %332, i32* %40
%333 = load i32, i32* %40
%334 = sub nsw i32 %333, 1
store i32 %334, i32* %40
%335 = load i32, i32* %40
%336 = sext i32 %335 to i64
%337 = getelementptr inbounds i8, i8* %320, i64 %336
%338 = load i8, i8* %337
%339 = sext i8 %338 to i32
%340 = icmp eq i32 %339, 10
br i1 %340, label %341, label %345
341: ; preds = %331
%342 = load i32, i32* %40
%343 = sext i32 %342 to i64
%344 = getelementptr inbounds i8, i8* %320, i64 %343
store i8 0, i8* %344
br label %345
345: ; preds = %341, %331
%346 = call i32 @strcpy(i8* %244, i8* %320)
%347 = load i32*, i32** %37
%348 = call i32 @fclose(i32* %347)
br label %349
349: ; preds = %345, %326
br label %321
350: ; preds = %321
%351 = load i8*, i8** %38
br label %358
352: ; preds = %308
%353 = load i32, i32* %27
%354 = sext i32 %353 to i64
%355 = mul nsw i64 %354, %139
%356 = getelementptr inbounds i8, i8* %141, i64 %355
%357 = call i32 @perror(i8* %356)
br label %358
358: ; preds = %352, %350
%359 = call i32 @strlen(i8* %241)
store i32 %359, i32* %41
store i32 0, i32* %42
store i32 0, i32* %43
store i32 0, i32* %28
br label %360
360: ; preds = %398, %358
%361 = load i32, i32* %28
%362 = load i32, i32* %41
%363 = icmp slt i32 %361, %362
br i1 %363, label %364, label %401
364: ; preds = %360
%365 = load i32, i32* %28
%366 = sext i32 %365 to i64
%367 = getelementptr inbounds i8, i8* %241, i64 %366
%368 = load i8, i8* %367
%369 = sext i8 %368 to i32
%370 = icmp eq i32 %369, 78
br i1 %370, label %378, label %371
371: ; preds = %364
%372 = load i32, i32* %28
%373 = sext i32 %372 to i64
%374 = getelementptr inbounds i8, i8* %244, i64 %373
%375 = load i8, i8* %374
%376 = sext i8 %375 to i32
%377 = icmp eq i32 %376, 78
br i1 %377, label %378, label %381
378: ; preds = %371, %364
%379 = load i32, i32* %43
%380 = add nsw i32 %379, 1
store i32 %380, i32* %43
br label %397
381: ; preds = %371
%382 = load i32, i32* %28
%383 = sext i32 %382 to i64
%384 = getelementptr inbounds i8, i8* %241, i64 %383
%385 = load i8, i8* %384
%386 = sext i8 %385 to i32
%387 = load i32, i32* %28
%388 = sext i32 %387 to i64
%389 = getelementptr inbounds i8, i8* %244, i64 %388
%390 = load i8, i8* %389
%391 = sext i8 %390 to i32
%392 = icmp ne i32 %386, %391
br i1 %392, label %393, label %396
393: ; preds = %381
%394 = load i32, i32* %42
%395 = add nsw i32 %394, 1
store i32 %395, i32* %42
br label %396
396: ; preds = %393, %381
br label %397
397: ; preds = %396, %378
br label %398
398: ; preds = %397
%399 = load i32, i32* %28
%400 = add nsw i32 %399, 1
store i32 %400, i32* %28
br label %360
401: ; preds = %360
%402 = load i32, i32* %41
%403 = load i32, i32* %43
%404 = sub nsw i32 %402, %403
store i32 %404, i32* %44
%405 = load i32, i32* %42
%406 = sitofp i32 %405 to float
%407 = load i32, i32* %44
%408 = sitofp i32 %407 to float
%409 = fdiv float %406, %408
store float %409, float* %45
%410 = load float, float* %45
%411 = call float @llvm.fmuladd.f32(float 0xBFF5555560000000, float %410, float 1.000000e+00)
%412 = fptosi float %411 to i32
%413 = call float @log(i32 %412)
%414 = fmul float -7.500000e-01, %413
store float %414, float* %46
%415 = load i32*, i32** %15
%416 = load i32, i32* %26
%417 = sext i32 %416 to i64
%418 = mul nsw i64 %417, %133
%419 = getelementptr inbounds i8, i8* %135, i64 %418
%420 = load i32, i32* %27
%421 = sext i32 %420 to i64
%422 = mul nsw i64 %421, %133
%423 = getelementptr inbounds i8, i8* %135, i64 %422
%424 = load i32, i32* %42
%425 = load i32, i32* %44
%426 = load float, float* %46
%427 = fpext float %426 to double
%428 = call i32 (i32*, i8*, ...) @fprintf(i32* %415, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0), i8* %419, i8* %423, i32 %424, i32 %425, double %427)
%429 = load i32, i32* %32
%430 = add nsw i32 %429, 1
store i32 %430, i32* %32
br label %431
431: ; preds = %401, %304
br label %432
432: ; preds = %431
%433 = load i32, i32* %27
%434 = add nsw i32 %433, 1
store i32 %434, i32* %27
br label %300
435: ; preds = %300
br label %436
436: ; preds = %435
%437 = load i32, i32* %26
%438 = add nsw i32 %437, 1
store i32 %438, i32* %26
br label %245
439: ; preds = %245
%440 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), i8* %50, i8* %71)
%441 = load i32*, i32** %13
%442 = call i32 (i32*, i8*, ...) @fprintf(i32* %441, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), i8* %50, i8* %71)
store i32 0, i32* %3
%443 = load i8*, i8** %7
%444 = load i32, i32* %3
ret i32 %444
}

LLVM IR (-O2):
@.str = [18 x i8] c"/Analysis/log.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [11 x i8] c"/Analysis/\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [2 x i8] c"_\00"
@.str.5 = [14 x i8] c"_di_upstream_\00"
@.str.6 = [5 x i8] c".csv\00"
@.str.7 = [2 x i8] c"w\00"
@.str.8 = [43 x i8] c"Isolate_1,Isolate_2,SNPs,Sites,Divergence\0A\00"
@.str.9 = [33 x i8] c"/Analysis/Core_genome_alignment/\00"
@.str.10 = [24 x i8] c"_Core_genome_alignment/\00"
@.str.11 = [14 x i8] c"_isolates.txt\00"
@.str.12 = [2 x i8] c"r\00"
@.str.13 = [28 x i8] c"/Intergenic_files_upstream_\00"
@.str.14 = [7 x i8] c".fasta\00"
@.str.15 = [19 x i8] c"%s,%s,%i,%i,%0.6f\0A\00"
@.str.16 = [31 x i8] c"%s di upstream %s calculated.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @strcpy(i8* %4, i8* %6)
%8 = alloca [1000 x i8]
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = call i32 @strcpy(i8* %9, i8* %11)
%13 = alloca [1000 x i8]
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %13, i64 0, i64 0
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = call i32 @strcpy(i8* %14, i8* %16)
%18 = alloca [1000 x i8]
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%20 = getelementptr inbounds i8*, i8** %1, i64 4
%21 = load i8*, i8** %20
%22 = call i32 @strcpy(i8* %19, i8* %21)
%23 = alloca [1000 x i8]
%24 = getelementptr inbounds [1000 x i8], [1000 x i8]* %23, i64 0, i64 0
%25 = call i32 @strcpy(i8* %24, i8* %14)
%26 = call i32 @strcat(i8* %24, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%27 = call i32* @fopen(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%28 = alloca [1000 x i8]
%29 = getelementptr inbounds [1000 x i8], [1000 x i8]* %28, i64 0, i64 0
%30 = call i32 @strcpy(i8* %29, i8* %14)
%31 = call i32 @strcat(i8* %29, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%32 = call i32 @strcat(i8* %29, i8* %9)
%33 = call i32 @strcat(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%34 = call i32 @strcat(i8* %29, i8* %4)
%35 = call i32 @strcat(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%36 = call i32 @strcat(i8* %29, i8* %9)
%37 = call i32 @strcat(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%38 = call i32 @strcat(i8* %29, i8* %4)
%39 = call i32 @strcat(i8* %29, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%40 = call i32 @strcat(i8* %29, i8* %19)
%41 = call i32 @strcat(i8* %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%42 = call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%43 = call i64 @fwrite(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0), i64 42, i64 1, i32* %42)
%44 = alloca [1000 x i8]
%45 = getelementptr inbounds [1000 x i8], [1000 x i8]* %44, i64 0, i64 0
%46 = call i32 @strcpy(i8* %45, i8* %14)
%47 = call i32 @strcat(i8* %45, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
%48 = call i32 @strcat(i8* %45, i8* %4)
%49 = call i32 @strcat(i8* %45, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
%50 = call i32 @strcat(i8* %45, i8* %4)
%51 = call i32 @strcat(i8* %45, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
%52 = alloca [1000 x i8]
%53 = getelementptr inbounds [1000 x i8], [1000 x i8]* %52, i64 0, i64 0
%54 = call i32* @fopen(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%55 = icmp eq i32* %54, null
br i1 %55, label %63, label %56
56: ; preds = %2, %56
%57 = phi i32 [ %60, %56 ], [ 0, %2 ]
%58 = call i32* @fgets(i8* %53, i32 1000, i32* %54)
%59 = icmp eq i32* %58, null
%60 = add nuw nsw i32 %57, 1
br i1 %59, label %61, label %56
61: ; preds = %56
%62 = call i32 @fclose(i32* %54)
br label %65
63: ; preds = %2
%64 = call i32 @perror(i8* %45)
br label %65
65: ; preds = %63, %61
%66 = phi i32 [ %57, %61 ], [ 0, %63 ]
%67 = zext i32 %66 to i64
%68 = mul nuw nsw i64 %67, 1000
%69 = alloca i8, i64 %68
%70 = alloca i8, i64 %68
%71 = call i32* @fopen(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%72 = icmp eq i32* %71, null
br i1 %72, label %107, label %73
73: ; preds = %65
%74 = call i32* @fgets(i8* %53, i32 1000, i32* %71)
%75 = icmp eq i32* %74, null
br i1 %75, label %109, label %76
76: ; preds = %73, %85
%77 = phi i64 [ %102, %85 ], [ 0, %73 ]
%78 = call i32 @strlen(i8* %53)
%79 = add nsw i32 %78, -1
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [1000 x i8], [1000 x i8]* %52, i64 0, i64 %80
%82 = load i8, i8* %81
%83 = icmp eq i8 %82, 10
br i1 %83, label %84, label %85
84: ; preds = %76
store i8 0, i8* %81
br label %85
85: ; preds = %84, %76
%86 = mul nuw nsw i64 %77, 1000
%87 = getelementptr inbounds i8, i8* %69, i64 %86
%88 = call i32 @strcpy(i8* %87, i8* %53)
%89 = getelementptr inbounds i8, i8* %70, i64 %86
%90 = call i32 @strcpy(i8* %89, i8* %14)
%91 = call i32 @strcat(i8* %89, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%92 = call i32 @strcat(i8* %89, i8* %9)
%93 = call i32 @strcat(i8* %89, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%94 = call i32 @strcat(i8* %89, i8* %4)
%95 = call i32 @strcat(i8* %89, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%96 = call i32 @strcat(i8* %89, i8* %9)
%97 = call i32 @strcat(i8* %89, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
%98 = call i32 @strcat(i8* %89, i8* %19)
%99 = call i32 @strcat(i8* %89, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%100 = call i32 @strcat(i8* %89, i8* %53)
%101 = call i32 @strcat(i8* %89, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%102 = add nuw i64 %77, 1
%103 = call i32* @fgets(i8* %53, i32 1000, i32* %71)
%104 = icmp eq i32* %103, null
br i1 %104, label %105, label %76
105: ; preds = %85
%106 = trunc i64 %102 to i32
br label %109
107: ; preds = %65
%108 = call i32 @perror(i8* %45)
br label %278
109: ; preds = %73, %105
%110 = phi i32 [ 0, %73 ], [ %106, %105 ]
%111 = call i32 @fclose(i32* %71)
%112 = alloca [1000000 x i8]
%113 = alloca [1000000 x i8]
%114 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %113, i64 0, i64 0
%115 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %112, i64 0, i64 0
%116 = icmp eq i32 %110, 0
br i1 %116, label %278, label %117
117: ; preds = %109
%118 = zext i32 %110 to i64
br label %119
119: ; preds = %117, %275
%120 = phi i64 [ 0, %117 ], [ %276, %275 ]
%121 = mul nuw nsw i64 %120, 1000
%122 = getelementptr inbounds i8, i8* %70, i64 %121
%123 = call i32* @fopen(i8* %122, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%124 = icmp eq i32* %123, null
br i1 %124, label %149, label %125
125: ; preds = %119
%126 = call i8* @llvm.stacksave()
%127 = alloca [1000000 x i8]
%128 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %127, i64 0, i64 0
%129 = call i32* @fgets(i8* %128, i32 1000000, i32* %123)
%130 = icmp eq i32* %129, null
br i1 %130, label %148, label %131
131: ; preds = %125, %145
%132 = load i8, i8* %128
%133 = icmp eq i8 %132, 62
br i1 %133, label %145, label %134
134: ; preds = %131
%135 = call i32 @strlen(i8* %128)
%136 = add nsw i32 %135, -1
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %127, i64 0, i64 %137
%139 = load i8, i8* %138
%140 = icmp eq i8 %139, 10
br i1 %140, label %141, label %142
141: ; preds = %134
store i8 0, i8* %138
br label %142
142: ; preds = %141, %134
%143 = call i32 @strcpy(i8* %115, i8* %128)
%144 = call i32 @fclose(i32* %123)
br label %145
145: ; preds = %142, %131
%146 = call i32* @fgets(i8* %128, i32 1000000, i32* %123)
%147 = icmp eq i32* %146, null
br i1 %147, label %148, label %131
148: ; preds = %145, %125
br label %151
149: ; preds = %119
%150 = call i32 @perror(i8* %122)
br label %151
151: ; preds = %149, %148
%152 = getelementptr inbounds i8, i8* %69, i64 %121
br label %153
153: ; preds = %151, %272
%154 = phi i64 [ 0, %151 ], [ %273, %272 ]
%155 = icmp ugt i64 %120, %154
br i1 %155, label %156, label %272
156: ; preds = %153
%157 = mul nuw nsw i64 %154, 1000
%158 = getelementptr inbounds i8, i8* %70, i64 %157
%159 = call i32* @fopen(i8* %158, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%160 = icmp eq i32* %159, null
br i1 %160, label %185, label %161
161: ; preds = %156
%162 = call i8* @llvm.stacksave()
%163 = alloca [1000000 x i8]
%164 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %163, i64 0, i64 0
%165 = call i32* @fgets(i8* %164, i32 1000000, i32* %159)
%166 = icmp eq i32* %165, null
br i1 %166, label %184, label %167
167: ; preds = %161, %181
%168 = load i8, i8* %164
%169 = icmp eq i8 %168, 62
br i1 %169, label %181, label %170
170: ; preds = %167
%171 = call i32 @strlen(i8* %164)
%172 = add nsw i32 %171, -1
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %163, i64 0, i64 %173
%175 = load i8, i8* %174
%176 = icmp eq i8 %175, 10
br i1 %176, label %177, label %178
177: ; preds = %170
store i8 0, i8* %174
br label %178
178: ; preds = %177, %170
%179 = call i32 @strcpy(i8* %114, i8* %164)
%180 = call i32 @fclose(i32* %159)
br label %181
181: ; preds = %178, %167
%182 = call i32* @fgets(i8* %164, i32 1000000, i32* %159)
%183 = icmp eq i32* %182, null
br i1 %183, label %184, label %167
184: ; preds = %181, %161
br label %187
185: ; preds = %156
%186 = call i32 @perror(i8* %158)
br label %187
187: ; preds = %185, %184
%188 = call i32 @strlen(i8* %115)
%189 = icmp sgt i32 %188, 0
br i1 %189, label %190, label %258
190: ; preds = %187
%191 = zext i32 %188 to i64
%192 = and i64 %191, 1
%193 = icmp eq i32 %188, 1
br i1 %193, label %237, label %194
194: ; preds = %190
%195 = and i64 %191, 4294967294
br label %196
196: ; preds = %231, %194
%197 = phi i64 [ 0, %194 ], [ %234, %231 ]
%198 = phi i32 [ 0, %194 ], [ %233, %231 ]
%199 = phi i32 [ 0, %194 ], [ %232, %231 ]
%200 = phi i64 [ 0, %194 ], [ %235, %231 ]
%201 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %112, i64 0, i64 %197
%202 = load i8, i8* %201
%203 = icmp eq i8 %202, 78
br i1 %203, label %208, label %204
204: ; preds = %196
%205 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %113, i64 0, i64 %197
%206 = load i8, i8* %205
%207 = icmp eq i8 %206, 78
br i1 %207, label %208, label %210
208: ; preds = %204, %196
%209 = add nsw i32 %198, 1
br label %214
210: ; preds = %204
%211 = icmp ne i8 %202, %206
%212 = zext i1 %211 to i32
%213 = add nsw i32 %199, %212
br label %214
214: ; preds = %210, %208
%215 = phi i32 [ %199, %208 ], [ %213, %210 ]
%216 = phi i32 [ %209, %208 ], [ %198, %210 ]
%217 = or i64 %197, 1
%218 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %112, i64 0, i64 %217
%219 = load i8, i8* %218
%220 = icmp eq i8 %219, 78
br i1 %220, label %229, label %221
221: ; preds = %214
%222 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %113, i64 0, i64 %217
%223 = load i8, i8* %222
%224 = icmp eq i8 %223, 78
br i1 %224, label %229, label %225
225: ; preds = %221
%226 = icmp ne i8 %219, %223
%227 = zext i1 %226 to i32
%228 = add nsw i32 %215, %227
br label %231
229: ; preds = %221, %214
%230 = add nsw i32 %216, 1
br label %231
231: ; preds = %229, %225
%232 = phi i32 [ %215, %229 ], [ %228, %225 ]
%233 = phi i32 [ %230, %229 ], [ %216, %225 ]
%234 = add nuw nsw i64 %197, 2
%235 = add i64 %200, 2
%236 = icmp eq i64 %235, %195
br i1 %236, label %237, label %196
237: ; preds = %231, %190
%238 = phi i32 [ undef, %190 ], [ %232, %231 ]
%239 = phi i32 [ undef, %190 ], [ %233, %231 ]
%240 = phi i64 [ 0, %190 ], [ %234, %231 ]
%241 = phi i32 [ 0, %190 ], [ %233, %231 ]
%242 = phi i32 [ 0, %190 ], [ %232, %231 ]
%243 = icmp eq i64 %192, 0
br i1 %243, label %258, label %244
244: ; preds = %237
%245 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %112, i64 0, i64 %240
%246 = load i8, i8* %245
%247 = icmp eq i8 %246, 78
br i1 %247, label %256, label %248
248: ; preds = %244
%249 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %113, i64 0, i64 %240
%250 = load i8, i8* %249
%251 = icmp eq i8 %250, 78
br i1 %251, label %256, label %252
252: ; preds = %248
%253 = icmp ne i8 %246, %250
%254 = zext i1 %253 to i32
%255 = add nsw i32 %242, %254
br label %258
256: ; preds = %248, %244
%257 = add nsw i32 %241, 1
br label %258
258: ; preds = %237, %256, %252, %187
%259 = phi i32 [ 0, %187 ], [ %238, %237 ], [ %242, %256 ], [ %255, %252 ]
%260 = phi i32 [ 0, %187 ], [ %239, %237 ], [ %257, %256 ], [ %241, %252 ]
%261 = sub nsw i32 %188, %260
%262 = sitofp i32 %259 to float
%263 = sitofp i32 %261 to float
%264 = fdiv float %262, %263
%265 = call float @llvm.fmuladd.f32(float %264, float 0xBFF5555560000000, float 1.000000e+00)
%266 = fptosi float %265 to i32
%267 = call float @log(i32 %266)
%268 = fmul float %267, -7.500000e-01
%269 = getelementptr inbounds i8, i8* %69, i64 %157
%270 = fpext float %268 to double
%271 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0), i8* %152, i8* %269, i32 %259, i32 %261, double %270)
br label %272
272: ; preds = %153, %258
%273 = add nuw nsw i64 %154, 1
%274 = icmp eq i64 %273, %118
br i1 %274, label %275, label %153
275: ; preds = %272
%276 = add nuw nsw i64 %120, 1
%277 = icmp eq i64 %276, %118
br i1 %277, label %278, label %119
278: ; preds = %275, %107, %109
%279 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), i8* %4, i8* %19)
%280 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), i8* %4, i8* %19)
ret i32 0
}