// File: kebwi[P]Trifid/src/FFT/matlib.cpp
// Function: cvprod(double*, double*, double*, long)
void cvprod(Float_t *a, Float_t *b, Float_t *out, long N){
/* complex vector product, can be in-place */
/* product of complex vector *a times complex vector *b */
/* INPUTS */
/* N vector length */
/* *a complex vector length N complex numbers */
/* *b complex vector length N complex numbers */
/* OUTPUTS */
/* *out complex vector length N */

long	OutCnt;		/* output counter */
Float_t	A0R; 		/* A storage */
Float_t	A0I; 		/* A storage */
Float_t	A1R; 		/* A storage */
Float_t	A1I; 		/* A storage */
Float_t	A2R; 		/* A storage */
Float_t	A2I; 		/* A storage */
Float_t	A3R; 		/* A storage */
Float_t	A3I; 		/* A storage */
Float_t	B0R; 		/* B storage */
Float_t	B0I; 		/* B storage */
Float_t	B1R; 		/* B storage */
Float_t	B1I; 		/* B storage */
Float_t	B2R; 		/* B storage */
Float_t	B2I; 		/* B storage */
Float_t	B3R; 		/* B storage */
Float_t	B3I; 		/* B storage */
Float_t	T0R; 		/* TMP storage */
Float_t	T0I; 		/* TMP storage */
Float_t	T1R; 		/* TMP storage */
Float_t	T1I; 		/* TMP storage */
Float_t	T2R; 		/* TMP storage */
Float_t	T2I; 		/* TMP storage */
Float_t	T3R; 		/* TMP storage */
Float_t	T3I; 		/* TMP storage */

if (N>=4){
	A0R = *a;
	B0R = *b;
	A0I = *(a +1);
	B0I = *(b +1);
	A1R = *(a +2);
	B1R = *(b +2);
	A1I = *(a +3);
	B1I = *(b +3);
	A2R = *(a +4);
	B2R = *(b +4);
	A2I = *(a +5);
	B2I = *(b +5);
	A3R = *(a +6);
	B3R = *(b +6);
	A3I = *(a +7);
	B3I = *(b +7);
	T0R = A0R * B0R;
	T0I = (A0R * B0I);
	T1R = A1R * B1R;
	T1I = (A1R * B1I);
	T2R = A2R * B2R;
	T2I = (A2R * B2I);
	T3R = A3R * B3R;
	T3I = (A3R * B3I);
	T0R -= (A0I * B0I);
	T0I = A0I * B0R + T0I;
	T1R -= (A1I * B1I);
	T1I = A1I * B1R + T1I;
	T2R -= (A2I * B2I);
	T2I = A2I * B2R + T2I;
	T3R -= (A3I * B3I);
	T3I = A3I * B3R + T3I;
	for (OutCnt=N/4-1; OutCnt > 0; OutCnt--){
		a += 8;
		b += 8;
		A0R = *a;
		B0R = *b;
		A0I = *(a +1);
		B0I = *(b +1);
		A1R = *(a +2);
		B1R = *(b +2);
		A1I = *(a +3);
		B1I = *(b +3);
		A2R = *(a +4);
		B2R = *(b +4);
		A2I = *(a +5);
		B2I = *(b +5);
		A3R = *(a +6);
		B3R = *(b +6);
		A3I = *(a +7);
		B3I = *(b +7);
		*out = T0R;
		*(out +1) = T0I;
		*(out +2) = T1R;
		*(out +3) = T1I;
		*(out +4) = T2R;
		*(out +5) = T2I;
		*(out +6) = T3R;
		*(out +7) = T3I;
		T0R = A0R * B0R;
		T0I = (A0R * B0I);
		T1R = A1R * B1R;
		T1I = (A1R * B1I);
		T2R = A2R * B2R;
		T2I = (A2R * B2I);
		T3R = A3R * B3R;
		T3I = (A3R * B3I);
		T0R -= (A0I * B0I);
		T0I = A0I * B0R + T0I;
		T1R -= (A1I * B1I);
		T1I = A1I * B1R + T1I;
		T2R -= (A2I * B2I);
		T2I = A2I * B2R + T2I;
		T3R -= (A3I * B3I);
		T3I = A3I * B3R + T3I;
		out += 8;
	}
	a += 8;
	b += 8;
	*out = T0R;
	*(out +1) = T0I;
	*(out +2) = T1R;
	*(out +3) = T1I;
	*(out +4) = T2R;
	*(out +5) = T2I;
	*(out +6) = T3R;
	*(out +7) = T3I;
	out += 8;
}
for (OutCnt=N%4; OutCnt > 0; OutCnt--){
	A0R = *a++;
	B0R = *b++;
	A0I = *a++;
	B0I = *b++;
	T0R = A0R * B0R;
	T0I = (A0R * B0I);
	T0R -= (A0I * B0I);
	T0I = A0I * B0R + T0I;
	*out++ = T0R;
	*out++ = T0I;
}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x68, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x4, -0x20(%rbp)
jl 0x48d59
movq -0x8(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x8(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x8(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x88(%rbp)
movq -0x8(%rbp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x10(%rbp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x90(%rbp)
movq -0x8(%rbp), %rax
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x10(%rbp), %rax
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x98(%rbp)
movq -0x8(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x10(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
movq -0x8(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x10(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0xa8(%rbp)
movsd -0x30(%rbp), %xmm0
mulsd -0x70(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd -0x30(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd -0x40(%rbp), %xmm0
mulsd -0x80(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0x40(%rbp), %xmm0
mulsd -0x88(%rbp), %xmm0
movsd %xmm0, -0xc8(%rbp)
movsd -0x50(%rbp), %xmm0
mulsd -0x90(%rbp), %xmm0
movsd %xmm0, -0xd0(%rbp)
movsd -0x50(%rbp), %xmm0
mulsd -0x98(%rbp), %xmm0
movsd %xmm0, -0xd8(%rbp)
movsd -0x60(%rbp), %xmm0
mulsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd -0x60(%rbp), %xmm0
mulsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0xe8(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x78(%rbp), %xmm2
movsd -0xb0(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x70(%rbp), %xmm2
movsd -0xb8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x88(%rbp), %xmm2
movsd -0xc0(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x80(%rbp), %xmm2
movsd -0xc8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xc8(%rbp)
movsd -0x58(%rbp), %xmm0
movsd -0x98(%rbp), %xmm2
movsd -0xd0(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xd0(%rbp)
movsd -0x58(%rbp), %xmm0
movsd -0x90(%rbp), %xmm2
movsd -0xd8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xd8(%rbp)
movsd -0x68(%rbp), %xmm0
movsd -0xa8(%rbp), %xmm2
movsd -0xe0(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd -0x68(%rbp), %xmm0
movsd -0xa0(%rbp), %xmm2
movsd -0xe8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xe8(%rbp)
movq -0x20(%rbp), %rax
movl $0x4, %ecx
cqto
idivq %rcx
subq $0x1, %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jle 0x48cae
movq -0x8(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x8(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x8(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x88(%rbp)
movq -0x8(%rbp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x10(%rbp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x90(%rbp)
movq -0x8(%rbp), %rax
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x10(%rbp), %rax
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x98(%rbp)
movq -0x8(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x10(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
movq -0x8(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x10(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0xa8(%rbp)
movsd -0xb0(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
movsd -0xb8(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movsd -0xc0(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movsd -0xc8(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movsd -0xd0(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x20(%rax)
movsd -0xd8(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x28(%rax)
movsd -0xe0(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x30(%rax)
movsd -0xe8(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x38(%rax)
movsd -0x30(%rbp), %xmm0
mulsd -0x70(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd -0x30(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd -0x40(%rbp), %xmm0
mulsd -0x80(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0x40(%rbp), %xmm0
mulsd -0x88(%rbp), %xmm0
movsd %xmm0, -0xc8(%rbp)
movsd -0x50(%rbp), %xmm0
mulsd -0x90(%rbp), %xmm0
movsd %xmm0, -0xd0(%rbp)
movsd -0x50(%rbp), %xmm0
mulsd -0x98(%rbp), %xmm0
movsd %xmm0, -0xd8(%rbp)
movsd -0x60(%rbp), %xmm0
mulsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd -0x60(%rbp), %xmm0
mulsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0xe8(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x78(%rbp), %xmm2
movsd -0xb0(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x70(%rbp), %xmm2
movsd -0xb8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x88(%rbp), %xmm2
movsd -0xc0(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x80(%rbp), %xmm2
movsd -0xc8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xc8(%rbp)
movsd -0x58(%rbp), %xmm0
movsd -0x98(%rbp), %xmm2
movsd -0xd0(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xd0(%rbp)
movsd -0x58(%rbp), %xmm0
movsd -0x90(%rbp), %xmm2
movsd -0xd8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xd8(%rbp)
movsd -0x68(%rbp), %xmm0
movsd -0xa8(%rbp), %xmm2
movsd -0xe0(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd -0x68(%rbp), %xmm0
movsd -0xa0(%rbp), %xmm2
movsd -0xe8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xe8(%rbp)
movq -0x18(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x488e0
movq -0x8(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x10(%rbp)
movsd -0xb0(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
movsd -0xb8(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movsd -0xc0(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movsd -0xc8(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movsd -0xd0(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x20(%rax)
movsd -0xd8(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x28(%rax)
movsd -0xe0(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x30(%rax)
movsd -0xe8(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x38(%rax)
movq -0x18(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
movl $0x4, %ecx
cqto
idivq %rcx
movq %rdx, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jle 0x48e9c
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x8(%rbp)
movsd (%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x10(%rbp)
movsd (%rax), %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x8(%rbp)
movsd (%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x10(%rbp)
movsd (%rax), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x30(%rbp), %xmm0
mulsd -0x70(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd -0x30(%rbp), %xmm0
mulsd -0x78(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x78(%rbp), %xmm2
movsd -0xb0(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x70(%rbp), %xmm2
movsd -0xb8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd -0xb0(%rbp), %xmm0
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x18(%rbp)
movsd %xmm0, (%rax)
movsd -0xb8(%rbp), %xmm0
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x18(%rbp)
movsd %xmm0, (%rax)
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x48d6b
addq $0x68, %rsp
popq %rbp
retq