user: 请将以下的汇编代码转换成C语言代码：

```asm
<plotCubicBezier>:
  endbr64
  push   %r15
  mov    %ecx,%eax
  pxor   %xmm6,%xmm6
  pxor   %xmm1,%xmm1
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  mov    %edx,%esi
  push   %rbx
  mov    %edi,%ebx
  lea    (%rdi,%rsi,1),%r15d
  mov    %esi,%edi
  lea    0x0(%rbp,%rax,1),%r13d
  mov    %ebp,%r14d
  sub    %r8d,%r15d
  sub    %r8d,%edi
  sub    %r9d,%r13d
  cvtsi2ss %ebp,%xmm6
  sub    %eax,%r14d
  shl    $0x2,%edi
  sub    $0xf8,%rsp
  cvtsi2ss %ebx,%xmm1
  sub    %r9d,%r14d
  movslq %edi,%rdi
  mov    %fs:0x28,%rdx
  mov    %rdx,0xe8(%rsp)
  xor    %edx,%edx
  mov    %ebx,%edx
  sub    0x138(%rsp),%r13d
  sub    0x130(%rsp),%r15d
  sub    %esi,%edx
  add    %r8d,%esi
  add    0x138(%rsp),%r14d
  movslq %r15d,%rcx
  sub    %r8d,%edx
  shl    $0x2,%esi
  add    0x130(%rsp),%edx
  movslq %r13d,%r8
  movslq %edx,%r10
  movslq %esi,%rsi
  mov    %r8,%r11
  movss  %xmm6,0xc(%rsp)
  add    %r10,%rsi
  mov    %rsi,0x38(%rsp)
  mov    %eax,%esi
  add    %r9d,%eax
  sub    %r9d,%esi
  shl    $0x2,%eax
  mov    %rcx,%r9
  shl    $0x2,%esi
  cltq
  movslq %esi,%rsi
  sub    %rsi,%r11
  movslq %r14d,%rsi
  add    %rsi,%rax
  mov    %rax,0x40(%rsp)
  sub    %rdi,%r9
  je     L101
  mov    %r10,%rax
  pxor   %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  mov    %rcx,%rdi
  imul   %r10,%rax
  imul   %r9,%rdi
  sub    %rdi,%rax
  cvtsi2sd %rax,%xmm0
  comisd %xmm2,%xmm0
  ja     L104
L115:
  pxor   %xmm6,%xmm6
  pxor   %xmm7,%xmm7
  movsd  D62(%rip),%xmm3
  xor    %r12d,%r12d
  cvtsi2sd %r15d,%xmm6
  cvtsi2sd %edx,%xmm7
  movsd  %xmm6,0x30(%rsp)
  pxor   %xmm6,%xmm6
  movsd  %xmm7,0x88(%rsp)
  cvtsi2sd %r9,%xmm6
  movsd  %xmm6,0x90(%rsp)
L88:
  test   %r11,%r11
  je     L32
L132:
  mov    %rsi,%rax
  mov    %r8,%rdx
  pxor   %xmm0,%xmm0
  imul   %rsi,%rax
  imul   %r11,%rdx
  sub    %rdx,%rax
  cvtsi2sd %rax,%xmm0
  comisd %xmm2,%xmm0
  ja     L58
  pxor   %xmm6,%xmm6
  pxor   %xmm7,%xmm7
  cvtsi2sd %r13d,%xmm6
  cvtsi2sd %r11,%xmm7
  movsd  %xmm6,0x28(%rsp)
  pxor   %xmm6,%xmm6
  movsd  %xmm7,0x80(%rsp)
  cvtsi2sd %r14d,%xmm6
  movsd  %xmm6,0x78(%rsp)
L72:
  cmp    $0x1,%r12d
  jle    L220
L77:
  movsd  0xc0(%rsp),%xmm2
  mov    $0x1,%eax
  nopl   0x0(%rax,%rax,1)
L120:
  movslq %eax,%rdx
  movsd  0xc0(%rsp,%rdx,8),%xmm0
  comisd %xmm0,%xmm2
  jbe    L294
  sub    $0x1,%eax
  cltq
  movsd  %xmm0,0xc0(%rsp,%rax,8)
  mov    $0x1,%eax
  movsd  %xmm2,0xc0(%rsp,%rdx,8)
  movsd  0xc0(%rsp),%xmm2
  jmp    L120
  nopl   (%rax)
L58:
  ucomisd %xmm0,%xmm2
  ja     L150
  sqrtsd %xmm0,%xmm0
L224:
  pxor   %xmm6,%xmm6
  pxor   %xmm7,%xmm7
  movq   D11(%rip),%xmm4
  cvtsi2sd %r14d,%xmm6
  cvtsi2sd %r11,%xmm7
  movsd  %xmm6,0x78(%rsp)
  subsd  %xmm0,%xmm6
  movsd  %xmm7,0x80(%rsp)
  movapd %xmm6,%xmm2
  divsd  %xmm7,%xmm2
  movapd %xmm2,%xmm5
  andpd  %xmm4,%xmm5
  comisd %xmm5,%xmm3
  ja     L112
L84:
  pxor   %xmm7,%xmm7
  addsd  0x78(%rsp),%xmm0
  divsd  0x80(%rsp),%xmm0
  andpd  %xmm0,%xmm4
  cvtsi2sd %r13d,%xmm7
  comisd %xmm4,%xmm3
  movsd  %xmm7,0x28(%rsp)
  jbe    L72
  movslq %r12d,%rax
  add    $0x1,%r12d
  movsd  %xmm0,0xc0(%rsp,%rax,8)
  cmp    $0x1,%r12d
  jg     L77
  nopl   0x0(%rax,%rax,1)
L220:
  lea    (%rcx,%rcx,1),%rdi
  lea    (%r10,%r10,1),%r9
  pxor   %xmm6,%xmm6
  movslq %r12d,%r12
  pxor   %xmm7,%xmm7
  cvtsi2sd %rdi,%xmm6
  lea    (%r8,%r8,1),%rax
  add    %rcx,%rdi
  cvtsi2sd %r9,%xmm7
  lea    (%rsi,%rsi,1),%rdx
  add    %r10,%r9
  movsd  %xmm3,0xc0(%rsp,%r12,8)
  pxor   %xmm9,%xmm9
  pxor   %xmm8,%xmm8
  lea    0xc0(%rsp),%r15
  cvtsi2sdq 0x38(%rsp),%xmm9
  lea    0xc8(%rsp,%r12,8),%r12
  movsd  %xmm6,0x98(%rsp)
  pxor   %xmm6,%xmm6
  cvtsi2sdq 0x40(%rsp),%xmm8
  movsd  %xmm7,0x10(%rsp)
  pxor   %xmm7,%xmm7
  cvtsi2sd %rax,%xmm6
  add    %r8,%rax
  cvtsi2sd %rdx,%xmm7
  add    %rsi,%rdx
  movsd  %xmm6,0x18(%rsp)
  pxor   %xmm6,%xmm6
  movsd  %xmm7,0x20(%rsp)
  pxor   %xmm7,%xmm7
  cvtsi2sd %r9,%xmm6
  cvtsi2sd %rdi,%xmm7
  movsd  %xmm6,0xa0(%rsp)
  pxor   %xmm6,%xmm6
  movsd  %xmm7,0xa8(%rsp)
  pxor   %xmm7,%xmm7
  cvtsi2sd %rdx,%xmm6
  cvtsi2sd %rax,%xmm7
  movsd  %xmm6,0xb0(%rsp)
  movsd  D30(%rip),%xmm6
  movsd  %xmm7,0xb8(%rsp)
  movsd  D75(%rip),%xmm7
L323:
  movapd %xmm6,%xmm12
  movsd  (%r15),%xmm6
  mov    %ebx,%r13d
  mov    %ebp,%r14d
  movsd  0x88(%rsp),%xmm3
  pxor   %xmm0,%xmm0
  movsd  0x90(%rsp),%xmm14
  pxor   %xmm11,%xmm11
  movsd  0x98(%rsp),%xmm13
  cvtss2sd %xmm1,%xmm0
  movsd  0x80(%rsp),%xmm15
  cvtss2sd 0xc(%rsp),%xmm11
  movapd %xmm3,%xmm4
  movapd %xmm14,%xmm2
  movsd  %xmm9,0x60(%rsp)
  mulsd  %xmm12,%xmm4
  movsd  %xmm6,0x50(%rsp)
  mulsd  %xmm12,%xmm2
  movsd  %xmm8,0x48(%rsp)
  subsd  0x10(%rsp),%xmm2
  mulsd  %xmm6,%xmm14
  mulsd  %xmm6,%xmm3
  mulsd  %xmm12,%xmm2
  subsd  %xmm13,%xmm4
  addsd  0x30(%rsp),%xmm2
  mulsd  %xmm12,%xmm4
  mulsd  %xmm6,%xmm2
  subsd  %xmm2,%xmm4
  movapd %xmm15,%xmm2
  mulsd  %xmm12,%xmm2
  subsd  0x20(%rsp),%xmm2
  addsd  %xmm9,%xmm4
  mulsd  %xmm12,%xmm2
  mulsd  %xmm7,%xmm4
  addsd  0x28(%rsp),%xmm2
  mulsd  %xmm6,%xmm2
  subsd  %xmm0,%xmm4
  cvtsd2ss %xmm4,%xmm4
  movss  %xmm4,0x74(%rsp)
  movsd  0x78(%rsp),%xmm4
  movapd %xmm4,%xmm5
  mulsd  %xmm12,%xmm5
  subsd  0x18(%rsp),%xmm5
  mulsd  %xmm6,%xmm4
  mulsd  %xmm12,%xmm5
  subsd  %xmm2,%xmm5
  movapd %xmm3,%xmm2
  movapd %xmm14,%xmm3
  subsd  0x10(%rsp),%xmm3
  subsd  %xmm13,%xmm2
  addsd  %xmm8,%xmm5
  mulsd  %xmm6,%xmm3
  addsd  0x30(%rsp),%xmm3
  mulsd  %xmm6,%xmm2
  mulsd  %xmm7,%xmm5
  mulsd  %xmm12,%xmm3
  subsd  %xmm11,%xmm5
  subsd  %xmm3,%xmm2
  movapd %xmm4,%xmm3
  subsd  0x18(%rsp),%xmm3
  cvtsd2ss %xmm5,%xmm5
  movss  %xmm5,0x70(%rsp)
  addsd  %xmm9,%xmm2
  mulsd  %xmm6,%xmm3
  mulsd  %xmm7,%xmm2
  subsd  %xmm0,%xmm2
  movapd %xmm15,%xmm0
  mulsd  %xmm6,%xmm0
  cvtsd2ss %xmm2,%xmm2
  movss  %xmm2,0x6c(%rsp)
  movapd %xmm0,%xmm13
  subsd  0x20(%rsp),%xmm13
  mulsd  %xmm6,%xmm13
  addsd  0x28(%rsp),%xmm13
  mulsd  %xmm13,%xmm12
  subsd  %xmm12,%xmm3
  movss  0xc(%rsp),%xmm12
  addsd  %xmm8,%xmm3
  mulsd  %xmm7,%xmm3
  subsd  %xmm11,%xmm3
  movaps %xmm1,%xmm11
  movsd  0xa0(%rsp),%xmm1
  subsd  %xmm14,%xmm1
  cvtsd2ss %xmm3,%xmm3
  movss  %xmm3,0x68(%rsp)
  mulsd  %xmm6,%xmm1
  subsd  0xa8(%rsp),%xmm1
  mulsd  %xmm6,%xmm1
  addsd  %xmm9,%xmm1
  mulsd  %xmm7,%xmm1
  cvtsd2ss %xmm1,%xmm1
  subss  %xmm1,%xmm11
  movss  %xmm11,0x58(%rsp)
  movsd  0xb0(%rsp),%xmm11
  subsd  %xmm0,%xmm11
  movapd %xmm11,%xmm0
  mulsd  %xmm6,%xmm0
  subsd  0xb8(%rsp),%xmm0
  mulsd  %xmm6,%xmm0
  addsd  %xmm8,%xmm0
  mulsd  %xmm7,%xmm0
  pxor   %xmm7,%xmm7
  cvtsd2ss %xmm0,%xmm7
  subss  %xmm7,%xmm12
  movss  %xmm7,0xc(%rsp)
  movss  %xmm12,0x40(%rsp)
  movss  D32(%rip),%xmm0
  movss  %xmm1,0x38(%rsp)
  addss  %xmm1,%xmm0
  call   <floor@plt>
  movss  D32(%rip),%xmm0
  addss  0xc(%rsp),%xmm0
  mov    %eax,%ebx
  call   <floor@plt>
  movss  0x58(%rsp),%xmm10
  pxor   %xmm7,%xmm7
  movss  0x38(%rsp),%xmm1
  mov    %eax,%ebp
  mov    D75(%rip),%rax
  movss  0x40(%rsp),%xmm12
  ucomiss %xmm7,%xmm10
  movsd  0x48(%rsp),%xmm8
  movsd  0x50(%rsp),%xmm6
  movsd  0x60(%rsp),%xmm9
  movss  0x68(%rsp),%xmm3
  movq   %rax,%xmm7
  movss  0x6c(%rsp),%xmm2
  movss  0x70(%rsp),%xmm5
  movss  0x74(%rsp),%xmm4
  jp     L51
  je     L199
L51:
  mov    %r13d,%eax
  pxor   %xmm0,%xmm0
  sub    %ebx,%eax
  cvtsi2ss %eax,%xmm0
  divss  %xmm10,%xmm0
  mulss  %xmm0,%xmm4
  mulss  %xmm0,%xmm2
L199:
  pxor   %xmm0,%xmm0
  ucomiss %xmm0,%xmm12
  jp     L322
  je     L348
L322:
  mov    %r14d,%eax
  pxor   %xmm0,%xmm0
  sub    %ebp,%eax
  cvtsi2ss %eax,%xmm0
  divss  %xmm12,%xmm0
  mulss  %xmm0,%xmm5
  mulss  %xmm0,%xmm3
L348:
  cmp    %r13d,%ebx
  jne    L1
  cmp    %r14d,%ebp
  jne    L1
L130:
  add    $0x8,%r15
  cmp    %r15,%r12
  jne    L323
  mov    0xe8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L316
  add    $0xf8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L104:
  ucomisd %xmm0,%xmm2
  ja     L157
  sqrtsd %xmm0,%xmm0
L214:
  pxor   %xmm7,%xmm7
  pxor   %xmm6,%xmm6
  movq   D11(%rip),%xmm4
  movsd  D62(%rip),%xmm3
  cvtsi2sd %edx,%xmm7
  mov    $0x1,%r12d
  cvtsi2sd %r9,%xmm6
  movsd  %xmm7,0x88(%rsp)
  subsd  %xmm0,%xmm7
  movsd  %xmm6,0x90(%rsp)
  movapd %xmm7,%xmm5
  divsd  %xmm6,%xmm5
  movapd %xmm5,%xmm6
  andpd  %xmm4,%xmm6
  comisd %xmm6,%xmm3
  ja     L149
  movsd  0xc0(%rsp),%xmm5
  xor    %r12d,%r12d
L149:
  addsd  0x88(%rsp),%xmm0
  divsd  0x90(%rsp),%xmm0
  andpd  %xmm0,%xmm4
  movsd  %xmm5,0xc0(%rsp)
  comisd %xmm4,%xmm3
  ja     L295
  pxor   %xmm6,%xmm6
  cvtsi2sd %r15d,%xmm6
  movsd  %xmm6,0x30(%rsp)
L114:
  test   %r11,%r11
  jne    L132
L32:
  mov    %r8,%rdi
  mov    %rsi,0x10(%rsp)
  mov    %r10,0x28(%rsp)
  mov    %rcx,0x20(%rsp)
  mov    %r8,0x18(%rsp)
  movsd  %xmm3,0x58(%rsp)
  movsd  %xmm2,0x50(%rsp)
  movss  %xmm1,0x48(%rsp)
  call   <abs@plt>
  mov    0x10(%rsp),%rdi
  mov    %eax,%r15d
  call   <abs@plt>
  pxor   %xmm6,%xmm6
  mov    0x28(%rsp),%r10
  mov    0x10(%rsp),%rsi
  cvtsi2sd %r13d,%xmm6
  add    %eax,%eax
  mov    0x18(%rsp),%r8
  mov    0x20(%rsp),%rcx
  cmp    %eax,%r15d
  movss  0x48(%rsp),%xmm1
  movsd  0x50(%rsp),%xmm2
  movsd  0x58(%rsp),%xmm3
  movsd  %xmm6,0x28(%rsp)
  jge    L172
  movsd  %xmm2,0x80(%rsp)
  pxor   %xmm4,%xmm4
  movslq %r12d,%rax
  add    $0x1,%r12d
  cvtsi2sd %r14d,%xmm4
  movsd  %xmm4,0x78(%rsp)
  addsd  %xmm4,%xmm4
  divsd  %xmm4,%xmm6
  movsd  %xmm6,0xc0(%rsp,%rax,8)
  jmp    L72
  xchg   %ax,%ax
L294:
  add    $0x1,%eax
  cmp    %eax,%r12d
  jle    L220
  movapd %xmm0,%xmm2
  jmp    L120
  nopl   (%rax)
L1:
  pxor   %xmm0,%xmm0
  movss  %xmm1,0x40(%rsp)
  mov    %r14d,%esi
  mov    %r13d,%edi
  pxor   %xmm10,%xmm10
  cvtsi2ss %r13d,%xmm0
  movsd  %xmm8,0x50(%rsp)
  cvtsi2ss %r14d,%xmm10
  movsd  %xmm9,0x48(%rsp)
  movsd  %xmm6,0x38(%rsp)
  push   %rbp
  addss  %xmm0,%xmm2
  addss  %xmm4,%xmm0
  push   %rbx
  addss  %xmm10,%xmm3
  addss  %xmm5,%xmm10
  cvttss2si %xmm0,%edx
  cvttss2si %xmm10,%ecx
  cvttss2si %xmm3,%r9d
  cvttss2si %xmm2,%r8d
  call   <plotCubicBezierSeg@plt>
  pop    %rax
  mov    D75(%rip),%rax
  pop    %rdx
  movsd  0x50(%rsp),%xmm8
  movsd  0x48(%rsp),%xmm9
  movss  0x40(%rsp),%xmm1
  movq   %rax,%xmm7
  movsd  0x38(%rsp),%xmm6
  jmp    L130
  nopl   0x0(%rax)
L101:
  mov    %rcx,%rdi
  mov    %rsi,0x48(%rsp)
  mov    %r11,0x30(%rsp)
  mov    %r8,0x28(%rsp)
  mov    %r10,0x10(%rsp)
  mov    %edx,0x20(%rsp)
  mov    %rcx,0x18(%rsp)
  movss  %xmm1,0x50(%rsp)
  mov    %r9,0x58(%rsp)
  call   <abs@plt>
  mov    0x10(%rsp),%rdi
  mov    %eax,%r12d
  call   <abs@plt>
  mov    0x10(%rsp),%r10
  mov    0x18(%rsp),%rcx
  add    %eax,%eax
  mov    0x20(%rsp),%edx
  mov    0x28(%rsp),%r8
  cmp    %eax,%r12d
  mov    0x30(%rsp),%r11
  mov    0x48(%rsp),%rsi
  movss  0x50(%rsp),%xmm1
  jge    L296
  pxor   %xmm2,%xmm2
  pxor   %xmm6,%xmm6
  movsd  D62(%rip),%xmm3
  mov    $0x1,%r12d
  cvtsi2sd %edx,%xmm2
  cvtsi2sd %r15d,%xmm6
  movsd  %xmm2,0x88(%rsp)
  addsd  %xmm2,%xmm2
  movsd  %xmm6,0x30(%rsp)
  divsd  %xmm2,%xmm6
  pxor   %xmm2,%xmm2
  movsd  %xmm2,0x90(%rsp)
  movsd  %xmm6,0xc0(%rsp)
  jmp    L88
L296:
  mov    0x58(%rsp),%r9
  pxor   %xmm2,%xmm2
  jmp    L115
  xchg   %ax,%ax
L172:
  movsd  %xmm2,0x80(%rsp)
  pxor   %xmm7,%xmm7
  cvtsi2sd %r14d,%xmm7
  movsd  %xmm7,0x78(%rsp)
  jmp    L72
  nopl   (%rax)
L295:
  pxor   %xmm6,%xmm6
  movslq %r12d,%rax
  add    $0x1,%r12d
  movsd  %xmm0,0xc0(%rsp,%rax,8)
  cvtsi2sd %r15d,%xmm6
  movsd  %xmm6,0x30(%rsp)
  jmp    L114
  nopl   0x0(%rax)
L112:
  movslq %r12d,%rax
  add    $0x1,%r12d
  movsd  %xmm2,0xc0(%rsp,%rax,8)
  jmp    L84
L150:
  mov    %rsi,0x48(%rsp)
  mov    %r11,0x28(%rsp)
  mov    %r8,0x20(%rsp)
  mov    %r10,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  movsd  %xmm3,0x58(%rsp)
  movss  %xmm1,0x50(%rsp)
  call   <sqrt@plt>
  movsd  0x58(%rsp),%xmm3
  movss  0x50(%rsp),%xmm1
  mov    0x48(%rsp),%rsi
  mov    0x28(%rsp),%r11
  mov    0x20(%rsp),%r8
  mov    0x18(%rsp),%r10
  mov    0x10(%rsp),%rcx
  jmp    L224
L157:
  mov    %rsi,0x50(%rsp)
  mov    %r11,0x48(%rsp)
  mov    %r8,0x30(%rsp)
  mov    %r10,0x28(%rsp)
  mov    %r9,0x20(%rsp)
  mov    %rcx,0x18(%rsp)
  mov    %edx,0x10(%rsp)
  movsd  %xmm2,0x60(%rsp)
  movss  %xmm1,0x58(%rsp)
  call   <sqrt@plt>
  movsd  0x60(%rsp),%xmm2
  movss  0x58(%rsp),%xmm1
  mov    0x50(%rsp),%rsi
  mov    0x48(%rsp),%r11
  mov    0x30(%rsp),%r8
  mov    0x28(%rsp),%r10
  mov    0x20(%rsp),%r9
  mov    0x18(%rsp),%rcx
  mov    0x10(%rsp),%edx
  jmp    L214
L316:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D62
datatype: f64
name: retrieve_data
arguments: label: D11
datatype: qword
name: retrieve_data
arguments: label: D30
datatype: f32[2]
name: retrieve_data
arguments: label: D75
datatype: f32[2]
name: retrieve_data
arguments: label: D32
datatype: f32

tool: D62: 1

tool: D11: 9223372036854775807

tool: {"D30": [0.0,-1.875]}

tool: {"D75": [0.0,1.5]}

tool: D32: 0.5

assistant: ```c
void plotCubicBezier(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) {
  int n = 0, i = 0;
  long xc = x0 + x1 - x2 - x3, xa = xc - 4 * (x1 - x2);
  long xb = x0 - x1 - x2 + x3, xd = xb + 4 * (x1 + x2);
  long yc = y0 + y1 - y2 - y3, ya = yc - 4 * (y1 - y2);
  long yb = y0 - y1 - y2 + y3, yd = yb + 4 * (y1 + y2);
  float fx0 = x0, fx1, fx2, fx3, fy0 = y0, fy1, fy2, fy3;
  double t1 = xb * xb - xa * xc, t2, t[5];
  if (xa == 0) {
    if (abs(xc) < 2 * abs(xb))
      t[n++] = xc / (2.0 * xb);
  } else if (t1 > 0.0) {
    t2 = sqrt(t1);
    t1 = (xb - t2) / xa;
    if (fabs(t1) < 1.0)
      t[n++] = t1;
    t1 = (xb + t2) / xa;
    if (fabs(t1) < 1.0)
      t[n++] = t1;
  }
  t1 = yb * yb - ya * yc;
  if (ya == 0) {
    if (abs(yc) < 2 * abs(yb))
      t[n++] = yc / (2.0 * yb);
  } else if (t1 > 0.0) {
    t2 = sqrt(t1);
    t1 = (yb - t2) / ya;
    if (fabs(t1) < 1.0)
      t[n++] = t1;
    t1 = (yb + t2) / ya;
    if (fabs(t1) < 1.0)
      t[n++] = t1;
  }
  for (i = 1; i < n; i++)
    if ((t1 = t[i - 1]) > t[i]) {
      t[i - 1] = t[i];
      t[i] = t1;
      i = 0;
    }
  t1 = -1.0;
  t[n] = 1.0;
  for (i = 0; i <= n; i++) {
    t2 = t[i];
    fx1 = (t1 * (t1 * xb - 2 * xc) - t2 * (t1 * (t1 * xa - 2 * xb) + xc) + xd) / 8 - fx0;
    fy1 = (t1 * (t1 * yb - 2 * yc) - t2 * (t1 * (t1 * ya - 2 * yb) + yc) + yd) / 8 - fy0;
    fx2 = (t2 * (t2 * xb - 2 * xc) - t1 * (t2 * (t2 * xa - 2 * xb) + xc) + xd) / 8 - fx0;
    fy2 = (t2 * (t2 * yb - 2 * yc) - t1 * (t2 * (t2 * ya - 2 * yb) + yc) + yd) / 8 - fy0;
    fx0 -= fx3 = (t2 * (t2 * (3 * xb - t2 * xa) - 3 * xc) + xd) / 8;
    fy0 -= fy3 = (t2 * (t2 * (3 * yb - t2 * ya) - 3 * yc) + yd) / 8;
    x3 = floor(fx3 + 0.5);
    y3 = floor(fy3 + 0.5);
    if (fx0 != 0.0) {
      fx1 *= fx0 = (x0 - x3) / fx0;
      fx2 *= fx0;
    }
    if (fy0 != 0.0) {
      fy1 *= fy0 = (y0 - y3) / fy0;
      fy2 *= fy0;
    }
    if (x0 != x3 || y0 != y3)
      plotCubicBezierSeg(x0, y0, x0 + fx1, y0 + fy1, x0 + fx2, y0 + fy2, x3, y3);
    x0 = x3;
    y0 = y3;
    fx0 = fx3;
    fy0 = fy3;
    t1 = t2;
  }
}
```