// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/sift.c
// Function: update_gradient
static void
update_gradient (VlSiftFilt *f)
{
  int       s_min = f->s_min ;
  int       s_max = f->s_max ;
  int       w     = vl_sift_get_octave_width  (f) ;
  int       h     = vl_sift_get_octave_height (f) ;
  int const xo    = 1 ;
  int const yo    = w ;
  int const so    = h * w ;
  int y, s ;

  if (f->grad_o == f->o_cur) return ;

  for (s  = s_min + 1 ;
       s <= s_max - 2 ; ++ s) {

    vl_sift_pix *src, *end, *grad, gx, gy ;

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

    src  = vl_sift_get_octave (f,s) ;
    grad = f->grad + 2 * so * (s - s_min -1) ;

    /* 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 ;

    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 ;
    }

    /* 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 ;
  }
  f->grad_o = f->o_cur ;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rax
movl 0x34(%rax), %eax
movl %eax, 0x4c(%rsp)
movq 0x50(%rsp), %rax
movl 0x38(%rax), %eax
movl %eax, 0x48(%rsp)
movq 0x50(%rsp), %rdi
callq 0x4d2e0
movl %eax, 0x44(%rsp)
movq 0x50(%rsp), %rdi
callq 0x4d2f0
movl %eax, 0x40(%rsp)
movl $0x1, 0x3c(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x38(%rsp)
movl 0x40(%rsp), %eax
imull 0x44(%rsp), %eax
movl %eax, 0x34(%rsp)
movq 0x50(%rsp), %rax
movl 0xb8(%rax), %eax
movq 0x50(%rsp), %rcx
cmpl 0x3c(%rcx), %eax
jne 0x4fee4
jmp 0x5077e
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movl 0x48(%rsp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jg 0x5076b
movq 0x50(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x4c860
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rax
movq 0xb0(%rax), %rax
movl 0x34(%rsp), %ecx
shll %ecx
movl 0x2c(%rsp), %edx
subl 0x4c(%rsp), %edx
subl $0x1, %edx
imull %edx, %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x20(%rsp), %rax
subss (%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x20(%rsp), %rax
movslq 0x38(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x20(%rsp), %rax
subss (%rax), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xc(%rsp), %xmm0
movss 0xc(%rsp), %xmm2
movss 0x8(%rsp), %xmm1
mulss 0x8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x522c0
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
callq 0x52330
cvtss2sd %xmm0, %xmm0
movsd 0x925e(%rip), %xmm1     # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x51390
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movq 0x20(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $-0x4, %rax
movslq 0x44(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
addq $-0x4, %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x50108
movq 0x20(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x20(%rsp), %rax
subss -0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x9030(%rip), %xmm0     # 0x59080
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x20(%rsp), %rax
movslq 0x38(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x20(%rsp), %rax
subss (%rax), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xc(%rsp), %xmm0
movss 0xc(%rsp), %xmm2
movss 0x8(%rsp), %xmm1
mulss 0x8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x522c0
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
callq 0x52330
cvtss2sd %xmm0, %xmm0
movsd 0x915d(%rip), %xmm1     # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x51390
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movq 0x20(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x20(%rsp)
jmp 0x50020
movq 0x20(%rsp), %rax
movss (%rax), %xmm0
movq 0x20(%rsp), %rax
subss -0x4(%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x20(%rsp), %rax
movslq 0x38(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x20(%rsp), %rax
subss (%rax), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xc(%rsp), %xmm0
movss 0xc(%rsp), %xmm2
movss 0x8(%rsp), %xmm1
mulss 0x8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x522c0
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
callq 0x52330
cvtss2sd %xmm0, %xmm0
movsd 0x909a(%rip), %xmm1     # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x51390
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movq 0x20(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x20(%rsp)
movl $0x1, 0x30(%rsp)
movl 0x30(%rsp), %eax
movl 0x40(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x504cd
movq 0x20(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x20(%rsp), %rax
subss (%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x20(%rsp), %rax
movslq 0x38(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x20(%rsp), %rax
xorl %ecx, %ecx
subl 0x38(%rsp), %ecx
movslq %ecx, %rcx
subss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x8e58(%rip), %xmm0     # 0x59080
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xc(%rsp), %xmm0
movss 0xc(%rsp), %xmm2
movss 0x8(%rsp), %xmm1
mulss 0x8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x522c0
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
callq 0x52330
cvtss2sd %xmm0, %xmm0
movsd 0x8fa3(%rip), %xmm1     # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x51390
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movq 0x20(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $-0x4, %rax
movslq 0x44(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
addq $-0x4, %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x503e1
movq 0x20(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x20(%rsp), %rax
subss -0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x8d75(%rip), %xmm0     # 0x59080
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x20(%rsp), %rax
movslq 0x38(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x20(%rsp), %rax
xorl %ecx, %ecx
subl 0x38(%rsp), %ecx
movslq %ecx, %rcx
subss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x8d39(%rip), %xmm0     # 0x59080
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xc(%rsp), %xmm0
movss 0xc(%rsp), %xmm2
movss 0x8(%rsp), %xmm1
mulss 0x8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x522c0
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
callq 0x52330
cvtss2sd %xmm0, %xmm0
movsd 0x8e84(%rip), %xmm1     # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x51390
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movq 0x20(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x20(%rsp)
jmp 0x502db
movq 0x20(%rsp), %rax
movss (%rax), %xmm0
movq 0x20(%rsp), %rax
subss -0x4(%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x20(%rsp), %rax
movslq 0x38(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x20(%rsp), %rax
xorl %ecx, %ecx
subl 0x38(%rsp), %ecx
movslq %ecx, %rcx
subss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x8c58(%rip), %xmm0     # 0x59080
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xc(%rsp), %xmm0
movss 0xc(%rsp), %xmm2
movss 0x8(%rsp), %xmm1
mulss 0x8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x522c0
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
callq 0x52330
cvtss2sd %xmm0, %xmm0
movsd 0x8da3(%rip), %xmm1     # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x51390
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movq 0x20(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x20(%rsp)
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x501ce
movq 0x20(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x20(%rsp), %rax
subss (%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x20(%rsp), %rax
movss (%rax), %xmm0
movq 0x20(%rsp), %rax
xorl %ecx, %ecx
subl 0x38(%rsp), %ecx
movslq %ecx, %rcx
subss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xc(%rsp), %xmm0
movss 0xc(%rsp), %xmm2
movss 0x8(%rsp), %xmm1
mulss 0x8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x522c0
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
callq 0x52330
cvtss2sd %xmm0, %xmm0
movsd 0x8cd1(%rip), %xmm1     # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x51390
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movq 0x20(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $-0x4, %rax
movslq 0x44(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
addq $-0x4, %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x50699
movq 0x20(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x20(%rsp), %rax
subss -0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x8aa3(%rip), %xmm0     # 0x59080
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x20(%rsp), %rax
movss (%rax), %xmm0
movq 0x20(%rsp), %rax
xorl %ecx, %ecx
subl 0x38(%rsp), %ecx
movslq %ecx, %rcx
subss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xc(%rsp), %xmm0
movss 0xc(%rsp), %xmm2
movss 0x8(%rsp), %xmm1
mulss 0x8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x522c0
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
callq 0x52330
cvtss2sd %xmm0, %xmm0
movsd 0x8bcc(%rip), %xmm1     # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x51390
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movq 0x20(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x20(%rsp)
jmp 0x505ad
movq 0x20(%rsp), %rax
movss (%rax), %xmm0
movq 0x20(%rsp), %rax
subss -0x4(%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x20(%rsp), %rax
movss (%rax), %xmm0
movq 0x20(%rsp), %rax
xorl %ecx, %ecx
subl 0x38(%rsp), %ecx
movslq %ecx, %rcx
subss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xc(%rsp), %xmm0
movss 0xc(%rsp), %xmm2
movss 0x8(%rsp), %xmm1
mulss 0x8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x522c0
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
callq 0x52330
cvtss2sd %xmm0, %xmm0
movsd 0x8b05(%rip), %xmm1     # 0x59230
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x51390
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movss %xmm0, (%rax)
movq 0x20(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x20(%rsp)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x4feef
movq 0x50(%rsp), %rax
movl 0x3c(%rax), %ecx
movq 0x50(%rsp), %rax
movl %ecx, 0xb8(%rax)
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)