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

```asm
<cast_light>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %edi,0x44(%rsp)
  mov    %esi,0x4c(%rsp)
  mov    %ecx,0x2c(%rsp)
  mov    %r8d,0x30(%rsp)
  mov    %r9d,0x5c(%rsp)
  mov    0xa8(%rsp),%r15d
  movss  %xmm0,0x10(%rsp)
  movss  %xmm1,0x28(%rsp)
  comiss %xmm0,%xmm1
  ja     L44
  mov    %rdx,%r14
  cmp    0xb0(%rsp),%r15d
  jg     L44
  mov    0xb0(%rsp),%eax
  imul   %eax,%eax
  mov    %eax,0x34(%rsp)
  mov    0xc8(%rsp),%eax
  add    0xd0(%rsp),%eax
  mov    %eax,0x54(%rsp)
  neg    %eax
  imul   %edi,%eax
  sub    0xc0(%rsp),%eax
  sub    0xb8(%rsp),%eax
  mov    %eax,0x58(%rsp)
  mov    %r15d,%eax
  neg    %eax
  mov    %eax,%edx
  imul   0xd0(%rsp),%edx
  mov    %r15d,%ecx
  imul   0xc8(%rsp),%ecx
  sub    %ecx,%edx
  mov    %edx,%ecx
  add    0xa0(%rsp),%ecx
  mov    %ecx,0x40(%rsp)
  imul   0xc0(%rsp),%eax
  mov    %r15d,%edx
  imul   0xb8(%rsp),%edx
  sub    %edx,%eax
  add    %r9d,%eax
  mov    %eax,%esi
  mov    %eax,0x3c(%rsp)
  mov    %edi,%eax
  imul   %ecx,%eax
  add    %esi,%eax
  mov    %eax,0x38(%rsp)
  mov    0xb8(%rsp),%eax
  add    0xc0(%rsp),%eax
  mov    %eax,0x50(%rsp)
  imul   0xc8(%rsp),%edi
  mov    %edi,%eax
  add    0xb8(%rsp),%eax
  mov    %eax,0x20(%rsp)
  jmp    L215
L200:
  test   %esi,%esi
  je     L186
  cltq
  mov    0x2c(%rsp),%edi
  xor    (%r14,%rax,4),%edi
  test   %edi,0x30(%rsp)
  jne    L53
  movss  %xmm2,0x10(%rsp)
  mov    $0x0,%esi
L38:
  test   %ebx,%ebx
  jg     L154
L142:
  add    0x20(%rsp),%r13d
  add    0xb8(%rsp),%ebp
  add    0xc8(%rsp),%r12d
L6:
  add    $0x1,%ebx
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  movapd %xmm1,%xmm0
  addsd  D28(%rip),%xmm0
  divsd  0x8(%rsp),%xmm0
  pxor   %xmm3,%xmm3
  cvtsd2ss %xmm0,%xmm3
  movss  %xmm3,0x14(%rsp)
  comiss 0x10(%rsp),%xmm3
  ja     L38
  subsd  D28(%rip),%xmm1
  movsd  0x18(%rsp),%xmm0
  addsd  D28(%rip),%xmm0
  divsd  %xmm0,%xmm1
  cvtsd2ss %xmm1,%xmm1
  movss  0x28(%rsp),%xmm6
  comiss %xmm1,%xmm6
  ja     L154
  mov    %r13d,%eax
  mov    %ebx,%edx
  imul   %ebx,%edx
  add    0x24(%rsp),%edx
  cmp    0x34(%rsp),%edx
  jge    L200
  mov    %ebp,%edx
  or     %r12d,%edx
  js     L200
  cmp    0x44(%rsp),%ebp
  jge    L200
  cmp    0x4c(%rsp),%r12d
  jge    L200
  movslq %r13d,%rdx
  mov    0xf0(%rsp),%r11
  lea    (%r11,%rdx,4),%rdx
  cmpl   $0x0,(%rdx)
  jne    L200
  movl   $0x1,(%rdx)
  mov    0xe8(%rsp),%rdx
  movslq (%rdx),%rdx
  mov    0xd8(%rsp),%r11
  mov    %ebp,(%r11,%rdx,4)
  mov    0xe8(%rsp),%rcx
  movslq (%rcx),%rdx
  mov    0xe0(%rsp),%rcx
  mov    %r12d,(%rcx,%rdx,4)
  mov    0xe8(%rsp),%rdi
  addl   $0x1,(%rdi)
  jmp    L200
L186:
  cltq
  mov    0x2c(%rsp),%ecx
  xor    (%r14,%rax,4),%ecx
  test   %ecx,0x30(%rsp)
  je     L38
  cmp    %r15d,0xb0(%rsp)
  jle    L38
  sub    $0x8,%rsp
  push   0xf8(%rsp)
  push   0xf8(%rsp)
  push   0xf8(%rsp)
  push   0xf8(%rsp)
  mov    0xf8(%rsp),%eax
  push   %rax
  mov    0xf8(%rsp),%eax
  push   %rax
  mov    0xf8(%rsp),%eax
  push   %rax
  mov    0xf8(%rsp),%eax
  push   %rax
  mov    0xf8(%rsp),%eax
  push   %rax
  mov    0x98(%rsp),%eax
  add    $0x1,%eax
  push   %rax
  mov    0xf8(%rsp),%eax
  push   %rax
  movss  0x70(%rsp),%xmm0
  mov    0xbc(%rsp),%r9d
  mov    0x90(%rsp),%r8d
  mov    0x8c(%rsp),%ecx
  mov    %r14,%rdx
  mov    0xac(%rsp),%esi
  mov    0xa4(%rsp),%edi
  call   <cast_light>
  add    $0x60,%rsp
L53:
  test   %ebx,%ebx
  jg     L44
  movss  0x14(%rsp),%xmm2
  mov    $0x1,%esi
  jmp    L142
L154:
  test   %esi,%esi
  jne    L44
L122:
  add    $0x1,%r15d
  mov    0x58(%rsp),%edi
  add    %edi,0x38(%rsp)
  mov    0x50(%rsp),%ecx
  sub    %ecx,0x3c(%rsp)
  mov    0x54(%rsp),%esi
  sub    %esi,0x40(%rsp)
  cmp    %r15d,0xb0(%rsp)
  jl     L44
L215:
  mov    %r15d,0x48(%rsp)
  mov    %r15d,%ebx
  not    %ebx
  mov    %r15d,%eax
  neg    %eax
  cmp    $0xffffffff,%r15d
  jl     L122
  mov    %r15d,%esi
  imul   %r15d,%esi
  mov    %esi,0x24(%rsp)
  mov    0x40(%rsp),%r12d
  mov    0x3c(%rsp),%ebp
  mov    0x38(%rsp),%r13d
  mov    $0x0,%esi
  pxor   %xmm7,%xmm7
  cvtsi2sd %eax,%xmm7
  movsd  %xmm7,0x18(%rsp)
  subsd  D28(%rip),%xmm7
  movsd  %xmm7,0x8(%rsp)
  jmp    L6
L44:
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: data_label: D28
type_infered: f64

tool: D28: 0.5

assistant: ```c
void cast_light(int width, int height, unsigned int *flags, unsigned int flag, unsigned int mask, int cx, int cy, int row, float start, float end, int radius, int xx, int xy, int yx, int yy, int *xs, int *ys, int *n, int *tmp) {
  if (start < end)
    return;
  for (int j = row; j <= radius; ++j) {
    int dx = -j - 1, dy = -j;
    int blocked = 0;
    while (dx <= 0) {
      dx += 1;
      int X = cx + dx * xx + dy * xy;
      int Y = cy + dx * yx + dy * yy;
      float l_slope = (dx - 0.5) / (dy + 0.5);
      float r_slope = (dx + 0.5) / (dy - 0.5);
      float new_start;
      if (start < r_slope) {
        continue;
      } else if (end > l_slope) {
        break;
      } else {
        int IDX = X + Y * width;
        if (dx * dx + dy * dy < radius * radius && X >= 0 && Y >= 0 && X < width && Y < height) {
          if (tmp[IDX] == 0) {
            tmp[IDX] = 1;
            xs[*n] = X;
            ys[*n] = Y;
            (*n) += 1;
          }
        }
        if (blocked) {
          if ((flags[IDX] & mask) != (flag & mask)) {
            new_start = r_slope;
            continue;
          } else {
            blocked = 0;
            start = new_start;
          }
        } else {
          if (((flags[IDX] & mask) != (flag & mask)) && j < radius) {
            blocked = 1;
            cast_light(width, height, flags, flag, mask, cx, cy, j + 1, start, l_slope, radius, xx, xy, yx, yy, xs, ys, n, tmp);
            new_start = r_slope;
          }
        }
      }
    }
    if (blocked) {
      break;
    }
  }
}
```