// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/mathop_sse2.c
// Function: vl_kernel_l1_sse2_d
VL_EXPORT T
VL_XCAT(_vl_kernel_l1_sse2_, SFX)
(vl_size dimension, T const * X, T const * Y)
{
  T const * X_end = X + dimension ;
  T const * X_vec_end = X_end - VSIZE + 1 ;
  T acc ;
  VTYPE vacc = VSTZ() ;
  VTYPE vminus = VL_XCAT(_mm_set1_p, VSFX) ((T) -0.0) ;
  vl_bool dataAligned = VALIGNED(X) & VALIGNED(Y) ;

  if (dataAligned) {
    while (X < X_vec_end) {
      VTYPE a = *(VTYPE*)X ;
      VTYPE b = *(VTYPE*)Y ;
      VTYPE a_ = VANDN(vminus, a) ;
      VTYPE b_ = VANDN(vminus, b) ;
      VTYPE sum = VADD(a_,b_) ;
      VTYPE diff = VSUB(a, b) ;
      VTYPE diff_ = VANDN(vminus, diff) ;
      vacc = VADD(vacc, VSUB(sum, diff_)) ;
      X += VSIZE ;
      Y += VSIZE ;
    }
  } else {
    while (X < X_vec_end) {
      VTYPE a = VLDU(X) ;
      VTYPE b = VLDU(Y) ;
      VTYPE a_ = VANDN(vminus, a) ;
      VTYPE b_ = VANDN(vminus, b) ;
      VTYPE sum = VADD(a_,b_) ;
      VTYPE diff = VSUB(a, b) ;
      VTYPE diff_ = VANDN(vminus, diff) ;
      vacc = VADD(vacc, VSUB(sum, diff_)) ;
      X += VSIZE ;
      Y += VSIZE ;
    }
  }

  acc = VL_XCAT(_vl_vhsum_sse2_, SFX)(vacc) ;

  while (X < X_end) {
    T a = *X++ ;
    T b = *Y++ ;
    T a_ = VL_XCAT(vl_abs_, SFX) (a) ;
    T b_ = VL_XCAT(vl_abs_, SFX) (b) ;
    acc += a_ + b_ - VL_XCAT(vl_abs_, SFX) (a - b) ;
  }

  return acc / ((T)2) ;
}

