// File: /workspace/github_cpp_makefile_star2_O2/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:
movq %rcx, %rax
movq %rdx, %rcx
cmpq $0x4, %rax
jl 0x21b3a
movupd (%rsi), %xmm2
movupd 0x10(%rsi), %xmm3
movupd 0x20(%rsi), %xmm4
movupd 0x30(%rsi), %xmm5
movsd (%rdi), %xmm10
movsd 0x8(%rdi), %xmm0
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 0x1ae0(%rip), %xmm11    # 0x23470
movapd %xmm0, %xmm1
xorpd %xmm11, %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
mulpd %xmm2, %xmm1
addpd %xmm10, %xmm1
movapd %xmm8, %xmm2
xorpd %xmm11, %xmm2
unpcklpd %xmm8, %xmm2            # xmm2 = xmm2[0],xmm8[0]
mulpd %xmm3, %xmm2
addpd %xmm6, %xmm2
movsd 0x28(%rdi), %xmm0
movapd %xmm0, %xmm3
xorpd %xmm11, %xmm3
unpcklpd %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
mulpd %xmm4, %xmm3
addpd %xmm9, %xmm3
movsd 0x38(%rdi), %xmm0
movapd %xmm0, %xmm4
xorpd %xmm11, %xmm4
unpcklpd %xmm0, %xmm4            # xmm4 = xmm4[0],xmm0[0]
mulpd %xmm5, %xmm4
addpd %xmm7, %xmm4
movq %rax, %rdx
shrq $0x2, %rdx
addq $0x40, %rsi
addq $0x40, %rcx
addq $0x40, %rdi
movapd 0x1a62(%rip), %xmm12    # 0x23470
cmpq $0x2, %rdx
jl 0x21b26
movupd (%rsi), %xmm11
movupd 0x10(%rsi), %xmm7
movupd 0x20(%rsi), %xmm6
movupd 0x30(%rsi), %xmm5
movsd (%rdi), %xmm14
movsd 0x8(%rdi), %xmm15
movsd 0x10(%rdi), %xmm9
movsd 0x18(%rdi), %xmm0
movaps %xmm0, -0x18(%rsp)
movsd 0x20(%rdi), %xmm10
movsd 0x30(%rdi), %xmm8
movsd 0x28(%rdi), %xmm0
movsd 0x38(%rdi), %xmm13
movupd %xmm1, -0x40(%rcx)
movupd %xmm2, -0x30(%rcx)
movupd %xmm3, -0x20(%rcx)
movupd %xmm4, -0x10(%rcx)
movapd %xmm15, %xmm1
xorpd %xmm12, %xmm1
unpcklpd %xmm15, %xmm1           # xmm1 = xmm1[0],xmm15[0]
unpcklpd %xmm14, %xmm14          # xmm14 = xmm14[0,0]
mulpd %xmm11, %xmm14
shufpd $0x1, %xmm11, %xmm11    # xmm11 = xmm11[1,0]
mulpd %xmm11, %xmm1
addpd %xmm14, %xmm1
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 %xmm0, %xmm3
xorpd %xmm12, %xmm3
unpcklpd %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[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
decq %rdx
addq $0x40, %rsi
addq $0x40, %rcx
addq $0x40, %rdi
jmp 0x21a0e
movupd %xmm1, -0x40(%rcx)
movupd %xmm2, -0x30(%rcx)
movupd %xmm3, -0x20(%rcx)
movupd %xmm4, -0x10(%rcx)
movabsq $0x4, %r8
cqto
idivq %r8
xorl %eax, %eax
movapd 0x191d(%rip), %xmm0     # 0x23470
testq %rdx, %rdx
jle 0x21b97
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, (%rcx,%rax)
decq %rdx
addq $0x10, %rax
jmp 0x21b53
retq