// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/slic.c
// Function: vl_slic_segment
void
vl_slic_segment (vl_uint32 * segmentation,
                 float const * image,
                 vl_size width,
                 vl_size height,
                 vl_size numChannels,
                 vl_size regionSize,
                 float regularization,
                 vl_size minRegionSize)
{
  vl_index i, x, y, u, v, k, region ;
  vl_uindex iter ;
  vl_size const numRegionsX = (vl_size) ceil((double) width / regionSize) ;
  vl_size const numRegionsY = (vl_size) ceil((double) height / regionSize) ;
  vl_size const numRegions = numRegionsX * numRegionsY ;
  vl_size const numPixels = width * height ;
  float * centers ;
  float * edgeMap ;
  float previousEnergy = VL_INFINITY_F ;
  float startingEnergy ;
  vl_uint32 * masses ;
  vl_size const maxNumIterations = 100 ;

  assert(segmentation) ;
  assert(image) ;
  assert(width >= 1) ;
  assert(height >= 1) ;
  assert(numChannels >= 1) ;
  assert(regionSize >= 1) ;
  assert(regularization >= 0) ;

#define atimage(x,y,k) image[(x)+(y)*width+(k)*width*height]
#define atEdgeMap(x,y) edgeMap[(x)+(y)*width]

  edgeMap = vl_calloc(numPixels, sizeof(float)) ;
  masses = vl_malloc(sizeof(vl_uint32) * numPixels) ;
  centers = vl_malloc(sizeof(float) * (2 + numChannels) * numRegions) ;

  /* compute edge map (gradient strength) */
  for (k = 0 ; k < (signed)numChannels ; ++k) {
    for (y = 1 ; y < (signed)height-1 ; ++y) {
      for (x = 1 ; x < (signed)width-1 ; ++x) {
        float a = atimage(x-1,y,k) ;
        float b = atimage(x+1,y,k) ;
        float c = atimage(x,y+1,k) ;
        float d = atimage(x,y-1,k) ;
        atEdgeMap(x,y) += (a - b)  * (a - b) + (c - d) * (c - d) ;
      }
    }
  }

  /* initialize K-means centers */
  i = 0 ;
  for (v = 0 ; v < (signed)numRegionsY ; ++v) {
    for (u = 0 ; u < (signed)numRegionsX ; ++u) {
      vl_index xp ;
      vl_index yp ;
      vl_index centerx = 0 ;
      vl_index centery = 0 ;
      float minEdgeValue = VL_INFINITY_F ;

      x = (vl_index) vl_round_d(regionSize * (u + 0.5)) ;
      y = (vl_index) vl_round_d(regionSize * (v + 0.5)) ;

      x = VL_MAX(VL_MIN(x, (signed)width-1),0) ;
      y = VL_MAX(VL_MIN(y, (signed)height-1),0) ;

      /* search in a 3x3 neighbourhood the smallest edge response */
      for (yp = VL_MAX(0, y-1) ; yp <= VL_MIN((signed)height-1, y+1) ; ++ yp) {
        for (xp = VL_MAX(0, x-1) ; xp <= VL_MIN((signed)width-1, x+1) ; ++ xp) {
          float thisEdgeValue = atEdgeMap(xp,yp) ;
          if (thisEdgeValue < minEdgeValue) {
            minEdgeValue = thisEdgeValue ;
            centerx = xp ;
            centery = yp ;
          }
        }
      }

      /* initialize the new center at this location */
      centers[i++] = (float) centerx ;
      centers[i++] = (float) centery ;
      for (k  = 0 ; k < (signed)numChannels ; ++k) {
        centers[i++] = atimage(centerx,centery,k) ;
      }
    }
  }

  /* run k-means iterations */
  for (iter = 0 ; iter < maxNumIterations ; ++iter) {
    float factor = regularization / (regionSize * regionSize) ;
    float energy = 0 ;

    /* assign pixels to centers */
    for (y = 0 ; y < (signed)height ; ++y) {
      for (x = 0 ; x < (signed)width ; ++x) {
        vl_index u = floor((double)x / regionSize - 0.5) ;
        vl_index v = floor((double)y / regionSize - 0.5) ;
        vl_index up, vp ;
        float minDistance = VL_INFINITY_F ;

        for (vp = VL_MAX(0, v) ; vp <= VL_MIN((signed)numRegionsY-1, v+1) ; ++vp) {
          for (up = VL_MAX(0, u) ; up <= VL_MIN((signed)numRegionsX-1, u+1) ; ++up) {
            vl_index region = up  + vp * numRegionsX ;
            float centerx = centers[(2 + numChannels) * region + 0]  ;
            float centery = centers[(2 + numChannels) * region + 1] ;
            float spatial = (x - centerx) * (x - centerx) + (y - centery) * (y - centery) ;
            float appearance = 0 ;
            float distance ;
            for (k = 0 ; k < (signed)numChannels ; ++k) {
              float centerz = centers[(2 + numChannels) * region + k + 2]  ;
              float z = atimage(x,y,k) ;
              appearance += (z - centerz) * (z - centerz) ;
            }
            distance = appearance + factor * spatial ;
            if (minDistance > distance) {
              minDistance = distance ;
              segmentation[x + y * width] = (vl_uint32)region ;
            }
          }
        }
        energy += minDistance ;
      }
    }

    /*
     VL_PRINTF("vl:slic: iter %d: energy: %g\n", iter, energy) ;
    */

    /* check energy termination conditions */
    if (iter == 0) {
      startingEnergy = energy ;
    } else {
      if ((previousEnergy - energy) < 1e-5 * (startingEnergy - energy)) {
        break ;
      }
    }
    previousEnergy = energy ;

    /* recompute centers */
    memset(masses, 0, sizeof(vl_uint32) * width * height) ;
    memset(centers, 0, sizeof(float) * (2 + numChannels) * numRegions) ;

    for (y = 0 ; y < (signed)height ; ++y) {
      for (x = 0 ; x < (signed)width ; ++x) {
        vl_index pixel = x + y * width ;
        vl_index region = segmentation[pixel] ;
        masses[region] ++ ;
        centers[region * (2 + numChannels) + 0] += x ;
        centers[region * (2 + numChannels) + 1] += y ;
        for (k = 0 ; k < (signed)numChannels ; ++k) {
          centers[region * (2 + numChannels) + k + 2] += atimage(x,y,k) ;
        }
      }
    }

    for (region = 0 ; region < (signed)numRegions ; ++region) {
      float mass = VL_MAX(masses[region], 1e-8) ;
      for (i = (2 + numChannels) * region ;
           i < (signed)(2 + numChannels) * (region + 1) ;
           ++i) {
        centers[i] /= mass ;
      }
    }
  }

  vl_free(masses) ;
  vl_free(centers) ;
  vl_free(edgeMap) ;

  /* elimiate small regions */
  {
    vl_uint32 * cleaned = vl_calloc(numPixels, sizeof(vl_uint32)) ;
    vl_uindex * segment = vl_malloc(sizeof(vl_uindex) * numPixels) ;
    vl_size segmentSize ;
    vl_uint32 label ;
    vl_uint32 cleanedLabel ;
    vl_size numExpanded ;
    vl_index const dx [] = {+1, -1,  0,  0} ;
    vl_index const dy [] = { 0,  0, +1, -1} ;
    vl_index direction ;
    vl_index pixel ;

    for (pixel = 0 ; pixel < (signed)numPixels ; ++pixel) {
      if (cleaned[pixel]) continue ;
      label = segmentation[pixel] ;
      numExpanded = 0 ;
      segmentSize = 0 ;
      segment[segmentSize++] = pixel ;

      /*
       find cleanedLabel as the label of an already cleaned
       region neihbour of this pixel
       */
      cleanedLabel = label + 1 ;
      cleaned[pixel] = label + 1 ;
      x = pixel % width ;
      y = pixel / width ;
      for (direction = 0 ; direction < 4 ; ++direction) {
        vl_index xp = x + dx[direction] ;
        vl_index yp = y + dy[direction] ;
        vl_index neighbor = xp + yp * width ;
        if (0 <= xp && xp < (signed)width &&
            0 <= yp && yp < (signed)height &&
            cleaned[neighbor]) {
          cleanedLabel = cleaned[neighbor] ;
        }
      }

      /* expand the segment */
      while (numExpanded < segmentSize) {
        vl_index open = segment[numExpanded++] ;
        x = open % width ;
        y = open / width ;
        for (direction = 0 ; direction < 4 ; ++direction) {
          vl_index xp = x + dx[direction] ;
          vl_index yp = y + dy[direction] ;
          vl_index neighbor = xp + yp * width ;
          if (0 <= xp && xp < (signed)width &&
              0 <= yp && yp < (signed)height &&
              cleaned[neighbor] == 0 &&
              segmentation[neighbor] == label) {
            cleaned[neighbor] = label + 1 ;
            segment[segmentSize++] = neighbor ;
          }
        }
      }

      /* change label to cleanedLabel if the semgent is too small */
      if (segmentSize < minRegionSize) {
        while (segmentSize > 0) {
          cleaned[segment[--segmentSize]] = cleanedLabel ;
        }
      }
    }
    /* restore base 0 indexing of the regions */
    for (pixel = 0 ; pixel < (signed)numPixels ; ++pixel) cleaned[pixel] -- ;

    memcpy(segmentation, cleaned, numPixels * sizeof(vl_uint32)) ;
    vl_free(cleaned) ;
    vl_free(segment) ;
  }
}