// Assembly:
subq $0x378, %rsp            # imm = 0x378
movq %rdi, 0x168(%rsp)
movq %rsi, 0x160(%rsp)
movq %rdx, 0x158(%rsp)
movq 0x160(%rsp), %rax
movq 0x168(%rsp), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, 0x150(%rsp)
movq 0x150(%rsp), %rax
addq $-0x8, %rax
movq %rax, 0x148(%rsp)
xorps %xmm0, %xmm0
movapd %xmm0, 0x170(%rsp)
movapd 0x170(%rsp), %xmm0
movapd %xmm0, 0x130(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x2a8(%rsp)
movsd 0x2a8(%rsp), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movapd %xmm0, 0x290(%rsp)
movapd 0x290(%rsp), %xmm0
movapd %xmm0, 0x120(%rsp)
movq 0x160(%rsp), %rax
andq $0xf, %rax
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movq 0x158(%rsp), %rcx
andq $0xf, %rcx
cmpq $0x0, %rcx
setne %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
andl %ecx, %eax
movl %eax, 0x11c(%rsp)
cmpl $0x0, 0x11c(%rsp)
je 0x40c74
jmp 0x40a46
movq 0x160(%rsp), %rax
cmpq 0x148(%rsp), %rax
jae 0x40c6f
movq 0x160(%rsp), %rax
movapd (%rax), %xmm0
movapd %xmm0, 0x100(%rsp)
movq 0x158(%rsp), %rax
movapd (%rax), %xmm0
movapd %xmm0, 0xf0(%rsp)
movapd 0x120(%rsp), %xmm1
movapd 0x100(%rsp), %xmm0
movapd %xmm1, 0x360(%rsp)
movapd %xmm0, 0x350(%rsp)
movaps 0x360(%rsp), %xmm0
pcmpeqd %xmm1, %xmm1
movaps 0x350(%rsp), %xmm2
pandn %xmm2, %xmm0
movaps %xmm0, 0xe0(%rsp)
movapd 0x120(%rsp), %xmm2
movapd 0xf0(%rsp), %xmm0
movapd %xmm2, 0x340(%rsp)
movapd %xmm0, 0x330(%rsp)
movaps 0x340(%rsp), %xmm0
movaps 0x330(%rsp), %xmm2
pandn %xmm2, %xmm0
movaps %xmm0, 0xd0(%rsp)
movapd 0xe0(%rsp), %xmm2
movapd 0xd0(%rsp), %xmm0
movapd %xmm2, 0x1f0(%rsp)
movapd %xmm0, 0x1e0(%rsp)
movapd 0x1f0(%rsp), %xmm0
movapd 0x1e0(%rsp), %xmm2
addpd %xmm2, %xmm0
movapd %xmm0, 0xc0(%rsp)
movapd 0x100(%rsp), %xmm2
movapd 0xf0(%rsp), %xmm0
movapd %xmm2, 0x280(%rsp)
movapd %xmm0, 0x270(%rsp)
movapd 0x280(%rsp), %xmm0
movapd 0x270(%rsp), %xmm2
subpd %xmm2, %xmm0
movapd %xmm0, 0xb0(%rsp)
movapd 0x120(%rsp), %xmm2
movapd 0xb0(%rsp), %xmm0
movapd %xmm2, 0x320(%rsp)
movapd %xmm0, 0x310(%rsp)
movaps 0x320(%rsp), %xmm0
pxor %xmm1, %xmm0
movapd 0x310(%rsp), %xmm1
pand %xmm1, %xmm0
movapd %xmm0, 0xa0(%rsp)
movapd 0x130(%rsp), %xmm1
movapd 0xc0(%rsp), %xmm2
movapd 0xa0(%rsp), %xmm0
movapd %xmm2, 0x260(%rsp)
movapd %xmm0, 0x250(%rsp)
movapd 0x260(%rsp), %xmm0
subpd 0x250(%rsp), %xmm0
movapd %xmm1, 0x1d0(%rsp)
movapd %xmm0, 0x1c0(%rsp)
movapd 0x1d0(%rsp), %xmm0
addpd 0x1c0(%rsp), %xmm0
movapd %xmm0, 0x130(%rsp)
movq 0x160(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x160(%rsp)
movq 0x158(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x158(%rsp)
jmp 0x40a46
jmp 0x40ea3
jmp 0x40c76
movq 0x160(%rsp), %rax
cmpq 0x148(%rsp), %rax
jae 0x40ea1
movq 0x160(%rsp), %rax
movq %rax, 0x208(%rsp)
movq 0x208(%rsp), %rax
movupd (%rax), %xmm0
movapd %xmm0, 0x90(%rsp)
movq 0x158(%rsp), %rax
movq %rax, 0x200(%rsp)
movq 0x200(%rsp), %rax
movupd (%rax), %xmm0
movapd %xmm0, 0x80(%rsp)
movapd 0x120(%rsp), %xmm1
movapd 0x90(%rsp), %xmm0
movapd %xmm1, 0x300(%rsp)
movapd %xmm0, 0x2f0(%rsp)
movaps 0x300(%rsp), %xmm0
pcmpeqd %xmm1, %xmm1
movaps 0x2f0(%rsp), %xmm2
pandn %xmm2, %xmm0
movaps %xmm0, 0x70(%rsp)
movapd 0x120(%rsp), %xmm2
movapd 0x80(%rsp), %xmm0
movapd %xmm2, 0x2e0(%rsp)
movapd %xmm0, 0x2d0(%rsp)
movaps 0x2e0(%rsp), %xmm0
movaps 0x2d0(%rsp), %xmm2
pandn %xmm2, %xmm0
movaps %xmm0, 0x60(%rsp)
movapd 0x70(%rsp), %xmm2
movapd 0x60(%rsp), %xmm0
movapd %xmm2, 0x1b0(%rsp)
movapd %xmm0, 0x1a0(%rsp)
movapd 0x1b0(%rsp), %xmm0
movapd 0x1a0(%rsp), %xmm2
addpd %xmm2, %xmm0
movapd %xmm0, 0x50(%rsp)
movapd 0x90(%rsp), %xmm2
movapd 0x80(%rsp), %xmm0
movapd %xmm2, 0x240(%rsp)
movapd %xmm0, 0x230(%rsp)
movapd 0x240(%rsp), %xmm0
movapd 0x230(%rsp), %xmm2
subpd %xmm2, %xmm0
movapd %xmm0, 0x40(%rsp)
movapd 0x120(%rsp), %xmm2
movapd 0x40(%rsp), %xmm0
movapd %xmm2, 0x2c0(%rsp)
movapd %xmm0, 0x2b0(%rsp)
movaps 0x2c0(%rsp), %xmm0
pxor %xmm1, %xmm0
movapd 0x2b0(%rsp), %xmm1
pand %xmm1, %xmm0
movapd %xmm0, 0x30(%rsp)
movapd 0x130(%rsp), %xmm1
movapd 0x50(%rsp), %xmm2
movapd 0x30(%rsp), %xmm0
movapd %xmm2, 0x220(%rsp)
movapd %xmm0, 0x210(%rsp)
movapd 0x220(%rsp), %xmm0
subpd 0x210(%rsp), %xmm0
movapd %xmm1, 0x190(%rsp)
movapd %xmm0, 0x180(%rsp)
movapd 0x190(%rsp), %xmm0
addpd 0x180(%rsp), %xmm0
movapd %xmm0, 0x130(%rsp)
movq 0x160(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x160(%rsp)
movq 0x158(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x158(%rsp)
jmp 0x40c76
jmp 0x40ea3
movapd 0x130(%rsp), %xmm0
callq 0x3f280
movsd %xmm0, 0x140(%rsp)
movq 0x160(%rsp), %rax
cmpq 0x150(%rsp), %rax
jae 0x40f7b
movq 0x160(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x160(%rsp)
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x158(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x158(%rsp)
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x40fa0
movsd %xmm0, 0x18(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x40fa0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x28(%rsp), %xmm0
subsd 0x20(%rsp), %xmm0
callq 0x40fa0
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
subsd %xmm1, %xmm0
addsd 0x140(%rsp), %xmm0
movsd %xmm0, 0x140(%rsp)
jmp 0x40eba
movsd 0x140(%rsp), %xmm0
movsd 0x18154(%rip), %xmm1    # 0x590e0
divsd %xmm1, %xmm0
addq $0x378, %rsp            # imm = 0x378
retq
nopl (%rax,%rax)