#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 int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
double fisher22(int, int, int, int, int);
double fisher22_1sided(int, int, int, int, int, int);
int /*<<< orphan*/ fisher22_precomp_thresh(int, int, int, int, int *, int *,
                                           int *);
double fisher23(int, int, int, int, int, int, int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int sscanf(char *, char *, char *, int *, int *, int *, int *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  FILE *test_file;
  uint32_t midp = 0;
  char buf[131072];
  char idstr[131072];
  char *bufptr;
  uint32_t m11;
  uint32_t m12;
  uint32_t m21;
  uint32_t m22;
  uint32_t m31;
  uint32_t m32;
  uint32_t tie;
  if (!strcmp(argv[argc - 1], "midp")) {
    midp = 1;
    argc--;
  }
  if (argc == 5) {
    m11 = atoi(argv[1]);
    m12 = atoi(argv[2]);
    m21 = atoi(argv[3]);
    m22 = atoi(argv[4]);
    printf("p-value: %g\n", fisher22(m11, m12, m21, m22, midp));
    fisher22_precomp_thresh(m11, m12, m21, m22, &m31, &m32, &tie);
    if (!m32) {
      printf("(This is maximal.)\n");
    } else {
      printf("%u <= m11 < %u results in a higher p-value.\n", m31, m32);
    }
    if (tie != m11) {
      printf("m11 == %u results in the same p-value.\n", tie);
    }
    return 0;
  } else if (argc == 6) {
    if ((argv[5][1] != '\0') || ((argv[5][0] != '+') && (argv[5][0] != '-'))) {
      goto main_std_help;
    }
    m11 = atoi(argv[1]);
    m12 = atoi(argv[2]);
    m21 = atoi(argv[3]);
    m22 = atoi(argv[4]);
    printf("p-value: %g\n", fisher22_1sided(m11, m12, m21, m22,
                                            (argv[5][0] == '+') ? 1 : 0, midp));
    return 0;
  } else if (argc == 7) {
    printf("p-value: %g\n",
           fisher23(atoi(argv[1]), atoi(argv[3]), atoi(argv[5]), atoi(argv[2]),
                    atoi(argv[4]), atoi(argv[6]), midp));
    return 0;
  } else if (argc != 2) {
  main_std_help:
    printf("Fisher 2x2 and 2x3 exact test       "
           "https://github.com/chrchang/stats\n"
           "(C) 2013-2014 Christopher Chang, GNU General Public License "
           "version 3\n\n"
           "Usage: fisher_test [m11] [m12] [m21] [m22] <+ | -> <midp>\n"
           "       fisher_test [m11] [m12] [m21] [m22] [m31] [m32] <midp>\n"
           "       fisher_test [filename] <midp>\n\n"
           "For the 2x2 case, if the optional 5th parameter is '+', a 1-sided "
           "test is used\n"
           "where the alternative hypothesis is that m11 is greater than "
           "expected;\n"
           "similarly, '-' invokes the 1-sided test with the "
           "m11-is-less-than-expected\n"
           "alternative.  With neither, a 2-sided test is employed.\n\n"
           "If a filename is provided, each line of the file is expected to "
           "contain an ID\n"
           "in the first column, and then either 4 or 6 values (in "
           "m11-m12-m21-m22-m31-m32\n"
           "order).\n\n"
           "If 'midp' is the last parameter, Lancaster's mid-p correction is "
           "applied.\n");
    return 1;
  }
  test_file = fopen(argv[1], "r");
  if (!test_file) {
    printf("Error: Unable to open file.\n");
    return 2;
  }
  buf[131072 - 1] = ' ';
  while (fgets(buf, 131072, test_file)) {
    if (!buf[131072 - 1]) {
      printf("Error: Excessively long line in input file.\n");
      fclose(test_file);
      return 3;
    }
    bufptr = buf;
    while ((*bufptr == ' ') || (*bufptr == '\t')) {
      bufptr++;
    }
    if (*bufptr < ' ') {
      continue;
    }
    if (sscanf(bufptr, "%s %u %u %u %u %u %u", idstr, &m11, &m12, &m21, &m22,
               &m31, &m32) < 7) {
      if (sscanf(bufptr, "%s %u %u %u %u", idstr, &m11, &m12, &m21, &m22) < 5) {
        continue;
      }
      printf("p-value for %s: %g\n", idstr, fisher22(m11, m12, m21, m22, midp));
    } else {
      printf("p-value for %s: %g\n", idstr,
             fisher23(m11, m21, m31, m12, m22, m32, midp));
    }
  }
  if (!feof(test_file)) {
    printf("Error: File read failure.\n");
    fclose(test_file);
    return 4;
  }
  fclose(test_file);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40090,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe08(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1216 <main+0x56>
movl   $0x1,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    133d <main+0x17d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x4002c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x40030(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x40034(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x40038(%rbp)
mov    -0x4002c(%rbp),%edi
mov    -0x40030(%rbp),%esi
mov    -0x40034(%rbp),%edx
mov    -0x40038(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
call   10e0 <fisher22@plt>
lea    0xd71(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x4002c(%rbp),%edi
mov    -0x40030(%rbp),%esi
mov    -0x40034(%rbp),%edx
mov    -0x40038(%rbp),%ecx
lea    -0x4003c(%rbp),%r8
lea    -0x40040(%rbp),%r9
lea    -0x40044(%rbp),%rax
mov    %rax,(%rsp)
call   10c0 <fisher22_precomp_thresh@plt>
cmpl   $0x0,-0x40040(%rbp)
jne    12f1 <main+0x131>
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    130b <main+0x14b>
mov    -0x4003c(%rbp),%esi
mov    -0x40040(%rbp),%edx
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40044(%rbp),%eax
cmp    -0x4002c(%rbp),%eax
je     1331 <main+0x171>
mov    -0x40044(%rbp),%esi
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    17bd <main+0x5fd>
cmpl   $0x6,-0x8(%rbp)
jne    142c <main+0x26c>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1384 <main+0x1c4>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
je     1389 <main+0x1c9>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1389 <main+0x1c9>
jmp    14f8 <main+0x338>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x4002c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x40030(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x40034(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x40038(%rbp)
mov    -0x4002c(%rbp),%edi
mov    -0x40030(%rbp),%esi
mov    -0x40034(%rbp),%edx
mov    -0x40038(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
movsbl (%rax),%r9d
xor    %r8d,%r8d
mov    $0x1,%eax
cmp    $0x2b,%r9d
cmove  %eax,%r8d
mov    -0x1c(%rbp),%r9d
call   1090 <fisher22_1sided@plt>
lea    0xbec(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    17bd <main+0x5fd>
cmpl   $0x7,-0x8(%rbp)
jne    14e9 <main+0x329>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x40058(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x40054(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x40050(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x4004c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x40048(%rbp)
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rdi
call   10d0 <atoi@plt>
mov    -0x40058(%rbp),%edi
mov    -0x40054(%rbp),%esi
mov    -0x40050(%rbp),%edx
mov    -0x4004c(%rbp),%ecx
mov    -0x40048(%rbp),%r8d
mov    %eax,%r9d
mov    -0x1c(%rbp),%eax
mov    %eax,(%rsp)
call   1060 <fisher23@plt>
lea    0xb2f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    17bd <main+0x5fd>
cmpl   $0x2,-0x8(%rbp)
je     1512 <main+0x352>
jmp    14f8 <main+0x338>
lea    0xb7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    17bd <main+0x5fd>
jmp    1517 <main+0x357>
jmp    151c <main+0x35c>
jmp    1521 <main+0x361>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe81(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    155e <main+0x39e>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    17bd <main+0x5fd>
movb   $0x20,-0x21(%rbp)
lea    -0x20020(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x20000,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     1778 <main+0x5b8>
cmpb   $0x0,-0x21(%rbp)
jne    15ae <main+0x3ee>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x3,-0x4(%rbp)
jmp    17bd <main+0x5fd>
lea    -0x20020(%rbp),%rax
mov    %rax,-0x40028(%rbp)
mov    -0x40028(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x40059(%rbp)
je     15ed <main+0x42d>
mov    -0x40028(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x40059(%rbp)
mov    -0x40059(%rbp),%al
test   $0x1,%al
jne    1600 <main+0x440>
jmp    1617 <main+0x457>
mov    -0x40028(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40028(%rbp)
jmp    15bc <main+0x3fc>
mov    -0x40028(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jge    162f <main+0x46f>
jmp    1562 <main+0x3a2>
mov    -0x40028(%rbp),%rdi
lea    -0x40020(%rbp),%rdx
lea    0xdb9(%rip),%rsi
lea    -0x4002c(%rbp),%rcx
lea    -0x40030(%rbp),%r8
lea    -0x40034(%rbp),%r9
lea    -0x40038(%rbp),%r11
lea    -0x4003c(%rbp),%r10
lea    -0x40040(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   10a0 <sscanf@plt>
cmp    $0x7,%eax
jge    171f <main+0x55f>
mov    -0x40028(%rbp),%rdi
lea    -0x40020(%rbp),%rdx
lea    0xd71(%rip),%rsi
lea    -0x4002c(%rbp),%rcx
lea    -0x40030(%rbp),%r8
lea    -0x40034(%rbp),%r9
lea    -0x40038(%rbp),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   10a0 <sscanf@plt>
cmp    $0x5,%eax
jge    16d6 <main+0x516>
jmp    1562 <main+0x3a2>
lea    -0x40020(%rbp),%rax
mov    %rax,-0x40068(%rbp)
mov    -0x4002c(%rbp),%edi
mov    -0x40030(%rbp),%esi
mov    -0x40034(%rbp),%edx
mov    -0x40038(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
call   10e0 <fisher22@plt>
mov    -0x40068(%rbp),%rsi
lea    0xd0e(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1773 <main+0x5b3>
lea    -0x40020(%rbp),%rax
mov    %rax,-0x40070(%rbp)
mov    -0x4002c(%rbp),%edi
mov    -0x40034(%rbp),%esi
mov    -0x4003c(%rbp),%edx
mov    -0x40030(%rbp),%ecx
mov    -0x40038(%rbp),%r8d
mov    -0x40040(%rbp),%r9d
mov    -0x1c(%rbp),%eax
mov    %eax,(%rsp)
call   1060 <fisher23@plt>
mov    -0x40070(%rbp),%rsi
lea    0xcb5(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1562 <main+0x3a2>
mov    -0x18(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
jne    17ad <main+0x5ed>
lea    0xca4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x4,-0x4(%rbp)
jmp    17bd <main+0x5fd>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40090,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40048,%rsp
mov    %rsi,%r12
mov    %edi,%ebx
movslq %edi,%rbp
add    $0xffffffff,%ebx
mov    -0x8(%rsi,%rbp,8),%rdi
lea    0xe20(%rip),%rsi
call   1080 <strcmp@plt>
movl   $0x0,0x1c(%rsp)
test   %eax,%eax
sete   %al
cmove  %ebx,%ebp
add    $0xfffffffe,%ebp
cmp    $0x5,%ebp
ja     146c <main+0x29c>
mov    0x1c(%rsp),%ecx
mov    %al,%cl
mov    %ecx,0x1c(%rsp)
lea    0xdd6(%rip),%rax
movslq (%rax,%rbp,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    0x8(%r12),%rdi
lea    0xe40(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1516 <main+0x346>
mov    %rax,%r14
movb   $0x20,0x2003f(%rsp)
20
lea    0x40(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x20000,%esi
mov    %rax,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     14fc <main+0x32c>
lea    0x20040(%rsp),%rbx
lea    0x2c(%rsp),%r13
mov    %r14,0x38(%rsp)
jmp    12ea <main+0x11a>
nopw   0x0(%rax,%rax,1)
mov    0x34(%rsp),%edi
mov    0x2c(%rsp),%esi
mov    0x24(%rsp),%edx
mov    0x30(%rsp),%ecx
mov    0x28(%rsp),%r8d
mov    0x20(%rsp),%r9d
mov    0x1c(%rsp),%eax
mov    %eax,(%rsp)
call   1070 <fisher23@plt>
lea    0x40(%rsp),%rbp
mov    0x38(%rsp),%r14
lea    0xdde(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    $0x20000,%esi
mov    %r14,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     14fc <main+0x32c>
cmpb   $0x0,0x2003f(%rsp)
je     15bd <main+0x3ed>
mov    %rbp,%r15
jmp    1304 <main+0x134>
nopl   (%rax)
add    $0x1,%r15
movzbl (%r15),%eax
cmp    $0x20,%al
je     1300 <main+0x130>
cmp    $0x9,%al
je     1300 <main+0x130>
cmp    $0x20,%al
jl     12d1 <main+0x101>
lea    0x20(%rsp),%rax
mov    %rax,0x10(%rsp)
lea    0x24(%rsp),%rax
mov    %rax,0x8(%rsp)
lea    0x28(%rsp),%rbp
mov    %rbp,(%rsp)
mov    %r15,%rdi
lea    0xd46(%rip),%rsi
mov    %rbx,%rdx
lea    0x34(%rsp),%r14
mov    %r14,%rcx
lea    0x30(%rsp),%r12
mov    %r12,%r8
mov    %r13,%r9
xor    %eax,%eax
call   10b0 <sscanf@plt>
cmp    $0x6,%eax
jg     1290 <main+0xc0>
mov    %rbp,(%rsp)
mov    %r15,%rdi
lea    0xd27(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r12,%r8
mov    %r13,%r9
xor    %eax,%eax
call   10b0 <sscanf@plt>
cmp    $0x5,%eax
lea    0x40(%rsp),%rbp
mov    0x38(%rsp),%r14
jl     12d1 <main+0x101>
mov    0x34(%rsp),%edi
mov    0x30(%rsp),%esi
mov    0x2c(%rsp),%edx
mov    0x28(%rsp),%ecx
mov    0x1c(%rsp),%r8d
call   10f0 <fisher22@plt>
jmp    12c0 <main+0xf0>
mov    0x8(%r12),%rdi
call   10e0 <atoi@plt>
mov    %eax,%r14d
mov    %eax,0x34(%rsp)
mov    0x10(%r12),%rdi
call   10e0 <atoi@plt>
mov    %eax,%r15d
mov    %eax,0x30(%rsp)
mov    0x18(%r12),%rdi
call   10e0 <atoi@plt>
mov    %eax,%ebx
mov    %eax,0x2c(%rsp)
mov    0x20(%r12),%rdi
call   10e0 <atoi@plt>
mov    %eax,%ebp
mov    %eax,0x28(%rsp)
mov    %r14d,%edi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %eax,%ecx
mov    0x1c(%rsp),%r8d
call   10f0 <fisher22@plt>
lea    0xc0c(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0x40(%rsp),%rax
mov    %rax,(%rsp)
lea    0x24(%rsp),%r8
lea    0x20(%rsp),%r9
mov    %r14d,%edi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
call   10d0 <fisher22_precomp_thresh@plt>
mov    0x20(%rsp),%edx
test   %edx,%edx
je     152c <main+0x35c>
mov    0x24(%rsp),%esi
lea    0xbd9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1538 <main+0x368>
mov    0x28(%r12),%rbx
cmpb   $0x0,0x1(%rbx)
je     155c <main+0x38c>
lea    0xca8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
jmp    15f1 <main+0x421>
mov    0x8(%r12),%rdi
call   10e0 <atoi@plt>
mov    %eax,%r13d
mov    0x18(%r12),%rdi
call   10e0 <atoi@plt>
mov    %eax,%r15d
mov    0x28(%r12),%rdi
call   10e0 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%r12),%rdi
call   10e0 <atoi@plt>
mov    %eax,%ebx
mov    0x20(%r12),%rdi
call   10e0 <atoi@plt>
mov    %eax,%r14d
mov    0x30(%r12),%rdi
call   10e0 <atoi@plt>
mov    0x1c(%rsp),%ecx
mov    %ecx,(%rsp)
mov    %r13d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %r14d,%r8d
mov    %eax,%r9d
call   1070 <fisher23@plt>
lea    0xb2f(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %ebx,%ebx
jmp    15f1 <main+0x421>
mov    %r14,%rdi
call   1090 <feof@plt>
test   %eax,%eax
je     15d8 <main+0x408>
mov    %r14,%rdi
call   1040 <fclose@plt>
jmp    14f5 <main+0x325>
lea    0xb9c(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%ebx
jmp    15f1 <main+0x421>
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
mov    0x40(%rsp),%esi
xor    %ebx,%ebx
cmp    %r14d,%esi
je     15f1 <main+0x421>
lea    0xb09(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    15f1 <main+0x421>
mov    (%rbx),%al
cmp    $0x2d,%al
je     156a <main+0x39a>
cmp    $0x2b,%al
jne    146c <main+0x29c>
mov    0x8(%r12),%rdi
call   10e0 <atoi@plt>
mov    %eax,%r14d
mov    0x10(%r12),%rdi
call   10e0 <atoi@plt>
mov    %eax,%r15d
mov    0x18(%r12),%rdi
call   10e0 <atoi@plt>
mov    %eax,%ebp
mov    0x20(%r12),%rdi
call   10e0 <atoi@plt>
xor    %r8d,%r8d
cmpb   $0x2b,(%rbx)
sete   %r8b
mov    %r14d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
mov    0x1c(%rsp),%r9d
call   10a0 <fisher22_1sided@plt>
jmp    14e7 <main+0x317>
lea    0xb2b(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    $0x3,%ebx
jmp    15f1 <main+0x421>
lea    0xaf6(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    $0x4,%ebx
mov    %ebx,%eax
add    $0x40048,%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 = [13 x i8] c"p-value: %g\0A\00"
@.str.2 = [20 x i8] c"(This is maximal.)\0A\00"
@.str.3 = [45 x i8] c"%u <= m11 < %u results in a higher p-value.\0A\00"
@.str.4 = [40 x i8] c"m11 == %u results in the same p-value.\0A\00"
@.str.5 = [822 x i8] c"Fisher 2x2 and 2x3 exact test https://github.com/chrchang/stats\0A(C) 2013-2014 Christopher Chang, GNU General Public License version 3\0A\0AUsage: fisher_test [m11] [m12] [m21] [m22] <+ | -> <midp>\0A fisher_test [m11] [m12] [m21] [m22] [m31] [m32] <midp>\0A fisher_test [filename] <midp>\0A\0AFor the 2x2 case, if the optional 5th parameter is '+', a 1-sided test is used\0Awhere the alternative hypothesis is that m11 is greater than expected;\0Asimilarly, '-' invokes the 1-sided test with the m11-is-less-than-expected\0Aalternative. With neither, a 2-sided test is employed.\0A\0AIf a filename is provided, each line of the file is expected to contain an ID\0Ain the first column, and then either 4 or 6 values (in m11-m12-m21-m22-m31-m32\0Aorder).\0A\0AIf 'midp' is the last parameter, Lancaster's mid-p correction is applied.\0A\00"
@.str.6 = [2 x i8] c"r\00"
@.str.7 = [29 x i8] c"Error: Unable to open file.\0A\00"
@.str.8 = [45 x i8] c"Error: Excessively long line in input file.\0A\00"
@.str.9 = [21 x i8] c"%s %u %u %u %u %u %u\00"
@.str.10 = [15 x i8] c"%s %u %u %u %u\00"
@.str.11 = [20 x i8] c"p-value for %s: %g\0A\00"
@.str.12 = [27 x i8] c"Error: File read failure.\0A\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 [131072 x i8]
%9 = alloca [131072 x i8]
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%18 = load i8**, i8*** %5
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %18, i64 %21
%23 = load i8*, i8** %22
%24 = call i32 @strcmp(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %29, label %26
26: ; preds = %2
store i32 1, i32* %7
%27 = load i32, i32* %4
%28 = add nsw i32 %27, -1
store i32 %28, i32* %4
br label %29
29: ; preds = %26, %2
%30 = load i32, i32* %4
%31 = icmp eq i32 %30, 5
br i1 %31, label %32, label %77
32: ; preds = %29
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @atoi(i8* %35)
store i32 %36, i32* %11
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 2
%39 = load i8*, i8** %38
%40 = call i32 @atoi(i8* %39)
store i32 %40, i32* %12
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 3
%43 = load i8*, i8** %42
%44 = call i32 @atoi(i8* %43)
store i32 %44, i32* %13
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 4
%47 = load i8*, i8** %46
%48 = call i32 @atoi(i8* %47)
store i32 %48, i32* %14
%49 = load i32, i32* %11
%50 = load i32, i32* %12
%51 = load i32, i32* %13
%52 = load i32, i32* %14
%53 = load i32, i32* %7
%54 = call double @fisher22(i32 %49, i32 %50, i32 %51, i32 %52, i32 %53)
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %54)
%56 = load i32, i32* %11
%57 = load i32, i32* %12
%58 = load i32, i32* %13
%59 = load i32, i32* %14
%60 = call i32 @fisher22_precomp_thresh(i32 %56, i32 %57, i32 %58, i32 %59, i32* %15, i32* %16, i32* %17)
%61 = load i32, i32* %16
%62 = icmp ne i32 %61, 0
br i1 %62, label %65, label %63
63: ; preds = %32
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %69
65: ; preds = %32
%66 = load i32, i32* %15
%67 = load i32, i32* %16
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i32 %66, i32 %67)
br label %69
69: ; preds = %65, %63
%70 = load i32, i32* %17
%71 = load i32, i32* %11
%72 = icmp ne i32 %70, %71
br i1 %72, label %73, label %76
73: ; preds = %69
%74 = load i32, i32* %17
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %74)
br label %76
76: ; preds = %73, %69
store i32 0, i32* %3
br label %268
77: ; preds = %29
%78 = load i32, i32* %4
%79 = icmp eq i32 %78, 6
br i1 %79, label %80, label %138
80: ; preds = %77
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i64 5
%83 = load i8*, i8** %82
%84 = getelementptr inbounds i8, i8* %83, i64 1
%85 = load i8, i8* %84
%86 = sext i8 %85 to i32
%87 = icmp ne i32 %86, 0
br i1 %87, label %104, label %88
88: ; preds = %80
%89 = load i8**, i8*** %5
%90 = getelementptr inbounds i8*, i8** %89, i64 5
%91 = load i8*, i8** %90
%92 = getelementptr inbounds i8, i8* %91, i64 0
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = icmp ne i32 %94, 43
br i1 %95, label %96, label %105
96: ; preds = %88
%97 = load i8**, i8*** %5
%98 = getelementptr inbounds i8*, i8** %97, i64 5
%99 = load i8*, i8** %98
%100 = getelementptr inbounds i8, i8* %99, i64 0
%101 = load i8, i8* %100
%102 = sext i8 %101 to i32
%103 = icmp ne i32 %102, 45
br i1 %103, label %104, label %105
104: ; preds = %96, %80
br label %173
105: ; preds = %96, %88
%106 = load i8**, i8*** %5
%107 = getelementptr inbounds i8*, i8** %106, i64 1
%108 = load i8*, i8** %107
%109 = call i32 @atoi(i8* %108)
store i32 %109, i32* %11
%110 = load i8**, i8*** %5
%111 = getelementptr inbounds i8*, i8** %110, i64 2
%112 = load i8*, i8** %111
%113 = call i32 @atoi(i8* %112)
store i32 %113, i32* %12
%114 = load i8**, i8*** %5
%115 = getelementptr inbounds i8*, i8** %114, i64 3
%116 = load i8*, i8** %115
%117 = call i32 @atoi(i8* %116)
store i32 %117, i32* %13
%118 = load i8**, i8*** %5
%119 = getelementptr inbounds i8*, i8** %118, i64 4
%120 = load i8*, i8** %119
%121 = call i32 @atoi(i8* %120)
store i32 %121, i32* %14
%122 = load i32, i32* %11
%123 = load i32, i32* %12
%124 = load i32, i32* %13
%125 = load i32, i32* %14
%126 = load i8**, i8*** %5
%127 = getelementptr inbounds i8*, i8** %126, i64 5
%128 = load i8*, i8** %127
%129 = getelementptr inbounds i8, i8* %128, i64 0
%130 = load i8, i8* %129
%131 = sext i8 %130 to i32
%132 = icmp eq i32 %131, 43
%133 = zext i1 %132 to i64
%134 = select i1 %132, i32 1, i32 0
%135 = load i32, i32* %7
%136 = call double @fisher22_1sided(i32 %122, i32 %123, i32 %124, i32 %125, i32 %134, i32 %135)
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %136)
store i32 0, i32* %3
br label %268
138: ; preds = %77
%139 = load i32, i32* %4
%140 = icmp eq i32 %139, 7
br i1 %140, label %141, label %169
141: ; preds = %138
%142 = load i8**, i8*** %5
%143 = getelementptr inbounds i8*, i8** %142, i64 1
%144 = load i8*, i8** %143
%145 = call i32 @atoi(i8* %144)
%146 = load i8**, i8*** %5
%147 = getelementptr inbounds i8*, i8** %146, i64 3
%148 = load i8*, i8** %147
%149 = call i32 @atoi(i8* %148)
%150 = load i8**, i8*** %5
%151 = getelementptr inbounds i8*, i8** %150, i64 5
%152 = load i8*, i8** %151
%153 = call i32 @atoi(i8* %152)
%154 = load i8**, i8*** %5
%155 = getelementptr inbounds i8*, i8** %154, i64 2
%156 = load i8*, i8** %155
%157 = call i32 @atoi(i8* %156)
%158 = load i8**, i8*** %5
%159 = getelementptr inbounds i8*, i8** %158, i64 4
%160 = load i8*, i8** %159
%161 = call i32 @atoi(i8* %160)
%162 = load i8**, i8*** %5
%163 = getelementptr inbounds i8*, i8** %162, i64 6
%164 = load i8*, i8** %163
%165 = call i32 @atoi(i8* %164)
%166 = load i32, i32* %7
%167 = call double @fisher23(i32 %145, i32 %149, i32 %153, i32 %157, i32 %161, i32 %165, i32 %166)
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %167)
store i32 0, i32* %3
br label %268
169: ; preds = %138
%170 = load i32, i32* %4
%171 = icmp ne i32 %170, 2
br i1 %171, label %172, label %175
172: ; preds = %169
br label %173
173: ; preds = %172, %104
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([822 x i8], [822 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %268
175: ; preds = %169
br label %176
176: ; preds = %175
br label %177
177: ; preds = %176
br label %178
178: ; preds = %177
%179 = load i8**, i8*** %5
%180 = getelementptr inbounds i8*, i8** %179, i64 1
%181 = load i8*, i8** %180
%182 = call i32* @fopen(i8* %181, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %182, i32** %6
%183 = load i32*, i32** %6
%184 = icmp ne i32* %183, null
br i1 %184, label %187, label %185
185: ; preds = %178
%186 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
store i32 2, i32* %3
br label %268
187: ; preds = %178
%188 = getelementptr inbounds [131072 x i8], [131072 x i8]* %8, i64 0, i64 131071
store i8 32, i8* %188
br label %189
189: ; preds = %256, %235, %224, %187
%190 = getelementptr inbounds [131072 x i8], [131072 x i8]* %8, i64 0, i64 0
%191 = load i32*, i32** %6
%192 = call i64 @fgets(i8* %190, i32 131072, i32* %191)
%193 = icmp ne i64 %192, 0
br i1 %193, label %194, label %257
194: ; preds = %189
%195 = getelementptr inbounds [131072 x i8], [131072 x i8]* %8, i64 0, i64 131071
%196 = load i8, i8* %195
%197 = icmp ne i8 %196, 0
br i1 %197, label %202, label %198
198: ; preds = %194
%199 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
%200 = load i32*, i32** %6
%201 = call i32 @fclose(i32* %200)
store i32 3, i32* %3
br label %268
202: ; preds = %194
%203 = getelementptr inbounds [131072 x i8], [131072 x i8]* %8, i64 0, i64 0
store i8* %203, i8** %10
br label %204
204: ; preds = %216, %202
%205 = load i8*, i8** %10
%206 = load i8, i8* %205
%207 = sext i8 %206 to i32
%208 = icmp eq i32 %207, 32
br i1 %208, label %214, label %209
209: ; preds = %204
%210 = load i8*, i8** %10
%211 = load i8, i8* %210
%212 = sext i8 %211 to i32
%213 = icmp eq i32 %212, 9
br label %214
214: ; preds = %209, %204
%215 = phi i1 [ true, %204 ], [ %213, %209 ]
br i1 %215, label %216, label %219
216: ; preds = %214
%217 = load i8*, i8** %10
%218 = getelementptr inbounds i8, i8* %217, i32 1
store i8* %218, i8** %10
br label %204
219: ; preds = %214
%220 = load i8*, i8** %10
%221 = load i8, i8* %220
%222 = sext i8 %221 to i32
%223 = icmp slt i32 %222, 32
br i1 %223, label %224, label %225
224: ; preds = %219
br label %189
225: ; preds = %219
%226 = load i8*, i8** %10
%227 = getelementptr inbounds [131072 x i8], [131072 x i8]* %9, i64 0, i64 0
%228 = call i32 (i8*, i8*, i8*, i32*, i32*, i32*, i32*, ...) @sscanf(i8* %226, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* %227, i32* %11, i32* %12, i32* %13, i32* %14, i32* %15, i32* %16)
%229 = icmp slt i32 %228, 7
br i1 %229, label %230, label %245
230: ; preds = %225
%231 = load i8*, i8** %10
%232 = getelementptr inbounds [131072 x i8], [131072 x i8]* %9, i64 0, i64 0
%233 = call i32 (i8*, i8*, i8*, i32*, i32*, i32*, i32*, ...) @sscanf(i8* %231, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i8* %232, i32* %11, i32* %12, i32* %13, i32* %14)
%234 = icmp slt i32 %233, 5
br i1 %234, label %235, label %236
235: ; preds = %230
br label %189
236: ; preds = %230
%237 = getelementptr inbounds [131072 x i8], [131072 x i8]* %9, i64 0, i64 0
%238 = load i32, i32* %11
%239 = load i32, i32* %12
%240 = load i32, i32* %13
%241 = load i32, i32* %14
%242 = load i32, i32* %7
%243 = call double @fisher22(i32 %238, i32 %239, i32 %240, i32 %241, i32 %242)
%244 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i8* %237, double %243)
br label %256
245: ; preds = %225
%246 = getelementptr inbounds [131072 x i8], [131072 x i8]* %9, i64 0, i64 0
%247 = load i32, i32* %11
%248 = load i32, i32* %13
%249 = load i32, i32* %15
%250 = load i32, i32* %12
%251 = load i32, i32* %14
%252 = load i32, i32* %16
%253 = load i32, i32* %7
%254 = call double @fisher23(i32 %247, i32 %248, i32 %249, i32 %250, i32 %251, i32 %252, i32 %253)
%255 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i8* %246, double %254)
br label %256
256: ; preds = %245, %236
br label %189
257: ; preds = %189
%258 = load i32*, i32** %6
%259 = call i32 @feof(i32* %258)
%260 = icmp ne i32 %259, 0
br i1 %260, label %265, label %261
261: ; preds = %257
%262 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0))
%263 = load i32*, i32** %6
%264 = call i32 @fclose(i32* %263)
store i32 4, i32* %3
br label %268
265: ; preds = %257
%266 = load i32*, i32** %6
%267 = call i32 @fclose(i32* %266)
store i32 0, i32* %3
br label %268
268: ; preds = %265, %261, %198, %185, %173, %141, %105, %76
%269 = load i32, i32* %3
ret i32 %269
}

LLVM IR (-O2):
@.str = [5 x i8] c"midp\00"
@.str.1 = [13 x i8] c"p-value: %g\0A\00"
@.str.3 = [45 x i8] c"%u <= m11 < %u results in a higher p-value.\0A\00"
@.str.4 = [40 x i8] c"m11 == %u results in the same p-value.\0A\00"
@.str.6 = [2 x i8] c"r\00"
@.str.9 = [21 x i8] c"%s %u %u %u %u %u %u\00"
@.str.10 = [15 x i8] c"%s %u %u %u %u\00"
@.str.11 = [20 x i8] c"p-value for %s: %g\0A\00"
@str = [28 x i8] c"Error: Unable to open file.\00"
@str.13 = [26 x i8] c"Error: File read failure.\00"
@str.14 = [44 x i8] c"Error: Excessively long line in input file.\00"
@str.15 = [821 x i8] c"Fisher 2x2 and 2x3 exact test https://github.com/chrchang/stats\0A(C) 2013-2014 Christopher Chang, GNU General Public License version 3\0A\0AUsage: fisher_test [m11] [m12] [m21] [m22] <+ | -> <midp>\0A fisher_test [m11] [m12] [m21] [m22] [m31] [m32] <midp>\0A fisher_test [filename] <midp>\0A\0AFor the 2x2 case, if the optional 5th parameter is '+', a 1-sided test is used\0Awhere the alternative hypothesis is that m11 is greater than expected;\0Asimilarly, '-' invokes the 1-sided test with the m11-is-less-than-expected\0Aalternative. With neither, a 2-sided test is employed.\0A\0AIf a filename is provided, each line of the file is expected to contain an ID\0Ain the first column, and then either 4 or 6 values (in m11-m12-m21-m22-m31-m32\0Aorder).\0A\0AIf 'midp' is the last parameter, Lancaster's mid-p correction is applied.\00"
@str.16 = [19 x i8] c"(This is maximal.)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [131072 x i8]
%4 = alloca [131072 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = getelementptr inbounds [131072 x i8], [131072 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds [131072 x i8], [131072 x i8]* %4, i64 0, i64 0
%14 = bitcast i32* %5 to i8*
%15 = bitcast i32* %6 to i8*
%16 = bitcast i32* %7 to i8*
%17 = bitcast i32* %8 to i8*
%18 = bitcast i32* %9 to i8*
%19 = bitcast i32* %10 to i8*
%20 = bitcast i32* %11 to i8*
%21 = add nsw i32 %0, -1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %1, i64 %22
%24 = load i8*, i8** %23
%25 = tail call i32 @strcmp(i8* dereferenceable(1) %24, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
%27 = select i1 %26, i32 %21, i32 %0
%28 = zext i1 %26 to i32
switch i32 %27, label %104 [
i32 5, label %29
i32 6, label %57
i32 7, label %83
i32 2, label %106
]
29: ; preds = %2
%30 = getelementptr inbounds i8*, i8** %1, i64 1
%31 = load i8*, i8** %30
%32 = tail call i32 @atoi(i8* %31)
store i32 %32, i32* %5
%33 = getelementptr inbounds i8*, i8** %1, i64 2
%34 = load i8*, i8** %33
%35 = tail call i32 @atoi(i8* %34)
store i32 %35, i32* %6
%36 = getelementptr inbounds i8*, i8** %1, i64 3
%37 = load i8*, i8** %36
%38 = tail call i32 @atoi(i8* %37)
store i32 %38, i32* %7
%39 = getelementptr inbounds i8*, i8** %1, i64 4
%40 = load i8*, i8** %39
%41 = tail call i32 @atoi(i8* %40)
store i32 %41, i32* %8
%42 = tail call double @fisher22(i32 %32, i32 %35, i32 %38, i32 %41, i32 %28)
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %42)
%44 = call i32 @fisher22_precomp_thresh(i32 %32, i32 %35, i32 %38, i32 %41, i32* %9, i32* %10, i32* %11)
%45 = load i32, i32* %10
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %29
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.16, i64 0, i64 0))
br label %52
49: ; preds = %29
%50 = load i32, i32* %9
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i32 %50, i32 %45)
br label %52
52: ; preds = %49, %47
%53 = load i32, i32* %11
%54 = icmp eq i32 %53, %32
br i1 %54, label %164, label %55
55: ; preds = %52
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %53)
br label %164
57: ; preds = %2
%58 = getelementptr inbounds i8*, i8** %1, i64 5
%59 = load i8*, i8** %58
%60 = getelementptr inbounds i8, i8* %59, i64 1
%61 = load i8, i8* %60
%62 = icmp eq i8 %61, 0
br i1 %62, label %63, label %104
63: ; preds = %57
%64 = load i8, i8* %59
switch i8 %64, label %104 [
i8 43, label %65
i8 45, label %65
]
65: ; preds = %63, %63
%66 = getelementptr inbounds i8*, i8** %1, i64 1
%67 = load i8*, i8** %66
%68 = tail call i32 @atoi(i8* %67)
%69 = getelementptr inbounds i8*, i8** %1, i64 2
%70 = load i8*, i8** %69
%71 = tail call i32 @atoi(i8* %70)
%72 = getelementptr inbounds i8*, i8** %1, i64 3
%73 = load i8*, i8** %72
%74 = tail call i32 @atoi(i8* %73)
%75 = getelementptr inbounds i8*, i8** %1, i64 4
%76 = load i8*, i8** %75
%77 = tail call i32 @atoi(i8* %76)
%78 = load i8, i8* %59
%79 = icmp eq i8 %78, 43
%80 = zext i1 %79 to i32
%81 = tail call double @fisher22_1sided(i32 %68, i32 %71, i32 %74, i32 %77, i32 %80, i32 %28)
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %81)
br label %164
83: ; preds = %2
%84 = getelementptr inbounds i8*, i8** %1, i64 1
%85 = load i8*, i8** %84
%86 = tail call i32 @atoi(i8* %85)
%87 = getelementptr inbounds i8*, i8** %1, i64 3
%88 = load i8*, i8** %87
%89 = tail call i32 @atoi(i8* %88)
%90 = getelementptr inbounds i8*, i8** %1, i64 5
%91 = load i8*, i8** %90
%92 = tail call i32 @atoi(i8* %91)
%93 = getelementptr inbounds i8*, i8** %1, i64 2
%94 = load i8*, i8** %93
%95 = tail call i32 @atoi(i8* %94)
%96 = getelementptr inbounds i8*, i8** %1, i64 4
%97 = load i8*, i8** %96
%98 = tail call i32 @atoi(i8* %97)
%99 = getelementptr inbounds i8*, i8** %1, i64 6
%100 = load i8*, i8** %99
%101 = tail call i32 @atoi(i8* %100)
%102 = tail call double @fisher23(i32 %86, i32 %89, i32 %92, i32 %95, i32 %98, i32 %101, i32 %28)
%103 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %102)
br label %164
104: ; preds = %2, %63, %57
%105 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([821 x i8], [821 x i8]* @str.15, i64 0, i64 0))
br label %164
106: ; preds = %2
%107 = getelementptr inbounds i8*, i8** %1, i64 1
%108 = load i8*, i8** %107
%109 = tail call i32* @fopen(i8* %108, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%110 = icmp eq i32* %109, null
br i1 %110, label %111, label %113
111: ; preds = %106
%112 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %164
113: ; preds = %106
%114 = getelementptr inbounds [131072 x i8], [131072 x i8]* %3, i64 0, i64 131071
store i8 32, i8* %114
%115 = call i64 @fgets(i8* %12, i32 131072, i32* %109)
%116 = icmp eq i64 %115, 0
br i1 %116, label %156, label %117
117: ; preds = %113, %153
%118 = load i8, i8* %114
%119 = icmp eq i8 %118, 0
br i1 %119, label %120, label %123
120: ; preds = %117
%121 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.14, i64 0, i64 0))
%122 = call i32 @fclose(i32* %109)
br label %164
123: ; preds = %117, %126
%124 = phi i8* [ %127, %126 ], [ %12, %117 ]
%125 = load i8, i8* %124
switch i8 %125, label %128 [
i8 32, label %126
i8 9, label %126
]
126: ; preds = %123, %123
%127 = getelementptr inbounds i8, i8* %124, i64 1
br label %123
128: ; preds = %123
%129 = icmp slt i8 %125, 32
br i1 %129, label %153, label %130
130: ; preds = %128
%131 = call i32 (i8*, i8*, i8*, i32*, i32*, i32*, i32*, ...) @sscanf(i8* %124, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* %13, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10)
%132 = icmp slt i32 %131, 7
br i1 %132, label %133, label %142
133: ; preds = %130
%134 = call i32 (i8*, i8*, i8*, i32*, i32*, i32*, i32*, ...) @sscanf(i8* %124, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i8* %13, i32* %5, i32* %6, i32* %7, i32* %8)
%135 = icmp slt i32 %134, 5
br i1 %135, label %153, label %136
136: ; preds = %133
%137 = load i32, i32* %5
%138 = load i32, i32* %6
%139 = load i32, i32* %7
%140 = load i32, i32* %8
%141 = call double @fisher22(i32 %137, i32 %138, i32 %139, i32 %140, i32 %28)
br label %150
142: ; preds = %130
%143 = load i32, i32* %5
%144 = load i32, i32* %7
%145 = load i32, i32* %9
%146 = load i32, i32* %6
%147 = load i32, i32* %8
%148 = load i32, i32* %10
%149 = call double @fisher23(i32 %143, i32 %144, i32 %145, i32 %146, i32 %147, i32 %148, i32 %28)
br label %150
150: ; preds = %142, %136
%151 = phi double [ %141, %136 ], [ %149, %142 ]
%152 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i8* %13, double %151)
br label %153
153: ; preds = %150, %128, %133
%154 = call i64 @fgets(i8* %12, i32 131072, i32* %109)
%155 = icmp eq i64 %154, 0
br i1 %155, label %156, label %117
156: ; preds = %153, %113
%157 = call i32 @feof(i32* %109)
%158 = icmp eq i32 %157, 0
br i1 %158, label %159, label %162
159: ; preds = %156
%160 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.13, i64 0, i64 0))
%161 = call i32 @fclose(i32* %109)
br label %164
162: ; preds = %156
%163 = call i32 @fclose(i32* %109)
br label %164
164: ; preds = %52, %55, %162, %159, %120, %111, %104, %83, %65
%165 = phi i32 [ 1, %104 ], [ 0, %65 ], [ 0, %83 ], [ 3, %120 ], [ 0, %162 ], [ 4, %159 ], [ 2, %111 ], [ 0, %55 ], [ 0, %52 ]
ret i32 %165
}