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

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

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

  while (X < X_end) {
    T a = *X++ ;
    T b = *Y++ ;
    T delta = a - b ;
    acc += VL_MAX(delta, - delta) ;
  }

  return acc ;
}

// Assembly:
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rdi, 0xd8(%rsp)
movq %rsi, 0xd0(%rsp)
movq %rdx, 0xc8(%rsp)
movq 0xd0(%rsp), %rax
movq 0xd8(%rsp), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, 0xc0(%rsp)
movq 0xd0(%rsp), %rax
movq 0xd8(%rsp), %rcx
leaq -0x10(%rax,%rcx,8), %rax
movq %rax, 0xb8(%rsp)
xorps %xmm0, %xmm0
movapd %xmm0, 0xe0(%rsp)
movapd 0xe0(%rsp), %xmm0
movapd %xmm0, 0xa0(%rsp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x198(%rsp)
movsd 0x198(%rsp), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movapd %xmm0, 0x180(%rsp)
movapd 0x180(%rsp), %xmm0
movapd %xmm0, 0x90(%rsp)
movq 0xd0(%rsp), %rax
andq $0xf, %rax
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movq 0xc8(%rsp), %rcx
andq $0xf, %rcx
cmpq $0x0, %rcx
setne %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
andl %ecx, %eax
movl %eax, 0x8c(%rsp)
cmpl $0x0, 0x8c(%rsp)
je 0x3fde9
jmp 0x3fccf
movq 0xd0(%rsp), %rax
cmpq 0xb8(%rsp), %rax
jae 0x3fde4
movq 0xd0(%rsp), %rax
movapd (%rax), %xmm0
movapd %xmm0, 0x70(%rsp)
movq 0xc8(%rsp), %rax
movapd (%rax), %xmm0
movapd %xmm0, 0x60(%rsp)
movapd 0x70(%rsp), %xmm1
movapd 0x60(%rsp), %xmm0
movapd %xmm1, 0x170(%rsp)
movapd %xmm0, 0x160(%rsp)
movapd 0x170(%rsp), %xmm0
movapd 0x160(%rsp), %xmm1
subpd %xmm1, %xmm0
movapd %xmm0, 0x50(%rsp)
movapd 0xa0(%rsp), %xmm1
movapd 0x90(%rsp), %xmm2
movapd 0x50(%rsp), %xmm0
movapd %xmm2, 0x1d0(%rsp)
movapd %xmm0, 0x1c0(%rsp)
movaps 0x1d0(%rsp), %xmm0
pcmpeqd %xmm2, %xmm2
pxor %xmm2, %xmm0
movapd 0x1c0(%rsp), %xmm2
pand %xmm2, %xmm0
movapd %xmm1, 0x120(%rsp)
movapd %xmm0, 0x110(%rsp)
movapd 0x120(%rsp), %xmm0
addpd 0x110(%rsp), %xmm0
movapd %xmm0, 0xa0(%rsp)
movq 0xd0(%rsp), %rax
addq $0x10, %rax
movq %rax, 0xd0(%rsp)
movq 0xc8(%rsp), %rax
addq $0x10, %rax
movq %rax, 0xc8(%rsp)
jmp 0x3fccf
jmp 0x3ff22
jmp 0x3fdeb
movq 0xd0(%rsp), %rax
cmpq 0xb8(%rsp), %rax
jae 0x3ff20
movq 0xd0(%rsp), %rax
movq %rax, 0x138(%rsp)
movq 0x138(%rsp), %rax
movupd (%rax), %xmm0
movapd %xmm0, 0x40(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0x130(%rsp)
movq 0x130(%rsp), %rax
movupd (%rax), %xmm0
movapd %xmm0, 0x30(%rsp)
movapd 0x40(%rsp), %xmm1
movapd 0x30(%rsp), %xmm0
movapd %xmm1, 0x150(%rsp)
movapd %xmm0, 0x140(%rsp)
movapd 0x150(%rsp), %xmm0
movapd 0x140(%rsp), %xmm1
subpd %xmm1, %xmm0
movapd %xmm0, 0x20(%rsp)
movapd 0xa0(%rsp), %xmm1
movapd 0x90(%rsp), %xmm2
movapd 0x20(%rsp), %xmm0
movapd %xmm2, 0x1b0(%rsp)
movapd %xmm0, 0x1a0(%rsp)
movaps 0x1b0(%rsp), %xmm0
pcmpeqd %xmm2, %xmm2
pxor %xmm2, %xmm0
movapd 0x1a0(%rsp), %xmm2
pand %xmm2, %xmm0
movapd %xmm1, 0x100(%rsp)
movapd %xmm0, 0xf0(%rsp)
movapd 0x100(%rsp), %xmm0
addpd 0xf0(%rsp), %xmm0
movapd %xmm0, 0xa0(%rsp)
movq 0xd0(%rsp), %rax
addq $0x10, %rax
movq %rax, 0xd0(%rsp)
movq 0xc8(%rsp), %rax
addq $0x10, %rax
movq %rax, 0xc8(%rsp)
jmp 0x3fdeb
jmp 0x3ff22
movapd 0xa0(%rsp), %xmm0
callq 0x3f280
movsd %xmm0, 0xb0(%rsp)
movq 0xd0(%rsp), %rax
cmpq 0xc0(%rsp), %rax
jae 0x40017
movq 0xd0(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0xd0(%rsp)
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0xc8(%rsp)
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
subsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x3ffd9
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsp)
jmp 0x3fffb
movsd 0x8(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, (%rsp)
movsd (%rsp), %xmm0
addsd 0xb0(%rsp), %xmm0
movsd %xmm0, 0xb0(%rsp)
jmp 0x3ff39
movsd 0xb0(%rsp), %xmm0
addq $0x1e8, %rsp            # imm = 0x1E8
retq
nopl (%rax,%rax)