// File: /workspace/github_c_makefile_star2_O3/yui0[P]img2vec/./potracelib.h
// Function: potrace_trace
potrace_state_t *potrace_trace(const potrace_param_t *param, const potrace_bitmap_t *bm) {
  int r;
  path_t *plist = NULL;
  potrace_state_t *st;
  progress_t prog;
  progress_t subprog;
  
  /* prepare private progress bar state */
  prog.callback = param->progress.callback;
  prog.data = param->progress.data;
  prog.min = param->progress.min;
  prog.max = param->progress.max;
  prog.epsilon = param->progress.epsilon;
  prog.d_prev = param->progress.min;
  /* allocate state object */
  st = (potrace_state_t *)malloc(sizeof(potrace_state_t));
  if (!st) {
    return NULL;
  }
  progress_subrange_start(0.0, 0.1, &prog, &subprog);
  /* process the image */
  r = bm_to_pathlist(bm, &plist, param, &subprog);
  if (r) {
    free(st);
    return NULL;
  }
  st->status = POTRACE_STATUS_OK;
  st->plist = plist;
  st->priv = NULL;  /* private state currently unused */
  progress_subrange_end(&prog, &subprog);
  progress_subrange_start(0.1, 1.0, &prog, &subprog);
  /* partial success. */
  r = process_path(plist, param, &subprog);
  if (r) {
    st->status = POTRACE_STATUS_INCOMPLETE;
  }
  progress_subrange_end(&prog, &subprog);
  return st;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rsi, %r12
movq %rdi, %r15
movq $0x0, 0x68(%rsp)
movq 0x20(%rdi), %r13
movq 0x28(%rdi), %r14
movsd 0x30(%rdi), %xmm0
movaps %xmm0, 0x50(%rsp)
movsd 0x38(%rdi), %xmm0
movaps %xmm0, 0x70(%rsp)
movsd 0x40(%rdi), %xmm0
movsd %xmm0, 0x10(%rsp)
movl $0x18, %edi
callq 0x1180
testq %rax, %rax
je 0xc231
movq %rax, %rbx
testq %r13, %r13
je 0xc1e3
xorpd %xmm0, %xmm0
movapd 0x70(%rsp), %xmm1
mulsd %xmm1, %xmm0
movapd 0x50(%rsp), %xmm3
addsd %xmm3, %xmm0
movsd 0x14a67(%rip), %xmm2    # 0x20c08
mulsd %xmm1, %xmm2
movsd 0x14a63(%rip), %xmm1    # 0x20c10
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
movsd 0x10(%rsp), %xmm4
ucomisd %xmm2, %xmm4
jbe 0xc1ee
movq $0x0, 0x18(%rsp)
movabsq $0x3fb999999999999a, %rax # imm = 0x3FB999999999999A
movq %rax, 0x40(%rsp)
jmp 0xc210
movq $0x0, 0x18(%rsp)
jmp 0xc210
movq %r13, 0x18(%rsp)
movq %r14, 0x20(%rsp)
movsd %xmm4, 0x38(%rsp)
movsd %xmm0, 0x28(%rsp)
movsd %xmm1, 0x30(%rsp)
movsd %xmm3, 0x48(%rsp)
leaq 0x68(%rsp), %rsi
leaq 0x18(%rsp), %rcx
movq %r12, %rdi
movq %r15, %rdx
callq 0xb470
testl %eax, %eax
je 0xc247
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl $0x0, (%rbx)
movq 0x68(%rsp), %r12
movq %r12, 0x8(%rbx)
movq $0x0, 0x10(%rbx)
testq %r13, %r13
je 0xc27f
cmpq $0x0, 0x18(%rsp)
movapd 0x50(%rsp), %xmm2
movsd 0x10(%rsp), %xmm3
je 0xc299
movsd 0x48(%rsp), %xmm4
jmp 0xc2f9
movq $0x0, 0x18(%rsp)
movapd 0x50(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0xc371
movsd 0x40(%rsp), %xmm4
movsd 0x14911(%rip), %xmm1    # 0x20bb8
ucomisd %xmm1, %xmm4
movapd %xmm1, %xmm0
subsd %xmm4, %xmm0
movapd 0x70(%rsp), %xmm1
mulsd %xmm4, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
jne 0xc2c9
jnp 0xc2db
movapd %xmm2, %xmm1
addsd %xmm3, %xmm1
ucomisd %xmm1, %xmm0
movapd %xmm2, %xmm4
jb 0xc2f9
movq %r14, %rdi
movsd %xmm0, 0x8(%rsp)
callq *%r13
movsd 0x10(%rsp), %xmm3
movapd 0x50(%rsp), %xmm2
movsd 0x8(%rsp), %xmm4
movsd 0x14907(%rip), %xmm1    # 0x20c08
movapd 0x70(%rsp), %xmm0
mulsd %xmm0, %xmm1
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movsd 0x148f5(%rip), %xmm0    # 0x20c10
mulpd %xmm2, %xmm0
addpd %xmm1, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
subsd %xmm0, %xmm1
ucomisd %xmm1, %xmm3
movsd %xmm4, 0x8(%rsp)
jbe 0xc355
movq $0x0, 0x18(%rsp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x40(%rsp)
jmp 0xc371
movq %r13, 0x18(%rsp)
movq %r14, 0x20(%rsp)
movsd %xmm3, 0x38(%rsp)
movupd %xmm0, 0x28(%rsp)
movsd %xmm4, 0x48(%rsp)
leaq 0x18(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x7ef0
testl %eax, %eax
je 0xc38b
movl $0x1, (%rbx)
testq %r13, %r13
je 0xc233
cmpq $0x0, 0x18(%rsp)
jne 0xc233
movsd 0x40(%rsp), %xmm0
movsd 0x1480a(%rip), %xmm1    # 0x20bb8
ucomisd %xmm1, %xmm0
subsd %xmm0, %xmm1
movapd 0x70(%rsp), %xmm2
mulsd %xmm0, %xmm2
movapd 0x50(%rsp), %xmm0
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
jne 0xc3d2
jnp 0xc3e8
movsd 0x10(%rsp), %xmm1
addsd 0x8(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jb 0xc233
movq %r14, %rdi
callq *%r13
jmp 0xc233