// File: /workspace/github_c_makefile_star2_O0/yui0[P]img2vec/./potracelib.h
// Function: calc_sums
static int calc_sums(privpath_t *pp) {
  int i, x, y;
  int n = pp->len;
  SAFE_CALLOC(pp->sums, pp->len+1, sums_t);
  /* origin */
  pp->x0 = pp->pt[0].x;
  pp->y0 = pp->pt[0].y;
  /* preparatory computation for later fast summing */
  pp->sums[0].x2 = pp->sums[0].xy = pp->sums[0].y2 = pp->sums[0].x = pp->sums[0].y = 0;
  for (i=0; i<n; i++) {
    x = pp->pt[i].x - pp->x0;
    y = pp->pt[i].y - pp->y0;
    pp->sums[i+1].x = pp->sums[i].x + x;
    pp->sums[i+1].y = pp->sums[i].y + y;
    pp->sums[i+1].x2 = pp->sums[i].x2 + (double)x*x;
    pp->sums[i+1].xy = pp->sums[i].xy + (double)x*y;
    pp->sums[i+1].y2 = pp->sums[i].y2 + (double)y*y;
  }
  return 0;  
 calloc_error:
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
movl $0x28, %esi
callq 0x1120
movq -0x10(%rbp), %rcx
movq %rax, 0x20(%rcx)
cmpq $0x0, %rax
jne 0x8bee
jmp 0x8e28
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rax)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x8e1f
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x18(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x1c(%rcx), %rcx
subq %rcx, %rax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
cvtsi2sdl -0x18(%rbp), %xmm1
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
cvtsi2sdl -0x1c(%rbp), %xmm1
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm1
cvtsi2sdl -0x18(%rbp), %xmm0
cvtsi2sdl -0x18(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movsd 0x18(%rax), %xmm1
cvtsi2sdl -0x18(%rbp), %xmm0
cvtsi2sdl -0x1c(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm1
cvtsi2sdl -0x1c(%rbp), %xmm0
cvtsi2sdl -0x1c(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x20(%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x8c6d
movl $0x0, -0x4(%rbp)
jmp 0x8e2f
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)