#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*/ DataCounter(char *, int *, int *, char *);
scalar_t__ atof(char *);
int atoi(char *);
double *calloc(int, int);
int extractData(char *, int, int, double *, char *);
int /*<<< orphan*/ printf(char *, ...);
char *strdup(char *);
int /*<<< orphan*/ tr(double *, int, int);
int handleParams(int argc, char *argv[], int *nSNP, int *nIND,
                 double **Genotypes, char **GenoFileName, char **OutputFileName,
                 int *K, int *nsteps, int *burnin, int *runSVD,
                 char **subSampleName, int *transpose, int *prior, double *b,
                 int *sc, double *prop) {
  int i, tmp;
  for (i = 0; i < argc; i++) {
    if (argv[i][0] == '-') {
      switch (argv[i][1]) {
      case 'i':
        *GenoFileName = strdup(argv[i + 1]);
        printf("Genotypes in file %s\n", *GenoFileName);
        if (!DataCounter(*GenoFileName, nSNP, nIND, "genotypes")) {
          *Genotypes = calloc((*nSNP) * (*nIND), sizeof(double));
          int res;
          res =
              extractData(*GenoFileName, *nSNP, *nIND, *Genotypes, "genotypes");
        } else {
          return 1;
        }
        break;
      case 'K':
        *K = atoi(argv[i + 1]);
        break;
      case 's':
        *nsteps = atoi(argv[i + 1]);
        break;
      case 'b':
        *burnin = atoi(argv[i + 1]);
        break;
      case 'o':
        *OutputFileName = strdup(argv[i + 1]);
        break;
      case 'I':
        *runSVD = 1;
        *subSampleName = strdup(argv[i + 1]);
        break;
      case 't':
        *transpose = atoi(argv[i + 1]);
        break;
      case 'p':
        *prop = (double)atof(argv[i + 1]);
        break;
      case 'B':
        *b = (double)atof(argv[i + 1]);
        break;
      case 'S':
        *sc = atoi(argv[i + 1]);
        break;
      }
    }
  }
  if (*transpose == 1) {
    tr(*Genotypes, *nSNP, *nIND);
    tmp = *nSNP;
    *nSNP = *nIND;
    *nIND = tmp;
    printf("%i snps typed on %i individuals\n", *nSNP, *nIND);
  } else {
    printf("%i snps typed on %i individuals\n", *nSNP, *nIND);
  }
  if (*K >= *nSNP || *K >= *nIND) {
    printf(
        "***WARNING*** K must be lower than the rank of the design matrix\n");
    *K = *nSNP < *nIND ? *nSNP - 1 : *nIND - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<handleParams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x60(%rbp),%rax
mov    0x58(%rbp),%rax
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    144b <handleParams+0x2cb>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1438 <handleParams+0x2b8>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
add    $0xffffffbe,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x32,%eax
ja     1433 <handleParams+0x2b3>
mov    -0x48(%rbp),%rax
lea    0xddd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10a0 <strdup@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
mov    (%rax),%rsi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe6b(%rip),%rcx
call   1040 <DataCounter@plt>
cmp    $0x0,%eax
jne    12d4 <handleParams+0x154>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
imul   (%rax),%edi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
lea    0xe1b(%rip),%r8
call   1060 <extractData@plt>
mov    %eax,-0x3c(%rbp)
jmp    12e0 <handleParams+0x160>
movl   $0x1,-0x4(%rbp)
jmp    1538 <handleParams+0x3b8>
jmp    1433 <handleParams+0x2b3>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1090 <atoi@plt>
mov    %eax,%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1433 <handleParams+0x2b3>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1090 <atoi@plt>
mov    %eax,%ecx
mov    0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    1433 <handleParams+0x2b3>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1090 <atoi@plt>
mov    %eax,%ecx
mov    0x28(%rbp),%rax
mov    %ecx,(%rax)
jmp    1433 <handleParams+0x2b3>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10a0 <strdup@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    1433 <handleParams+0x2b3>
mov    0x30(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10a0 <strdup@plt>
mov    %rax,%rcx
mov    0x38(%rbp),%rax
mov    %rcx,(%rax)
jmp    1433 <handleParams+0x2b3>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1090 <atoi@plt>
mov    %eax,%ecx
mov    0x40(%rbp),%rax
mov    %ecx,(%rax)
jmp    1433 <handleParams+0x2b3>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atof@plt>
cvtsi2sd %rax,%xmm0
mov    0x60(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1433 <handleParams+0x2b3>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atof@plt>
cvtsi2sd %rax,%xmm0
mov    0x50(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1433 <handleParams+0x2b3>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1090 <atoi@plt>
mov    %eax,%ecx
mov    0x58(%rbp),%rax
mov    %ecx,(%rax)
jmp    1438 <handleParams+0x2b8>
jmp    143d <handleParams+0x2bd>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11d2 <handleParams+0x52>
mov    0x40(%rbp),%rax
cmpl   $0x1,(%rax)
jne    14ad <handleParams+0x32d>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
call   1080 <tr@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
lea    0xc4b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14c7 <handleParams+0x347>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
lea    0xc2c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    14eb <handleParams+0x36b>
mov    0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jl     1531 <handleParams+0x3b1>
lea    0xc1b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jge    151c <handleParams+0x39c>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1528 <handleParams+0x3a8>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleParams>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,0x18(%rsp)
mov    %r8,0x10(%rsp)
mov    %rcx,0x8(%rsp)
mov    %rdx,%r15
mov    0x68(%rsp),%rbp
test   %edi,%edi
jle    13b7 <handleParams+0x227>
mov    %rsi,%rbx
mov    %edi,%r12d
lea    0xf18(%rip),%r14
xor    %r13d,%r13d
mov    %r15,0x20(%rsp)
jmp    11fd <handleParams+0x6d>
mov    0x8(%rbx,%r13,8),%rdi
call   10a0 <atoi@plt>
lea    0xefd(%rip),%r14
mov    0xa8(%rsp),%rcx
mov    %eax,(%rcx)
nop
add    $0x1,%r13
cmp    %r13,%r12
je     13b7 <handleParams+0x227>
mov    (%rbx,%r13,8),%rax
cmpb   $0x2d,(%rax)
jne    11f0 <handleParams+0x60>
movsbl 0x1(%rax),%eax
add    $0xffffffbe,%eax
cmp    $0x32,%eax
ja     11f0 <handleParams+0x60>
lea    0xde7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x8(%rbx,%r13,8),%rdi
call   1040 <atof@plt>
lea    0xeaf(%rip),%r14
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0xa0(%rsp),%rax
movsd  %xmm0,(%rax)
jmp    11f0 <handleParams+0x60>
mov    0x80(%rsp),%rax
movl   $0x1,(%rax)
mov    0x8(%rbx,%r13,8),%rdi
call   10b0 <strdup@plt>
lea    0xe7a(%rip),%r14
mov    0x88(%rsp),%rcx
mov    %rax,(%rcx)
jmp    11f0 <handleParams+0x60>
mov    0x8(%rbx,%r13,8),%rdi
call   10a0 <atoi@plt>
lea    0xe59(%rip),%r14
mov    %eax,0x0(%rbp)
jmp    11f0 <handleParams+0x60>
mov    0x8(%rbx,%r13,8),%rdi
call   10a0 <atoi@plt>
lea    0xe40(%rip),%r14
mov    0x78(%rsp),%rcx
jmp    11ed <handleParams+0x5d>
mov    0x8(%rbx,%r13,8),%rdi
call   10b0 <strdup@plt>
mov    0x18(%rsp),%rbp
mov    %rax,0x0(%rbp)
lea    0xe06(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x0(%rbp),%rdi
mov    %r15,%rsi
mov    0x8(%rsp),%rdx
mov    %r14,%rcx
call   1050 <DataCounter@plt>
test   %eax,%eax
jne    1444 <handleParams+0x2b4>
mov    (%r15),%ebp
mov    0x8(%rsp),%rax
mov    (%rax),%r15d
mov    %r15d,%edi
imul   %ebp,%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    0x10(%rsp),%rcx
mov    %rax,(%rcx)
mov    0x18(%rsp),%rcx
mov    (%rcx),%rdi
mov    %ebp,%esi
mov    %r15d,%edx
mov    0x20(%rsp),%r15
mov    0x68(%rsp),%rbp
mov    %rax,%rcx
mov    %r14,%r8
call   1070 <extractData@plt>
jmp    11f0 <handleParams+0x60>
mov    0x8(%rbx,%r13,8),%rdi
call   10b0 <strdup@plt>
lea    0xd9b(%rip),%r14
mov    0x60(%rsp),%rcx
mov    %rax,(%rcx)
jmp    11f0 <handleParams+0x60>
mov    0x8(%rbx,%r13,8),%rdi
call   1040 <atof@plt>
lea    0xd7d(%rip),%r14
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0xb0(%rsp),%rax
movsd  %xmm0,(%rax)
jmp    11f0 <handleParams+0x60>
mov    0x8(%rbx,%r13,8),%rdi
call   10a0 <atoi@plt>
lea    0xd53(%rip),%r14
mov    0x70(%rsp),%rcx
jmp    11ed <handleParams+0x5d>
mov    0x8(%rbx,%r13,8),%rdi
call   10a0 <atoi@plt>
lea    0xd38(%rip),%r14
mov    0x90(%rsp),%rcx
jmp    11ed <handleParams+0x5d>
mov    0x90(%rsp),%rax
cmpl   $0x1,(%rax)
jne    13e7 <handleParams+0x257>
mov    0x10(%rsp),%rax
mov    (%rax),%rdi
mov    (%r15),%esi
mov    0x8(%rsp),%rbx
mov    (%rbx),%edx
call   1090 <tr@plt>
mov    (%r15),%edx
mov    (%rbx),%eax
mov    %eax,(%r15)
mov    %edx,(%rbx)
jmp    13ee <handleParams+0x25e>
mov    0x8(%rsp),%rax
mov    (%rax),%edx
mov    (%r15),%esi
lea    0xcf4(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x0(%rbp),%eax
cmp    (%r15),%eax
jge    1412 <handleParams+0x282>
mov    0x8(%rsp),%rcx
cmp    (%rcx),%eax
jl     1433 <handleParams+0x2a3>
lea    0xcf4(%rip),%rdi
call   1030 <puts@plt>
mov    (%r15),%eax
mov    0x8(%rsp),%rcx
mov    (%rcx),%ecx
cmp    %ecx,%eax
cmovl  %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,0x0(%rbp)
mov    %ebx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebx
jmp    1433 <handleParams+0x2a3>

LLVM IR (-O0):
@.str = [22 x i8] c"Genotypes in file %s\0A\00"
@.str.1 = [10 x i8] c"genotypes\00"
@.str.2 = [33 x i8] c"%i snps typed on %i individuals\0A\00"
@.str.3 = [66 x i8] c"***WARNING*** K must be lower than the rank of the design matrix\0A\00"
define i32 @handleParams(i32 %0, i8** %1, i32* %2, i32* %3, double** %4, i8** %5, i8** %6, i32* %7, i32* %8, i32* %9, i32* %10, i8** %11, i32* %12, i32* %13, double* %14, i32* %15, double* %16) {
%18 = alloca i32
%19 = alloca i32
%20 = alloca i8**
%21 = alloca i32*
%22 = alloca i32*
%23 = alloca double**
%24 = alloca i8**
%25 = alloca i8**
%26 = alloca i32*
%27 = alloca i32*
%28 = alloca i32*
%29 = alloca i32*
%30 = alloca i8**
%31 = alloca i32*
%32 = alloca i32*
%33 = alloca double*
%34 = alloca i32*
%35 = alloca double*
%36 = alloca i32
%37 = alloca i32
%38 = alloca i32
store i32 %0, i32* %19
store i8** %1, i8*** %20
store i32* %2, i32** %21
store i32* %3, i32** %22
store double** %4, double*** %23
store i8** %5, i8*** %24
store i8** %6, i8*** %25
store i32* %7, i32** %26
store i32* %8, i32** %27
store i32* %9, i32** %28
store i32* %10, i32** %29
store i8** %11, i8*** %30
store i32* %12, i32** %31
store i32* %13, i32** %32
store double* %14, double** %33
store i32* %15, i32** %34
store double* %16, double** %35
store i32 0, i32* %36
br label %39
39: ; preds = %185, %17
%40 = load i32, i32* %36
%41 = load i32, i32* %19
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %188
43: ; preds = %39
%44 = load i8**, i8*** %20
%45 = load i32, i32* %36
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8*, i8** %44, i64 %46
%48 = load i8*, i8** %47
%49 = getelementptr inbounds i8, i8* %48, i64 0
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 45
br i1 %52, label %53, label %184
53: ; preds = %43
%54 = load i8**, i8*** %20
%55 = load i32, i32* %36
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8*, i8** %54, i64 %56
%58 = load i8*, i8** %57
%59 = getelementptr inbounds i8, i8* %58, i64 1
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
switch i32 %61, label %183 [
i32 105, label %62
i32 75, label %99
i32 115, label %108
i32 98, label %117
i32 111, label %126
i32 73, label %135
i32 116, label %145
i32 112, label %154
i32 66, label %164
i32 83, label %174
]
62: ; preds = %53
%63 = load i8**, i8*** %20
%64 = load i32, i32* %36
%65 = add nsw i32 %64, 1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8*, i8** %63, i64 %66
%68 = load i8*, i8** %67
%69 = call i8* @strdup(i8* %68)
%70 = load i8**, i8*** %24
store i8* %69, i8** %70
%71 = load i8**, i8*** %24
%72 = load i8*, i8** %71
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %72)
%74 = load i8**, i8*** %24
%75 = load i8*, i8** %74
%76 = load i32*, i32** %21
%77 = load i32*, i32** %22
%78 = call i32 @DataCounter(i8* %75, i32* %76, i32* %77, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%79 = icmp ne i32 %78, 0
br i1 %79, label %97, label %80
80: ; preds = %62
%81 = load i32*, i32** %21
%82 = load i32, i32* %81
%83 = load i32*, i32** %22
%84 = load i32, i32* %83
%85 = mul nsw i32 %82, %84
%86 = call double* @calloc(i32 %85, i32 8)
%87 = load double**, double*** %23
store double* %86, double** %87
%88 = load i8**, i8*** %24
%89 = load i8*, i8** %88
%90 = load i32*, i32** %21
%91 = load i32, i32* %90
%92 = load i32*, i32** %22
%93 = load i32, i32* %92
%94 = load double**, double*** %23
%95 = load double*, double** %94
%96 = call i32 @extractData(i8* %89, i32 %91, i32 %93, double* %95, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i32 %96, i32* %38
br label %98
97: ; preds = %62
store i32 1, i32* %18
br label %249
98: ; preds = %80
br label %183
99: ; preds = %53
%100 = load i8**, i8*** %20
%101 = load i32, i32* %36
%102 = add nsw i32 %101, 1
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8*, i8** %100, i64 %103
%105 = load i8*, i8** %104
%106 = call i32 @atoi(i8* %105)
%107 = load i32*, i32** %26
store i32 %106, i32* %107
br label %183
108: ; preds = %53
%109 = load i8**, i8*** %20
%110 = load i32, i32* %36
%111 = add nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i8*, i8** %109, i64 %112
%114 = load i8*, i8** %113
%115 = call i32 @atoi(i8* %114)
%116 = load i32*, i32** %27
store i32 %115, i32* %116
br label %183
117: ; preds = %53
%118 = load i8**, i8*** %20
%119 = load i32, i32* %36
%120 = add nsw i32 %119, 1
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8*, i8** %118, i64 %121
%123 = load i8*, i8** %122
%124 = call i32 @atoi(i8* %123)
%125 = load i32*, i32** %28
store i32 %124, i32* %125
br label %183
126: ; preds = %53
%127 = load i8**, i8*** %20
%128 = load i32, i32* %36
%129 = add nsw i32 %128, 1
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i8*, i8** %127, i64 %130
%132 = load i8*, i8** %131
%133 = call i8* @strdup(i8* %132)
%134 = load i8**, i8*** %25
store i8* %133, i8** %134
br label %183
135: ; preds = %53
%136 = load i32*, i32** %29
store i32 1, i32* %136
%137 = load i8**, i8*** %20
%138 = load i32, i32* %36
%139 = add nsw i32 %138, 1
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i8*, i8** %137, i64 %140
%142 = load i8*, i8** %141
%143 = call i8* @strdup(i8* %142)
%144 = load i8**, i8*** %30
store i8* %143, i8** %144
br label %183
145: ; preds = %53
%146 = load i8**, i8*** %20
%147 = load i32, i32* %36
%148 = add nsw i32 %147, 1
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i8*, i8** %146, i64 %149
%151 = load i8*, i8** %150
%152 = call i32 @atoi(i8* %151)
%153 = load i32*, i32** %31
store i32 %152, i32* %153
br label %183
154: ; preds = %53
%155 = load i8**, i8*** %20
%156 = load i32, i32* %36
%157 = add nsw i32 %156, 1
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds i8*, i8** %155, i64 %158
%160 = load i8*, i8** %159
%161 = call i64 @atof(i8* %160)
%162 = sitofp i64 %161 to double
%163 = load double*, double** %35
store double %162, double* %163
br label %183
164: ; preds = %53
%165 = load i8**, i8*** %20
%166 = load i32, i32* %36
%167 = add nsw i32 %166, 1
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds i8*, i8** %165, i64 %168
%170 = load i8*, i8** %169
%171 = call i64 @atof(i8* %170)
%172 = sitofp i64 %171 to double
%173 = load double*, double** %33
store double %172, double* %173
br label %183
174: ; preds = %53
%175 = load i8**, i8*** %20
%176 = load i32, i32* %36
%177 = add nsw i32 %176, 1
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds i8*, i8** %175, i64 %178
%180 = load i8*, i8** %179
%181 = call i32 @atoi(i8* %180)
%182 = load i32*, i32** %34
store i32 %181, i32* %182
br label %183
183: ; preds = %53, %174, %164, %154, %145, %135, %126, %117, %108, %99, %98
br label %184
184: ; preds = %183, %43
br label %185
185: ; preds = %184
%186 = load i32, i32* %36
%187 = add nsw i32 %186, 1
store i32 %187, i32* %36
br label %39
188: ; preds = %39
%189 = load i32*, i32** %31
%190 = load i32, i32* %189
%191 = icmp eq i32 %190, 1
br i1 %191, label %192, label %212
192: ; preds = %188
%193 = load double**, double*** %23
%194 = load double*, double** %193
%195 = load i32*, i32** %21
%196 = load i32, i32* %195
%197 = load i32*, i32** %22
%198 = load i32, i32* %197
%199 = call i32 @tr(double* %194, i32 %196, i32 %198)
%200 = load i32*, i32** %21
%201 = load i32, i32* %200
store i32 %201, i32* %37
%202 = load i32*, i32** %22
%203 = load i32, i32* %202
%204 = load i32*, i32** %21
store i32 %203, i32* %204
%205 = load i32, i32* %37
%206 = load i32*, i32** %22
store i32 %205, i32* %206
%207 = load i32*, i32** %21
%208 = load i32, i32* %207
%209 = load i32*, i32** %22
%210 = load i32, i32* %209
%211 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %208, i32 %210)
br label %218
212: ; preds = %188
%213 = load i32*, i32** %21
%214 = load i32, i32* %213
%215 = load i32*, i32** %22
%216 = load i32, i32* %215
%217 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %214, i32 %216)
br label %218
218: ; preds = %212, %192
%219 = load i32*, i32** %26
%220 = load i32, i32* %219
%221 = load i32*, i32** %21
%222 = load i32, i32* %221
%223 = icmp sge i32 %220, %222
br i1 %223, label %230, label %224
224: ; preds = %218
%225 = load i32*, i32** %26
%226 = load i32, i32* %225
%227 = load i32*, i32** %22
%228 = load i32, i32* %227
%229 = icmp sge i32 %226, %228
br i1 %229, label %230, label %248
230: ; preds = %224, %218
%231 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0))
%232 = load i32*, i32** %21
%233 = load i32, i32* %232
%234 = load i32*, i32** %22
%235 = load i32, i32* %234
%236 = icmp slt i32 %233, %235
br i1 %236, label %237, label %241
237: ; preds = %230
%238 = load i32*, i32** %21
%239 = load i32, i32* %238
%240 = sub nsw i32 %239, 1
br label %245
241: ; preds = %230
%242 = load i32*, i32** %22
%243 = load i32, i32* %242
%244 = sub nsw i32 %243, 1
br label %245
245: ; preds = %241, %237
%246 = phi i32 [ %240, %237 ], [ %244, %241 ]
%247 = load i32*, i32** %26
store i32 %246, i32* %247
br label %248
248: ; preds = %245, %224
store i32 0, i32* %18
br label %249
249: ; preds = %248, %97
%250 = load i32, i32* %18
ret i32 %250
}

LLVM IR (-O2):
@.str = [22 x i8] c"Genotypes in file %s\0A\00"
@.str.1 = [10 x i8] c"genotypes\00"
@.str.2 = [33 x i8] c"%i snps typed on %i individuals\0A\00"
@str = [65 x i8] c"***WARNING*** K must be lower than the rank of the design matrix\00"
define i32 @handleParams(i32 %0, i8** nocapture %1, i32* %2, i32* %3, double** nocapture %4, i8** nocapture %5, i8** nocapture writeonly %6, i32* nocapture %7, i32* nocapture writeonly %8, i32* nocapture writeonly %9, i32* nocapture writeonly %10, i8** nocapture writeonly %11, i32* nocapture %12, i32* nocapture readnone %13, double* nocapture writeonly %14, i32* nocapture writeonly %15, double* nocapture writeonly %16) {
%18 = icmp sgt i32 %0, 0
br i1 %18, label %19, label %97
19: ; preds = %17
%20 = zext i32 %0 to i64
br label %21
21: ; preds = %19, %94
%22 = phi i64 [ 0, %19 ], [ %95, %94 ]
%23 = getelementptr inbounds i8*, i8** %1, i64 %22
%24 = load i8*, i8** %23
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 45
br i1 %26, label %27, label %94
27: ; preds = %21
%28 = getelementptr inbounds i8, i8* %24, i64 1
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
switch i32 %30, label %94 [
i32 105, label %31
i32 75, label %47
i32 115, label %52
i32 98, label %57
i32 111, label %62
i32 73, label %67
i32 116, label %72
i32 112, label %77
i32 66, label %83
i32 83, label %89
]
31: ; preds = %27
%32 = add nuw nsw i64 %22, 1
%33 = getelementptr inbounds i8*, i8** %1, i64 %32
%34 = load i8*, i8** %33
%35 = tail call i8* @strdup(i8* %34)
store i8* %35, i8** %5
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %35)
%37 = load i8*, i8** %5
%38 = tail call i32 @DataCounter(i8* %37, i32* %2, i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %126
40: ; preds = %31
%41 = load i32, i32* %2
%42 = load i32, i32* %3
%43 = mul nsw i32 %42, %41
%44 = tail call double* @calloc(i32 %43, i32 8)
store double* %44, double** %4
%45 = load i8*, i8** %5
%46 = tail call i32 @extractData(i8* %45, i32 %41, i32 %42, double* %44, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %94
47: ; preds = %27
%48 = add nuw nsw i64 %22, 1
%49 = getelementptr inbounds i8*, i8** %1, i64 %48
%50 = load i8*, i8** %49
%51 = tail call i32 @atoi(i8* %50)
store i32 %51, i32* %7
br label %94
52: ; preds = %27
%53 = add nuw nsw i64 %22, 1
%54 = getelementptr inbounds i8*, i8** %1, i64 %53
%55 = load i8*, i8** %54
%56 = tail call i32 @atoi(i8* %55)
store i32 %56, i32* %8
br label %94
57: ; preds = %27
%58 = add nuw nsw i64 %22, 1
%59 = getelementptr inbounds i8*, i8** %1, i64 %58
%60 = load i8*, i8** %59
%61 = tail call i32 @atoi(i8* %60)
store i32 %61, i32* %9
br label %94
62: ; preds = %27
%63 = add nuw nsw i64 %22, 1
%64 = getelementptr inbounds i8*, i8** %1, i64 %63
%65 = load i8*, i8** %64
%66 = tail call i8* @strdup(i8* %65)
store i8* %66, i8** %6
br label %94
67: ; preds = %27
store i32 1, i32* %10
%68 = add nuw nsw i64 %22, 1
%69 = getelementptr inbounds i8*, i8** %1, i64 %68
%70 = load i8*, i8** %69
%71 = tail call i8* @strdup(i8* %70)
store i8* %71, i8** %11
br label %94
72: ; preds = %27
%73 = add nuw nsw i64 %22, 1
%74 = getelementptr inbounds i8*, i8** %1, i64 %73
%75 = load i8*, i8** %74
%76 = tail call i32 @atoi(i8* %75)
store i32 %76, i32* %12
br label %94
77: ; preds = %27
%78 = add nuw nsw i64 %22, 1
%79 = getelementptr inbounds i8*, i8** %1, i64 %78
%80 = load i8*, i8** %79
%81 = tail call i64 @atof(i8* %80)
%82 = sitofp i64 %81 to double
store double %82, double* %16
br label %94
83: ; preds = %27
%84 = add nuw nsw i64 %22, 1
%85 = getelementptr inbounds i8*, i8** %1, i64 %84
%86 = load i8*, i8** %85
%87 = tail call i64 @atof(i8* %86)
%88 = sitofp i64 %87 to double
store double %88, double* %14
br label %94
89: ; preds = %27
%90 = add nuw nsw i64 %22, 1
%91 = getelementptr inbounds i8*, i8** %1, i64 %90
%92 = load i8*, i8** %91
%93 = tail call i32 @atoi(i8* %92)
store i32 %93, i32* %15
br label %94
94: ; preds = %21, %27, %89, %83, %77, %72, %67, %62, %57, %52, %47, %40
%95 = add nuw nsw i64 %22, 1
%96 = icmp eq i64 %95, %20
br i1 %96, label %97, label %21
97: ; preds = %94, %17
%98 = load i32, i32* %12
%99 = icmp eq i32 %98, 1
br i1 %99, label %100, label %107
100: ; preds = %97
%101 = load double*, double** %4
%102 = load i32, i32* %2
%103 = load i32, i32* %3
%104 = tail call i32 @tr(double* %101, i32 %102, i32 %103)
%105 = load i32, i32* %2
%106 = load i32, i32* %3
store i32 %106, i32* %2
store i32 %105, i32* %3
br label %109
107: ; preds = %97
%108 = load i32, i32* %3
br label %109
109: ; preds = %107, %100
%110 = phi i32 [ %108, %107 ], [ %105, %100 ]
%111 = load i32, i32* %2
%112 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %111, i32 %110)
%113 = load i32, i32* %7
%114 = load i32, i32* %2
%115 = icmp slt i32 %113, %114
br i1 %115, label %116, label %119
116: ; preds = %109
%117 = load i32, i32* %3
%118 = icmp slt i32 %113, %117
br i1 %118, label %126, label %119
119: ; preds = %116, %109
%120 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%121 = load i32, i32* %2
%122 = load i32, i32* %3
%123 = icmp slt i32 %121, %122
%124 = select i1 %123, i32 %121, i32 %122
%125 = add nsw i32 %124, -1
store i32 %125, i32* %7
br label %126
126: ; preds = %31, %116, %119
%127 = phi i32 [ 0, %119 ], [ 0, %116 ], [ 1, %31 ]
ret i32 %127
}