#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 atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
char *getInput(int, char **, int *);
int /*<<< orphan*/ getOutput(int, char **, int *, char **, char **);
scalar_t__ malloc(int);
scalar_t__ realloc(char *, int);
unsigned long splitSequencesBlast(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
int main(int ac, char **av) {
  int nChunks, iin, iout;
  FILE *fOut;
  char tmp[1000];
  char *parameters, *aux, *input, *prefix, *suffix;
  unsigned long i, length;
  if (ac < 5) {
    fprintf(stderr, "USE: ./mapSequences inputFile.fasta nChunks +commandLine "
                    "(-query input -out output )\n");
    exit(-1);
  }
  nChunks = atoi(av[2]);
  input = getInput(ac, av, &iin);
  getOutput(ac, av, &iout, &prefix, &suffix);
  length = splitSequencesBlast(input, nChunks);
  sprintf(tmp, "%s-map", av[1]);
  if ((fOut = fopen(tmp, "wt")) == NULL) {
    fprintf(stderr, "opening final MAP script file\n");
    exit(-1);
  }
  parameters = (char *)malloc(sizeof(char) * (strlen(av[3]) + 1));
  sprintf(parameters, "%s", av[3]);
  for (i = 4; i < ac; i++) {
    if (i != iin && i != iin - 1 && i != iout && i != iout - 1) {
      aux = (char *)malloc(sizeof(char) * (strlen(av[i]) + 1));
      sprintf(aux, " %s", av[i]);
      parameters = (char *)realloc(
          parameters, sizeof(char) * (strlen(aux) + strlen(parameters) + 1));
      strcat(parameters, aux);
    }
  }
  for (i = 0; i < length; i++) {
    fprintf(fOut, "%s %s %s-%04lu %s %s-%04lu.%s\n", parameters, av[iin - 1],
            av[iin], i, av[iout - 1], prefix, i, suffix);
  }
  fclose(fOut);
  sprintf(tmp, "%s-red", av[1]);
  if ((fOut = fopen(tmp, "wt")) == NULL) {
    fprintf(stderr, "opening final REDUCE script file\n");
    exit(-1);
  }
  fprintf(fOut, "cat ");
  for (i = 0; i < length; i++) {
    fprintf(fOut, "%s-%04lu.%s ", prefix, i, suffix);
  }
  fprintf(fOut, "> %s.%s", prefix, suffix);
  fclose(fOut);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x488,%rsp
movl   $0x0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1216 <main+0x46>
mov    0x2de5(%rip),%rax
movslq (%rax),%rdi
lea    0xdfb(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0xffffffff,%edi
call   10f0 <exit@plt>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1060 <getInput@plt>
mov    %rax,-0x438(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x18(%rbp),%rsi
lea    -0x24(%rbp),%rdx
lea    -0x440(%rbp),%rcx
lea    -0x448(%rbp),%r8
call   10b0 <getOutput@plt>
mov    -0x438(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <splitSequencesBlast@plt>
mov    %rax,-0x458(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xdcf(%rip),%rsi
call   10e0 <sprintf@plt>
lea    -0x420(%rbp),%rdi
lea    0xdc3(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    12cf <main+0xff>
mov    0x2d2c(%rip),%rax
movslq (%rax),%rdi
lea    0xda2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0xffffffff,%edi
call   10f0 <exit@plt>
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x428(%rbp)
mov    -0x428(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rdx
lea    0xd77(%rip),%rsi
call   10e0 <sprintf@plt>
movq   $0x4,-0x450(%rbp)
mov    -0x450(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmp    %rcx,%rax
jae    1457 <main+0x287>
mov    -0x450(%rbp),%rax
movslq -0x20(%rbp),%rcx
cmp    %rcx,%rax
je     143b <main+0x26b>
mov    -0x450(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
je     143b <main+0x26b>
mov    -0x450(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmp    %rcx,%rax
je     143b <main+0x26b>
mov    -0x450(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
je     143b <main+0x26b>
mov    -0x18(%rbp),%rax
mov    -0x450(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x430(%rbp)
mov    -0x430(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x450(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xcb0(%rip),%rsi
call   10e0 <sprintf@plt>
mov    -0x428(%rbp),%rax
mov    %rax,-0x468(%rbp)
mov    -0x430(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x45c(%rbp)
mov    -0x428(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x468(%rbp),%rdi
mov    %eax,%ecx
mov    -0x45c(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%esi
call   1090 <realloc@plt>
mov    %rax,-0x428(%rbp)
mov    -0x428(%rbp),%rdi
mov    -0x430(%rbp),%rsi
call   10d0 <strcat@plt>
jmp    1440 <main+0x270>
mov    -0x450(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x450(%rbp)
jmp    1319 <main+0x149>
movq   $0x0,-0x450(%rbp)
mov    -0x450(%rbp),%rax
cmp    -0x458(%rbp),%rax
jae    1503 <main+0x333>
mov    -0x30(%rbp),%rdi
mov    -0x428(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rsi
mov    (%rax,%rsi,8),%r8
mov    -0x450(%rbp),%r9
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%esi
sub    $0x1,%esi
movslq %esi,%rsi
mov    (%rax,%rsi,8),%rbx
mov    -0x440(%rbp),%r11
mov    -0x450(%rbp),%r10
mov    -0x448(%rbp),%rax
lea    0xbb1(%rip),%rsi
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x450(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x450(%rbp)
jmp    1462 <main+0x292>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
lea    -0x420(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xb80(%rip),%rsi
call   10e0 <sprintf@plt>
lea    -0x420(%rbp),%rdi
lea    0xb28(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    156a <main+0x39a>
mov    0x2a91(%rip),%rax
movslq (%rax),%rdi
lea    0xb50(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0xffffffff,%edi
call   10f0 <exit@plt>
mov    -0x30(%rbp),%rdi
lea    0xb56(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movq   $0x0,-0x450(%rbp)
mov    -0x450(%rbp),%rax
cmp    -0x458(%rbp),%rax
jae    15d9 <main+0x409>
mov    -0x30(%rbp),%rdi
mov    -0x440(%rbp),%rdx
mov    -0x450(%rbp),%rcx
mov    -0x448(%rbp),%r8
lea    0xb15(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x450(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x450(%rbp)
jmp    1587 <main+0x3b7>
mov    -0x30(%rbp),%rdi
mov    -0x440(%rbp),%rdx
mov    -0x448(%rbp),%rcx
lea    0xaeb(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x488,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
cmp    $0x4,%edi
jle    147a <main+0x28a>
mov    %rsi,%r14
mov    %edi,%r13d
mov    0x10(%rsi),%rdi
call   10d0 <atoi@plt>
mov    %eax,%ebx
lea    0xc(%rsp),%rdx
mov    %r13d,%edi
mov    %r14,%rsi
call   1070 <getInput@plt>
mov    %rax,%rbp
lea    0x8(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x10(%rsp),%r8
mov    %r13d,%edi
mov    %r14,%rsi
call   10c0 <getOutput@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
call   1050 <splitSequencesBlast@plt>
mov    %rax,0x20(%rsp)
mov    0x8(%r14),%rdx
lea    0xdf4(%rip),%rsi
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
call   10f0 <sprintf@plt>
lea    0xde7(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1492 <main+0x2a2>
mov    %rax,%r12
mov    0x18(%r14),%rdi
call   1060 <strlen@plt>
lea    0x1(%rax),%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
mov    0x18(%r14),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %r13d,%r13d
mov    $0x4,%r15d
jmp    12cd <main+0xdd>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r15
cmp    %r15,%r13
je     1355 <main+0x165>
movslq 0xc(%rsp),%rax
cmp    %rax,%r15
je     12c0 <main+0xd0>
add    $0xffffffffffffffff,%rax
cmp    %rax,%r15
je     12c0 <main+0xd0>
movslq 0x8(%rsp),%rax
cmp    %rax,%r15
je     12c0 <main+0xd0>
add    $0xffffffffffffffff,%rax
cmp    %rax,%r15
je     12c0 <main+0xd0>
mov    (%r14,%r15,8),%rdi
call   1060 <strlen@plt>
lea    0x1(%rax),%edi
call   1090 <malloc@plt>
mov    %rax,%rbp
mov    (%r14,%r15,8),%rdx
mov    %rax,%rdi
lea    0xd6a(%rip),%rsi
call   10f0 <sprintf@plt>
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %rax,0x28(%rsp)
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    0x28(%rsp),%rcx
lea    (%rcx,%rax,1),%esi
add    $0x1,%esi
mov    %rbx,%rdi
call   10a0 <realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
call   10e0 <strcat@plt>
jmp    12c0 <main+0xd0>
mov    0x20(%rsp),%r15
test   %r15,%r15
mov    %r12,%rdi
je     13b8 <main+0x1c8>
mov    %rbx,%r13
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movslq 0xc(%rsp),%rax
mov    -0x8(%r14,%rax,8),%rcx
mov    (%r14,%rax,8),%r8
movslq 0x8(%rsp),%rbx
mov    %r12,%rdi
lea    0xcf6(%rip),%rsi
mov    %r13,%rdx
mov    %rbp,%r9
xor    %eax,%eax
push   0x10(%rsp)
push   %rbp
push   0x28(%rsp)
push   -0x8(%r14,%rbx,8)
call   1080 <fprintf@plt>
mov    %r12,%rdi
add    $0x20,%rsp
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1370 <main+0x180>
call   1040 <fclose@plt>
mov    0x8(%r14),%rdx
lea    0xcda(%rip),%rsi
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   10f0 <sprintf@plt>
lea    0xc81(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     14aa <main+0x2ba>
mov    %rax,%r14
lea    0xcd4(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1110 <fwrite@plt>
test   %r15,%r15
je     1443 <main+0x253>
mov    %r15,%rbx
lea    0xcb8(%rip),%r15
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    0x18(%rsp),%rdx
mov    0x10(%rsp),%r8
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbp,%rcx
xor    %eax,%eax
call   1080 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1420 <main+0x230>
mov    0x18(%rsp),%rdx
mov    0x10(%rsp),%rcx
lea    0xc89(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b5f(%rip),%rax
movslq (%rax),%rcx
lea    0xb75(%rip),%rdi
mov    $0x55,%esi
jmp    14c0 <main+0x2d0>
mov    0x2b47(%rip),%rax
movslq (%rax),%rcx
lea    0xbbd(%rip),%rdi
mov    $0x1e,%esi
jmp    14c0 <main+0x2d0>
mov    0x2b2f(%rip),%rax
movslq (%rax),%rcx
lea    0xbee(%rip),%rdi
mov    $0x21,%esi
mov    $0x1,%edx
call   1110 <fwrite@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [86 x i8] c"USE: ./mapSequences inputFile.fasta nChunks +commandLine (-query input -out output )\0A\00"
@.str.1 = [7 x i8] c"%s-map\00"
@.str.2 = [3 x i8] c"wt\00"
@.str.3 = [31 x i8] c"opening final MAP script file\0A\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [4 x i8] c" %s\00"
@.str.6 = [31 x i8] c"%s %s %s-%04lu %s %s-%04lu.%s\0A\00"
@.str.7 = [7 x i8] c"%s-red\00"
@.str.8 = [34 x i8] c"opening final REDUCE script file\0A\00"
@.str.9 = [5 x i8] c"cat \00"
@.str.10 = [13 x i8] c"%s-%04lu.%s \00"
@.str.11 = [8 x i8] c"> %s.%s\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 i32*
%10 = alloca [1000 x i8]
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 5
br i1 %19, label %20, label %26
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i32*
%24 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%25 = call i32 @exit(i32 -1)
unreachable
26: ; preds = %2
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 2
%29 = load i8*, i8** %28
%30 = call i32 @atoi(i8* %29)
store i32 %30, i32* %6
%31 = load i32, i32* %4
%32 = load i8**, i8*** %5
%33 = call i8* @getInput(i32 %31, i8** %32, i32* %7)
store i8* %33, i8** %13
%34 = load i32, i32* %4
%35 = load i8**, i8*** %5
%36 = call i32 @getOutput(i32 %34, i8** %35, i32* %8, i8** %14, i8** %15)
%37 = load i8*, i8** %13
%38 = load i32, i32* %6
%39 = call i64 @splitSequencesBlast(i8* %37, i32 %38)
store i64 %39, i64* %17
%40 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 1
%43 = load i8*, i8** %42
%44 = call i32 @sprintf(i8* %40, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %43)
%45 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%46 = call i32* @fopen(i8* %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %46, i32** %9
%47 = icmp eq i32* %46, null
br i1 %47, label %48, label %54
48: ; preds = %26
%49 = load i32, i32* @stderr
%50 = sext i32 %49 to i64
%51 = inttoptr i64 %50 to i32*
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %51, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%53 = call i32 @exit(i32 -1)
unreachable
54: ; preds = %26
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 3
%57 = load i8*, i8** %56
%58 = call i32 @strlen(i8* %57)
%59 = add nsw i32 %58, 1
%60 = sext i32 %59 to i64
%61 = mul i64 1, %60
%62 = trunc i64 %61 to i32
%63 = call i64 @malloc(i32 %62)
%64 = inttoptr i64 %63 to i8*
store i8* %64, i8** %11
%65 = load i8*, i8** %11
%66 = load i8**, i8*** %5
%67 = getelementptr inbounds i8*, i8** %66, i64 3
%68 = load i8*, i8** %67
%69 = call i32 @sprintf(i8* %65, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %68)
store i64 4, i64* %16
br label %70
70: ; preds = %131, %54
%71 = load i64, i64* %16
%72 = load i32, i32* %4
%73 = sext i32 %72 to i64
%74 = icmp ult i64 %71, %73
br i1 %74, label %75, label %134
75: ; preds = %70
%76 = load i64, i64* %16
%77 = load i32, i32* %7
%78 = sext i32 %77 to i64
%79 = icmp ne i64 %76, %78
br i1 %79, label %80, label %130
80: ; preds = %75
%81 = load i64, i64* %16
%82 = load i32, i32* %7
%83 = sub nsw i32 %82, 1
%84 = sext i32 %83 to i64
%85 = icmp ne i64 %81, %84
br i1 %85, label %86, label %130
86: ; preds = %80
%87 = load i64, i64* %16
%88 = load i32, i32* %8
%89 = sext i32 %88 to i64
%90 = icmp ne i64 %87, %89
br i1 %90, label %91, label %130
91: ; preds = %86
%92 = load i64, i64* %16
%93 = load i32, i32* %8
%94 = sub nsw i32 %93, 1
%95 = sext i32 %94 to i64
%96 = icmp ne i64 %92, %95
br i1 %96, label %97, label %130
97: ; preds = %91
%98 = load i8**, i8*** %5
%99 = load i64, i64* %16
%100 = getelementptr inbounds i8*, i8** %98, i64 %99
%101 = load i8*, i8** %100
%102 = call i32 @strlen(i8* %101)
%103 = add nsw i32 %102, 1
%104 = sext i32 %103 to i64
%105 = mul i64 1, %104
%106 = trunc i64 %105 to i32
%107 = call i64 @malloc(i32 %106)
%108 = inttoptr i64 %107 to i8*
store i8* %108, i8** %12
%109 = load i8*, i8** %12
%110 = load i8**, i8*** %5
%111 = load i64, i64* %16
%112 = getelementptr inbounds i8*, i8** %110, i64 %111
%113 = load i8*, i8** %112
%114 = call i32 @sprintf(i8* %109, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %113)
%115 = load i8*, i8** %11
%116 = load i8*, i8** %12
%117 = call i32 @strlen(i8* %116)
%118 = load i8*, i8** %11
%119 = call i32 @strlen(i8* %118)
%120 = add nsw i32 %117, %119
%121 = add nsw i32 %120, 1
%122 = sext i32 %121 to i64
%123 = mul i64 1, %122
%124 = trunc i64 %123 to i32
%125 = call i64 @realloc(i8* %115, i32 %124)
%126 = inttoptr i64 %125 to i8*
store i8* %126, i8** %11
%127 = load i8*, i8** %11
%128 = load i8*, i8** %12
%129 = call i32 @strcat(i8* %127, i8* %128)
br label %130
130: ; preds = %97, %91, %86, %80, %75
br label %131
131: ; preds = %130
%132 = load i64, i64* %16
%133 = add i64 %132, 1
store i64 %133, i64* %16
br label %70
134: ; preds = %70
store i64 0, i64* %16
br label %135
135: ; preds = %164, %134
%136 = load i64, i64* %16
%137 = load i64, i64* %17
%138 = icmp ult i64 %136, %137
br i1 %138, label %139, label %167
139: ; preds = %135
%140 = load i32*, i32** %9
%141 = load i8*, i8** %11
%142 = load i8**, i8*** %5
%143 = load i32, i32* %7
%144 = sub nsw i32 %143, 1
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds i8*, i8** %142, i64 %145
%147 = load i8*, i8** %146
%148 = load i8**, i8*** %5
%149 = load i32, i32* %7
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i8*, i8** %148, i64 %150
%152 = load i8*, i8** %151
%153 = load i64, i64* %16
%154 = load i8**, i8*** %5
%155 = load i32, i32* %8
%156 = sub nsw i32 %155, 1
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds i8*, i8** %154, i64 %157
%159 = load i8*, i8** %158
%160 = load i8*, i8** %14
%161 = load i64, i64* %16
%162 = load i8*, i8** %15
%163 = call i32 (i32*, i8*, ...) @fprintf(i32* %140, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i8* %141, i8* %147, i8* %152, i64 %153, i8* %159, i8* %160, i64 %161, i8* %162)
br label %164
164: ; preds = %139
%165 = load i64, i64* %16
%166 = add i64 %165, 1
store i64 %166, i64* %16
br label %135
167: ; preds = %135
%168 = load i32*, i32** %9
%169 = call i32 @fclose(i32* %168)
%170 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%171 = load i8**, i8*** %5
%172 = getelementptr inbounds i8*, i8** %171, i64 1
%173 = load i8*, i8** %172
%174 = call i32 @sprintf(i8* %170, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %173)
%175 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%176 = call i32* @fopen(i8* %175, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %176, i32** %9
%177 = icmp eq i32* %176, null
br i1 %177, label %178, label %184
178: ; preds = %167
%179 = load i32, i32* @stderr
%180 = sext i32 %179 to i64
%181 = inttoptr i64 %180 to i32*
%182 = call i32 (i32*, i8*, ...) @fprintf(i32* %181, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
%183 = call i32 @exit(i32 -1)
unreachable
184: ; preds = %167
%185 = load i32*, i32** %9
%186 = call i32 (i32*, i8*, ...) @fprintf(i32* %185, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
store i64 0, i64* %16
br label %187
187: ; preds = %197, %184
%188 = load i64, i64* %16
%189 = load i64, i64* %17
%190 = icmp ult i64 %188, %189
br i1 %190, label %191, label %200
191: ; preds = %187
%192 = load i32*, i32** %9
%193 = load i8*, i8** %14
%194 = load i64, i64* %16
%195 = load i8*, i8** %15
%196 = call i32 (i32*, i8*, ...) @fprintf(i32* %192, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %193, i64 %194, i8* %195)
br label %197
197: ; preds = %191
%198 = load i64, i64* %16
%199 = add i64 %198, 1
store i64 %199, i64* %16
br label %187
200: ; preds = %187
%201 = load i32*, i32** %9
%202 = load i8*, i8** %14
%203 = load i8*, i8** %15
%204 = call i32 (i32*, i8*, ...) @fprintf(i32* %201, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i8* %202, i8* %203)
%205 = load i32*, i32** %9
%206 = call i32 @fclose(i32* %205)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [86 x i8] c"USE: ./mapSequences inputFile.fasta nChunks +commandLine (-query input -out output )\0A\00"
@.str.1 = [7 x i8] c"%s-map\00"
@.str.2 = [3 x i8] c"wt\00"
@.str.3 = [31 x i8] c"opening final MAP script file\0A\00"
@.str.5 = [4 x i8] c" %s\00"
@.str.6 = [31 x i8] c"%s %s %s-%04lu %s %s-%04lu.%s\0A\00"
@.str.7 = [7 x i8] c"%s-red\00"
@.str.8 = [34 x i8] c"opening final REDUCE script file\0A\00"
@.str.9 = [5 x i8] c"cat \00"
@.str.10 = [13 x i8] c"%s-%04lu.%s \00"
@.str.11 = [8 x i8] c"> %s.%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1000 x i8]
%6 = alloca i8*
%7 = alloca i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%11 = bitcast i8** %6 to i8*
%12 = bitcast i8** %7 to i8*
%13 = icmp slt i32 %0, 5
br i1 %13, label %14, label %20
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = tail call i64 @fwrite(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i64 85, i64 1, i32* %17)
%19 = tail call i32 @exit(i32 -1)
unreachable
20: ; preds = %2
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i32 @atoi(i8* %22)
%24 = call i8* @getInput(i32 %0, i8** %1, i32* %3)
%25 = call i32 @getOutput(i32 %0, i8** %1, i32* %4, i8** %6, i8** %7)
%26 = call i64 @splitSequencesBlast(i8* %24, i32 %23)
%27 = getelementptr inbounds i8*, i8** %1, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %28)
%30 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %38
32: ; preds = %20
%33 = load i32, i32* @stderr
%34 = sext i32 %33 to i64
%35 = inttoptr i64 %34 to i32*
%36 = call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i64 30, i64 1, i32* %35)
%37 = call i32 @exit(i32 -1)
unreachable
38: ; preds = %20
%39 = getelementptr inbounds i8*, i8** %1, i64 3
%40 = load i8*, i8** %39
%41 = call i32 @strlen(i8* %40)
%42 = add nsw i32 %41, 1
%43 = call i64 @malloc(i32 %42)
%44 = inttoptr i64 %43 to i8*
%45 = load i8*, i8** %39
%46 = call i8* @strcpy(i8* dereferenceable(1) %44, i8* dereferenceable(1) %45)
%47 = zext i32 %0 to i64
br label %50
48: ; preds = %84
%49 = icmp eq i64 %26, 0
br i1 %49, label %108, label %88
50: ; preds = %38, %84
%51 = phi i64 [ %86, %84 ], [ 4, %38 ]
%52 = phi i8* [ %85, %84 ], [ %44, %38 ]
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = icmp eq i64 %51, %54
br i1 %55, label %84, label %56
56: ; preds = %50
%57 = add nsw i32 %53, -1
%58 = sext i32 %57 to i64
%59 = icmp eq i64 %51, %58
br i1 %59, label %84, label %60
60: ; preds = %56
%61 = load i32, i32* %4
%62 = sext i32 %61 to i64
%63 = icmp eq i64 %51, %62
br i1 %63, label %84, label %64
64: ; preds = %60
%65 = add nsw i32 %61, -1
%66 = sext i32 %65 to i64
%67 = icmp eq i64 %51, %66
br i1 %67, label %84, label %68
68: ; preds = %64
%69 = getelementptr inbounds i8*, i8** %1, i64 %51
%70 = load i8*, i8** %69
%71 = call i32 @strlen(i8* %70)
%72 = add nsw i32 %71, 1
%73 = call i64 @malloc(i32 %72)
%74 = inttoptr i64 %73 to i8*
%75 = load i8*, i8** %69
%76 = call i32 @sprintf(i8* dereferenceable(1) %74, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %75)
%77 = call i32 @strlen(i8* %74)
%78 = call i32 @strlen(i8* %52)
%79 = add i32 %77, 1
%80 = add i32 %79, %78
%81 = call i64 @realloc(i8* %52, i32 %80)
%82 = inttoptr i64 %81 to i8*
%83 = call i32 @strcat(i8* %82, i8* %74)
br label %84
84: ; preds = %50, %56, %60, %64, %68
%85 = phi i8* [ %82, %68 ], [ %52, %64 ], [ %52, %60 ], [ %52, %56 ], [ %52, %50 ]
%86 = add nuw i64 %51, 1
%87 = icmp eq i64 %86, %47
br i1 %87, label %48, label %50
88: ; preds = %48, %88
%89 = phi i64 [ %106, %88 ], [ 0, %48 ]
%90 = load i32, i32* %3
%91 = add nsw i32 %90, -1
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8*, i8** %1, i64 %92
%94 = load i8*, i8** %93
%95 = sext i32 %90 to i64
%96 = getelementptr inbounds i8*, i8** %1, i64 %95
%97 = load i8*, i8** %96
%98 = load i32, i32* %4
%99 = add nsw i32 %98, -1
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8*, i8** %1, i64 %100
%102 = load i8*, i8** %101
%103 = load i8*, i8** %6
%104 = load i8*, i8** %7
%105 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i8* %85, i8* %94, i8* %97, i64 %89, i8* %102, i8* %103, i64 %89, i8* %104)
%106 = add nuw i64 %89, 1
%107 = icmp eq i64 %106, %26
br i1 %107, label %108, label %88
108: ; preds = %88, %48
%109 = call i32 @fclose(i32* %30)
%110 = load i8*, i8** %27
%111 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %110)
%112 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%113 = icmp eq i32* %112, null
br i1 %113, label %114, label %120
114: ; preds = %108
%115 = load i32, i32* @stderr
%116 = sext i32 %115 to i64
%117 = inttoptr i64 %116 to i32*
%118 = call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), i64 33, i64 1, i32* %117)
%119 = call i32 @exit(i32 -1)
unreachable
120: ; preds = %108
%121 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i64 4, i64 1, i32* %112)
br i1 %49, label %129, label %122
122: ; preds = %120, %122
%123 = phi i64 [ %127, %122 ], [ 0, %120 ]
%124 = load i8*, i8** %6
%125 = load i8*, i8** %7
%126 = call i32 (i32*, i8*, ...) @fprintf(i32* %112, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %124, i64 %123, i8* %125)
%127 = add nuw i64 %123, 1
%128 = icmp eq i64 %127, %26
br i1 %128, label %129, label %122
129: ; preds = %122, %120
%130 = load i8*, i8** %6
%131 = load i8*, i8** %7
%132 = call i32 (i32*, i8*, ...) @fprintf(i32* %112, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i8* %130, i8* %131)
%133 = call i32 @fclose(i32* %112)
ret i32 0
}