// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/covdet.c
// Function: vl_covdet_extract_patch_helper
vl_bool
vl_covdet_extract_patch_helper (VlCovDet * self,
                                double * sigma1,
                                double * sigma2,
                                float * patch,
                                vl_size resolution,
                                double extent,
                                double sigma,
                                double A_ [4],
                                double T_ [2],
                                double d1, double d2)
{
  vl_index o, s ;
  double factor ;
  double sigma_ ;
  float const * level ;
  vl_size width, height ;
  double step ;

  double A [4] = {A_[0], A_[1], A_[2], A_[3]} ;
  double T [2] = {T_[0], T_[1]} ;

  VlScaleSpaceGeometry geom = vl_scalespace_get_geometry(self->gss) ;
  VlScaleSpaceOctaveGeometry oct ;

  /* Starting from a pre-smoothed image at scale sigma_
     because of the mapping A the resulting smoothing in
     the warped patch is S, where

        sigma_^2 I = A S A',

        S = sigma_^2 inv(A) inv(A)' = sigma_^2 V D^-2 V',

        A = U D V'.

     Thus we rotate A by V to obtain an axis-aligned smoothing:

        A = U*D,

        S = sigma_^2 D^-2.

     Then we search the scale-space for the best sigma_ such
     that the target smoothing is approximated from below:

        max sigma_(o,s) :    simga_(o,s) factor <= sigma,
        factor = max{abs(D11), abs(D22)}.
   */


  /*
   Determine the best level (o,s) such that sigma_(o,s) factor <= sigma.
   This can be obtained by scanning octaves from smallest to largest
   and stopping when no level in the octave satisfies the relation.

   Given the range of octave availables, do the best you can.
   */

  factor = 1.0 / VL_MIN(d1, d2) ;

  for (o = geom.firstOctave + 1 ; o <= geom.lastOctave ; ++o) {
    s = vl_floor_d(vl_log2_d(sigma / (factor * geom.baseScale)) - o) ;
    s = VL_MAX(s, geom.octaveFirstSubdivision) ;
    s = VL_MIN(s, geom.octaveLastSubdivision) ;
    sigma_ = geom.baseScale * pow(2.0, o + (double)s / geom.octaveResolution) ;
    /*VL_PRINTF(".. %d D=%g %g; sigma_=%g factor*sigma_=%g\n", o, d1, d2, sigma_, factor* sigma_) ;*/
    if (factor * sigma_ > sigma) {
      o -- ;
      break ;
    }
  }
  o = VL_MIN(o, geom.lastOctave) ;
  s = vl_floor_d(vl_log2_d(sigma / (factor * geom.baseScale)) - o) ;
  s = VL_MAX(s, geom.octaveFirstSubdivision) ;
  s = VL_MIN(s, geom.octaveLastSubdivision) ;
  sigma_ = geom.baseScale * pow(2.0, o + (double)s / geom.octaveResolution) ;
  if (sigma1) *sigma1 = sigma_ / d1 ;
  if (sigma2) *sigma2 = sigma_ / d2 ;

  /*VL_PRINTF("%d %d %g %g %g %g\n", o, s, factor, sigma_, factor * sigma_, sigma) ;*/

  /*
   Now the scale space level to be used for this warping has been
   determined.

   If the patch is partially or completely out of the image boundary,
   create a padded copy of the required region first.
   */

  level = vl_scalespace_get_level(self->gss, o, s) ;
  oct = vl_scalespace_get_octave_geometry(self->gss, o) ;
  width = oct.width ;
  height = oct.height ;
  step = oct.step ;

  A[0] /= step ;
  A[1] /= step ;
  A[2] /= step ;
  A[3] /= step ;
  T[0] /= step ;
  T[1] /= step ;

  {
    /*
     Warp the patch domain [x0hat,y0hat,x1hat,y1hat] to the image domain/
     Obtain a box [x0,y0,x1,y1] enclosing that wrapped box, and then
     an integer vertexes version [x0i, y0i, x1i, y1i], making room
     for one pixel at the boundary to simplify bilinear interpolation
     later on.
     */
    vl_index x0i, y0i, x1i, y1i ;
    double x0 = +VL_INFINITY_D ;
    double x1 = -VL_INFINITY_D ;
    double y0 = +VL_INFINITY_D ;
    double y1 = -VL_INFINITY_D ;
    double boxx [4] = {extent, extent, -extent, -extent} ;
    double boxy [4] = {-extent, extent, extent, -extent} ;
    int i ;
    for (i = 0 ; i < 4 ; ++i) {
      double x = A[0] * boxx[i] + A[2] * boxy[i] + T[0] ;
      double y = A[1] * boxx[i] + A[3] * boxy[i] + T[1] ;
      x0 = VL_MIN(x0, x) ;
      x1 = VL_MAX(x1, x) ;
      y0 = VL_MIN(y0, y) ;
      y1 = VL_MAX(y1, y) ;
    }

    /* Leave one pixel border for bilinear interpolation. */
    x0i = floor(x0) - 1 ;
    y0i = floor(y0) - 1 ;
    x1i = ceil(x1) + 1 ;
    y1i = ceil(y1) + 1 ;

    /*
     If the box [x0i,y0i,x1i,y1i] is not fully contained in the
     image domain, then create a copy of this region by padding
     the image. The image is extended by continuity.
     */

    if (x0i < 0 || x1i > (signed)width-1 ||
        y0i < 0 || y1i > (signed)height-1) {
      vl_index xi, yi ;

      /* compute the amount of l,r,t,b padding needed to complete the patch */
      vl_index padx0 = VL_MAX(0, - x0i) ;
      vl_index pady0 = VL_MAX(0, - y0i) ;
      vl_index padx1 = VL_MAX(0, x1i - ((signed)width - 1)) ;
      vl_index pady1 = VL_MAX(0, y1i - ((signed)height - 1)) ;

      /* make enough room for the patch */
      vl_index patchWidth = x1i - x0i + 1 ;
      vl_index patchHeight = y1i - y0i + 1 ;
      vl_size patchBufferSize = patchWidth * patchHeight * sizeof(float) ;
      if (patchBufferSize > self->patchBufferSize) {
        int err = _vl_resize_buffer((void**)&self->patch, &self->patchBufferSize, patchBufferSize) ;
        if (err) return vl_set_last_error(VL_ERR_ALLOC, NULL) ;
      }

      if (pady0 < patchHeight - pady1) {
        /* start by filling the central horizontal band */
        for (yi = y0i + pady0 ; yi < y0i + patchHeight - pady1 ; ++ yi) {
          float *dst = self->patch + (yi - y0i) * patchWidth ;
          float const *src = level + yi * width + VL_MIN(VL_MAX(0, x0i),(signed)width-1) ;
          for (xi = x0i ; xi < x0i + padx0 ; ++xi) *dst++ = *src ;
          for ( ; xi < x0i + patchWidth - padx1 - 2 ; ++xi) *dst++ = *src++ ;
          for ( ; xi < x0i + patchWidth ; ++xi) *dst++ = *src ;
        }
        /* now extend the central band up and down */
        for (yi = 0 ; yi < pady0 ; ++yi) {
          memcpy(self->patch + yi * patchWidth,
                 self->patch + pady0 * patchWidth,
                 patchWidth * sizeof(float)) ;
        }
        for (yi = patchHeight - pady1 ; yi < patchHeight ; ++yi) {
          memcpy(self->patch + yi * patchWidth,
                 self->patch + (patchHeight - pady1 - 1) * patchWidth,
                 patchWidth * sizeof(float)) ;
        }
      } else {
        /* should be handled better! */
        memset(self->patch, 0, self->patchBufferSize) ;
      }
#if 0
      {
        char name [200] ;
        snprintf(name, 200, "/tmp/%20.0f-ext.pgm", 1e10*vl_get_cpu_time()) ;
        vl_pgm_write_f(name, patch, patchWidth, patchWidth) ;
      }
#endif

      level = self->patch ;
      width = patchWidth ;
      height = patchHeight ;
      T[0] -= x0i ;
      T[1] -= y0i ;
    }
  }

  /*
   Resample by using bilinear interpolation.
   */
  {
    float * pt = patch ;
    double yhat = -extent ;
    vl_index xxi ;
    vl_index yyi ;
    double stephat = extent / resolution ;

    for (yyi = 0 ; yyi < 2 * (signed)resolution + 1 ; ++yyi) {
      double xhat = -extent ;
      double rx = A[2] * yhat + T[0] ;
      double ry = A[3] * yhat + T[1] ;
      for (xxi = 0 ; xxi < 2 * (signed)resolution + 1 ; ++xxi) {
        double x = A[0] * xhat + rx ;
        double y = A[1] * xhat + ry ;
        vl_index xi = vl_floor_d(x) ;
        vl_index yi = vl_floor_d(y) ;
        double i00 = level[yi * width + xi] ;
        double i10 = level[yi * width + xi + 1] ;
        double i01 = level[(yi + 1) * width + xi] ;
        double i11 = level[(yi + 1) * width + xi + 1] ;
        double wx = x - xi ;
        double wy = y - yi ;

        assert(xi >= 0 && xi <= (signed)width - 1) ;
        assert(yi >= 0 && yi <= (signed)height - 1) ;

        *pt++ =
        (1.0 - wy) * ((1.0 - wx) * i00 + wx * i10) +
        wy * ((1.0 - wx) * i01 + wx * i11) ;

        xhat += stephat ;
      }
      yhat += stephat ;
    }
  }
#if 0
    {
      char name [200] ;
      snprintf(name, 200, "/tmp/%20.0f.pgm", 1e10*vl_get_cpu_time()) ;
      vl_pgm_write_f(name, patch, 2*resolution+1, 2*resolution+1) ;
    }
#endif
  return VL_ERR_OK ;
}

