// File: /workspace/github_c_makefile_star2_O0/yui0[P]img2vec/./potracelib.h
// Function: smooth
static void smooth(privcurve_t *curve, double alphamax) {
  int m = curve->n;
  int i, j, k;
  double dd, denom, alpha;
  dpoint_t p2, p3, p4;
  /* examine each vertex and find its best fit */
  for (i=0; i<m; i++) {
    j = mod(i+1, m);
    k = mod(i+2, m);
    p4 = interval(1/2.0, curve->vertex[k], curve->vertex[j]);
    denom = ddenom(curve->vertex[i], curve->vertex[k]);
    if (denom != 0.0) {
      dd = dpara(curve->vertex[i], curve->vertex[j], curve->vertex[k]) / denom;
      dd = fabs(dd);
      alpha = dd>1 ? (1 - 1.0/dd) : 0;
      alpha = alpha / 0.75;
    } else {
      alpha = 4/3.0;
    }
    curve->alpha0[j] = alpha;	 /* remember "original" value of alpha */
    if (alpha >= alphamax) {  /* pointed corner */
      curve->tag[j] = POTRACE_CORNER;
      curve->c[j][1] = curve->vertex[j];
      curve->c[j][2] = p4;
    } else {
      if (alpha < 0.55) {
	alpha = 0.55;
      } else if (alpha > 1) {
	alpha = 1;
      }
      p2 = interval(.5+.5*alpha, curve->vertex[i], curve->vertex[j]);
      p3 = interval(.5+.5*alpha, curve->vertex[k], curve->vertex[j]);
      curve->tag[j] = POTRACE_CURVETO;
      curve->c[j][0] = p2;
      curve->c[j][1] = p3;
      curve->c[j][2] = p4;
    }
    curve->alpha[j] = alpha;	/* store the "cropped" value of alpha */
    curve->beta[j] = 0.5;
  }
  curve->alphacurve = 1;
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xafb9
movl -0x18(%rbp), %edi
addl $0x1, %edi
movl -0x14(%rbp), %esi
callq 0x2ca20
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %edi
addl $0x2, %edi
movl -0x14(%rbp), %esi
callq 0x2ca20
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x1c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movsd (%rcx), %xmm1
movsd 0x8(%rcx), %xmm2
movsd (%rax), %xmm3
movsd 0x8(%rax), %xmm4
movsd 0x27446(%rip), %xmm0    # 0x32028
callq 0x2d6b0
movsd %xmm0, -0x78(%rbp)
movsd %xmm1, -0x70(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x18(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x20(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movsd (%rcx), %xmm0
movsd 0x8(%rcx), %xmm1
movsd (%rax), %xmm2
movsd 0x8(%rax), %xmm3
callq 0x2d720
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xac58
jp 0xac58
jmp 0xad38
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdx
movslq -0x18(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x1c(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x20(%rbp), %rsi
shlq $0x4, %rsi
addq %rsi, %rax
movsd (%rdx), %xmm0
movsd 0x8(%rdx), %xmm1
movsd (%rcx), %xmm2
movsd 0x8(%rcx), %xmm3
movsd (%rax), %xmm4
movsd 0x8(%rax), %xmm5
callq 0x2d7b0
divsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movaps 0x273e9(%rip), %xmm1    # 0x320b0
pand %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd 0x2733b(%rip), %xmm1    # 0x32018
ucomisd %xmm1, %xmm0
jbe 0xad06
movsd 0x2732d(%rip), %xmm1    # 0x32018
divsd -0x28(%rbp), %xmm1
movsd 0x27320(%rip), %xmm0    # 0x32018
subsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
jmp 0xad13
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
jmp 0xad13
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
movsd 0x2730b(%rip), %xmm1    # 0x32038
divsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
jmp 0xad45
movsd 0x272f0(%rip), %xmm0    # 0x32030
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x1c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x38(%rbp), %xmm0
ucomisd -0x10(%rbp), %xmm0
jb 0xadd7
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl $0x2, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
movq 0x20(%rcx), %rcx
movslq -0x1c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq -0x68(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq -0x60(%rbp), %rcx
movq %rcx, 0x28(%rax)
jmp 0xaf7c
movsd 0x27261(%rip), %xmm0    # 0x32040
ucomisd -0x38(%rbp), %xmm0
jbe 0xadf5
movsd 0x27252(%rip), %xmm0    # 0x32040
movsd %xmm0, -0x38(%rbp)
jmp 0xae17
movsd -0x38(%rbp), %xmm0
movsd 0x27216(%rip), %xmm1    # 0x32018
ucomisd %xmm1, %xmm0
jbe 0xae15
movsd 0x27208(%rip), %xmm0    # 0x32018
movsd %xmm0, -0x38(%rbp)
jmp 0xae17
movsd -0x38(%rbp), %xmm0
movsd 0x27204(%rip), %xmm1    # 0x32028
mulsd %xmm1, %xmm0
addsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x18(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x1c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movsd (%rcx), %xmm1
movsd 0x8(%rcx), %xmm2
movsd (%rax), %xmm3
movsd 0x8(%rax), %xmm4
callq 0x2d6b0
movsd %xmm0, -0x88(%rbp)
movsd %xmm1, -0x80(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x40(%rbp)
movsd -0x38(%rbp), %xmm0
movsd 0x27192(%rip), %xmm1    # 0x32028
mulsd %xmm1, %xmm0
addsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x20(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x1c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movsd (%rcx), %xmm1
movsd 0x8(%rcx), %xmm2
movsd (%rax), %xmm3
movsd 0x8(%rax), %xmm4
callq 0x2d6b0
movsd %xmm0, -0x98(%rbp)
movsd %xmm1, -0x90(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq -0x48(%rbp), %rcx
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq -0x58(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x50(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq -0x68(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq -0x60(%rbp), %rcx
movq %rcx, 0x28(%rax)
movsd -0x38(%rbp), %xmm0
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x1c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x1c(%rbp), %rcx
movsd 0x27082(%rip), %xmm0    # 0x32028
movsd %xmm0, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xab74
movq -0x8(%rbp), %rax
movl $0x1, 0x18(%rax)
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)