// File: /workspace/github_cpp_makefile_star2_O3/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:
cmpq $0x4, %rcx
jl 0x2996c
movupd (%rsi), %xmm2
movupd 0x10(%rsi), %xmm3
movupd 0x20(%rsi), %xmm4
movupd 0x30(%rsi), %xmm5
movsd (%rdi), %xmm10
movsd 0x8(%rdi), %xmm1
movsd 0x10(%rdi), %xmm6
movsd 0x18(%rdi), %xmm8
unpcklpd %xmm10, %xmm10          # xmm10 = xmm10[0,0]
mulpd %xmm2, %xmm10
shufpd $0x1, %xmm2, %xmm2      # xmm2 = xmm2[1,0]
unpcklpd %xmm6, %xmm6            # xmm6 = xmm6[0,0]
mulpd %xmm3, %xmm6
shufpd $0x1, %xmm3, %xmm3      # xmm3 = xmm3[1,0]
movsd 0x20(%rdi), %xmm9
unpcklpd %xmm9, %xmm9            # xmm9 = xmm9[0,0]
mulpd %xmm4, %xmm9
shufpd $0x1, %xmm4, %xmm4      # xmm4 = xmm4[1,0]
movsd 0x30(%rdi), %xmm7
unpcklpd %xmm7, %xmm7            # xmm7 = xmm7[0,0]
mulpd %xmm5, %xmm7
shufpd $0x1, %xmm5, %xmm5      # xmm5 = xmm5[1,0]
movapd 0x1cda(%rip), %xmm11    # 0x2b480
movapd %xmm1, %xmm0
xorpd %xmm11, %xmm0
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
mulpd %xmm2, %xmm0
addpd %xmm10, %xmm0
movapd %xmm8, %xmm2
xorpd %xmm11, %xmm2
unpcklpd %xmm8, %xmm2            # xmm2 = xmm2[0],xmm8[0]
mulpd %xmm3, %xmm2
addpd %xmm6, %xmm2
movsd 0x28(%rdi), %xmm1
movapd %xmm1, %xmm3
xorpd %xmm11, %xmm3
unpcklpd %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0]
mulpd %xmm4, %xmm3
addpd %xmm9, %xmm3
movsd 0x38(%rdi), %xmm1
movapd %xmm1, %xmm4
xorpd %xmm11, %xmm4
unpcklpd %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0]
mulpd %xmm5, %xmm4
addpd %xmm7, %xmm4
cmpq $0x8, %rcx
jb 0x29941
movq %rcx, %rax
shrq $0x2, %rax
incq %rax
movapd 0x1c5b(%rip), %xmm12    # 0x2b480
movupd 0x40(%rsi), %xmm11
movupd 0x50(%rsi), %xmm7
movupd 0x60(%rsi), %xmm6
movupd 0x70(%rsi), %xmm5
movsd 0x40(%rdi), %xmm14
movsd 0x48(%rdi), %xmm15
movsd 0x50(%rdi), %xmm9
movsd 0x58(%rdi), %xmm1
movaps %xmm1, -0x18(%rsp)
movsd 0x60(%rdi), %xmm10
movsd 0x70(%rdi), %xmm8
movsd 0x68(%rdi), %xmm1
movsd 0x78(%rdi), %xmm13
movupd %xmm0, (%rdx)
movupd %xmm2, 0x10(%rdx)
movupd %xmm3, 0x20(%rdx)
movupd %xmm4, 0x30(%rdx)
movapd %xmm15, %xmm0
xorpd %xmm12, %xmm0
unpcklpd %xmm15, %xmm0           # xmm0 = xmm0[0],xmm15[0]
unpcklpd %xmm14, %xmm14          # xmm14 = xmm14[0,0]
mulpd %xmm11, %xmm14
shufpd $0x1, %xmm11, %xmm11    # xmm11 = xmm11[1,0]
mulpd %xmm11, %xmm0
addpd %xmm14, %xmm0
movapd -0x18(%rsp), %xmm3
movapd %xmm3, %xmm2
xorpd %xmm12, %xmm2
unpcklpd %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0]
unpcklpd %xmm9, %xmm9            # xmm9 = xmm9[0,0]
mulpd %xmm7, %xmm9
shufpd $0x1, %xmm7, %xmm7      # xmm7 = xmm7[1,0]
mulpd %xmm7, %xmm2
addpd %xmm9, %xmm2
movapd %xmm1, %xmm3
xorpd %xmm12, %xmm3
unpcklpd %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0]
unpcklpd %xmm10, %xmm10          # xmm10 = xmm10[0,0]
mulpd %xmm6, %xmm10
shufpd $0x1, %xmm6, %xmm6      # xmm6 = xmm6[1,0]
mulpd %xmm6, %xmm3
addpd %xmm10, %xmm3
movapd %xmm13, %xmm4
xorpd %xmm12, %xmm4
unpcklpd %xmm13, %xmm4           # xmm4 = xmm4[0],xmm13[0]
unpcklpd %xmm8, %xmm8            # xmm8 = xmm8[0,0]
mulpd %xmm5, %xmm8
shufpd $0x1, %xmm5, %xmm5      # xmm5 = xmm5[1,0]
mulpd %xmm5, %xmm4
addpd %xmm8, %xmm4
leaq 0x40(%rdi), %r8
leaq 0x40(%rsi), %r9
addq $0x40, %rdx
decq %rax
movq %r8, %rdi
movq %r9, %rsi
cmpq $0x2, %rax
ja 0x29825
jmp 0x29947
movq %rsi, %r9
movq %rdi, %r8
addq $0x40, %r8
addq $0x40, %r9
movupd %xmm0, (%rdx)
movupd %xmm2, 0x10(%rdx)
movupd %xmm3, 0x20(%rdx)
movupd %xmm4, 0x30(%rdx)
addq $0x40, %rdx
movq %r9, %rsi
movq %r8, %rdi
leaq 0x3(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
andq $-0x4, %rax
subq %rax, %rcx
testq %rcx, %rcx
jle 0x299d3
incq %rcx
xorl %eax, %eax
movapd 0x1af0(%rip), %xmm0     # 0x2b480
movsd (%rdi,%rax), %xmm1
movsd 0x8(%rdi,%rax), %xmm2
movapd %xmm2, %xmm3
xorpd %xmm0, %xmm3
movupd (%rsi,%rax), %xmm4
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm4, %xmm1
shufpd $0x1, %xmm4, %xmm4      # xmm4 = xmm4[1,0]
unpcklpd %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0]
mulpd %xmm4, %xmm3
addpd %xmm1, %xmm3
movupd %xmm3, (%rdx,%rax)
decq %rcx
addq $0x10, %rax
cmpq $0x1, %rcx
ja 0x29990
retq