// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/imopv.c
// Function: vl_imgradient_polar_f
VL_EXPORT void
VL_XCAT(vl_imgradient_polar_, SFX)
(T * gradientModulus, T * gradientAngle,
 vl_size gradientHorizontalStride, vl_size gradHeightStride,
 T const* image,
 vl_size imageWidth, vl_size imageHeight, vl_size imageStride)
{
  /* Shortcuts */
  vl_index const xo = 1 ;
  vl_index const yo = imageStride ;
  vl_size const w = imageWidth;
  vl_size const h = imageHeight;

  T const *src, *end;
  T *pgrad_angl, *pgrad_ampl;
  T gx, gy ;
  vl_size y;

#define SAVE_BACK                                                    \
*pgrad_ampl = vl_fast_sqrt_f (gx*gx + gy*gy) ;                       \
pgrad_ampl += gradientHorizontalStride ;                             \
*pgrad_angl = vl_mod_2pi_f   (vl_fast_atan2_f (gy, gx) + 2*VL_PI) ;  \
pgrad_angl += gradientHorizontalStride ;                             \
++src ;                                                              \

  src  = image ;
  pgrad_angl = gradientAngle ;
  pgrad_ampl = gradientModulus ;

  /* first pixel of the first row */
  gx = src[+xo] - src[0] ;
  gy = src[+yo] - src[0] ;
  SAVE_BACK ;

  /* middle pixels of the  first row */
  end = (src - 1) + w - 1 ;
  while (src < end) {
    gx = 0.5 * (src[+xo] - src[-xo]) ;
    gy =        src[+yo] - src[0] ;
    SAVE_BACK ;
  }

  /* last pixel of the first row */
  gx = src[0]   - src[-xo] ;
  gy = src[+yo] - src[0] ;
  SAVE_BACK ;

  gradientModulus += gradHeightStride;
  pgrad_ampl = gradientModulus;
  gradientAngle += gradHeightStride;
  pgrad_angl = gradientAngle;
  image += imageStride;
  src = image;

  for (y = 1 ; y < h -1 ; ++y) {

    /* first pixel of the middle rows */
    gx =        src[+xo] - src[0] ;
    gy = 0.5 * (src[+yo] - src[-yo]) ;
    SAVE_BACK ;

    /* middle pixels of the middle rows */
    end = (src - 1) + w - 1 ;
    while (src < end) {
      gx = 0.5 * (src[+xo] - src[-xo]) ;
      gy = 0.5 * (src[+yo] - src[-yo]) ;
      SAVE_BACK ;
    }

    /* last pixel of the middle row */
    gx =        src[0]   - src[-xo] ;
    gy = 0.5 * (src[+yo] - src[-yo]) ;
    SAVE_BACK ;

    gradientModulus += gradHeightStride;
    pgrad_ampl = gradientModulus;
    gradientAngle += gradHeightStride;
    pgrad_angl = gradientAngle;
    image += imageStride;
    src = image;
  }

  /* first pixel of the last row */
  gx = src[+xo] - src[0] ;
  gy = src[  0] - src[-yo] ;
  SAVE_BACK ;

  /* middle pixels of the last row */
  end = (src - 1) + w - 1 ;
  while (src < end) {
    gx = 0.5 * (src[+xo] - src[-xo]) ;
    gy =        src[0]   - src[-yo] ;
    SAVE_BACK ;
  }

  /* last pixel of the last row */
  gx = src[0]   - src[-xo] ;
  gy = src[0]   - src[-yo] ;
  SAVE_BACK ;

}