// Assembly:
subq $0x338, %rsp            # imm = 0x338
movq 0x340(%rsp), %rax
movq %rdi, 0x330(%rsp)
movq %rsi, 0x328(%rsp)
movq %rdx, 0x320(%rsp)
movq %rcx, 0x318(%rsp)
movq %r8, 0x310(%rsp)
movq %r9, 0x308(%rsp)
movss %xmm0, 0x304(%rsp)
movq 0x320(%rsp), %xmm0
movaps 0x6bd8(%rip), %xmm3     # 0x59160
movaps %xmm3, 0xf0(%rsp)
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x6bd4(%rip), %xmm2     # 0x59170
movaps %xmm2, 0x100(%rsp)
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq 0x308(%rsp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x9b70
movaps 0xf0(%rsp), %xmm3
movaps 0x100(%rsp), %xmm2
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x73f1(%rip), %xmm1     # 0x599f0
movsd %xmm1, 0x110(%rsp)
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, 0x2b8(%rsp)
movq 0x318(%rsp), %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq 0x308(%rsp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x9b70
movsd 0x110(%rsp), %xmm1
movaps %xmm0, %xmm2
cvttsd2si %xmm2, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, 0x2b0(%rsp)
movq 0x2b8(%rsp), %rax
imulq 0x2b0(%rsp), %rax
movq %rax, 0x2a8(%rsp)
movq 0x320(%rsp), %rax
imulq 0x318(%rsp), %rax
movq %rax, 0x2a0(%rsp)
movss 0x7abb(%rip), %xmm0     # 0x5a184
movss %xmm0, 0x28c(%rsp)
movq $0x64, 0x278(%rsp)
movq 0x2a0(%rsp), %rdi
movl $0x4, %esi
callq 0x9a70
movq %rax, 0x290(%rsp)
movq 0x2a0(%rsp), %rdi
shlq $0x2, %rdi
callq 0x9660
movq %rax, 0x280(%rsp)
movq 0x310(%rsp), %rdi
addq $0x2, %rdi
shlq $0x2, %rdi
imulq 0x2a8(%rsp), %rdi
callq 0x9660
movq %rax, 0x298(%rsp)
movq $0x0, 0x2d0(%rsp)
movq 0x2d0(%rsp), %rax
movq 0x310(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x529d2
movq $0x1, 0x2e8(%rsp)
movq 0x2e8(%rsp), %rax
movq 0x318(%rsp), %rcx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x529b7
movq $0x1, 0x2f0(%rsp)
movq 0x2f0(%rsp), %rax
movq 0x320(%rsp), %rcx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x5299c
movq 0x328(%rsp), %rax
movq 0x2f0(%rsp), %rcx
subq $0x1, %rcx
movq 0x2e8(%rsp), %rdx
imulq 0x320(%rsp), %rdx
addq %rdx, %rcx
movq 0x2d0(%rsp), %rdx
imulq 0x320(%rsp), %rdx
imulq 0x318(%rsp), %rdx
addq %rdx, %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x274(%rsp)
movq 0x328(%rsp), %rax
movq 0x2f0(%rsp), %rcx
addq $0x1, %rcx
movq 0x2e8(%rsp), %rdx
imulq 0x320(%rsp), %rdx
addq %rdx, %rcx
movq 0x2d0(%rsp), %rdx
imulq 0x320(%rsp), %rdx
imulq 0x318(%rsp), %rdx
addq %rdx, %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x270(%rsp)
movq 0x328(%rsp), %rax
movq 0x2f0(%rsp), %rcx
movq 0x2e8(%rsp), %rdx
addq $0x1, %rdx
imulq 0x320(%rsp), %rdx
addq %rdx, %rcx
movq 0x2d0(%rsp), %rdx
imulq 0x320(%rsp), %rdx
imulq 0x318(%rsp), %rdx
addq %rdx, %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x26c(%rsp)
movq 0x328(%rsp), %rax
movq 0x2f0(%rsp), %rcx
movq 0x2e8(%rsp), %rdx
subq $0x1, %rdx
imulq 0x320(%rsp), %rdx
addq %rdx, %rcx
movq 0x2d0(%rsp), %rdx
imulq 0x320(%rsp), %rdx
imulq 0x318(%rsp), %rdx
addq %rdx, %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x268(%rsp)
movss 0x274(%rsp), %xmm0
subss 0x270(%rsp), %xmm0
movss 0x274(%rsp), %xmm2
subss 0x270(%rsp), %xmm2
movss 0x26c(%rsp), %xmm1
subss 0x268(%rsp), %xmm1
movss 0x26c(%rsp), %xmm3
subss 0x268(%rsp), %xmm3
mulss %xmm3, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq 0x290(%rsp), %rax
movq 0x2f0(%rsp), %rcx
movq 0x2e8(%rsp), %rdx
imulq 0x320(%rsp), %rdx
addq %rdx, %rcx
addss (%rax,%rcx,4), %xmm0
movss %xmm0, (%rax,%rcx,4)
movq 0x2f0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2f0(%rsp)
jmp 0x52796
jmp 0x5299e
movq 0x2e8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2e8(%rsp)
jmp 0x5276b
jmp 0x529b9
movq 0x2d0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2d0(%rsp)
jmp 0x52743
movq $0x0, 0x2f8(%rsp)
movq $0x0, 0x2d8(%rsp)
movq 0x2d8(%rsp), %rax
movq 0x2b0(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x52fd5
movq $0x0, 0x2e0(%rsp)
movq 0x2e0(%rsp), %rax
movq 0x2b8(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x52fba
movq $0x0, 0x250(%rsp)
movq $0x0, 0x248(%rsp)
movss 0x7736(%rip), %xmm0     # 0x5a184
movss %xmm0, 0x244(%rsp)
movq 0x308(%rsp), %xmm0
movaps 0x66f9(%rip), %xmm1     # 0x59160
movaps %xmm1, 0xd0(%rsp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x66f5(%rip), %xmm1     # 0x59170
movaps %xmm1, 0xe0(%rsp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
cvtsi2sdq 0x2e0(%rsp), %xmm1
movsd 0x65dc(%rip), %xmm2     # 0x59080
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
callq 0x53f80
movaps 0xd0(%rsp), %xmm2
movaps 0xe0(%rsp), %xmm1
movq %rax, 0x2f0(%rsp)
movq 0x308(%rsp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
cvtsi2sdq 0x2d8(%rsp), %xmm1
movsd 0x6589(%rip), %xmm2     # 0x59080
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
callq 0x53f80
movq %rax, 0x2e8(%rsp)
movq 0x2f0(%rsp), %rax
movq 0x320(%rsp), %rcx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x52b39
movq 0x2f0(%rsp), %rax
movq %rax, 0xc8(%rsp)
jmp 0x52b4e
movq 0x320(%rsp), %rax
subl $0x1, %eax
cltq
movq %rax, 0xc8(%rsp)
movq 0xc8(%rsp), %rax
cmpq $0x0, %rax
jle 0x52bb0
movq 0x2f0(%rsp), %rax
movq 0x320(%rsp), %rcx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x52b89
movq 0x2f0(%rsp), %rax
movq %rax, 0xc0(%rsp)
jmp 0x52b9e
movq 0x320(%rsp), %rax
subl $0x1, %eax
cltq
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0xb8(%rsp)
jmp 0x52bbc
xorl %eax, %eax
movq %rax, 0xb8(%rsp)
jmp 0x52bbc
movq 0xb8(%rsp), %rax
movq %rax, 0x2f0(%rsp)
movq 0x2e8(%rsp), %rax
movq 0x318(%rsp), %rcx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x52bf9
movq 0x2e8(%rsp), %rax
movq %rax, 0xb0(%rsp)
jmp 0x52c0e
movq 0x318(%rsp), %rax
subl $0x1, %eax
cltq
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
cmpq $0x0, %rax
jle 0x52c70
movq 0x2e8(%rsp), %rax
movq 0x318(%rsp), %rcx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x52c49
movq 0x2e8(%rsp), %rax
movq %rax, 0xa8(%rsp)
jmp 0x52c5e
movq 0x318(%rsp), %rax
subl $0x1, %eax
cltq
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0xa0(%rsp)
jmp 0x52c7c
xorl %eax, %eax
movq %rax, 0xa0(%rsp)
jmp 0x52c7c
movq 0xa0(%rsp), %rax
movq %rax, 0x2e8(%rsp)
movq 0x2e8(%rsp), %rcx
subq $0x1, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jle 0x52cab
xorl %eax, %eax
movq %rax, 0x98(%rsp)
jmp 0x52cbf
movq 0x2e8(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x258(%rsp)
movq 0x258(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x318(%rsp), %rax
subl $0x1, %eax
cltq
movq 0x2e8(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jge 0x52d14
movq 0x318(%rsp), %rax
subl $0x1, %eax
cltq
movq %rax, 0x88(%rsp)
jmp 0x52d28
movq 0x2e8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
movq 0x90(%rsp), %rax
movq 0x88(%rsp), %rcx
cmpq %rcx, %rax
jg 0x52e98
movq 0x2f0(%rsp), %rcx
subq $0x1, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jle 0x52d60
xorl %eax, %eax
movq %rax, 0x80(%rsp)
jmp 0x52d74
movq 0x2f0(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x260(%rsp)
movq 0x260(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x320(%rsp), %rax
subl $0x1, %eax
cltq
movq 0x2f0(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jge 0x52dc3
movq 0x320(%rsp), %rax
subl $0x1, %eax
cltq
movq %rax, 0x70(%rsp)
jmp 0x52dd4
movq 0x2f0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rax
movq 0x70(%rsp), %rcx
cmpq %rcx, %rax
jg 0x52e7d
movq 0x290(%rsp), %rax
movq 0x260(%rsp), %rcx
movq 0x258(%rsp), %rdx
imulq 0x320(%rsp), %rdx
addq %rdx, %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x240(%rsp)
movss 0x240(%rsp), %xmm1
movss 0x244(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x52e62
movss 0x240(%rsp), %xmm0
movss %xmm0, 0x244(%rsp)
movq 0x260(%rsp), %rax
movq %rax, 0x250(%rsp)
movq 0x258(%rsp), %rax
movq %rax, 0x248(%rsp)
jmp 0x52e64
movq 0x260(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x260(%rsp)
jmp 0x52d84
jmp 0x52e7f
movq 0x258(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x258(%rsp)
jmp 0x52ccf
cvtsi2ssq 0x250(%rsp), %xmm0
movq 0x298(%rsp), %rax
movq 0x2f8(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x2f8(%rsp)
movss %xmm0, (%rax,%rcx,4)
cvtsi2ssq 0x248(%rsp), %xmm0
movq 0x298(%rsp), %rax
movq 0x2f8(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x2f8(%rsp)
movss %xmm0, (%rax,%rcx,4)
movq $0x0, 0x2d0(%rsp)
movq 0x2d0(%rsp), %rax
movq 0x310(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x52f9f
movq 0x328(%rsp), %rax
movq 0x250(%rsp), %rcx
movq 0x248(%rsp), %rdx
imulq 0x320(%rsp), %rdx
addq %rdx, %rcx
movq 0x2d0(%rsp), %rdx
imulq 0x320(%rsp), %rdx
imulq 0x318(%rsp), %rdx
addq %rdx, %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x298(%rsp), %rax
movq 0x2f8(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x2f8(%rsp)
movss %xmm0, (%rax,%rcx,4)
movq 0x2d0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2d0(%rsp)
jmp 0x52f00
jmp 0x52fa1
movq 0x2e0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2e0(%rsp)
jmp 0x52a12
jmp 0x52fbc
movq 0x2d8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2d8(%rsp)
jmp 0x529ea
movq $0x0, 0x2c0(%rsp)
cmpq $0x64, 0x2c0(%rsp)
jae 0x539a4
movss 0x304(%rsp), %xmm0
movss %xmm0, 0x64(%rsp)
movq 0x308(%rsp), %rax
imulq %rax, %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x68(%rsp)
testq %rax, %rax
movss %xmm0, 0x6c(%rsp)
js 0x53044
movss 0x68(%rsp), %xmm0
movss %xmm0, 0x6c(%rsp)
movss 0x64(%rsp), %xmm0
movss 0x6c(%rsp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, 0x23c(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x238(%rsp)
movq $0x0, 0x2e8(%rsp)
movq 0x2e8(%rsp), %rax
movq 0x318(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x53592
movq $0x0, 0x2f0(%rsp)
movq 0x2f0(%rsp), %rax
movq 0x320(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x53577
cvtsi2sdq 0x2f0(%rsp), %xmm0
movq 0x308(%rsp), %xmm1
movaps 0x608d(%rip), %xmm2     # 0x59160
movaps %xmm2, 0x40(%rsp)
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x608c(%rip), %xmm2     # 0x59170
movaps %xmm2, 0x50(%rsp)
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd 0x5fe4(%rip), %xmm1     # 0x590e8
addsd %xmm1, %xmm0
callq 0x9a00
movaps 0x40(%rsp), %xmm3
movaps 0x50(%rsp), %xmm2
cvttsd2si %xmm0, %rax
movq %rax, 0x230(%rsp)
cvtsi2sdq 0x2e8(%rsp), %xmm0
movq 0x308(%rsp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd 0x5f2a(%rip), %xmm1     # 0x59080
subsd %xmm1, %xmm0
callq 0x9a00
cvttsd2si %xmm0, %rax
movq %rax, 0x228(%rsp)
movss 0x7010(%rip), %xmm0     # 0x5a184
movss %xmm0, 0x214(%rsp)
xorl %eax, %eax
cmpq 0x228(%rsp), %rax
jle 0x53192
xorl %eax, %eax
movq %rax, 0x38(%rsp)
jmp 0x5319f
movq 0x228(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x218(%rsp)
movq 0x218(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x2b0(%rsp), %rax
subl $0x1, %eax
cltq
movq 0x228(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jge 0x531eb
movq 0x2b0(%rsp), %rax
subl $0x1, %eax
cltq
movq %rax, 0x28(%rsp)
jmp 0x531fc
movq 0x228(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq %rcx, %rax
jg 0x53543
xorl %eax, %eax
cmpq 0x230(%rsp), %rax
jle 0x53224
xorl %eax, %eax
movq %rax, 0x20(%rsp)
jmp 0x53231
movq 0x230(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x220(%rsp)
movq 0x220(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x2b8(%rsp), %rax
subl $0x1, %eax
cltq
movq 0x230(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jge 0x5327d
movq 0x2b8(%rsp), %rax
subl $0x1, %eax
cltq
movq %rax, 0x10(%rsp)
jmp 0x5328e
movq 0x230(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq %rcx, %rax
jg 0x53528
movq 0x220(%rsp), %rax
movq 0x218(%rsp), %rcx
imulq 0x2b8(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x208(%rsp)
movq 0x298(%rsp), %rax
movq 0x310(%rsp), %rcx
addq $0x2, %rcx
imulq 0x208(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x204(%rsp)
movq 0x298(%rsp), %rax
movq 0x310(%rsp), %rcx
addq $0x2, %rcx
imulq 0x208(%rsp), %rcx
movss 0x4(%rax,%rcx,4), %xmm0
movss %xmm0, 0x200(%rsp)
cvtsi2ssq 0x2f0(%rsp), %xmm0
subss 0x204(%rsp), %xmm0
cvtsi2ssq 0x2f0(%rsp), %xmm2
subss 0x204(%rsp), %xmm2
cvtsi2ssq 0x2e8(%rsp), %xmm1
subss 0x200(%rsp), %xmm1
cvtsi2ssq 0x2e8(%rsp), %xmm3
subss 0x200(%rsp), %xmm3
mulss %xmm3, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1fc(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x1f8(%rsp)
movq $0x0, 0x2d0(%rsp)
movq 0x2d0(%rsp), %rax
movq 0x310(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x5348b
movq 0x298(%rsp), %rax
movq 0x310(%rsp), %rcx
addq $0x2, %rcx
imulq 0x208(%rsp), %rcx
addq 0x2d0(%rsp), %rcx
movss 0x8(%rax,%rcx,4), %xmm0
movss %xmm0, 0x1f0(%rsp)
movq 0x328(%rsp), %rax
movq 0x2f0(%rsp), %rcx
movq 0x2e8(%rsp), %rdx
imulq 0x320(%rsp), %rdx
addq %rdx, %rcx
movq 0x2d0(%rsp), %rdx
imulq 0x320(%rsp), %rdx
imulq 0x318(%rsp), %rdx
addq %rdx, %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, 0x1ec(%rsp)
movss 0x1ec(%rsp), %xmm0
subss 0x1f0(%rsp), %xmm0
movss 0x1ec(%rsp), %xmm2
subss 0x1f0(%rsp), %xmm2
movss 0x1f8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1f8(%rsp)
movq 0x2d0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2d0(%rsp)
jmp 0x53395
movss 0x1f8(%rsp), %xmm1
movss 0x23c(%rsp), %xmm0
movss 0x1fc(%rsp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1f4(%rsp)
movss 0x214(%rsp), %xmm0
ucomiss 0x1f4(%rsp), %xmm0
jbe 0x5350d
movss 0x1f4(%rsp), %xmm0
movss %xmm0, 0x214(%rsp)
movq 0x208(%rsp), %rax
movl %eax, %edx
movq 0x330(%rsp), %rax
movq 0x2f0(%rsp), %rcx
movq 0x2e8(%rsp), %rsi
imulq 0x320(%rsp), %rsi
addq %rsi, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x5350f
movq 0x220(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x220(%rsp)
jmp 0x5323e
jmp 0x5352a
movq 0x218(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x218(%rsp)
jmp 0x531ac
movss 0x214(%rsp), %xmm0
addss 0x238(%rsp), %xmm0
movss %xmm0, 0x238(%rsp)
movq 0x2f0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2f0(%rsp)
jmp 0x5309d
jmp 0x53579
movq 0x2e8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2e8(%rsp)
jmp 0x53075
cmpq $0x0, 0x2c0(%rsp)
jne 0x535b1
movss 0x238(%rsp), %xmm0
movss %xmm0, 0x288(%rsp)
jmp 0x535f6
movss 0x28c(%rsp), %xmm0
subss 0x238(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movss 0x288(%rsp), %xmm0
subss 0x238(%rsp), %xmm0
cvtss2sd %xmm0, %xmm2
movsd 0x5d63(%rip), %xmm0     # 0x59348
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x535f4
jmp 0x539a4
jmp 0x535f6
movss 0x238(%rsp), %xmm0
movss %xmm0, 0x28c(%rsp)
movq 0x280(%rsp), %rdi
movq 0x320(%rsp), %rdx
shlq $0x2, %rdx
imulq 0x318(%rsp), %rdx
xorl %esi, %esi
callq 0x9480
movq 0x298(%rsp), %rdi
movq 0x310(%rsp), %rdx
addq $0x2, %rdx
shlq $0x2, %rdx
imulq 0x2a8(%rsp), %rdx
xorl %esi, %esi
callq 0x9480
movq $0x0, 0x2e8(%rsp)
movq 0x2e8(%rsp), %rax
movq 0x318(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x53857
movq $0x0, 0x2f0(%rsp)
movq 0x2f0(%rsp), %rax
movq 0x320(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x5383c
movq 0x2f0(%rsp), %rax
movq 0x2e8(%rsp), %rcx
imulq 0x320(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x1e0(%rsp)
movq 0x330(%rsp), %rax
movq 0x1e0(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movq %rax, 0x1d8(%rsp)
movq 0x280(%rsp), %rax
movq 0x1d8(%rsp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
cvtsi2ssq 0x2f0(%rsp), %xmm0
movq 0x298(%rsp), %rax
movq 0x1d8(%rsp), %rcx
movq 0x310(%rsp), %rdx
addq $0x2, %rdx
imulq %rdx, %rcx
addss (%rax,%rcx,4), %xmm0
movss %xmm0, (%rax,%rcx,4)
cvtsi2ssq 0x2e8(%rsp), %xmm0
movq 0x298(%rsp), %rax
movq 0x1d8(%rsp), %rcx
movq 0x310(%rsp), %rdx
addq $0x2, %rdx
imulq %rdx, %rcx
addss 0x4(%rax,%rcx,4), %xmm0
movss %xmm0, 0x4(%rax,%rcx,4)
movq $0x0, 0x2d0(%rsp)
movq 0x2d0(%rsp), %rax
movq 0x310(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x53821
movq 0x328(%rsp), %rax
movq 0x2f0(%rsp), %rcx
movq 0x2e8(%rsp), %rdx
imulq 0x320(%rsp), %rdx
addq %rdx, %rcx
movq 0x2d0(%rsp), %rdx
imulq 0x320(%rsp), %rdx
imulq 0x318(%rsp), %rdx
addq %rdx, %rcx
movss (%rax,%rcx,4), %xmm0
movq 0x298(%rsp), %rax
movq 0x1d8(%rsp), %rcx
movq 0x310(%rsp), %rdx
addq $0x2, %rdx
imulq %rdx, %rcx
addq 0x2d0(%rsp), %rcx
addss 0x8(%rax,%rcx,4), %xmm0
movss %xmm0, 0x8(%rax,%rcx,4)
movq 0x2d0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2d0(%rsp)
jmp 0x53772
jmp 0x53823
movq 0x2f0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2f0(%rsp)
jmp 0x53688
jmp 0x5383e
movq 0x2e8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2e8(%rsp)
jmp 0x53660
movq $0x0, 0x2c8(%rsp)
movq 0x2c8(%rsp), %rax
movq 0x2a8(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x53989
movq 0x280(%rsp), %rax
movq 0x2c8(%rsp), %rcx
movl (%rax,%rcx,4), %eax
cvtsi2sd %rax, %xmm0
movsd 0x5999(%rip), %xmm1     # 0x59238
ucomisd %xmm1, %xmm0
jbe 0x538c5
movq 0x280(%rsp), %rax
movq 0x2c8(%rsp), %rcx
movl (%rax,%rcx,4), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x538d5
movsd 0x596b(%rip), %xmm0     # 0x59238
movsd %xmm0, 0x8(%rsp)
jmp 0x538d5
movsd 0x8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1d4(%rsp)
movq 0x310(%rsp), %rax
addq $0x2, %rax
imulq 0x2c8(%rsp), %rax
movq %rax, 0x2f8(%rsp)
movq 0x2f8(%rsp), %rax
movq 0x310(%rsp), %rcx
addq $0x2, %rcx
movslq %ecx, %rcx
movq 0x2c8(%rsp), %rdx
addq $0x1, %rdx
imulq %rdx, %rcx
cmpq %rcx, %rax
jge 0x5396e
movss 0x1d4(%rsp), %xmm1
movq 0x298(%rsp), %rax
movq 0x2f8(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
divss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movq 0x2f8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2f8(%rsp)
jmp 0x53905
jmp 0x53970
movq 0x2c8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2c8(%rsp)
jmp 0x53863
jmp 0x5398b
movq 0x2c0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2c0(%rsp)
jmp 0x52fe1
movq 0x280(%rsp), %rdi
callq 0x9620
movq 0x298(%rsp), %rdi
callq 0x9620
movq 0x290(%rsp), %rdi
callq 0x9620
movq 0x2a0(%rsp), %rdi
movl $0x4, %esi
callq 0x9a70
movq %rax, 0x1c8(%rsp)
movq 0x2a0(%rsp), %rdi
shlq $0x3, %rdi
callq 0x9660
movq %rax, 0x1c0(%rsp)
movq 0x678b(%rip), %rax      # 0x5a190
movq %rax, 0x180(%rsp)
movq 0x6784(%rip), %rax      # 0x5a198
movq %rax, 0x188(%rsp)
movq 0x677d(%rip), %rax      # 0x5a1a0
movq %rax, 0x190(%rsp)
movq 0x6776(%rip), %rax      # 0x5a1a8
movq %rax, 0x198(%rsp)
movq 0x676f(%rip), %rax      # 0x5a1b0
movq %rax, 0x160(%rsp)
movq 0x6768(%rip), %rax      # 0x5a1b8
movq %rax, 0x168(%rsp)
movq 0x6761(%rip), %rax      # 0x5a1c0
movq %rax, 0x170(%rsp)
movq 0x675a(%rip), %rax      # 0x5a1c8
movq %rax, 0x178(%rsp)
movq $0x0, 0x150(%rsp)
movq 0x150(%rsp), %rax
movq 0x2a0(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x53eea
movq 0x1c8(%rsp), %rax
movq 0x150(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x53ab9
jmp 0x53ed1
movq 0x330(%rsp), %rax
movq 0x150(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x1b4(%rsp)
movq $0x0, 0x1a8(%rsp)
movq $0x0, 0x1b8(%rsp)
movq 0x150(%rsp), %rdx
movq 0x1c0(%rsp), %rax
movq 0x1b8(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x1b8(%rsp)
movq %rdx, (%rax,%rcx,8)
movl 0x1b4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1b0(%rsp)
movl 0x1b4(%rsp), %edx
addl $0x1, %edx
movq 0x1c8(%rsp), %rax
movq 0x150(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x150(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq 0x320(%rsp)
movq %rdx, 0x2f0(%rsp)
movq 0x150(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq 0x320(%rsp)
movq %rax, 0x2e8(%rsp)
movq $0x0, 0x158(%rsp)
cmpq $0x4, 0x158(%rsp)
jge 0x53c8e
movq 0x2f0(%rsp), %rax
movq 0x158(%rsp), %rcx
addq 0x180(%rsp,%rcx,8), %rax
movq %rax, 0x148(%rsp)
movq 0x2e8(%rsp), %rax
movq 0x158(%rsp), %rcx
addq 0x160(%rsp,%rcx,8), %rax
movq %rax, 0x140(%rsp)
movq 0x148(%rsp), %rax
movq 0x140(%rsp), %rcx
imulq 0x320(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x138(%rsp)
xorl %eax, %eax
cmpq 0x148(%rsp), %rax
jg 0x53c73
movq 0x148(%rsp), %rax
movq 0x320(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x53c73
xorl %eax, %eax
cmpq 0x140(%rsp), %rax
jg 0x53c73
movq 0x140(%rsp), %rax
movq 0x318(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x53c73
movq 0x1c8(%rsp), %rax
movq 0x138(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x53c73
movq 0x1c8(%rsp), %rax
movq 0x138(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x1b0(%rsp)
jmp 0x53c75
movq 0x158(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x158(%rsp)
jmp 0x53b88
jmp 0x53c90
movq 0x1a8(%rsp), %rax
cmpq 0x1b8(%rsp), %rax
jae 0x53e76
movq 0x1c0(%rsp), %rax
movq 0x1a8(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x1a8(%rsp)
movq (%rax,%rcx,8), %rax
movq %rax, 0x130(%rsp)
movq 0x130(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq 0x320(%rsp)
movq %rdx, 0x2f0(%rsp)
movq 0x130(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq 0x320(%rsp)
movq %rax, 0x2e8(%rsp)
movq $0x0, 0x158(%rsp)
cmpq $0x4, 0x158(%rsp)
jge 0x53e71
movq 0x2f0(%rsp), %rax
movq 0x158(%rsp), %rcx
addq 0x180(%rsp,%rcx,8), %rax
movq %rax, 0x128(%rsp)
movq 0x2e8(%rsp), %rax
movq 0x158(%rsp), %rcx
addq 0x160(%rsp,%rcx,8), %rax
movq %rax, 0x120(%rsp)
movq 0x128(%rsp), %rax
movq 0x120(%rsp), %rcx
imulq 0x320(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x118(%rsp)
xorl %eax, %eax
cmpq 0x128(%rsp), %rax
jg 0x53e56
movq 0x128(%rsp), %rax
movq 0x320(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x53e56
xorl %eax, %eax
cmpq 0x120(%rsp), %rax
jg 0x53e56
movq 0x120(%rsp), %rax
movq 0x318(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x53e56
movq 0x1c8(%rsp), %rax
movq 0x118(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x53e56
movq 0x330(%rsp), %rax
movq 0x118(%rsp), %rcx
movl (%rax,%rcx,4), %eax
cmpl 0x1b4(%rsp), %eax
jne 0x53e56
movl 0x1b4(%rsp), %edx
addl $0x1, %edx
movq 0x1c8(%rsp), %rax
movq 0x118(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x118(%rsp), %rdx
movq 0x1c0(%rsp), %rax
movq 0x1b8(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x1b8(%rsp)
movq %rdx, (%rax,%rcx,8)
jmp 0x53e58
movq 0x158(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x158(%rsp)
jmp 0x53d15
jmp 0x53c90
movq 0x1b8(%rsp), %rax
cmpq 0x340(%rsp), %rax
jae 0x53ecf
jmp 0x53e8a
cmpq $0x0, 0x1b8(%rsp)
jbe 0x53ecd
movl 0x1b0(%rsp), %edx
movq 0x1c8(%rsp), %rax
movq 0x1c0(%rsp), %rcx
movq 0x1b8(%rsp), %rsi
movq %rsi, %rdi
addq $-0x1, %rdi
movq %rdi, 0x1b8(%rsp)
movq -0x8(%rcx,%rsi,8), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x53e8a
jmp 0x53ecf
jmp 0x53ed1
movq 0x150(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x150(%rsp)
jmp 0x53a82
movq $0x0, 0x150(%rsp)
movq 0x150(%rsp), %rax
movq 0x2a0(%rsp), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x53f3d
movq 0x1c8(%rsp), %rax
movq 0x150(%rsp), %rcx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
movq 0x150(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x150(%rsp)
jmp 0x53ef6
movq 0x330(%rsp), %rdi
movq 0x1c8(%rsp), %rsi
movq 0x2a0(%rsp), %rdx
shlq $0x2, %rdx
callq 0x9640
movq 0x1c8(%rsp), %rdi
callq 0x9620
movq 0x1c0(%rsp), %rdi
callq 0x9620
addq $0x338, %rsp            # imm = 0x338
retq