// File: ashlall[P]StreamStats/ChiSquareExperiments/./../SourceCode/ChiSquare/Chi_Square_Distribution.cpp
// Function: gcf(double, double)
void gcf(  double a, double x )
{
	int i, ITMAX=100;
	double an, b, c, d, del, h, eps = 3.0e-7, fpmin = 1.0e-30;
	gln = gammln( a );
	b = x + 1.0 - a;
	c = 1.0 / fpmin;
	d = 1.0 / b;
	h = d;
	for( i = 1; i < ITMAX; i++ )
	{
		
		an = -i * ( i-a );
		b += 2.0;
		d = an * d + b;
		if( fabs( d ) < fpmin )
			d = fpmin;
		c = b + an / c;
		if( fabs( c ) < fpmin )
			c = fpmin;
		d = 1.0 / d;
		del = d * c;
		h *= del;
		if( fabs( del-1.0 ) < eps )
			break;
	}
	if( i > ITMAX )
	{
		printf( "Error:a too large, ITMAX too small in routine gser" );
		exit( 1 );
	}
	gammcf = exp( -x + a * log( x ) - gln ) * h;
//	returns the incomplete gamma function P(a,x) evaluated by its continued fraction
//	reprentation as gammcf, also returns ln(gamma(a) as gln;
//  the definition of incomplete function P(a,x) can see routine gser();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movsd %xmm0, -0x8(%rbp)
movsd %xmm1, -0x10(%rbp)
movl $0x64, -0x18(%rbp)
movsd 0xd01f(%rip), %xmm0     # 0x12020
movsd %xmm0, -0x50(%rbp)
movsd 0xd03a(%rip), %xmm0     # 0x12048
movsd %xmm0, -0x58(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x4e10
movsd %xmm0, 0x15213(%rip)    # 0x1a238
movsd 0xcfdb(%rip), %xmm0     # 0x12008
addsd -0x10(%rbp), %xmm0
subsd -0x8(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0xcfc4(%rip), %xmm0     # 0x12008
divsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0xcfb2(%rip), %xmm0     # 0x12008
divsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x5192
xorl %eax, %eax
subl -0x14(%rbp), %eax
cvtsi2sd %eax, %xmm0
cvtsi2sdl -0x14(%rbp), %xmm1
subsd -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0xcfaf(%rip), %xmm0     # 0x12050
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x20(%rbp), %xmm0
movsd -0x38(%rbp), %xmm2
movsd -0x28(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm1
movaps 0xd0bd(%rip), %xmm0     # 0x12190
pand %xmm0, %xmm1
movsd -0x58(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x50ec
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
divsd -0x30(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm1
movaps 0xd080(%rip), %xmm0     # 0x12190
pand %xmm0, %xmm1
movsd -0x58(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x5129
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0xced7(%rip), %xmm0     # 0x12008
divsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
mulsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x40(%rbp), %xmm1
movsd 0xcea2(%rip), %xmm0     # 0x12008
subsd %xmm0, %xmm1
movaps 0xd01f(%rip), %xmm0     # 0x12190
pand %xmm0, %xmm1
movsd -0x50(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x5182
jmp 0x5192
jmp 0x5184
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x5071
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jle 0x51b2
leaq 0xd063(%rip), %rdi      # 0x12204
movb $0x0, %al
callq 0x2040
movl $0x1, %edi
callq 0x2200
movsd -0x10(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x8(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x2140
movsd -0x68(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x60(%rbp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
subsd 0x15034(%rip), %xmm0    # 0x1a238
callq 0x2340
mulsd -0x48(%rbp), %xmm0
movsd %xmm0, 0x15032(%rip)    # 0x1a248
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)