#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 */

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int atoi(char *);
int /*<<< orphan*/ calculateANI(char *, int, int const, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ numberOfFiles(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc == 4) {
    const int kmerSizeMinParam = atoi(argv[2]);
    const int kmerSizeMaxParam = atoi(argv[3]);
    const int fileSimilarityThresholdConstantParam = 0;
    printf("INSERT INTO anilyzeTable (Genus1, Species1, Genus2, Species2, "
           "kmerSize, Percentage) \nVALUES \n");
    for (int i = kmerSizeMinParam; i <= kmerSizeMaxParam; i++) {
      calculateANI(argv[1], i, fileSimilarityThresholdConstantParam,
                   numberOfFiles(argv[1]));
    }
  } else {
    printf("%s",
           "Error, ./anilyzeExeC <User/path/locationOfFormattedFiles> "
           "<kmerSizeInteger> <filePercentSimilarityThresholdConstantInteger>");
    printf("%s", "Example: ./anilyzeExeC "
                 "/Users/jon/desktop/anilyze/C/tests/sampleTestFiles/ 2 4");
    printf("%s", "Please ./README for more information on formattedFiles");
    exit(EXIT_FAILURE);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    11f9 <main+0xa9>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     11f4 <main+0xa4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <numberOfFiles@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    %eax,%ecx
xor    %edx,%edx
call   1040 <calculateANI@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11ab <main+0x5b>
jmp    1246 <main+0xf6>
lea    0xe5e(%rip),%rdi
lea    0xe5a(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe49(%rip),%rdi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe34(%rip),%rdi
lea    0xefb(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2da1(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x4,%edi
jne    11cf <main+0x6f>
mov    %rsi,%r14
mov    0x10(%rsi),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebp
mov    0x18(%r14),%rdi
call   1070 <atoi@plt>
mov    %eax,%r15d
lea    0xf78(%rip),%rdi
call   1040 <puts@plt>
cmp    %r15d,%ebp
jg     11c2 <main+0x62>
add    $0x1,%r15d
nopl   0x0(%rax,%rax,1)
mov    0x8(%r14),%rbx
mov    %rbx,%rdi
call   1030 <numberOfFiles@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
mov    %eax,%ecx
call   1050 <calculateANI@plt>
add    $0x1,%ebp
cmp    %ebp,%r15d
jne    11a0 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe2a(%rip),%rbx
lea    0xe26(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe91(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2dd0(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [94 x i8] c"INSERT INTO anilyzeTable (Genus1, Species1, Genus2, Species2, kmerSize, Percentage) \0AVALUES \0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [124 x i8] c"Error, ./anilyzeExeC <User/path/locationOfFormattedFiles> <kmerSizeInteger> <filePercentSimilarityThresholdConstantInteger>\00"
@.str.3 = [79 x i8] c"Example: ./anilyzeExeC /Users/jon/desktop/anilyze/C/tests/sampleTestFiles/ 2 4\00"
@.str.4 = [55 x i8] c"Please ./README for more information on formattedFiles\00"
@EXIT_FAILURE = global i32 0
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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 4
br i1 %11, label %12, label %41
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %6
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 3
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
store i32 %20, i32* %7
store i32 0, i32* %8
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
%22 = load i32, i32* %6
store i32 %22, i32* %9
br label %23
23: ; preds = %37, %12
%24 = load i32, i32* %9
%25 = load i32, i32* %7
%26 = icmp sle i32 %24, %25
br i1 %26, label %27, label %40
27: ; preds = %23
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = load i32, i32* %9
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32 @numberOfFiles(i8* %34)
%36 = call i32 @calculateANI(i8* %30, i32 %31, i32 0, i32 %35)
br label %37
37: ; preds = %27
%38 = load i32, i32* %9
%39 = add nsw i32 %38, 1
store i32 %39, i32* %9
br label %23
40: ; preds = %23
br label %47
41: ; preds = %2
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str.2, i64 0, i64 0))
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
%45 = load i32, i32* @EXIT_FAILURE
%46 = call i32 @exit(i32 %45)
unreachable
47: ; preds = %40
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [124 x i8] c"Error, ./anilyzeExeC <User/path/locationOfFormattedFiles> <kmerSizeInteger> <filePercentSimilarityThresholdConstantInteger>\00"
@.str.3 = [79 x i8] c"Example: ./anilyzeExeC /Users/jon/desktop/anilyze/C/tests/sampleTestFiles/ 2 4\00"
@.str.4 = [55 x i8] c"Please ./README for more information on formattedFiles\00"
@EXIT_FAILURE = global i32 0
@str = [93 x i8] c"INSERT INTO anilyzeTable (Genus1, Species1, Genus2, Species2, kmerSize, Percentage) \0AVALUES \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %4, label %23
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = getelementptr inbounds i8*, i8** %1, i64 3
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @str, i64 0, i64 0))
%12 = icmp sgt i32 %7, %10
br i1 %12, label %15, label %13
13: ; preds = %4
%14 = getelementptr inbounds i8*, i8** %1, i64 1
br label %16
15: ; preds = %16, %4
ret i32 0
16: ; preds = %13, %16
%17 = phi i32 [ %7, %13 ], [ %21, %16 ]
%18 = load i8*, i8** %14
%19 = tail call i32 @numberOfFiles(i8* %18)
%20 = tail call i32 @calculateANI(i8* %18, i32 %17, i32 0, i32 %19)
%21 = add i32 %17, 1
%22 = icmp eq i32 %17, %10
br i1 %22, label %15, label %16
23: ; preds = %2
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str.2, i64 0, i64 0))
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0))
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
%27 = load i32, i32* @EXIT_FAILURE
%28 = tail call i32 @exit(i32 %27)
unreachable
}