// File: /workspace/github_c_makefile_star2_O1/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 $0x60, %rsp
movq %rsi, %r12
movq %rdi, %r15
movq $0x0, 0x58(%rsp)
movq 0x20(%rdi), %r13
movq 0x28(%rdi), %r14
movsd 0x30(%rdi), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x38(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x40(%rdi), %xmm0
movsd %xmm0, (%rsp)
movl $0x18, %edi
callq 0x1190
testq %rax, %rax
je 0xc333
movq %rax, %rbx
testq %r13, %r13
je 0xc2e5
xorpd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x10(%rsp), %xmm3
addsd %xmm3, %xmm0
movsd 0x13824(%rip), %xmm2    # 0x1fac8
mulsd %xmm1, %xmm2
movsd 0x13820(%rip), %xmm1    # 0x1fad0
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
movsd (%rsp), %xmm4
ucomisd %xmm2, %xmm4
jbe 0xc2f0
movq $0x0, 0x20(%rsp)
movabsq $0x3fb999999999999a, %rax # imm = 0x3FB999999999999A
movq %rax, 0x48(%rsp)
jmp 0xc312
movq $0x0, 0x20(%rsp)
jmp 0xc312
movq %r13, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movsd %xmm4, 0x40(%rsp)
movsd %xmm0, 0x30(%rsp)
movsd %xmm1, 0x38(%rsp)
movsd %xmm3, 0x50(%rsp)
leaq 0x58(%rsp), %rsi
leaq 0x20(%rsp), %rcx
movq %r12, %rdi
movq %r15, %rdx
callq 0xb4fe
testl %eax, %eax
je 0xc346
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl $0x0, (%rbx)
movq 0x58(%rsp), %r12
movq %r12, 0x8(%rbx)
movq $0x0, 0x10(%rbx)
movsd 0x10(%rsp), %xmm2
movapd %xmm2, %xmm4
testq %r13, %r13
je 0xc3d7
cmpq $0x0, 0x20(%rsp)
je 0xc37c
movsd 0x50(%rsp), %xmm4
jmp 0xc3d7
movsd 0x48(%rsp), %xmm3
movsd 0x136f6(%rip), %xmm1    # 0x1fa80
ucomisd %xmm1, %xmm3
movapd %xmm1, %xmm0
subsd %xmm3, %xmm0
movsd 0x8(%rsp), %xmm1
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
jne 0xc3ac
jnp 0xc3bf
movapd %xmm2, %xmm1
addsd (%rsp), %xmm1
ucomisd %xmm1, %xmm0
movapd %xmm2, %xmm4
jb 0xc3d7
movq %r14, %rdi
movsd %xmm0, 0x18(%rsp)
callq *%r13
movsd 0x10(%rsp), %xmm2
movsd 0x18(%rsp), %xmm4
testq %r13, %r13
movsd %xmm4, 0x18(%rsp)
je 0xc43d
movsd 0x136de(%rip), %xmm1    # 0x1fac8
movsd 0x8(%rsp), %xmm3
mulsd %xmm3, %xmm1
movsd 0x136d4(%rip), %xmm0    # 0x1fad0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm3, %xmm1
movapd %xmm1, %xmm2
subsd %xmm0, %xmm2
movsd (%rsp), %xmm3
ucomisd %xmm2, %xmm3
jbe 0xc448
movq $0x0, 0x20(%rsp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x48(%rsp)
jmp 0xc46a
movq $0x0, 0x20(%rsp)
jmp 0xc46a
movq %r13, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movsd %xmm3, 0x40(%rsp)
movsd %xmm0, 0x30(%rsp)
movsd %xmm1, 0x38(%rsp)
movsd %xmm4, 0x50(%rsp)
leaq 0x20(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x7deb
testl %eax, %eax
je 0xc484
movl $0x1, (%rbx)
testq %r13, %r13
movsd 0x10(%rsp), %xmm0
je 0xc335
cmpq $0x0, 0x20(%rsp)
jne 0xc335
movsd 0x48(%rsp), %xmm2
movsd 0x135d3(%rip), %xmm1    # 0x1fa80
ucomisd %xmm1, %xmm2
subsd %xmm2, %xmm1
movsd 0x8(%rsp), %xmm3
mulsd %xmm2, %xmm3
mulsd %xmm1, %xmm0
addsd %xmm3, %xmm0
jne 0xc4cb
jnp 0xc4e0
movsd (%rsp), %xmm1
addsd 0x18(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jb 0xc335
movq %r14, %rdi
callq *%r13
jmp 0xc335