user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<bezier>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,%ebp
  mov    %esi,%r12d
  mov    %edx,%esi
  mov    %r8d,%r13d
  mov    %r9d,%r14d
  mov    %edi,%r8d
  sub    %edx,%r8d
  movslq %r8d,%r8
  mov    %r12d,%edi
  sub    %ecx,%edi
  movslq %edi,%rdi
  mov    %r9d,%eax
  sub    %ecx,%eax
  cltq
  mov    %r13d,%edx
  sub    %esi,%edx
  movslq %edx,%rdx
  mov    %rax,%r9
  imul   %r8,%r9
  mov    %rdx,%r10
  imul   %rdi,%r10
  sub    %r10,%r9
  pxor   %xmm2,%xmm2
  cvtsi2sd %r9,%xmm2
  mov    %rdx,%r10
  imul   %rdx,%r10
  mov    %rax,%r9
  imul   %rax,%r9
  add    %r9,%r10
  mov    %r8,%r9
  imul   %r8,%r9
  mov    %rdi,%r11
  imul   %rdi,%r11
  add    %r11,%r9
  cmp    %r9,%r10
  jle    L91
  xorpd  D34(%rip),%xmm2
  mov    %r12d,%r9d
  mov    %r14d,%r12d
  mov    %r9d,%r14d
  mov    %ebp,%r9d
  mov    %r13d,%ebp
  mov    %r9d,%r13d
L91:
  ucomisd D16(%rip),%xmm2
  jp     L30
  je     L1
L30:
  add    %r8,%rdx
  cmp    %r13d,%ebp
  setl   %bl
  movzbl %bl,%ebx
  lea    -0x1(%rbx,%rbx,1),%ebx
  movslq %ebx,%r8
  imul   %rdx,%r8
  add    %rdi,%rax
  cmp    %r14d,%r12d
  setl   %r15b
  movzbl %r15b,%r15d
  lea    -0x1(%r15,%r15,1),%r15d
  movslq %r15d,%rdx
  imul   %rdx,%rax
  mov    %r8,%rdx
  imul   %rax,%rdx
  add    %rdx,%rdx
  imul   %r8,%r8
  imul   %rax,%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %r15d,%xmm1
  movapd %xmm0,%xmm3
  mulsd  %xmm2,%xmm3
  mulsd  %xmm1,%xmm3
  pxor   %xmm4,%xmm4
  comisd %xmm3,%xmm4
  ja     L22
L43:
  pxor   %xmm6,%xmm6
  cvtsi2sd %rdx,%xmm6
  movsd  %xmm6,0x18(%rsp)
  movsd  D39(%rip),%xmm3
  mulsd  %xmm3,%xmm1
  mulsd  %xmm2,%xmm1
  sub    %ebp,%esi
  pxor   %xmm4,%xmm4
  cvtsi2sd %esi,%xmm4
  mulsd  %xmm4,%xmm1
  pxor   %xmm4,%xmm4
  cvtsi2sd %r8,%xmm4
  addsd  %xmm4,%xmm1
  subsd  %xmm6,%xmm1
  movapd %xmm1,%xmm7
  movsd  %xmm1,(%rsp)
  mulsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm0
  mov    %r12d,%edx
  sub    %ecx,%edx
  pxor   %xmm1,%xmm1
  cvtsi2sd %edx,%xmm1
  mulsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  addsd  %xmm1,%xmm0
  movapd %xmm0,%xmm3
  subsd  %xmm6,%xmm3
  movsd  %xmm3,0x8(%rsp)
  lea    (%r8,%r8,1),%rcx
  mov    %rcx,0x20(%rsp)
  add    %rax,%rax
  mov    %rax,0x28(%rsp)
  addsd  %xmm3,%xmm7
  movapd %xmm7,%xmm0
  addsd  %xmm6,%xmm0
  movsd  %xmm0,0x10(%rsp)
  jmp    L51
L22:
  neg    %r8
  neg    %rax
  neg    %rdx
  xorpd  D34(%rip),%xmm2
  jmp    L43
L114:
  movsd  %xmm1,(%rsp)
L117:
  movsd  (%rsp),%xmm4
  comisd 0x8(%rsp),%xmm4
  jbe    L1
L51:
  mov    %r12d,%esi
  mov    %ebp,%edi
  call   <setPixel@plt>
  cmp    %r13d,%ebp
  jne    L111
  cmp    %r14d,%r12d
  je     L29
L111:
  movsd  0x10(%rsp),%xmm5
  movapd %xmm5,%xmm0
  addsd  %xmm5,%xmm0
  movsd  0x8(%rsp),%xmm6
  movsd  (%rsp),%xmm1
  comisd %xmm6,%xmm0
  jbe    L12
  add    %ebx,%ebp
  movsd  (%rsp),%xmm1
  subsd  0x18(%rsp),%xmm1
  pxor   %xmm2,%xmm2
  cvtsi2sdq 0x28(%rsp),%xmm2
  addsd  %xmm6,%xmm2
  movsd  %xmm2,0x8(%rsp)
  addsd  %xmm2,%xmm5
  movsd  %xmm5,0x10(%rsp)
L12:
  movsd  (%rsp),%xmm7
  comisd %xmm0,%xmm7
  jbe    L114
  add    %r15d,%r12d
  movsd  0x8(%rsp),%xmm4
  subsd  0x18(%rsp),%xmm4
  movsd  %xmm4,0x8(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sdq 0x20(%rsp),%xmm0
  movapd %xmm0,%xmm7
  addsd  %xmm1,%xmm7
  movsd  %xmm7,(%rsp)
  movsd  0x10(%rsp),%xmm3
  addsd  %xmm7,%xmm3
  movsd  %xmm3,0x10(%rsp)
  jmp    L117
L1:
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    %r12d,%esi
  mov    %ebp,%edi
  call   <line@plt>
L29:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D34
type_guessed: byte[16]
name: disassemble_data
arguments: tag: D16
type_guessed: byte[8]
name: disassemble_data
arguments: tag: D39
type_guessed: f64

tool: {"D34": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D16": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: D39: 4

assistant: ```c
void bezier(int x0, int y0, int x1, int y1, int x2, int y2) {
  int sx = x2 - x1, sy = y2 - y1;
  long xx = x0 - x1, yy = y0 - y1, xy;
  double dx, dy, err, cur = xx * sy - yy * sx;
  if (sx * (long)sx + sy * (long)sy > xx * xx + yy * yy) {
    x2 = x0;
    x0 = sx + x1;
    y2 = y0;
    y0 = sy + y1;
    cur = -cur;
  }
  if (cur != 0) {
    xx += sx;
    xx *= sx = x0 < x2 ? 1 : -1;
    yy += sy;
    yy *= sy = y0 < y2 ? 1 : -1;
    xy = 2 * xx * yy;
    xx *= xx;
    yy *= yy;
    if (cur * sx * sy < 0) {
      xx = -xx;
      yy = -yy;
      xy = -xy;
      cur = -cur;
    }
    dx = 4.0 * sy * cur * (x1 - x0) + xx - xy;
    dy = 4.0 * sx * cur * (y0 - y1) + yy - xy;
    xx += xx;
    yy += yy;
    err = dx + dy + xy;
    do {
      setPixel(x0, y0);
      if (x0 == x2 && y0 == y2)
        return;
      y1 = 2 * err < dx;
      if (2 * err > dy) {
        x0 += sx;
        dx -= xy;
        err += dy += yy;
      }
      if (y1) {
        y0 += sy;
        dy -= xy;
        err += dx += xx;
      }
    } while (dy < dx);
  }
  line(x0, y0, x2, y2);
}
```