#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 uint32_t;
typedef scalar_t__ int32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
double SNPHWE2(scalar_t__, scalar_t__, scalar_t__, int);
int SNPHWE_midp_t(scalar_t__, scalar_t__, scalar_t__, double);
int SNPHWE_t(scalar_t__, scalar_t__, scalar_t__, double);
scalar_t__ atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *, scalar_t__ *,
                          scalar_t__ *, scalar_t__ *);
int /*<<< orphan*/ printf(char *, ...);
int sscanf(char *, char *, double *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  uint32_t midp = 0;
  char name[100];
  FILE *test_file;
  int32_t hets;
  int32_t homs1;
  int32_t homs2;
  double p_value;
  uint32_t uii;
  if (!strcmp(argv[argc - 1], "midp")) {
    midp = 1;
    argc--;
  }
  if ((argc == 4) || (argc == 5)) {
    hets = atoi(argv[1]);
    homs1 = atoi(argv[2]);
    homs2 = atoi(argv[3]);
    if ((hets < 0) || (homs1 < 0) || (homs2 < 0)) {
      printf("Error: Negative parameter.\n");
      return 3;
    }
    if (argc == 4) {
      p_value = SNPHWE2(hets, homs1, homs2, midp);
      printf("P-value: %lg\n", p_value);
    } else {
      if (sscanf(argv[4], "%lg", &p_value) != 1) {
        printf("Error: Invalid p-value '%s'.\n", argv[4]);
        return 3;
      }
      if (midp) {
        uii = SNPHWE_midp_t(hets, homs1, homs2, p_value);
      } else {
        uii = SNPHWE_t(hets, homs1, homs2, p_value);
      }
      if (uii) {
        printf("Test failed (p-value below threshold).\n");
      } else {
        printf("Test passed (p-value above threshold).\n");
      }
    }
    return 0;
  } else if (argc != 2) {
    printf("SNPHWE2 demo    http://www.sph.umich.edu/csg/abecasis/Exact/\n"
           "                https://github.com/chrchang/stats\n\n"
           "  snphwe_test [het count] [hom count 1] [hom count 2] {threshold} "
           "<midp>\n"
           "  snphwe_test [filename] <midp>\n\n"
           "If a filename is provided, the file is expected to contain marker "
           "names in the\n"
           "first column, heterozygote counts in the second, and homozygote "
           "counts in the\n"
           "third and fourth.\n");
    return 1;
  }
  test_file = fopen(argv[1], "r");
  if (!test_file) {
    printf("Error: Unable to open file.\n");
    return 2;
  }
  while (!feof(test_file)) {
    fscanf(test_file, "%s %d %d %d\n", name, &hets, &homs1, &homs2);
    p_value = SNPHWE2(hets, homs1, homs2, midp);
    printf("P-value for %s: %lg\n", name, p_value);
  }
  fclose(test_file);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe18(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    1206 <main+0x56>
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     121a <main+0x6a>
cmpl   $0x5,-0x8(%rbp)
jne    13c8 <main+0x218>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    %rax,-0x90(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
mov    %rax,-0x98(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10d0 <atoi@plt>
mov    %rax,-0xa0(%rbp)
cmpq   $0x0,-0x90(%rbp)
jl     1280 <main+0xd0>
cmpq   $0x0,-0x98(%rbp)
jl     1280 <main+0xd0>
cmpq   $0x0,-0xa0(%rbp)
jge    129a <main+0xea>
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x3,-0x4(%rbp)
jmp    14dd <main+0x32d>
cmpl   $0x4,-0x8(%rbp)
jne    12e4 <main+0x134>
mov    -0x90(%rbp),%rdi
mov    -0x98(%rbp),%rsi
mov    -0xa0(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <SNPHWE2@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
lea    0xd49(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
jmp    13bc <main+0x20c>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xd3c(%rip),%rsi
lea    -0xa8(%rbp),%rdx
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
je     132a <main+0x17a>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
lea    0xd1c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x3,-0x4(%rbp)
jmp    14dd <main+0x32d>
cmpl   $0x0,-0x14(%rbp)
je     1361 <main+0x1b1>
mov    -0x90(%rbp),%rdi
mov    -0x98(%rbp),%rsi
mov    -0xa0(%rbp),%rdx
movsd  -0xa8(%rbp),%xmm0
ff
call   1050 <SNPHWE_midp_t@plt>
mov    %eax,-0xac(%rbp)
jmp    1389 <main+0x1d9>
mov    -0x90(%rbp),%rdi
mov    -0x98(%rbp),%rsi
mov    -0xa0(%rbp),%rdx
movsd  -0xa8(%rbp),%xmm0
ff
call   10b0 <SNPHWE_t@plt>
mov    %eax,-0xac(%rbp)
cmpl   $0x0,-0xac(%rbp)
je     13a9 <main+0x1f9>
lea    0xcb4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13b7 <main+0x207>
lea    0xcc9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13bc <main+0x20c>
movl   $0x0,-0x4(%rbp)
jmp    14dd <main+0x32d>
cmpl   $0x2,-0x8(%rbp)
je     13ec <main+0x23c>
lea    0xcc8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14dd <main+0x32d>
jmp    13f1 <main+0x241>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2b(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x88(%rbp)
cmpq   $0x0,-0x88(%rbp)
jne    1434 <main+0x284>
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    14dd <main+0x32d>
jmp    1439 <main+0x289>
mov    -0x88(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    145a <main+0x2aa>
jmp    14ca <main+0x31a>
mov    -0x88(%rbp),%rdi
lea    -0x80(%rbp),%rdx
lea    0xdde(%rip),%rsi
lea    -0x90(%rbp),%rcx
lea    -0x98(%rbp),%r8
lea    -0xa0(%rbp),%r9
call   1070 <fscanf@plt>
mov    -0x90(%rbp),%rdi
mov    -0x98(%rbp),%rsi
mov    -0xa0(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <SNPHWE2@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
lea    -0x80(%rbp),%rsi
movsd  -0xa8(%rbp),%xmm0
ff
lea    0xd99(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
jmp    1439 <main+0x289>
mov    -0x88(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movslq %edi,%r12
add    $0xffffffff,%ebp
mov    -0x8(%rsi,%r12,8),%rdi
lea    0xe18(%rip),%rsi
call   1090 <strcmp@plt>
mov    %eax,%r14d
xor    %r13d,%r13d
test   %eax,%eax
sete   %r13b
cmove  %ebp,%r12d
mov    %r12d,%eax
and    $0xfffffffe,%eax
cmp    $0x4,%eax
jne    1272 <main+0xb2>
mov    0x8(%rbx),%rdi
call   10e0 <atoi@plt>
mov    %rax,%r15
mov    0x10(%rbx),%rdi
call   10e0 <atoi@plt>
mov    %rax,%rbp
mov    0x18(%rbx),%rdi
call   10e0 <atoi@plt>
test   %r15,%r15
js     131f <main+0x15f>
test   %rbp,%rbp
js     131f <main+0x15f>
test   %rax,%rax
js     131f <main+0x15f>
cmp    $0x4,%r12d
jne    134b <main+0x18b>
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %rax,%rdx
mov    %r13d,%ecx
call   1040 <SNPHWE2@plt>
lea    0xd9f(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
jmp    13cc <main+0x20c>
cmp    $0x2,%r12d
jne    1335 <main+0x175>
mov    0x8(%rbx),%rdi
lea    0xdae(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     138b <main+0x1cb>
mov    %rax,%rbx
mov    %rax,%rdi
call   10a0 <feof@plt>
test   %eax,%eax
jne    1312 <main+0x152>
lea    0x20(%rsp),%r15
lea    0x10(%rsp),%rbp
lea    0x8(%rsp),%r14
lea    0xd8a(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
lea    0xd6d(%rip),%rsi
mov    %r15,%rdx
lea    0x18(%rsp),%rcx
mov    %rbp,%r8
mov    %r14,%r9
call   1080 <fscanf@plt>
mov    0x18(%rsp),%rdi
mov    0x10(%rsp),%rsi
mov    0x8(%rsp),%rdx
mov    %r13d,%ecx
call   1040 <SNPHWE2@plt>
movsd  %xmm0,(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0x1,%al
call   1070 <printf@plt>
mov    %rbx,%rdi
call   10a0 <feof@plt>
test   %eax,%eax
je     12c0 <main+0x100>
mov    %rbx,%rdi
call   1050 <fclose@plt>
jmp    13cc <main+0x20c>
lea    0xf26(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%eax
jmp    13ce <main+0x20e>
lea    0xd39(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
jmp    13ce <main+0x20e>
mov    %rax,%r12
mov    0x20(%rbx),%rdi
lea    0xcba(%rip),%rsi
mov    %rsp,%rdx
call   10b0 <sscanf@plt>
cmp    $0x1,%eax
jne    139e <main+0x1de>
movsd  (%rsp),%xmm0
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
test   %r14d,%r14d
je     13b7 <main+0x1f7>
call   10c0 <SNPHWE_t@plt>
test   %eax,%eax
je     13c0 <main+0x200>
lea    0xe9c(%rip),%rdi
jmp    13c7 <main+0x207>
lea    0xcc7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%eax
jmp    13ce <main+0x20e>
mov    0x20(%rbx),%rsi
lea    0xc6e(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x3,%eax
jmp    13ce <main+0x20e>
call   1060 <SNPHWE_midp_t@plt>
test   %eax,%eax
jne    1382 <main+0x1c2>
lea    0xe37(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"midp\00"
@.str.1 = [28 x i8] c"Error: Negative parameter.\0A\00"
@.str.2 = [14 x i8] c"P-value: %lg\0A\00"
@.str.3 = [4 x i8] c"%lg\00"
@.str.4 = [30 x i8] c"Error: Invalid p-value '%s'.\0A\00"
@.str.5 = [40 x i8] c"Test failed (p-value below threshold).\0A\00"
@.str.6 = [40 x i8] c"Test passed (p-value above threshold).\0A\00"
@.str.7 = [394 x i8] c"SNPHWE2 demo http://www.sph.umich.edu/csg/abecasis/Exact/\0A https://github.com/chrchang/stats\0A\0A snphwe_test [het count] [hom count 1] [hom count 2] {threshold} <midp>\0A snphwe_test [filename] <midp>\0A\0AIf a filename is provided, the file is expected to contain marker names in the\0Afirst column, heterozygote counts in the second, and homozygote counts in the\0Athird and fourth.\0A\00"
@.str.8 = [2 x i8] c"r\00"
@.str.9 = [29 x i8] c"Error: Unable to open file.\0A\00"
@.str.10 = [13 x i8] c"%s %d %d %d\0A\00"
@.str.11 = [21 x i8] c"P-value for %s: %lg\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [100 x i8]
%8 = alloca i32*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca double
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%14 = load i8**, i8*** %5
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %14, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %2
store i32 1, i32* %6
%23 = load i32, i32* %4
%24 = add nsw i32 %23, -1
store i32 %24, i32* %4
br label %25
25: ; preds = %22, %2
%26 = load i32, i32* %4
%27 = icmp eq i32 %26, 4
br i1 %27, label %31, label %28
28: ; preds = %25
%29 = load i32, i32* %4
%30 = icmp eq i32 %29, 5
br i1 %30, label %31, label %100
31: ; preds = %28, %25
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i64 @atoi(i8* %34)
store i64 %35, i64* %9
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 2
%38 = load i8*, i8** %37
%39 = call i64 @atoi(i8* %38)
store i64 %39, i64* %10
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 3
%42 = load i8*, i8** %41
%43 = call i64 @atoi(i8* %42)
store i64 %43, i64* %11
%44 = load i64, i64* %9
%45 = icmp slt i64 %44, 0
br i1 %45, label %52, label %46
46: ; preds = %31
%47 = load i64, i64* %10
%48 = icmp slt i64 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %46
%50 = load i64, i64* %11
%51 = icmp slt i64 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %49, %46, %31
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
store i32 3, i32* %3
br label %136
54: ; preds = %49
%55 = load i32, i32* %4
%56 = icmp eq i32 %55, 4
br i1 %56, label %57, label %65
57: ; preds = %54
%58 = load i64, i64* %9
%59 = load i64, i64* %10
%60 = load i64, i64* %11
%61 = load i32, i32* %6
%62 = call double @SNPHWE2(i64 %58, i64 %59, i64 %60, i32 %61)
store double %62, double* %12
%63 = load double, double* %12
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %63)
br label %99
65: ; preds = %54
%66 = load i8**, i8*** %5
%67 = getelementptr inbounds i8*, i8** %66, i64 4
%68 = load i8*, i8** %67
%69 = call i32 @sscanf(i8* %68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %12)
%70 = icmp ne i32 %69, 1
br i1 %70, label %71, label %76
71: ; preds = %65
%72 = load i8**, i8*** %5
%73 = getelementptr inbounds i8*, i8** %72, i64 4
%74 = load i8*, i8** %73
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %74)
store i32 3, i32* %3
br label %136
76: ; preds = %65
%77 = load i32, i32* %6
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %85
79: ; preds = %76
%80 = load i64, i64* %9
%81 = load i64, i64* %10
%82 = load i64, i64* %11
%83 = load double, double* %12
%84 = call i32 @SNPHWE_midp_t(i64 %80, i64 %81, i64 %82, double %83)
store i32 %84, i32* %13
br label %91
85: ; preds = %76
%86 = load i64, i64* %9
%87 = load i64, i64* %10
%88 = load i64, i64* %11
%89 = load double, double* %12
%90 = call i32 @SNPHWE_t(i64 %86, i64 %87, i64 %88, double %89)
store i32 %90, i32* %13
br label %91
91: ; preds = %85, %79
%92 = load i32, i32* %13
%93 = icmp ne i32 %92, 0
br i1 %93, label %94, label %96
94: ; preds = %91
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
br label %98
96: ; preds = %91
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
br label %98
98: ; preds = %96, %94
br label %99
99: ; preds = %98, %57
store i32 0, i32* %3
br label %136
100: ; preds = %28
%101 = load i32, i32* %4
%102 = icmp ne i32 %101, 2
br i1 %102, label %103, label %105
103: ; preds = %100
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([394 x i8], [394 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %3
br label %136
105: ; preds = %100
br label %106
106: ; preds = %105
%107 = load i8**, i8*** %5
%108 = getelementptr inbounds i8*, i8** %107, i64 1
%109 = load i8*, i8** %108
%110 = call i32* @fopen(i8* %109, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32* %110, i32** %8
%111 = load i32*, i32** %8
%112 = icmp ne i32* %111, null
br i1 %112, label %115, label %113
113: ; preds = %106
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0))
store i32 2, i32* %3
br label %136
115: ; preds = %106
br label %116
116: ; preds = %121, %115
%117 = load i32*, i32** %8
%118 = call i32 @feof(i32* %117)
%119 = icmp ne i32 %118, 0
%120 = xor i1 %119, true
br i1 %120, label %121, label %133
121: ; preds = %116
%122 = load i32*, i32** %8
%123 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%124 = call i32 @fscanf(i32* %122, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %123, i64* %9, i64* %10, i64* %11)
%125 = load i64, i64* %9
%126 = load i64, i64* %10
%127 = load i64, i64* %11
%128 = load i32, i32* %6
%129 = call double @SNPHWE2(i64 %125, i64 %126, i64 %127, i32 %128)
store double %129, double* %12
%130 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%131 = load double, double* %12
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %130, double %131)
br label %116
133: ; preds = %116
%134 = load i32*, i32** %8
%135 = call i32 @fclose(i32* %134)
store i32 0, i32* %3
br label %136
136: ; preds = %133, %113, %103, %99, %71, %52
%137 = load i32, i32* %3
ret i32 %137
}

LLVM IR (-O2):
@.str = [5 x i8] c"midp\00"
@.str.2 = [14 x i8] c"P-value: %lg\0A\00"
@.str.3 = [4 x i8] c"%lg\00"
@.str.4 = [30 x i8] c"Error: Invalid p-value '%s'.\0A\00"
@.str.8 = [2 x i8] c"r\00"
@.str.10 = [13 x i8] c"%s %d %d %d\0A\00"
@.str.11 = [21 x i8] c"P-value for %s: %lg\0A\00"
@str = [28 x i8] c"Error: Unable to open file.\00"
@str.12 = [393 x i8] c"SNPHWE2 demo http://www.sph.umich.edu/csg/abecasis/Exact/\0A https://github.com/chrchang/stats\0A\0A snphwe_test [het count] [hom count 1] [hom count 2] {threshold} <midp>\0A snphwe_test [filename] <midp>\0A\0AIf a filename is provided, the file is expected to contain marker names in the\0Afirst column, heterozygote counts in the second, and homozygote counts in the\0Athird and fourth.\00"
@str.13 = [39 x i8] c"Test passed (p-value above threshold).\00"
@str.14 = [39 x i8] c"Test failed (p-value below threshold).\00"
@str.15 = [27 x i8] c"Error: Negative parameter.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca double
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = bitcast i64* %4 to i8*
%10 = bitcast i64* %5 to i8*
%11 = bitcast i64* %6 to i8*
%12 = bitcast double* %7 to i8*
%13 = add nsw i32 %0, -1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %16, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
%19 = select i1 %18, i32 %13, i32 %0
%20 = zext i1 %18 to i32
%21 = icmp eq i32 %19, 4
%22 = and i32 %19, -2
%23 = icmp eq i32 %22, 4
br i1 %23, label %24, label %66
24: ; preds = %2
%25 = getelementptr inbounds i8*, i8** %1, i64 1
%26 = load i8*, i8** %25
%27 = tail call i64 @atoi(i8* %26)
%28 = getelementptr inbounds i8*, i8** %1, i64 2
%29 = load i8*, i8** %28
%30 = tail call i64 @atoi(i8* %29)
%31 = getelementptr inbounds i8*, i8** %1, i64 3
%32 = load i8*, i8** %31
%33 = tail call i64 @atoi(i8* %32)
%34 = icmp slt i64 %27, 0
%35 = icmp slt i64 %30, 0
%36 = select i1 %34, i1 true, i1 %35
%37 = icmp slt i64 %33, 0
%38 = select i1 %36, i1 true, i1 %37
br i1 %38, label %39, label %41
39: ; preds = %24
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.15, i64 0, i64 0))
br label %91
41: ; preds = %24
br i1 %21, label %42, label %45
42: ; preds = %41
%43 = tail call double @SNPHWE2(i64 %27, i64 %30, i64 %33, i32 %20)
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %43)
br label %91
45: ; preds = %41
%46 = getelementptr inbounds i8*, i8** %1, i64 4
%47 = load i8*, i8** %46
%48 = call i32 @sscanf(i8* %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %7)
%49 = icmp eq i32 %48, 1
br i1 %49, label %53, label %50
50: ; preds = %45
%51 = load i8*, i8** %46
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %51)
br label %91
53: ; preds = %45
%54 = load double, double* %7
br i1 %18, label %55, label %57
55: ; preds = %53
%56 = call i32 @SNPHWE_midp_t(i64 %27, i64 %30, i64 %33, double %54)
br label %59
57: ; preds = %53
%58 = call i32 @SNPHWE_t(i64 %27, i64 %30, i64 %33, double %54)
br label %59
59: ; preds = %57, %55
%60 = phi i32 [ %56, %55 ], [ %58, %57 ]
%61 = icmp eq i32 %60, 0
br i1 %61, label %64, label %62
62: ; preds = %59
%63 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.14, i64 0, i64 0))
br label %91
64: ; preds = %59
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.13, i64 0, i64 0))
br label %91
66: ; preds = %2
%67 = icmp eq i32 %19, 2
br i1 %67, label %70, label %68
68: ; preds = %66
%69 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([393 x i8], [393 x i8]* @str.12, i64 0, i64 0))
br label %91
70: ; preds = %66
%71 = getelementptr inbounds i8*, i8** %1, i64 1
%72 = load i8*, i8** %71
%73 = tail call i32* @fopen(i8* %72, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%74 = icmp eq i32* %73, null
br i1 %74, label %78, label %75
75: ; preds = %70
%76 = call i32 @feof(i32* %73)
%77 = icmp eq i32 %76, 0
br i1 %77, label %80, label %89
78: ; preds = %70
%79 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %91
80: ; preds = %75, %80
%81 = call i32 @fscanf(i32* %73, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %8, i64* %4, i64* %5, i64* %6)
%82 = load i64, i64* %4
%83 = load i64, i64* %5
%84 = load i64, i64* %6
%85 = call double @SNPHWE2(i64 %82, i64 %83, i64 %84, i32 %20)
store double %85, double* %7
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %8, double %85)
%87 = call i32 @feof(i32* %73)
%88 = icmp eq i32 %87, 0
br i1 %88, label %80, label %89
89: ; preds = %80, %75
%90 = call i32 @fclose(i32* %73)
br label %91
91: ; preds = %42, %64, %62, %89, %78, %68, %50, %39
%92 = phi i32 [ 3, %39 ], [ 3, %50 ], [ 1, %68 ], [ 0, %89 ], [ 2, %78 ], [ 0, %62 ], [ 0, %64 ], [ 0, %42 ]
ret i32 %92
}