#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 IncompleteGamma(double, double, int /*<<< orphan*/);
int /*<<< orphan*/ LnGammaFunction(double);
double PointChi2(double, double);
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main(int argc, char *argv[]) {
  int i, j, n = 20, ndf = 200, nprob = 8, option = 0;
  double df, chi2, d = 1.0 / n,
                   prob[] = {.005, .025, .1, .5, .90, .95, .99, .999};
  option = (argc > 1);
  if (option) {
    for (;;) {
      printf("\nd.f. & Chi^2 value (Ctrl-c to break)? ");
      scanf("%lf%lf", &df, &chi2);
      if (df < 1 || chi2 < 0)
        break;
      prob[0] = 1 - IncompleteGamma((0.5) * (chi2), (df) / 2.0,
                                    LnGammaFunction((df) / 2.0));
      printf("\nprob = %.9f = %.3e\n", prob[0], prob[0]);
    }
  } else {
    printf("\n\nChi-square critical values\n");
    for (i = 0; i < ndf; i++) {
      if (i % 15 == 0) {
        printf("\n\t\t\t\tSignificance level\n");
        printf("\n DF ");
        for (j = 0; j < nprob; j++)
          printf("%9.4f", 1 - prob[j]);
        printf("\n");
      }
      printf("\n%3d ", i + 1);
      for (j = 0; j < nprob; j++)
        printf("%9.4f", PointChi2(prob[j], (double)(i + 1)));
      if (i % 5 == 4)
        printf("\n");
      if (i % 15 == 14) {
        printf("\nENTER for more, (q+ENTER) for quit... ");
        if (getchar() == 'q')
          break;
      }
    }
  }
  printf("\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x14,-0x1c(%rbp)
movl   $0xc8,-0x20(%rbp)
movl   $0x8,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xe4e(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xe5a(%rip),%rsi
mov    $0x40,%edx
call   1070 <memcpy@plt>
cmpl   $0x1,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     12c5 <main+0x155>
jmp    11ee <main+0x7e>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe85(%rip),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x38(%rbp),%rdx
call   1090 <scanf@plt>
movsd  0xde8(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
ja     1231 <main+0xc1>
xorps  %xmm0,%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    1236 <main+0xc6>
jmp    12c0 <main+0x150>
movsd  0xdd2(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0xdb0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0xd97(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <LnGammaFunction@plt>
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm1
ff
mov    %eax,%edi
call   1050 <IncompleteGamma@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
lea    0xddb(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    11ee <main+0x7e>
jmp    143a <main+0x2ca>
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1435 <main+0x2c5>
mov    -0x14(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1365 <main+0x1f5>
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1357 <main+0x1e7>
movslq -0x18(%rbp),%rax
movsd  0xccb(%rip),%xmm0
subsd  -0x80(%rbp,%rax,8),%xmm0
lea    0xd9f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    131d <main+0x1ad>
lea    0xd44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    13c1 <main+0x251>
movslq -0x18(%rbp),%rax
movsd  -0x80(%rbp,%rax,8),%xmm0
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
call   1080 <PointChi2@plt>
lea    0xd35(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1380 <main+0x210>
mov    -0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x4,%edx
jne    13e3 <main+0x273>
lea    0xcc6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
cmp    $0xe,%edx
jne    1422 <main+0x2b2>
lea    0xcef(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
movsbl %al,%eax
cmp    $0x71,%eax
jne    141d <main+0x2ad>
jmp    1435 <main+0x2c5>
jmp    1422 <main+0x2b2>
jmp    1427 <main+0x2b7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12da <main+0x16a>
jmp    143a <main+0x2ca>
lea    0xc61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
cmp    $0x2,%edi
jl     12ad <main+0x12d>
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xefc(%rip),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   10a0 <scanf@plt>
movsd  0x18(%rsp),%xmm1
movsd  0xea7(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     1526 <main+0x3a6>
movsd  0x10(%rsp),%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
ja     1526 <main+0x3a6>
lea    0xec1(%rip),%r14
lea    0xe8b(%rip),%r15
lea    0xeac(%rip),%r12
lea    0x18(%rsp),%rbp
lea    0x10(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
movsd  0xe00(%rip),%xmm0
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x20(%rsp)
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1030 <LnGammaFunction@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %eax,%edi
call   1070 <IncompleteGamma@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mov    %r14,%rdi
movapd %xmm0,%xmm1
mov    $0x2,%al
call   1060 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   10a0 <scanf@plt>
movsd  0x18(%rsp),%xmm1
movsd  0xde6(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     1526 <main+0x3a6>
movsd  0x10(%rsp),%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
jbe    1210 <main+0x90>
jmp    1526 <main+0x3a6>
lea    0xe4a(%rip),%rdi
call   1050 <puts@plt>
lea    0xe0a(%rip),%rbx
lea    0xe09(%rip),%r12
xor    %r15d,%r15d
jmp    12ef <main+0x16f>
nopl   0x0(%rax)
lea    (%r15,%r13,1),%eax
add    $0xfffffff2,%eax
test   %al,%al
je     1500 <main+0x380>
cmp    $0xc6,%r15d
ja     1526 <main+0x3a6>
mov    %ebp,%r15d
mov    %r15d,%ebp
mov    $0xcccccccd,%eax
imul   %rax,%rbp
shr    $0x22,%rbp
movzbl %r15b,%eax
imul   $0x89,%eax,%eax
shr    $0xb,%eax
mov    %eax,%ecx
shl    $0x4,%ecx
sub    %ecx,%eax
movzbl %al,%r13d
lea    (%r15,%r13,1),%eax
test   %al,%al
jne    13d7 <main+0x257>
lea    0xdf1(%rip),%rdi
call   1050 <puts@plt>
lea    0xd8e(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
movsd  0xcb8(%rip),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
mov    %rbx,%rdi
movsd  0xcae(%rip),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
mov    %rbx,%rdi
movsd  0xca4(%rip),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
mov    %rbx,%rdi
movsd  0xc9a(%rip),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
mov    %rbx,%rdi
movsd  0xc90(%rip),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
mov    %rbx,%rdi
movsd  0xc86(%rip),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
mov    %rbx,%rdi
movsd  0xc7c(%rip),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
mov    %rbx,%rdi
movsd  0xc72(%rip),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x4(%rbp,%rbp,4),%r14d
lea    0x1(%r15),%ebp
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xc3f(%rip),%xmm0
call   1090 <PointChi2@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xc30(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1090 <PointChi2@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xc1b(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1090 <PointChi2@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xbc6(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1090 <PointChi2@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xba1(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1090 <PointChi2@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xbcc(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1090 <PointChi2@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xbb7(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1090 <PointChi2@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xba2(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1090 <PointChi2@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
cmp    %r15d,%r14d
jne    12d0 <main+0x150>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    12d0 <main+0x150>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xbcf(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1080 <getchar@plt>
cmp    $0x71,%al
je     1526 <main+0x3a6>
cmp    $0xc7,%r15d
jb     12ec <main+0x16c>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.prob = [8 x double] [double 5.000000e-03, double 2.500000e-02, double 1.000000e-01, double 5.000000e-01, double 9.000000e-01, double 0x3FEE666666666666, double 0x3FEFAE147AE147AE, double 0x3FEFF7CED916872B]
@.str = [40 x i8] c"\0Ad.f. & Chi^2 value (Ctrl-c to break)? \00"
@.str.1 = [7 x i8] c"%lf%lf\00"
@.str.2 = [21 x i8] c"\0Aprob = %.9f = %.3e\0A\00"
@.str.3 = [30 x i8] c"\0A\0AChi-square critical values\0A\00"
@.str.4 = [25 x i8] c"\0A\09\09\09\09Significance level\0A\00"
@.str.5 = [6 x i8] c"\0A DF \00"
@.str.6 = [6 x i8] c"%9.4f\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [6 x i8] c"\0A%3d \00"
@.str.9 = [40 x i8] c"\0AENTER for more, (q+ENTER) for quit... \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca [8 x double]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 20, i32* %8
store i32 200, i32* %9
store i32 8, i32* %10
store i32 0, i32* %11
%16 = load i32, i32* %8
%17 = sitofp i32 %16 to double
%18 = fdiv double 1.000000e+00, %17
store double %18, double* %14
%19 = bitcast [8 x double]* %15 to i8*
%20 = load i32, i32* %4
%21 = icmp sgt i32 %20, 1
%22 = zext i1 %21 to i32
store i32 %22, i32* %11
%23 = load i32, i32* %11
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %53
25: ; preds = %2
br label %26
26: ; preds = %35, %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%28 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double* %12, double* %13)
%29 = load double, double* %12
%30 = fcmp olt double %29, 1.000000e+00
br i1 %30, label %34, label %31
31: ; preds = %26
%32 = load double, double* %13
%33 = fcmp olt double %32, 0.000000e+00
br i1 %33, label %34, label %35
34: ; preds = %31, %26
br label %52
35: ; preds = %31
%36 = load double, double* %13
%37 = fmul double 5.000000e-01, %36
%38 = load double, double* %12
%39 = fdiv double %38, 2.000000e+00
%40 = load double, double* %12
%41 = fdiv double %40, 2.000000e+00
%42 = call i32 @LnGammaFunction(double %41)
%43 = call i32 @IncompleteGamma(double %37, double %39, i32 %42)
%44 = sub nsw i32 1, %43
%45 = sitofp i32 %44 to double
%46 = getelementptr inbounds [8 x double], [8 x double]* %15, i64 0, i64 0
store double %45, double* %46
%47 = getelementptr inbounds [8 x double], [8 x double]* %15, i64 0, i64 0
%48 = load double, double* %47
%49 = getelementptr inbounds [8 x double], [8 x double]* %15, i64 0, i64 0
%50 = load double, double* %49
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %48, double %50)
br label %26
52: ; preds = %34
br label %125
53: ; preds = %2
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %6
br label %55
55: ; preds = %121, %53
%56 = load i32, i32* %6
%57 = load i32, i32* %9
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %124
59: ; preds = %55
%60 = load i32, i32* %6
%61 = srem i32 %60, 15
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %82
63: ; preds = %59
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %7
br label %66
66: ; preds = %77, %63
%67 = load i32, i32* %7
%68 = load i32, i32* %10
%69 = icmp slt i32 %67, %68
br i1 %69, label %70, label %80
70: ; preds = %66
%71 = load i32, i32* %7
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [8 x double], [8 x double]* %15, i64 0, i64 %72
%74 = load double, double* %73
%75 = fsub double 1.000000e+00, %74
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %75)
br label %77
77: ; preds = %70
%78 = load i32, i32* %7
%79 = add nsw i32 %78, 1
store i32 %79, i32* %7
br label %66
80: ; preds = %66
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %82
82: ; preds = %80, %59
%83 = load i32, i32* %6
%84 = add nsw i32 %83, 1
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %84)
store i32 0, i32* %7
br label %86
86: ; preds = %100, %82
%87 = load i32, i32* %7
%88 = load i32, i32* %10
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %103
90: ; preds = %86
%91 = load i32, i32* %7
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [8 x double], [8 x double]* %15, i64 0, i64 %92
%94 = load double, double* %93
%95 = load i32, i32* %6
%96 = add nsw i32 %95, 1
%97 = sitofp i32 %96 to double
%98 = call double @PointChi2(double %94, double %97)
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %98)
br label %100
100: ; preds = %90
%101 = load i32, i32* %7
%102 = add nsw i32 %101, 1
store i32 %102, i32* %7
br label %86
103: ; preds = %86
%104 = load i32, i32* %6
%105 = srem i32 %104, 5
%106 = icmp eq i32 %105, 4
br i1 %106, label %107, label %109
107: ; preds = %103
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %109
109: ; preds = %107, %103
%110 = load i32, i32* %6
%111 = srem i32 %110, 15
%112 = icmp eq i32 %111, 14
br i1 %112, label %113, label %120
113: ; preds = %109
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0))
%115 = call signext i8 (...) @getchar()
%116 = sext i8 %115 to i32
%117 = icmp eq i32 %116, 113
br i1 %117, label %118, label %119
118: ; preds = %113
br label %124
119: ; preds = %113
br label %120
120: ; preds = %119, %109
br label %121
121: ; preds = %120
%122 = load i32, i32* %6
%123 = add nsw i32 %122, 1
store i32 %123, i32* %6
br label %55
124: ; preds = %118, %55
br label %125
125: ; preds = %124, %52
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"\0Ad.f. & Chi^2 value (Ctrl-c to break)? \00"
@.str.1 = [7 x i8] c"%lf%lf\00"
@.str.2 = [21 x i8] c"\0Aprob = %.9f = %.3e\0A\00"
@.str.5 = [6 x i8] c"\0A DF \00"
@.str.6 = [6 x i8] c"%9.4f\00"
@.str.8 = [6 x i8] c"\0A%3d \00"
@.str.9 = [40 x i8] c"\0AENTER for more, (q+ENTER) for quit... \00"
@str = [29 x i8] c"\0A\0AChi-square critical values\00"
@str.10 = [24 x i8] c"\0A\09\09\09\09Significance level\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %33
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double* %3, double* %4)
%11 = load double, double* %3
%12 = fcmp olt double %11, 1.000000e+00
%13 = load double, double* %4
%14 = fcmp olt double %13, 0.000000e+00
%15 = select i1 %12, i1 true, i1 %14
br i1 %15, label %87, label %16
16: ; preds = %8, %16
%17 = phi double [ %30, %16 ], [ %13, %8 ]
%18 = phi double [ %28, %16 ], [ %11, %8 ]
%19 = fmul double %17, 5.000000e-01
%20 = fmul double %18, 5.000000e-01
%21 = call i32 @LnGammaFunction(double %20)
%22 = call i32 @IncompleteGamma(double %19, double %20, i32 %21)
%23 = sub nsw i32 1, %22
%24 = sitofp i32 %23 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %24, double %24)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%27 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double* %3, double* %4)
%28 = load double, double* %3
%29 = fcmp olt double %28, 1.000000e+00
%30 = load double, double* %4
%31 = fcmp olt double %30, 0.000000e+00
%32 = select i1 %29, i1 true, i1 %31
br i1 %32, label %87, label %16
33: ; preds = %2
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %35
35: ; preds = %86, %33
%36 = phi i32 [ 0, %33 ], [ %53, %86 ]
%37 = trunc i32 %36 to i8
%38 = urem i8 %37, 15
%39 = icmp eq i8 %38, 0
br i1 %39, label %40, label %52
40: ; preds = %35
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.10, i64 0, i64 0))
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double 0x3FEFD70A3D70A3D7)
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double 0x3FEF333333333333)
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double 9.000000e-01)
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double 5.000000e-01)
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double 0x3FB9999999999998)
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double 0x3FA99999999999A0)
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double 0x3F847AE147AE1480)
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double 0x3F50624DD2F1AA00)
%51 = tail call i32 @putchar(i32 10)
br label %52
52: ; preds = %40, %35
%53 = add nuw nsw i32 %36, 1
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %53)
%55 = sitofp i32 %53 to double
%56 = tail call double @PointChi2(double 5.000000e-03, double %55)
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %56)
%58 = tail call double @PointChi2(double 2.500000e-02, double %55)
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %58)
%60 = tail call double @PointChi2(double 1.000000e-01, double %55)
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %60)
%62 = tail call double @PointChi2(double 5.000000e-01, double %55)
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %62)
%64 = tail call double @PointChi2(double 9.000000e-01, double %55)
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %64)
%66 = tail call double @PointChi2(double 0x3FEE666666666666, double %55)
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %66)
%68 = tail call double @PointChi2(double 0x3FEFAE147AE147AE, double %55)
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %68)
%70 = tail call double @PointChi2(double 0x3FEFF7CED916872B, double %55)
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %70)
%72 = urem i32 %36, 5
%73 = icmp eq i32 %72, 4
br i1 %73, label %74, label %76
74: ; preds = %52
%75 = tail call i32 @putchar(i32 10)
br label %76
76: ; preds = %74, %52
%77 = icmp eq i8 %38, 14
br i1 %77, label %78, label %84
78: ; preds = %76
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0))
%80 = tail call signext i8 (...) @getchar()
%81 = icmp ne i8 %80, 113
%82 = icmp ult i32 %36, 199
%83 = and i1 %81, %82
br i1 %83, label %86, label %87
84: ; preds = %76
%85 = icmp ult i32 %36, 199
br i1 %85, label %86, label %87
86: ; preds = %84, %78
br label %35
87: ; preds = %84, %78, %16, %8
%88 = call i32 @putchar(i32 10)
ret i32 0
}