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

```asm
<render_line_2D_WALA>:
  endbr64
  mov    %rdi,%rsi
  mov    %ecx,%eax
  mov    0x8(%rsp),%r10d
  movaps %xmm0,%xmm1
  pxor   %xmm4,%xmm4
  cvtsi2sd %r9d,%xmm4
  pxor   %xmm0,%xmm0
  cvtsi2sd %ecx,%xmm0
  subsd  %xmm0,%xmm4
  pxor   %xmm5,%xmm5
  cvtsi2sd %r10d,%xmm5
  pxor   %xmm0,%xmm0
  cvtsi2sd %r8d,%xmm0
  subsd  %xmm0,%xmm5
  movq   D1(%rip),%xmm0
  movapd %xmm4,%xmm2
  andpd  %xmm0,%xmm2
  andpd  %xmm5,%xmm0
  comisd %xmm0,%xmm2
  jbe    L39
  cmp    %ecx,%r9d
  jge    L3
  mov    %r8d,%ecx
  mov    %r10d,%r8d
  mov    %ecx,%r10d
  mov    %eax,%ecx
  mov    %r9d,%eax
  mov    %ecx,%r9d
L3:
  divsd  %xmm4,%xmm5
  pxor   %xmm3,%xmm3
  cvtsi2sd %eax,%xmm3
  movsd  D10(%rip),%xmm4
  movapd %xmm3,%xmm0
  addsd  %xmm4,%xmm0
  cvttsd2si %xmm0,%edi
  pxor   %xmm2,%xmm2
  cvtsi2sd %edi,%xmm2
  subsd  %xmm3,%xmm2
  mulsd  %xmm5,%xmm2
  pxor   %xmm3,%xmm3
  cvtsi2sd %r8d,%xmm3
  addsd  %xmm3,%xmm2
  subsd  %xmm0,%xmm0
  movsd  D31(%rip),%xmm3
  movapd %xmm3,%xmm7
  subsd  %xmm0,%xmm7
  cvttsd2si %xmm2,%r8d
  mov    %edx,%eax
  imul   %r8d,%eax
  lea    (%rdi,%rax,1),%ecx
  movslq %ecx,%rcx
  lea    (%rsi,%rcx,4),%rcx
  pxor   %xmm6,%xmm6
  cvtsi2sd %r8d,%xmm6
  movapd %xmm2,%xmm0
  subsd  %xmm6,%xmm0
  cvtss2sd %xmm1,%xmm1
  movapd %xmm3,%xmm6
  subsd  %xmm0,%xmm6
  mulsd  %xmm7,%xmm6
  mulsd  %xmm1,%xmm6
  pxor   %xmm8,%xmm8
  cvtss2sd (%rcx),%xmm8
  addsd  %xmm8,%xmm6
  cvtsd2ss %xmm6,%xmm6
  movss  %xmm6,(%rcx)
  add    %edx,%eax
  add    %edi,%eax
  cltq
  lea    (%rsi,%rax,4),%rax
  mulsd  %xmm7,%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm6,%xmm6
  cvtss2sd (%rax),%xmm6
  addsd  %xmm6,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  addsd  %xmm5,%xmm2
  pxor   %xmm6,%xmm6
  cvtsi2sd %r9d,%xmm6
  addsd  %xmm6,%xmm4
  cvttsd2si %xmm4,%r8d
  pxor   %xmm0,%xmm0
  cvtsi2sd %r8d,%xmm0
  subsd  %xmm6,%xmm0
  mulsd  %xmm5,%xmm0
  pxor   %xmm6,%xmm6
  cvtsi2sd %r10d,%xmm6
  addsd  %xmm6,%xmm0
  subsd  %xmm4,%xmm4
  cvttsd2si %xmm0,%r9d
  mov    %edx,%eax
  imul   %r9d,%eax
  lea    (%r8,%rax,1),%ecx
  movslq %ecx,%rcx
  lea    (%rsi,%rcx,4),%rcx
  pxor   %xmm6,%xmm6
  cvtsi2sd %r9d,%xmm6
  subsd  %xmm6,%xmm0
  subsd  %xmm0,%xmm3
  mulsd  %xmm4,%xmm3
  mulsd  %xmm1,%xmm3
  pxor   %xmm6,%xmm6
  cvtss2sd (%rcx),%xmm6
  addsd  %xmm6,%xmm3
  cvtsd2ss %xmm3,%xmm3
  movss  %xmm3,(%rcx)
  add    %edx,%eax
  add    %r8d,%eax
  cltq
  lea    (%rsi,%rax,4),%rax
  mulsd  %xmm4,%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm3,%xmm3
  cvtss2sd (%rax),%xmm3
  addsd  %xmm3,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  add    $0x1,%edi
  cmp    %edi,%r8d
  jle    L28
  movsd  D31(%rip),%xmm6
L1:
  cvttsd2si %xmm2,%r9d
  mov    %r9d,%eax
  imul   %edx,%eax
  lea    (%rax,%rdi,1),%ecx
  movslq %ecx,%rcx
  lea    (%rsi,%rcx,4),%rcx
  pxor   %xmm0,%xmm0
  cvtsi2sd %r9d,%xmm0
  movapd %xmm2,%xmm3
  subsd  %xmm0,%xmm3
  movapd %xmm6,%xmm0
  subsd  %xmm3,%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm4,%xmm4
  cvtss2sd (%rcx),%xmm4
  addsd  %xmm4,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rcx)
  add    %edx,%eax
  add    %edi,%eax
  cltq
  lea    (%rsi,%rax,4),%rax
  pxor   %xmm0,%xmm0
  cvtss2sd (%rax),%xmm0
  mulsd  %xmm1,%xmm3
  addsd  %xmm3,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  addsd  %xmm5,%xmm2
  add    $0x1,%edi
  cmp    %edi,%r8d
  jne    L1
  ret
L39:
  cmp    %r8d,%r10d
  jge    L15
  mov    %r8d,%ecx
  mov    %r10d,%r8d
  mov    %ecx,%r10d
  mov    %eax,%ecx
  mov    %r9d,%eax
  mov    %ecx,%r9d
L15:
  divsd  %xmm5,%xmm4
  pxor   %xmm2,%xmm2
  cvtsi2sd %r8d,%xmm2
  movsd  D10(%rip),%xmm5
  movapd %xmm2,%xmm0
  addsd  %xmm5,%xmm0
  cvttsd2si %xmm0,%edi
  pxor   %xmm3,%xmm3
  cvtsi2sd %edi,%xmm3
  subsd  %xmm2,%xmm3
  mulsd  %xmm4,%xmm3
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  addsd  %xmm2,%xmm3
  subsd  %xmm0,%xmm0
  movsd  D31(%rip),%xmm2
  movapd %xmm2,%xmm7
  subsd  %xmm0,%xmm7
  cvttsd2si %xmm3,%eax
  mov    %edi,%ecx
  imul   %edx,%ecx
  lea    (%rcx,%rax,1),%r8d
  movslq %r8d,%r8
  lea    (%rsi,%r8,4),%r8
  pxor   %xmm6,%xmm6
  cvtsi2sd %eax,%xmm6
  movapd %xmm3,%xmm0
  subsd  %xmm6,%xmm0
  cvtss2sd %xmm1,%xmm1
  movapd %xmm2,%xmm6
  subsd  %xmm0,%xmm6
  mulsd  %xmm7,%xmm6
  mulsd  %xmm1,%xmm6
  pxor   %xmm8,%xmm8
  cvtss2sd (%r8),%xmm8
  addsd  %xmm8,%xmm6
  cvtsd2ss %xmm6,%xmm6
  movss  %xmm6,(%r8)
  add    $0x1,%edi
  add    %edx,%ecx
  add    %ecx,%eax
  cltq
  lea    (%rsi,%rax,4),%rax
  mulsd  %xmm7,%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm6,%xmm6
  cvtss2sd (%rax),%xmm6
  addsd  %xmm6,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  addsd  %xmm4,%xmm3
  pxor   %xmm6,%xmm6
  cvtsi2sd %r10d,%xmm6
  addsd  %xmm6,%xmm5
  cvttsd2si %xmm5,%r10d
  pxor   %xmm0,%xmm0
  cvtsi2sd %r10d,%xmm0
  subsd  %xmm6,%xmm0
  mulsd  %xmm4,%xmm0
  pxor   %xmm6,%xmm6
  cvtsi2sd %r9d,%xmm6
  addsd  %xmm6,%xmm0
  subsd  %xmm5,%xmm5
  cvttsd2si %xmm0,%r8d
  mov    %r10d,%eax
  imul   %edx,%eax
  lea    (%rax,%r8,1),%r9d
  movslq %r9d,%r9
  lea    (%rsi,%r9,4),%r9
  pxor   %xmm6,%xmm6
  cvtsi2sd %r8d,%xmm6
  subsd  %xmm6,%xmm0
  subsd  %xmm0,%xmm2
  mulsd  %xmm5,%xmm2
  mulsd  %xmm1,%xmm2
  pxor   %xmm6,%xmm6
  cvtss2sd (%r9),%xmm6
  addsd  %xmm6,%xmm2
  cvtsd2ss %xmm2,%xmm2
  movss  %xmm2,(%r9)
  add    %edx,%eax
  add    %r8d,%eax
  cltq
  lea    (%rsi,%rax,4),%rax
  mulsd  %xmm5,%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm2,%xmm2
  cvtss2sd (%rax),%xmm2
  addsd  %xmm2,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  cmp    %r10d,%edi
  jge    L28
  movsd  D31(%rip),%xmm6
L34:
  cvttsd2si %xmm3,%r9d
  lea    (%rcx,%r9,1),%eax
  cltq
  shl    $0x2,%rax
  lea    (%rsi,%rax,1),%r8
  pxor   %xmm0,%xmm0
  cvtsi2sd %r9d,%xmm0
  movapd %xmm3,%xmm2
  subsd  %xmm0,%xmm2
  movapd %xmm6,%xmm0
  subsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm5,%xmm5
  cvtss2sd (%r8),%xmm5
  addsd  %xmm5,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%r8)
  lea    0x4(%rsi,%rax,1),%rax
  pxor   %xmm0,%xmm0
  cvtss2sd (%rax),%xmm0
  mulsd  %xmm1,%xmm2
  addsd  %xmm2,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  addsd  %xmm4,%xmm3
  add    $0x1,%edi
  add    %edx,%ecx
  cmp    %edi,%r10d
  jne    L34
L28:
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D1
data_type: qword
name: retrieve_data
arguments: tag: D10
data_type: f64
name: retrieve_data
arguments: tag: D31
data_type: f64

tool: D1: 9223372036854775807

tool: D10: 0.5

tool: D31: 1

assistant: ```c
void render_line_2D_WALA(float *mat, int wy, int wx, int x1, int y1, int x2, int y2, float val) {
  double dx = (double)x2 - (double)x1;
  double dy = (double)y2 - (double)y1;
  if (fabs(dx) > fabs(dy)) {
    if (x2 < x1) {
      do {
        __typeof__(x1) tmp;
        tmp = x1;
        x1 = x2;
        x2 = tmp;
      } while (0);
      do {
        __typeof__(y1) tmp;
        tmp = y1;
        y1 = y2;
        y2 = tmp;
      } while (0);
    }
    double gradient = dy / dx;
    double xend = ((int)(((double)(x1)) + 0.5));
    double yend = y1 + gradient * (xend - x1);
    double xgap = (1.0 - ((double)(x1 + 0.5) - (double)((int)x1 + 0.5)));
    int xpxl1 = xend;
    int ypxl1 = ((int)yend);
    mat[ypxl1 * wx + xpxl1] += ((1.0 - ((double)(yend) - (double)((int)yend))) * xgap * val);
    mat[(ypxl1 + 1) * wx + xpxl1] += (((double)(yend) - (double)((int)yend)) * xgap * val);
    double intery = yend + gradient;
    xend = ((int)(((double)(x2)) + 0.5));
    yend = y2 + gradient * (xend - x2);
    xgap = ((double)(x2 + 0.5) - (double)((int)x2 + 0.5));
    int xpxl2 = xend;
    int ypxl2 = ((int)yend);
    mat[ypxl2 * wx + xpxl2] += ((1.0 - ((double)(yend) - (double)((int)yend))) * xgap * val);
    mat[(ypxl2 + 1) * wx + xpxl2] += (((double)(yend) - (double)((int)yend)) * xgap * val);
    int x;
    for (x = xpxl1 + 1; x <= (xpxl2 - 1); x++) {
      mat[((int)intery) * wx + x] += ((1.0 - ((double)(intery) - (double)((int)intery))) * val);
      mat[(((int)intery) + 1) * wx + x] += (((double)(intery) - (double)((int)intery)) * val);
      intery += gradient;
    }
  } else {
    if (y2 < y1) {
      do {
        __typeof__(x1) tmp;
        tmp = x1;
        x1 = x2;
        x2 = tmp;
      } while (0);
      do {
        __typeof__(y1) tmp;
        tmp = y1;
        y1 = y2;
        y2 = tmp;
      } while (0);
    }
    double gradient = dx / dy;
    double yend = ((int)(((double)(y1)) + 0.5));
    double xend = x1 + gradient * (yend - y1);
    double ygap = (1.0 - ((double)(y1 + 0.5) - (double)((int)y1 + 0.5)));
    int ypxl1 = yend;
    int xpxl1 = ((int)xend);
    mat[ypxl1 * wx + xpxl1] += ((1.0 - ((double)(xend) - (double)((int)xend))) * ygap * val);
    mat[(ypxl1 + 1) * wx + xpxl1] += (((double)(xend) - (double)((int)xend)) * ygap * val);
    double interx = xend + gradient;
    yend = ((int)(((double)(y2)) + 0.5));
    xend = x2 + gradient * (yend - y2);
    ygap = ((double)(y2 + 0.5) - (double)((int)y2 + 0.5));
    int ypxl2 = yend;
    int xpxl2 = ((int)xend);
    mat[ypxl2 * wx + xpxl2] += ((1.0 - ((double)(xend) - (double)((int)xend))) * ygap * val);
    mat[(ypxl2 + 1) * wx + xpxl2] += (((double)(xend) - (double)((int)xend)) * ygap * val);
    int y;
    for (y = ypxl1 + 1; y <= (ypxl2 - 1); y++) {
      mat[y * wx + ((int)interx)] += ((1.0 - ((double)(interx) - (double)((int)interx))) * val);
      mat[y * wx + ((int)interx) + 1] += (((double)(interx) - (double)((int)interx)) * val);
      interx += gradient;
    }
  }
}
```