// Assembly:
subq $0x88, %rsp
movq 0x98(%rsp), %rax
movq 0x90(%rsp), %rax
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movq %r8, 0x60(%rsp)
movq %r9, 0x58(%rsp)
movq $0x1, 0x50(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x30(%rsp), %rax
subss (%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x30(%rsp), %rax
movq 0x48(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x30(%rsp), %rax
subss (%rax), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x14(%rsp), %xmm0
movss 0x14(%rsp), %xmm2
movss 0x10(%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x27a70
movq 0x18(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movss 0x10(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
callq 0x27b40
cvtss2sd %xmm0, %xmm0
movsd 0x32095(%rip), %xmm1    # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x27ae0
movq 0x20(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $-0x4, %rax
movq 0x40(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
addq $-0x4, %rax
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
jae 0x272e6
movq 0x30(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x30(%rsp), %rax
subss -0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x31e60(%rip), %xmm0    # 0x59080
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x30(%rsp), %rax
movq 0x48(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x30(%rsp), %rax
subss (%rax), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x14(%rsp), %xmm0
movss 0x14(%rsp), %xmm2
movss 0x10(%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x27a70
movq 0x18(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movss 0x10(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
callq 0x27b40
cvtss2sd %xmm0, %xmm0
movsd 0x31f86(%rip), %xmm1    # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x27ae0
movq 0x20(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x30(%rsp)
jmp 0x271f0
movq 0x30(%rsp), %rax
movss (%rax), %xmm0
movq 0x30(%rsp), %rax
subss -0x4(%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x30(%rsp), %rax
movq 0x48(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x30(%rsp), %rax
subss (%rax), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x14(%rsp), %xmm0
movss 0x14(%rsp), %xmm2
movss 0x10(%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x27a70
movq 0x18(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movss 0x10(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
callq 0x27b40
cvtss2sd %xmm0, %xmm0
movsd 0x31eb5(%rip), %xmm1    # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x27ae0
movq 0x20(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rax
shlq $0x2, %rax
addq 0x80(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x68(%rsp), %rax
shlq $0x2, %rax
addq 0x78(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x98(%rsp), %rax
shlq $0x2, %rax
addq 0x60(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x30(%rsp)
movq $0x1, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x38(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x277ab
movq 0x30(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x30(%rsp), %rax
subss (%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x30(%rsp), %rax
movq 0x48(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x30(%rsp), %rax
xorl %ecx, %ecx
subq 0x48(%rsp), %rcx
subss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x31c06(%rip), %xmm0    # 0x59080
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x14(%rsp), %xmm0
movss 0x14(%rsp), %xmm2
movss 0x10(%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x27a70
movq 0x18(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movss 0x10(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
callq 0x27b40
cvtss2sd %xmm0, %xmm0
movsd 0x31d4a(%rip), %xmm1    # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x27ae0
movq 0x20(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $-0x4, %rax
movq 0x40(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
addq $-0x4, %rax
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
jae 0x2764d
movq 0x30(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x30(%rsp), %rax
subss -0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x31b15(%rip), %xmm0    # 0x59080
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x30(%rsp), %rax
movq 0x48(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x30(%rsp), %rax
xorl %ecx, %ecx
subq 0x48(%rsp), %rcx
subss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x31adb(%rip), %xmm0    # 0x59080
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x14(%rsp), %xmm0
movss 0x14(%rsp), %xmm2
movss 0x10(%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x27a70
movq 0x18(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movss 0x10(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
callq 0x27b40
cvtss2sd %xmm0, %xmm0
movsd 0x31c1f(%rip), %xmm1    # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x27ae0
movq 0x20(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x30(%rsp)
jmp 0x2753b
movq 0x30(%rsp), %rax
movss (%rax), %xmm0
movq 0x30(%rsp), %rax
subss -0x4(%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x30(%rsp), %rax
movq 0x48(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x30(%rsp), %rax
xorl %ecx, %ecx
subq 0x48(%rsp), %rcx
subss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x319ee(%rip), %xmm0    # 0x59080
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x14(%rsp), %xmm0
movss 0x14(%rsp), %xmm2
movss 0x10(%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x27a70
movq 0x18(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movss 0x10(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
callq 0x27b40
cvtss2sd %xmm0, %xmm0
movsd 0x31b32(%rip), %xmm1    # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x27ae0
movq 0x20(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rax
shlq $0x2, %rax
addq 0x80(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x68(%rsp), %rax
shlq $0x2, %rax
addq 0x78(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x98(%rsp), %rax
shlq $0x2, %rax
addq 0x60(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x2741e
movq 0x30(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x30(%rsp), %rax
subss (%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x30(%rsp), %rax
movss (%rax), %xmm0
movq 0x30(%rsp), %rax
xorl %ecx, %ecx
subq 0x48(%rsp), %rcx
subss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x14(%rsp), %xmm0
movss 0x14(%rsp), %xmm2
movss 0x10(%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x27a70
movq 0x18(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movss 0x10(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
callq 0x27b40
cvtss2sd %xmm0, %xmm0
movsd 0x319ee(%rip), %xmm1    # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x27ae0
movq 0x20(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $-0x4, %rax
movq 0x40(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
addq $-0x4, %rax
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
jae 0x2798f
movq 0x30(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x30(%rsp), %rax
subss -0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x317b9(%rip), %xmm0    # 0x59080
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x30(%rsp), %rax
movss (%rax), %xmm0
movq 0x30(%rsp), %rax
xorl %ecx, %ecx
subq 0x48(%rsp), %rcx
subss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x14(%rsp), %xmm0
movss 0x14(%rsp), %xmm2
movss 0x10(%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x27a70
movq 0x18(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movss 0x10(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
callq 0x27b40
cvtss2sd %xmm0, %xmm0
movsd 0x318dd(%rip), %xmm1    # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x27ae0
movq 0x20(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x30(%rsp)
jmp 0x27897
movq 0x30(%rsp), %rax
movss (%rax), %xmm0
movq 0x30(%rsp), %rax
subss -0x4(%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x30(%rsp), %rax
movss (%rax), %xmm0
movq 0x30(%rsp), %rax
xorl %ecx, %ecx
subq 0x48(%rsp), %rcx
subss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x14(%rsp), %xmm0
movss 0x14(%rsp), %xmm2
movss 0x10(%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x27a70
movq 0x18(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movss 0x10(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
callq 0x27b40
cvtss2sd %xmm0, %xmm0
movsd 0x3180a(%rip), %xmm1    # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x27ae0
movq 0x20(%rsp), %rax
movss %xmm0, (%rax)
movq 0x70(%rsp), %rax
shlq $0x2, %rax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x30(%rsp)
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)