// File: /workspace/github_c_makefile_star2_O0/yui0[P]img2vec/./potracelib.h
// Function: adjust_vertices
static int adjust_vertices(privpath_t *pp) {
  int m = pp->m;
  int *po = pp->po;
  int n = pp->len;
  point_t *pt = pp->pt;
  int x0 = pp->x0;
  int y0 = pp->y0;
  dpoint_t *ctr = NULL;      /* ctr[m] */
  dpoint_t *dir = NULL;      /* dir[m] */
  quadform_t *q = NULL;      /* q[m] */
  double v[3];
  double d;
  int i, j, k, l;
  dpoint_t s;
  int r;
  SAFE_CALLOC(ctr, m, dpoint_t);
  SAFE_CALLOC(dir, m, dpoint_t);
  SAFE_CALLOC(q, m, quadform_t);
  r = privcurve_init(&pp->curve, m);
  if (r) {
    goto calloc_error;
  }
  
  /* calculate "optimal" point-slope representation for each line
     segment */
  for (i=0; i<m; i++) {
    j = po[mod(i+1,m)];
    j = mod(j-po[i],n)+po[i];
    pointslope(pp, po[i], j, &ctr[i], &dir[i]);
  }
  /* represent each line segment as a singular quadratic form; the
     distance of a point (x,y) from the line segment will be
     (x,y,1)Q(x,y,1)^t, where Q=q[i]. */
  for (i=0; i<m; i++) {
    d = sq(dir[i].x) + sq(dir[i].y);
    if (d == 0.0) {
      for (j=0; j<3; j++) {
	for (k=0; k<3; k++) {
	  q[i][j][k] = 0;
	}
      }
    } else {
      v[0] = dir[i].y;
      v[1] = -dir[i].x;
      v[2] = - v[1] * ctr[i].y - v[0] * ctr[i].x;
      for (l=0; l<3; l++) {
	for (k=0; k<3; k++) {
	  q[i][l][k] = v[l] * v[k] / d;
	}
      }
    }
  }
  /* now calculate the "intersections" of consecutive segments.
     Instead of using the actual intersection, we find the point
     within a given unit square which minimizes the square distance to
     the two lines. */
  for (i=0; i<m; i++) {
    quadform_t Q;
    dpoint_t w;
    double dx, dy;
    double det;
    double min, cand; /* minimum and candidate for minimum of quad. form */
    double xmin, ymin;	/* coordinates of minimum */
    int z;
    /* let s be the vertex, in coordinates relative to x0/y0 */
    s.x = pt[po[i]].x-x0;
    s.y = pt[po[i]].y-y0;
    /* intersect segments i-1 and i */
    j = mod(i-1,m);
    /* add quadratic forms */
    for (l=0; l<3; l++) {
      for (k=0; k<3; k++) {
	Q[l][k] = q[j][l][k] + q[i][l][k];
      }
    }
    
    while(1) {
      /* minimize the quadratic form Q on the unit square */
      /* find intersection */
#ifdef HAVE_GCC_LOOP_BUG
      /* work around gcc bug #12243 */
      free(NULL);
#endif
      
      det = Q[0][0]*Q[1][1] - Q[0][1]*Q[1][0];
      if (det != 0.0) {
	w.x = (-Q[0][2]*Q[1][1] + Q[1][2]*Q[0][1]) / det;
	w.y = ( Q[0][2]*Q[1][0] - Q[1][2]*Q[0][0]) / det;
	break;
      }
      /* matrix is singular - lines are parallel. Add another,
	 orthogonal axis, through the center of the unit square */
      if (Q[0][0]>Q[1][1]) {
	v[0] = -Q[0][1];
	v[1] = Q[0][0];
      } else if (Q[1][1]) {
	v[0] = -Q[1][1];
	v[1] = Q[1][0];
      } else {
	v[0] = 1;
	v[1] = 0;
      }
      d = sq(v[0]) + sq(v[1]);
      v[2] = - v[1] * s.y - v[0] * s.x;
      for (l=0; l<3; l++) {
	for (k=0; k<3; k++) {
	  Q[l][k] += v[l] * v[k] / d;
	}
      }
    }
    dx = fabs(w.x-s.x);
    dy = fabs(w.y-s.y);
    if (dx <= .5 && dy <= .5) {
      pp->curve.vertex[i].x = w.x+x0;
      pp->curve.vertex[i].y = w.y+y0;
      continue;
    }
    /* the minimum was not in the unit square; now minimize quadratic
       on boundary of square */
    min = quadform(Q, s);
    xmin = s.x;
    ymin = s.y;
    if (Q[0][0] == 0.0) {
      goto fixx;
    }
    for (z=0; z<2; z++) {   /* value of the y-coordinate */
      w.y = s.y-0.5+z;
      w.x = - (Q[0][1] * w.y + Q[0][2]) / Q[0][0];
      dx = fabs(w.x-s.x);
      cand = quadform(Q, w);
      if (dx <= .5 && cand < min) {
	min = cand;
	xmin = w.x;
	ymin = w.y;
      }
    }
  fixx:
    if (Q[1][1] == 0.0) {
      goto corners;
    }
    for (z=0; z<2; z++) {   /* value of the x-coordinate */
      w.x = s.x-0.5+z;
      w.y = - (Q[1][0] * w.x + Q[1][2]) / Q[1][1];
      dy = fabs(w.y-s.y);
      cand = quadform(Q, w);
      if (dy <= .5 && cand < min) {
	min = cand;
	xmin = w.x;
	ymin = w.y;
      }
    }
  corners:
    /* check four corners */
    for (l=0; l<2; l++) {
      for (k=0; k<2; k++) {
	w.x = s.x-0.5+l;
	w.y = s.y-0.5+k;
	cand = quadform(Q, w);
	if (cand < min) {
	  min = cand;
	  xmin = w.x;
	  ymin = w.y;
	}
      }
    }
    pp->curve.vertex[i].x = xmin + x0;
    pp->curve.vertex[i].y = ymin + y0;
    continue;
  }
  free(ctr);
  free(dir);
  free(q);
  return 0;
 calloc_error:
  free(ctr);
  free(dir);
  free(q);
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movslq -0x14(%rbp), %rdi
movl $0x10, %esi
callq 0x1120
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x9dc3
jmp 0xaa55
movslq -0x14(%rbp), %rdi
movl $0x10, %esi
callq 0x1120
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
jne 0x9de0
jmp 0xaa55
movslq -0x14(%rbp), %rdi
movl $0x48, %esi
callq 0x1120
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0x9dfd
jmp 0xaa55
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movl -0x14(%rbp), %esi
callq 0x8810
movl %eax, -0x9c(%rbp)
cmpl $0x0, -0x9c(%rbp)
je 0x9e21
jmp 0xaa55
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x9ec6
movq -0x20(%rbp), %rax
movq %rax, -0x148(%rbp)
movl -0x7c(%rbp), %edi
addl $0x1, %edi
movl -0x14(%rbp), %esi
callq 0x2ca20
movl %eax, %ecx
movq -0x148(%rbp), %rax
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %edi
movq -0x20(%rbp), %rax
movslq -0x7c(%rbp), %rcx
subl (%rax,%rcx,4), %edi
movl -0x24(%rbp), %esi
callq 0x2ca20
movq -0x20(%rbp), %rcx
movslq -0x7c(%rbp), %rdx
addl (%rcx,%rdx,4), %eax
movl %eax, -0x80(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movl (%rax,%rcx,4), %esi
movl -0x80(%rbp), %edx
movq -0x40(%rbp), %rcx
movslq -0x7c(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x48(%rbp), %r8
movslq -0x7c(%rbp), %rax
shlq $0x4, %rax
addq %rax, %r8
callq 0x2d0e0
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x9e28
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xa10f
movq -0x48(%rbp), %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq -0x48(%rbp), %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm2
movq -0x48(%rbp), %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm1
movq -0x48(%rbp), %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
mulsd 0x8(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x78(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x9fb0
jp 0x9fb0
movl $0x0, -0x80(%rbp)
cmpl $0x3, -0x80(%rbp)
jge 0x9fab
movl $0x0, -0x84(%rbp)
cmpl $0x3, -0x84(%rbp)
jge 0x9f9e
movq -0x50(%rbp), %rax
movslq -0x7c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movslq -0x80(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq -0x84(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x9f5b
jmp 0x9fa0
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x9f4b
jmp 0xa0ff
movq -0x48(%rbp), %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x48(%rbp), %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x40(%rbp), %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm2
movsd -0x70(%rbp), %xmm1
movq -0x40(%rbp), %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
mulsd (%rax), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movl $0x0, -0x88(%rbp)
cmpl $0x3, -0x88(%rbp)
jge 0xa0fd
movl $0x0, -0x84(%rbp)
cmpl $0x3, -0x84(%rbp)
jge 0xa0e7
movslq -0x88(%rbp), %rax
movsd -0x70(%rbp,%rax,8), %xmm0
movslq -0x84(%rbp), %rax
mulsd -0x70(%rbp,%rax,8), %xmm0
divsd -0x78(%rbp), %xmm0
movq -0x50(%rbp), %rax
movslq -0x7c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movslq -0x88(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq -0x84(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0xa085
jmp 0xa0e9
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0xa06e
jmp 0xa0ff
jmp 0xa101
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x9ecd
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xaa31
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq -0x7c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x34(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x98(%rbp)
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq -0x7c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movslq -0x38(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x90(%rbp)
movl -0x7c(%rbp), %edi
subl $0x1, %edi
movl -0x14(%rbp), %esi
callq 0x2ca20
movl %eax, -0x80(%rbp)
movl $0x0, -0x88(%rbp)
cmpl $0x3, -0x88(%rbp)
jge 0xa25b
movl $0x0, -0x84(%rbp)
cmpl $0x3, -0x84(%rbp)
jge 0xa245
movq -0x50(%rbp), %rax
movslq -0x80(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movslq -0x88(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq -0x84(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x50(%rbp), %rax
movslq -0x7c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movslq -0x88(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq -0x84(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movslq -0x88(%rbp), %rcx
leaq -0xf0(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq -0x84(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0xa1b1
jmp 0xa247
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0xa19a
jmp 0xa25d
movsd -0xf0(%rbp), %xmm0
movsd -0xd0(%rbp), %xmm2
movsd -0xe8(%rbp), %xmm1
mulsd -0xd8(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x118(%rbp)
movsd -0x118(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xa2bc
jp 0xa2bc
jmp 0xa35f
movsd -0xe0(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd -0xd0(%rbp), %xmm2
movsd -0xc8(%rbp), %xmm1
mulsd -0xe8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
divsd -0x118(%rbp), %xmm0
movsd %xmm0, -0x100(%rbp)
movsd -0xe0(%rbp), %xmm0
movsd -0xd8(%rbp), %xmm2
movsd -0xc8(%rbp), %xmm1
mulsd -0xf0(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
divsd -0x118(%rbp), %xmm0
movsd %xmm0, -0xf8(%rbp)
jmp 0xa510
movsd -0xf0(%rbp), %xmm0
ucomisd -0xd0(%rbp), %xmm0
jbe 0xa3a4
movsd -0xe8(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0xf0(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
jmp 0xa403
movsd -0xd0(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xa3b9
jp 0xa3b9
jmp 0xa3ec
movsd -0xd0(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0xd8(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
jmp 0xa401
movsd 0x27c24(%rip), %xmm0    # 0x32018
movsd %xmm0, -0x70(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x68(%rbp)
jmp 0xa403
movsd -0x70(%rbp), %xmm0
movsd -0x70(%rbp), %xmm2
movsd -0x68(%rbp), %xmm1
mulsd -0x68(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x68(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd -0x90(%rbp), %xmm2
movsd -0x70(%rbp), %xmm1
mulsd -0x98(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movl $0x0, -0x88(%rbp)
cmpl $0x3, -0x88(%rbp)
jge 0xa50b
movl $0x0, -0x84(%rbp)
cmpl $0x3, -0x84(%rbp)
jge 0xa4f5
movslq -0x88(%rbp), %rax
movsd -0x70(%rbp,%rax,8), %xmm0
movslq -0x84(%rbp), %rax
mulsd -0x70(%rbp,%rax,8), %xmm0
divsd -0x78(%rbp), %xmm0
movslq -0x88(%rbp), %rcx
leaq -0xf0(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq -0x84(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0xa496
jmp 0xa4f7
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0xa483
jmp 0xa25d
movsd -0x100(%rbp), %xmm0
subsd -0x98(%rbp), %xmm0
movaps 0x27b89(%rip), %xmm1    # 0x320b0
pand %xmm1, %xmm0
movsd %xmm0, -0x108(%rbp)
movsd -0xf8(%rbp), %xmm0
subsd -0x90(%rbp), %xmm0
movaps 0x27b66(%rip), %xmm1    # 0x320b0
pand %xmm1, %xmm0
movsd %xmm0, -0x110(%rbp)
movsd 0x27aca(%rip), %xmm0    # 0x32028
ucomisd -0x108(%rbp), %xmm0
jb 0xa5d0
movsd 0x27ab8(%rip), %xmm0    # 0x32028
ucomisd -0x110(%rbp), %xmm0
jb 0xa5d0
movsd -0x100(%rbp), %xmm0
cvtsi2sdl -0x34(%rbp), %xmm1
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movsd -0xf8(%rbp), %xmm0
cvtsi2sdl -0x38(%rbp), %xmm1
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
jmp 0xaa23
leaq -0xf0(%rbp), %rdi
movsd -0x98(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
callq 0x2d5f0
movsd %xmm0, -0x120(%rbp)
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x130(%rbp)
movsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x138(%rbp)
movsd -0xf0(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xa62c
jp 0xa62c
jmp 0xa769
movl $0x0, -0x13c(%rbp)
cmpl $0x2, -0x13c(%rbp)
jge 0xa767
movsd -0x90(%rbp), %xmm0
movsd 0x279d5(%rip), %xmm1    # 0x32028
subsd %xmm1, %xmm0
cvtsi2sdl -0x13c(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0xf8(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd -0xf8(%rbp), %xmm2
movsd -0xe0(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
divsd -0xf0(%rbp), %xmm0
movsd %xmm0, -0x100(%rbp)
movsd -0x100(%rbp), %xmm0
subsd -0x98(%rbp), %xmm0
movaps 0x279e7(%rip), %xmm1    # 0x320b0
pand %xmm1, %xmm0
movsd %xmm0, -0x108(%rbp)
leaq -0xf0(%rbp), %rdi
movsd -0x100(%rbp), %xmm0
movsd -0xf8(%rbp), %xmm1
callq 0x2d5f0
movsd %xmm0, -0x128(%rbp)
movsd 0x27927(%rip), %xmm0    # 0x32028
ucomisd -0x108(%rbp), %xmm0
jb 0xa751
movsd -0x128(%rbp), %xmm1
movsd -0x120(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xa751
movsd -0x128(%rbp), %xmm0
movsd %xmm0, -0x120(%rbp)
movsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x130(%rbp)
movsd -0xf8(%rbp), %xmm0
movsd %xmm0, -0x138(%rbp)
jmp 0xa753
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0xa636
jmp 0xa769
movsd -0xd0(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xa781
jp 0xa781
jmp 0xa8be
movl $0x0, -0x13c(%rbp)
cmpl $0x2, -0x13c(%rbp)
jge 0xa8bc
movsd -0x98(%rbp), %xmm0
movsd 0x27880(%rip), %xmm1    # 0x32028
subsd %xmm1, %xmm0
cvtsi2sdl -0x13c(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x100(%rbp)
movsd -0xd8(%rbp), %xmm0
movsd -0x100(%rbp), %xmm2
movsd -0xc8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
divsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0xf8(%rbp)
movsd -0xf8(%rbp), %xmm0
subsd -0x90(%rbp), %xmm0
movaps 0x27892(%rip), %xmm1    # 0x320b0
pand %xmm1, %xmm0
movsd %xmm0, -0x110(%rbp)
leaq -0xf0(%rbp), %rdi
movsd -0x100(%rbp), %xmm0
movsd -0xf8(%rbp), %xmm1
callq 0x2d5f0
movsd %xmm0, -0x128(%rbp)
movsd 0x277d2(%rip), %xmm0    # 0x32028
ucomisd -0x110(%rbp), %xmm0
jb 0xa8a6
movsd -0x128(%rbp), %xmm1
movsd -0x120(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xa8a6
movsd -0x128(%rbp), %xmm0
movsd %xmm0, -0x120(%rbp)
movsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x130(%rbp)
movsd -0xf8(%rbp), %xmm0
movsd %xmm0, -0x138(%rbp)
jmp 0xa8a8
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0xa78b
jmp 0xa8be
movl $0x0, -0x88(%rbp)
cmpl $0x2, -0x88(%rbp)
jge 0xa9d2
movl $0x0, -0x84(%rbp)
cmpl $0x2, -0x84(%rbp)
jge 0xa9bc
movsd -0x98(%rbp), %xmm0
movsd 0x2772c(%rip), %xmm1    # 0x32028
subsd %xmm1, %xmm0
cvtsi2sdl -0x88(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x100(%rbp)
movsd -0x90(%rbp), %xmm0
movsd 0x27704(%rip), %xmm1    # 0x32028
subsd %xmm1, %xmm0
cvtsi2sdl -0x84(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0xf8(%rbp)
leaq -0xf0(%rbp), %rdi
movsd -0x100(%rbp), %xmm0
movsd -0xf8(%rbp), %xmm1
callq 0x2d5f0
movsd %xmm0, -0x128(%rbp)
movsd -0x128(%rbp), %xmm1
movsd -0x120(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xa9a6
movsd -0x128(%rbp), %xmm0
movsd %xmm0, -0x120(%rbp)
movsd -0x100(%rbp), %xmm0
movsd %xmm0, -0x130(%rbp)
movsd -0xf8(%rbp), %xmm0
movsd %xmm0, -0x138(%rbp)
jmp 0xa9a8
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0xa8df
jmp 0xa9be
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0xa8c8
movsd -0x130(%rbp), %xmm0
cvtsi2sdl -0x34(%rbp), %xmm1
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movsd -0x138(%rbp), %xmm0
cvtsi2sdl -0x38(%rbp), %xmm1
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x7c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0xa116
movq -0x40(%rbp), %rdi
callq 0x1030
movq -0x48(%rbp), %rdi
callq 0x1030
movq -0x50(%rbp), %rdi
callq 0x1030
movl $0x0, -0x4(%rbp)
jmp 0xaa77
movq -0x40(%rbp), %rdi
callq 0x1030
movq -0x48(%rbp), %rdi
callq 0x1030
movq -0x50(%rbp), %rdi
callq 0x1030
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)