// Assembly:
subq $0x378, %rsp            # imm = 0x378
movq 0x380(%rsp), %rax
movq %rdi, 0x368(%rsp)
movq %rsi, 0x360(%rsp)
movq %rdx, 0x358(%rsp)
movq %rcx, 0x350(%rsp)
movq %r8, 0x348(%rsp)
movsd %xmm0, 0x340(%rsp)
movsd %xmm1, 0x338(%rsp)
movq %r9, 0x330(%rsp)
movsd %xmm2, 0x328(%rsp)
movsd %xmm3, 0x320(%rsp)
movq 0x330(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x2c0(%rsp)
movq 0x330(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x2c8(%rsp)
movq 0x330(%rsp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x2d0(%rsp)
movq 0x330(%rsp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x2d8(%rsp)
movq 0x380(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x2b0(%rsp)
movq 0x380(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x2b8(%rsp)
movq 0x368(%rsp), %rax
movq (%rax), %rsi
leaq 0x268(%rsp), %rdi
callq 0x9a40
movsd 0x328(%rsp), %xmm1
movsd 0x320(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xfef9
movsd 0x328(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
jmp 0xff0b
movsd 0x320(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movsd 0xa0(%rsp), %xmm1
movsd 0x491bc(%rip), %xmm0    # 0x590d8
divsd %xmm1, %xmm0
movsd %xmm0, 0x308(%rsp)
movq 0x278(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x318(%rsp)
movq 0x318(%rsp), %rax
cmpq 0x280(%rsp), %rax
jg 0x100e7
movsd 0x338(%rsp), %xmm0
movsd 0x308(%rsp), %xmm1
mulsd 0x2a0(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0xdfe0
cvtsi2sdq 0x318(%rsp), %xmm1
subsd %xmm1, %xmm0
callq 0xdf80
movq %rax, 0x310(%rsp)
movq 0x310(%rsp), %rax
cmpq 0x290(%rsp), %rax
jle 0xffb6
movq 0x310(%rsp), %rax
movq %rax, 0x98(%rsp)
jmp 0xffc6
movq 0x290(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x310(%rsp)
movq 0x310(%rsp), %rax
cmpq 0x298(%rsp), %rax
jge 0xfffa
movq 0x310(%rsp), %rax
movq %rax, 0x90(%rsp)
jmp 0x1000a
movq 0x298(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x310(%rsp)
movsd 0x2a0(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
cvtsi2sdq 0x318(%rsp), %xmm1
cvtsi2sdq 0x310(%rsp), %xmm0
movaps 0x49119(%rip), %xmm3    # 0x59160
movq 0x288(%rsp), %xmm2
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movapd 0x49114(%rip), %xmm3    # 0x59170
subpd %xmm3, %xmm2
movaps %xmm2, %xmm3
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm3, %xmm2
divsd %xmm2, %xmm0
addsd %xmm0, %xmm1
movsd 0x49065(%rip), %xmm0    # 0x590e0
callq 0x92b0
movaps %xmm0, %xmm1
movsd 0x88(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x300(%rsp)
movsd 0x308(%rsp), %xmm0
mulsd 0x300(%rsp), %xmm0
ucomisd 0x338(%rsp), %xmm0
jbe 0x100cc
movq 0x318(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x318(%rsp)
jmp 0x100e7
jmp 0x100ce
movq 0x318(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x318(%rsp)
jmp 0xff3d
movq 0x318(%rsp), %rax
cmpq 0x280(%rsp), %rax
jge 0x1010b
movq 0x318(%rsp), %rax
movq %rax, 0x80(%rsp)
jmp 0x1011b
movq 0x280(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x318(%rsp)
movsd 0x338(%rsp), %xmm0
movsd 0x308(%rsp), %xmm1
mulsd 0x2a0(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0xdfe0
cvtsi2sdq 0x318(%rsp), %xmm1
subsd %xmm1, %xmm0
callq 0xdf80
movq %rax, 0x310(%rsp)
movq 0x310(%rsp), %rax
cmpq 0x290(%rsp), %rax
jle 0x1018b
movq 0x310(%rsp), %rax
movq %rax, 0x78(%rsp)
jmp 0x10198
movq 0x290(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x310(%rsp)
movq 0x310(%rsp), %rax
cmpq 0x298(%rsp), %rax
jge 0x101c6
movq 0x310(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x101d3
movq 0x298(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x310(%rsp)
movsd 0x2a0(%rsp), %xmm0
movsd %xmm0, 0x68(%rsp)
cvtsi2sdq 0x318(%rsp), %xmm1
cvtsi2sdq 0x310(%rsp), %xmm0
movaps 0x48f56(%rip), %xmm3    # 0x59160
movq 0x288(%rsp), %xmm2
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movapd 0x48f51(%rip), %xmm3    # 0x59170
subpd %xmm3, %xmm2
movaps %xmm2, %xmm3
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm3, %xmm2
divsd %xmm2, %xmm0
addsd %xmm0, %xmm1
movsd 0x48ea2(%rip), %xmm0    # 0x590e0
callq 0x92b0
movaps %xmm0, %xmm1
movsd 0x68(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x300(%rsp)
cmpq $0x0, 0x360(%rsp)
je 0x10282
movsd 0x300(%rsp), %xmm0
divsd 0x328(%rsp), %xmm0
movq 0x360(%rsp), %rax
movsd %xmm0, (%rax)
cmpq $0x0, 0x358(%rsp)
je 0x102ab
movsd 0x300(%rsp), %xmm0
divsd 0x320(%rsp), %xmm0
movq 0x358(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x368(%rsp), %rax
movq (%rax), %rdi
movq 0x318(%rsp), %rsi
movq 0x310(%rsp), %rdx
callq 0x9040
movq %rax, 0x2f8(%rsp)
movq 0x368(%rsp), %rax
movq (%rax), %rsi
movq 0x318(%rsp), %rdx
leaq 0x238(%rsp), %rdi
callq 0x96c0
movq 0x238(%rsp), %rax
movq %rax, 0x250(%rsp)
movq 0x240(%rsp), %rax
movq %rax, 0x258(%rsp)
movq 0x248(%rsp), %rax
movq %rax, 0x260(%rsp)
movq 0x250(%rsp), %rax
movq %rax, 0x2f0(%rsp)
movq 0x258(%rsp), %rax
movq %rax, 0x2e8(%rsp)
movsd 0x260(%rsp), %xmm0
movsd %xmm0, 0x2e0(%rsp)
movsd 0x2e0(%rsp), %xmm1
movsd 0x2c0(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x2c0(%rsp)
movsd 0x2e0(%rsp), %xmm1
movsd 0x2c8(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x2c8(%rsp)
movsd 0x2e0(%rsp), %xmm1
movsd 0x2d0(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x2d0(%rsp)
movsd 0x2e0(%rsp), %xmm1
movsd 0x2d8(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x2d8(%rsp)
movsd 0x2e0(%rsp), %xmm1
movsd 0x2b0(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x2b0(%rsp)
movsd 0x2e0(%rsp), %xmm1
movsd 0x2b8(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x2b8(%rsp)
movsd 0x48d89(%rip), %xmm0    # 0x591a0
movsd %xmm0, 0x210(%rsp)
movsd 0x48d78(%rip), %xmm0    # 0x591a0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x208(%rsp)
movsd 0x48d50(%rip), %xmm0    # 0x591a0
movsd %xmm0, 0x200(%rsp)
movsd 0x48d3f(%rip), %xmm0    # 0x591a0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x1f8(%rsp)
movsd 0x340(%rsp), %xmm0
movsd %xmm0, 0x1d0(%rsp)
movsd 0x340(%rsp), %xmm0
movsd %xmm0, 0x1d8(%rsp)
movsd 0x340(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x1e0(%rsp)
movsd 0x340(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x1e8(%rsp)
movsd 0x340(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x1b0(%rsp)
movsd 0x340(%rsp), %xmm0
movsd %xmm0, 0x1b8(%rsp)
movsd 0x340(%rsp), %xmm0
movsd %xmm0, 0x1c0(%rsp)
movsd 0x340(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x1c8(%rsp)
movl $0x0, 0x1ac(%rsp)
cmpl $0x4, 0x1ac(%rsp)
jge 0x1074c
movsd 0x2c0(%rsp), %xmm0
movslq 0x1ac(%rsp), %rax
movsd 0x1d0(%rsp,%rax,8), %xmm2
movsd 0x2d0(%rsp), %xmm1
movslq 0x1ac(%rsp), %rax
mulsd 0x1b0(%rsp,%rax,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd 0x2b0(%rsp), %xmm0
movsd %xmm0, 0x1a0(%rsp)
movsd 0x2c8(%rsp), %xmm0
movslq 0x1ac(%rsp), %rax
movsd 0x1d0(%rsp,%rax,8), %xmm2
movsd 0x2d8(%rsp), %xmm1
movslq 0x1ac(%rsp), %rax
mulsd 0x1b0(%rsp,%rax,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd 0x2b8(%rsp), %xmm0
movsd %xmm0, 0x198(%rsp)
movsd 0x210(%rsp), %xmm1
movsd 0x1a0(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1064b
movsd 0x210(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
jmp 0x1065a
movsd 0x1a0(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x210(%rsp)
movsd 0x208(%rsp), %xmm0
ucomisd 0x1a0(%rsp), %xmm0
jbe 0x1068e
movsd 0x208(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
jmp 0x1069d
movsd 0x1a0(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x208(%rsp)
movsd 0x200(%rsp), %xmm1
movsd 0x198(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x106d5
movsd 0x200(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
jmp 0x106e4
movsd 0x198(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x200(%rsp)
movsd 0x1f8(%rsp), %xmm0
ucomisd 0x198(%rsp), %xmm0
jbe 0x10718
movsd 0x1f8(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
jmp 0x10727
movsd 0x198(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x1f8(%rsp)
movl 0x1ac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1ac(%rsp)
jmp 0x10578
movsd 0x210(%rsp), %xmm0
callq 0x9a00
movsd 0x48976(%rip), %xmm1    # 0x590d8
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, 0x230(%rsp)
movsd 0x200(%rsp), %xmm0
callq 0x9a00
movsd 0x4894f(%rip), %xmm1    # 0x590d8
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, 0x228(%rsp)
movsd 0x208(%rsp), %xmm0
callq 0x9b70
movsd 0x48928(%rip), %xmm1    # 0x590d8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, 0x220(%rsp)
movsd 0x1f8(%rsp), %xmm0
callq 0x9b70
movsd 0x48901(%rip), %xmm1    # 0x590d8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, 0x218(%rsp)
cmpq $0x0, 0x230(%rsp)
jl 0x10838
movq 0x220(%rsp), %rax
movq 0x2f0(%rsp), %rcx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jg 0x10838
cmpq $0x0, 0x228(%rsp)
jl 0x10838
movq 0x218(%rsp), %rax
movq 0x2e8(%rsp), %rcx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jle 0x10e80
xorl %eax, %eax
movl %eax, %ecx
subq 0x230(%rsp), %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jle 0x10854
xorl %eax, %eax
movq %rax, 0x40(%rsp)
jmp 0x10863
xorl %eax, %eax
subq 0x230(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x180(%rsp)
xorl %eax, %eax
movl %eax, %ecx
subq 0x228(%rsp), %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jle 0x1088c
xorl %eax, %eax
movq %rax, 0x38(%rsp)
jmp 0x1089b
xorl %eax, %eax
subq 0x228(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x178(%rsp)
movq 0x220(%rsp), %rcx
movq 0x2f0(%rsp), %rax
subl $0x1, %eax
cltq
subq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jle 0x108d0
xorl %eax, %eax
movq %rax, 0x30(%rsp)
jmp 0x108ee
movq 0x220(%rsp), %rax
movq 0x2f0(%rsp), %rcx
subl $0x1, %ecx
movslq %ecx, %rcx
subq %rcx, %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x170(%rsp)
movq 0x218(%rsp), %rcx
movq 0x2e8(%rsp), %rax
subl $0x1, %eax
cltq
subq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jle 0x10923
xorl %eax, %eax
movq %rax, 0x28(%rsp)
jmp 0x10941
movq 0x218(%rsp), %rax
movq 0x2e8(%rsp), %rcx
subl $0x1, %ecx
movslq %ecx, %rcx
subq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x168(%rsp)
movq 0x220(%rsp), %rax
subq 0x230(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x160(%rsp)
movq 0x218(%rsp), %rax
subq 0x228(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x158(%rsp)
movq 0x160(%rsp), %rax
imulq 0x158(%rsp), %rax
shlq $0x2, %rax
movq %rax, 0x150(%rsp)
movq 0x150(%rsp), %rax
movq 0x368(%rsp), %rcx
cmpq 0x70(%rcx), %rax
jbe 0x10a0d
movq 0x368(%rsp), %rdi
addq $0x68, %rdi
movq 0x368(%rsp), %rsi
addq $0x70, %rsi
movq 0x150(%rsp), %rdx
callq 0xbc10
movl %eax, 0x14c(%rsp)
cmpl $0x0, 0x14c(%rsp)
je 0x10a0b
movl $0x2, %edi
xorl %eax, %eax
movl %eax, %esi
movb $0x0, %al
callq 0x9160
movl %eax, 0x374(%rsp)
jmp 0x11283
jmp 0x10a0d
movq 0x178(%rsp), %rax
movq 0x158(%rsp), %rcx
subq 0x168(%rsp), %rcx
cmpq %rcx, %rax
jge 0x10ded
movq 0x228(%rsp), %rax
addq 0x178(%rsp), %rax
movq %rax, 0x188(%rsp)
movq 0x188(%rsp), %rax
movq 0x228(%rsp), %rcx
addq 0x158(%rsp), %rcx
subq 0x168(%rsp), %rcx
cmpq %rcx, %rax
jge 0x10cb3
movq 0x368(%rsp), %rax
movq 0x68(%rax), %rax
movq 0x188(%rsp), %rcx
subq 0x228(%rsp), %rcx
imulq 0x160(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x140(%rsp)
movq 0x2f8(%rsp), %rax
movq 0x188(%rsp), %rcx
imulq 0x2f0(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
xorl %eax, %eax
cmpq 0x230(%rsp), %rax
jle 0x10add
xorl %eax, %eax
movq %rax, 0x18(%rsp)
jmp 0x10aea
movq 0x230(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x2f0(%rsp), %rcx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x10b30
xorl %eax, %eax
cmpq 0x230(%rsp), %rax
jle 0x10b17
xorl %eax, %eax
movq %rax, 0x10(%rsp)
jmp 0x10b24
movq 0x230(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x10b42
movq 0x2f0(%rsp), %rax
subl $0x1, %eax
cltq
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq 0x8(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x138(%rsp)
movq 0x230(%rsp), %rax
movq %rax, 0x190(%rsp)
movq 0x190(%rsp), %rax
movq 0x230(%rsp), %rcx
addq 0x180(%rsp), %rcx
cmpq %rcx, %rax
jge 0x10bc5
movq 0x138(%rsp), %rax
movss (%rax), %xmm0
movq 0x140(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x140(%rsp)
movss %xmm0, (%rax)
movq 0x190(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x190(%rsp)
jmp 0x10b6b
jmp 0x10bc7
movq 0x190(%rsp), %rax
movq 0x230(%rsp), %rcx
addq 0x160(%rsp), %rcx
subq 0x170(%rsp), %rcx
subq $0x2, %rcx
cmpq %rcx, %rax
jge 0x10c3c
movq 0x138(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x138(%rsp)
movss (%rax), %xmm0
movq 0x140(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x140(%rsp)
movss %xmm0, (%rax)
movq 0x190(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x190(%rsp)
jmp 0x10bc7
jmp 0x10c3e
movq 0x190(%rsp), %rax
movq 0x230(%rsp), %rcx
addq 0x160(%rsp), %rcx
cmpq %rcx, %rax
jge 0x10c98
movq 0x138(%rsp), %rax
movss (%rax), %xmm0
movq 0x140(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x140(%rsp)
movss %xmm0, (%rax)
movq 0x190(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x190(%rsp)
jmp 0x10c3e
jmp 0x10c9a
movq 0x188(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x188(%rsp)
jmp 0x10a46
movq $0x0, 0x188(%rsp)
movq 0x188(%rsp), %rax
cmpq 0x178(%rsp), %rax
jge 0x10d43
movq 0x368(%rsp), %rax
movq 0x68(%rax), %rdi
movq 0x188(%rsp), %rax
imulq 0x160(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq 0x368(%rsp), %rax
movq 0x68(%rax), %rsi
movq 0x178(%rsp), %rax
imulq 0x160(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
movq 0x160(%rsp), %rdx
shlq $0x2, %rdx
callq 0x9640
movq 0x188(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x188(%rsp)
jmp 0x10cbf
movq 0x158(%rsp), %rax
subq 0x168(%rsp), %rax
movq %rax, 0x188(%rsp)
movq 0x188(%rsp), %rax
cmpq 0x158(%rsp), %rax
jge 0x10deb
movq 0x368(%rsp), %rax
movq 0x68(%rax), %rdi
movq 0x188(%rsp), %rax
imulq 0x160(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq 0x368(%rsp), %rax
movq 0x68(%rax), %rsi
movq 0x158(%rsp), %rax
subq 0x168(%rsp), %rax
subq $0x1, %rax
imulq 0x160(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
movq 0x160(%rsp), %rdx
shlq $0x2, %rdx
callq 0x9640
movq 0x188(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x188(%rsp)
jmp 0x10d5b
jmp 0x10e0c
movq 0x368(%rsp), %rax
movq 0x68(%rax), %rdi
movq 0x368(%rsp), %rax
movq 0x70(%rax), %rdx
xorl %esi, %esi
callq 0x9480
movq 0x368(%rsp), %rax
movq 0x68(%rax), %rax
movq %rax, 0x2f8(%rsp)
movq 0x160(%rsp), %rax
movq %rax, 0x2f0(%rsp)
movq 0x158(%rsp), %rax
movq %rax, 0x2e8(%rsp)
cvtsi2sdq 0x230(%rsp), %xmm1
movsd 0x2b0(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x2b0(%rsp)
cvtsi2sdq 0x228(%rsp), %xmm1
movsd 0x2b8(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x2b8(%rsp)
movq 0x350(%rsp), %rax
movq %rax, 0x130(%rsp)
movaps 0x482e9(%rip), %xmm1    # 0x59180
movsd 0x340(%rsp), %xmm0
pxor %xmm1, %xmm0
movlpd %xmm0, 0x128(%rsp)
movsd 0x340(%rsp), %xmm0
movaps 0x482a3(%rip), %xmm2    # 0x59160
movq 0x348(%rsp), %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x4829e(%rip), %xmm2    # 0x59170
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x110(%rsp)
movq $0x0, 0x118(%rsp)
movq 0x118(%rsp), %rax
movq 0x348(%rsp), %rcx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x11278
movsd 0x340(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x108(%rsp)
movsd 0x2d0(%rsp), %xmm0
movsd 0x128(%rsp), %xmm2
movsd 0x2b0(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x100(%rsp)
movsd 0x2d8(%rsp), %xmm0
movsd 0x128(%rsp), %xmm2
movsd 0x2b8(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xf8(%rsp)
movq $0x0, 0x120(%rsp)
movq 0x120(%rsp), %rax
movq 0x348(%rsp), %rcx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x11244
movsd 0x2c0(%rsp), %xmm0
movsd 0x108(%rsp), %xmm2
movsd 0x100(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xf0(%rsp)
movsd 0x2c8(%rsp), %xmm0
movsd 0x108(%rsp), %xmm2
movsd 0xf8(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xe8(%rsp)
movsd 0xf0(%rsp), %xmm0
callq 0xdf80
movq %rax, 0xe0(%rsp)
movsd 0xe8(%rsp), %xmm0
callq 0xdf80
movq %rax, 0xd8(%rsp)
movq 0x2f8(%rsp), %rax
movq 0xd8(%rsp), %rcx
imulq 0x2f0(%rsp), %rcx
addq 0xe0(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xd0(%rsp)
movq 0x2f8(%rsp), %rax
movq 0xd8(%rsp), %rcx
imulq 0x2f0(%rsp), %rcx
addq 0xe0(%rsp), %rcx
movss 0x4(%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xc8(%rsp)
movq 0x2f8(%rsp), %rax
movq 0xd8(%rsp), %rcx
addq $0x1, %rcx
imulq 0x2f0(%rsp), %rcx
addq 0xe0(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xc0(%rsp)
movq 0x2f8(%rsp), %rax
movq 0xd8(%rsp), %rcx
addq $0x1, %rcx
imulq 0x2f0(%rsp), %rcx
addq 0xe0(%rsp), %rcx
movss 0x4(%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xb8(%rsp)
movsd 0xf0(%rsp), %xmm0
cvtsi2sdq 0xe0(%rsp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0xb0(%rsp)
movsd 0xe8(%rsp), %xmm0
cvtsi2sdq 0xd8(%rsp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0xa8(%rsp)
movsd 0x47f6d(%rip), %xmm0    # 0x590d8
subsd 0xa8(%rsp), %xmm0
movsd 0x47f5c(%rip), %xmm2    # 0x590d8
subsd 0xb0(%rsp), %xmm2
movsd 0xd0(%rsp), %xmm3
movsd 0xb0(%rsp), %xmm1
mulsd 0xc8(%rsp), %xmm1
mulsd %xmm3, %xmm2
addsd %xmm1, %xmm2
movsd 0xa8(%rsp), %xmm1
movsd 0x47f1f(%rip), %xmm3    # 0x590d8
subsd 0xb0(%rsp), %xmm3
movsd 0xc0(%rsp), %xmm5
movsd 0xb0(%rsp), %xmm4
mulsd 0xb8(%rsp), %xmm4
mulsd %xmm5, %xmm3
addsd %xmm4, %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0x130(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x130(%rsp)
movss %xmm0, (%rax)
movsd 0x110(%rsp), %xmm0
addsd 0x108(%rsp), %xmm0
movsd %xmm0, 0x108(%rsp)
movq 0x120(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x120(%rsp)
jmp 0x10fa8
movsd 0x110(%rsp), %xmm0
addsd 0x128(%rsp), %xmm0
movsd %xmm0, 0x128(%rsp)
movq 0x118(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x118(%rsp)
jmp 0x10efa
movl $0x0, 0x374(%rsp)
movl 0x374(%rsp), %eax
addq $0x378, %rsp            # imm = 0x378
retq
nopw %cs:(%rax,%rax)