// File: fhirschman[P]CANF-gp/source/CPU_functions.cc
// Function: cgammln(std::complex<double>)
complex<double> cgammln(complex<double> xx)
{
	complex<double> x,y,tmp,ser,res;
	static double cof[6]={76.18009172947146,-86.50532032941677,
		24.01409824083091,-1.231739572450155,
		0.1208650973866179e-2,-0.5395239384953e-5};
	int j;

	y=x=xx;

	tmp=x+5.5;
	tmp -= (x+0.5)*log(tmp);
	ser=1.000000000190015;
	for (j=0;j<=5;j++){
		y+=1;
		ser += cof[j]/y;
	}
	res=-tmp+log(2.5066282746310005*ser/x);
	res={real(res),0.0};
	return res;
}

// Assembly:
subq $0x138, %rsp            # imm = 0x138
movsd %xmm0, 0x110(%rsp)
movsd %xmm1, 0x118(%rsp)
leaq 0x100(%rsp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xc0c0
leaq 0xf0(%rsp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xc0c0
leaq 0xe0(%rsp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xc0c0
leaq 0xd0(%rsp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xc0c0
leaq 0x120(%rsp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xc0c0
movq 0x110(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x118(%rsp), %rax
movq %rax, 0x108(%rsp)
movq 0x100(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0x108(%rsp), %rax
movq %rax, 0xf8(%rsp)
movsd 0x7b58(%rip), %xmm0     # 0x1ef88
movsd %xmm0, 0xb0(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x18900
movsd %xmm0, 0xb8(%rsp)
movsd %xmm1, 0xc0(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0xe8(%rsp)
movsd 0x7af8(%rip), %xmm0     # 0x1ef80
movsd %xmm0, 0x88(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x18900
movsd %xmm0, 0x90(%rsp)
movsd %xmm1, 0x98(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x18980
movsd %xmm0, 0x78(%rsp)
movsd %xmm1, 0x80(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x18940
movsd %xmm0, 0xa0(%rsp)
movsd %xmm1, 0xa8(%rsp)
leaq 0xe0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x189f0
leaq 0xd0(%rsp), %rdi
movsd 0x7a5b(%rip), %xmm0     # 0x1ef78
callq 0x18a40
movl $0x0, 0xcc(%rsp)
cmpl $0x5, 0xcc(%rsp)
jg 0x175a0
leaq 0xf0(%rsp), %rdi
movsd 0x7a49(%rip), %xmm0     # 0x1ef90
callq 0x18a70
movslq 0xcc(%rsp), %rax
leaq 0x12035(%rip), %rdi     # 0x29590
shlq $0x3, %rax
addq %rax, %rdi
leaq 0xf0(%rsp), %rsi
callq 0x18aa0
movsd %xmm0, 0x68(%rsp)
movsd %xmm1, 0x70(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x11340
movl 0xcc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xcc(%rsp)
jmp 0x1752d
leaq 0xe0(%rsp), %rdi
callq 0x18af0
movsd %xmm0, 0x48(%rsp)
movsd %xmm1, 0x50(%rsp)
movabsq $0x40040d931ff62706, %rax # imm = 0x40040D931FF62706
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0xc270
movsd %xmm0, 0x18(%rsp)
movsd %xmm1, 0x20(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x18b50
movsd %xmm0, 0x28(%rsp)
movsd %xmm1, 0x30(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x18980
movsd %xmm0, 0x38(%rsp)
movsd %xmm1, 0x40(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0xc230
movsd %xmm0, 0x58(%rsp)
movsd %xmm1, 0x60(%rsp)
movups 0x58(%rsp), %xmm0
movaps %xmm0, 0x120(%rsp)
leaq 0x120(%rsp), %rdi
callq 0xbd10
movq %rsp, %rdi
xorps %xmm1, %xmm1
callq 0xc0c0
movups (%rsp), %xmm0
movaps %xmm0, 0x120(%rsp)
movsd 0x120(%rsp), %xmm0
movsd 0x128(%rsp), %xmm1
addq $0x138, %rsp            # imm = 0x138
retq