// File: /workspace/github_c_makefile_star2_O2/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 $0x90, %rsp
movq %rsi, %r15
movq %rdi, %r14
andq $0x0, 0x38(%rsp)
movq 0x20(%rdi), %r12
movq %r12, 0x48(%rsp)
movq 0x28(%rdi), %r13
movq %r13, 0x50(%rsp)
movupd 0x30(%rdi), %xmm0
movupd %xmm0, 0x58(%rsp)
movsd 0x40(%rdi), %xmm1
movsd %xmm1, 0x40(%rsp)
movsd %xmm1, 0x68(%rsp)
movapd %xmm0, 0x80(%rsp)
movlpd %xmm0, 0x78(%rsp)
pushq $0x18
popq %rdi
callq 0x1180
testq %rax, %rax
je 0xb276
movq %rax, %rbx
testq %r12, %r12
je 0xb22f
movapd 0x80(%rsp), %xmm3
movapd %xmm3, %xmm2
unpckhpd %xmm3, %xmm2            # xmm2 = xmm2[1],xmm3[1]
xorpd %xmm0, %xmm0
mulsd %xmm2, %xmm0
mulsd 0x10907(%rip), %xmm2    # 0x1baf8
addsd %xmm3, %xmm0
movsd 0x10903(%rip), %xmm1    # 0x1bb00
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
movsd 0x40(%rsp), %xmm4
ucomisd %xmm2, %xmm4
jbe 0xb236
andq $0x0, (%rsp)
movabsq $0x3fb999999999999a, %rax # imm = 0x3FB999999999999A
movq %rax, 0x28(%rsp)
jmp 0xb257
andq $0x0, (%rsp)
jmp 0xb257
movq %r12, (%rsp)
movq %r13, 0x8(%rsp)
movsd %xmm4, 0x20(%rsp)
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x18(%rsp)
movsd %xmm3, 0x30(%rsp)
leaq 0x38(%rsp), %rsi
movq %rsp, %rcx
movq %r15, %rdi
movq %r14, %rdx
callq 0xa723
testl %eax, %eax
je 0xb27d
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
jmp 0xb357
andl $0x0, (%rbx)
movq 0x38(%rsp), %r15
movq %r15, 0x8(%rbx)
andq $0x0, 0x10(%rbx)
leaq 0x48(%rsp), %r12
movq %rsp, %rsi
movq %r12, %rdi
callq 0xb36b
movq (%r12), %rax
testq %rax, %rax
je 0xb305
movupd 0x58(%rsp), %xmm1
movsd 0x60(%rsp), %xmm0
movsd 0x1083d(%rip), %xmm2    # 0x1baf8
mulsd %xmm0, %xmm2
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
movsd 0x10831(%rip), %xmm0    # 0x1bb00
mulpd %xmm1, %xmm0
addpd %xmm2, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
subsd %xmm0, %xmm2
movsd 0x68(%rsp), %xmm1
ucomisd %xmm2, %xmm1
jbe 0xb30c
andq $0x0, (%rsp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x28(%rsp)
jmp 0xb332
andq $0x0, (%rsp)
jmp 0xb332
movq %rax, (%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
movsd %xmm1, 0x20(%rsp)
movupd %xmm0, 0x10(%rsp)
movsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movq %rsp, %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x7804
testl %eax, %eax
je 0xb34a
movl $0x1, (%rbx)
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
callq 0xb36b
movq %rbx, %rax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq