user: Please show me the C implementation that matches the assembly code listed below:

```asm
<pet_c_raycasting>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x30(%rsp),%rbx
  mov    0x40(%rsp),%rbp
  mov    0x50(%rsp),%r12
  mov    0x78(%rsp),%r13d
  pxor   %xmm6,%xmm6
  cvtsi2ssl 0x70(%rsp),%xmm6
  mov    %r13d,%eax
  add    0x70(%rsp),%eax
  pxor   %xmm11,%xmm11
  cvtsi2ssl 0x80(%rsp),%xmm11
  test   %esi,%esi
  jle    L404
  mov    %rdi,%r10
  mov    %rdx,%r11
  pxor   %xmm14,%xmm14
  cvtsi2ss %eax,%xmm14
  mov    %esi,%r9d
  mov    $0x0,%eax
  pxor   %xmm10,%xmm10
  movaps %xmm10,%xmm9
  jmp    L408
L425:
  movaps %xmm6,%xmm0
  subss  %xmm8,%xmm0
  divss  %xmm1,%xmm0
  movaps %xmm14,%xmm5
  subss  %xmm8,%xmm5
  divss  %xmm1,%xmm5
  comiss %xmm5,%xmm0
  jbe    L368
  movaps %xmm0,%xmm4
  movaps %xmm5,%xmm0
  movaps %xmm4,%xmm5
  jmp    L368
L332:
  movaps %xmm6,%xmm7
  subss  %xmm13,%xmm7
  divss  %xmm2,%xmm7
  movaps %xmm14,%xmm4
  subss  %xmm13,%xmm4
  divss  %xmm2,%xmm4
  comiss %xmm4,%xmm7
  jbe    L163
  movaps %xmm7,%xmm15
  movaps %xmm4,%xmm7
  movaps %xmm15,%xmm4
L163:
  maxss  %xmm0,%xmm7
  movaps %xmm7,%xmm0
  minss  %xmm5,%xmm4
  movaps %xmm4,%xmm5
  jmp    L6
L115:
  pxor   %xmm7,%xmm7
  subss  %xmm12,%xmm7
  divss  %xmm3,%xmm7
  movaps %xmm11,%xmm4
  subss  %xmm12,%xmm4
  divss  %xmm3,%xmm4
  comiss %xmm4,%xmm7
  jbe    L64
  movaps %xmm7,%xmm15
  movaps %xmm4,%xmm7
  movaps %xmm15,%xmm4
L64:
  maxss  %xmm0,%xmm7
  movaps %xmm7,%xmm0
  minss  %xmm5,%xmm4
  movaps %xmm4,%xmm5
  jmp    L208
L249:
  pxor   %xmm4,%xmm4
  cvtsi2ss %r13d,%xmm4
  subss  D142(%rip),%xmm4
  jmp    L390
L63:
  pxor   %xmm7,%xmm7
  cvtsi2ss %r13d,%xmm7
  subss  D142(%rip),%xmm7
  jmp    L219
L98:
  movaps %xmm11,%xmm0
  subss  D142(%rip),%xmm0
  jmp    L12
L418:
  pxor   %xmm1,%xmm1
  cvtsi2ss %r13d,%xmm1
  subss  D142(%rip),%xmm1
  movaps %xmm1,%xmm8
  jmp    L43
L51:
  pxor   %xmm2,%xmm2
  cvtsi2ss %r13d,%xmm2
  subss  D142(%rip),%xmm2
  movaps %xmm2,%xmm13
  jmp    L91
L167:
  movaps %xmm11,%xmm12
  subss  D142(%rip),%xmm12
  jmp    L345
L237:
  mov    0x60(%rsp),%rcx
  movl   $0x1,(%rcx,%rax,4)
L275:
  add    $0x1,%rax
  cmp    %r9,%rax
  je     L404
L408:
  movss  (%r10,%rax,4),%xmm8
  movss  (%r11,%rax,4),%xmm13
  movss  (%r8,%rax,4),%xmm12
  movss  (%rbx,%rax,4),%xmm1
  subss  %xmm8,%xmm1
  movss  0x0(%rbp,%rax,4),%xmm2
  subss  %xmm13,%xmm2
  movss  (%r12,%rax,4),%xmm3
  subss  %xmm12,%xmm3
  ucomiss %xmm10,%xmm1
  jp     L425
  ucomiss D42(%rip),%xmm1
  jne    L425
  movss  D121(%rip),%xmm5
  movss  D175(%rip),%xmm0
L368:
  ucomiss %xmm9,%xmm2
  jp     L332
  ucomiss D42(%rip),%xmm2
  jne    L332
L6:
  pxor   %xmm7,%xmm7
  ucomiss %xmm7,%xmm3
  jp     L115
  jne    L115
L208:
  movaps %xmm0,%xmm4
  mulss  %xmm1,%xmm4
  addss  %xmm8,%xmm4
  comiss %xmm6,%xmm4
  jb     L275
  comiss %xmm4,%xmm14
  jb     L275
  movaps %xmm0,%xmm7
  mulss  %xmm2,%xmm7
  addss  %xmm13,%xmm7
  comiss %xmm6,%xmm7
  jb     L275
  comiss %xmm7,%xmm14
  jb     L275
  mulss  %xmm3,%xmm0
  addss  %xmm12,%xmm0
  comiss D42(%rip),%xmm0
  jb     L275
  comiss %xmm0,%xmm11
  jb     L275
  subss  %xmm6,%xmm4
  subss  %xmm6,%xmm7
  pxor   %xmm15,%xmm15
  cvtss2sd %xmm4,%xmm15
  addsd  D42(%rip),%xmm15
  cvttsd2si %xmm15,%r14d
  cmp    %r13d,%r14d
  je     L249
L390:
  pxor   %xmm15,%xmm15
  cvtss2sd %xmm7,%xmm15
  addsd  D42(%rip),%xmm15
  cvttsd2si %xmm15,%r14d
  cmp    %r13d,%r14d
  je     L63
L219:
  pxor   %xmm15,%xmm15
  cvtss2sd %xmm0,%xmm15
  addsd  D42(%rip),%xmm15
  cvttsd2si %xmm15,%r14d
  cmp    0x80(%rsp),%r14d
  je     L98
L12:
  mulss  %xmm5,%xmm1
  addss  %xmm1,%xmm8
  movss  %xmm4,(%r10,%rax,4)
  movss  %xmm7,(%r11,%rax,4)
  movss  %xmm0,(%r8,%rax,4)
  comiss %xmm6,%xmm8
  jb     L275
  comiss %xmm8,%xmm14
  jb     L275
  mulss  %xmm5,%xmm2
  addss  %xmm2,%xmm13
  comiss %xmm6,%xmm13
  jb     L275
  comiss %xmm13,%xmm14
  jb     L275
  mulss  %xmm3,%xmm5
  addss  %xmm5,%xmm12
  comiss D42(%rip),%xmm12
  jb     L275
  comiss %xmm12,%xmm11
  jb     L275
  subss  %xmm6,%xmm8
  subss  %xmm6,%xmm13
  pxor   %xmm5,%xmm5
  cvtss2sd %xmm8,%xmm5
  addsd  D42(%rip),%xmm5
  cvttsd2si %xmm5,%edx
  cmp    %r13d,%edx
  je     L418
L43:
  pxor   %xmm5,%xmm5
  cvtss2sd %xmm13,%xmm5
  addsd  D42(%rip),%xmm5
  cvttsd2si %xmm5,%edx
  cmp    %r13d,%edx
  je     L51
L91:
  pxor   %xmm5,%xmm5
  cvtss2sd %xmm12,%xmm5
  addsd  D42(%rip),%xmm5
  cvttsd2si %xmm5,%edx
  cmp    0x80(%rsp),%edx
  je     L167
L345:
  movss  %xmm8,(%rbx,%rax,4)
  movss  %xmm13,0x0(%rbp,%rax,4)
  movss  %xmm12,(%r12,%rax,4)
  cvttss2si %xmm4,%ecx
  cvttss2si %xmm8,%edx
  cmp    %edx,%ecx
  jne    L237
  cvttss2si %xmm7,%ecx
  cvttss2si %xmm13,%edx
  cmp    %edx,%ecx
  jne    L237
  cvttss2si %xmm0,%ecx
  cvttss2si %xmm12,%edx
  cmp    %edx,%ecx
  jne    L237
  jmp    L275
L404:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D142
datatype: byte[4]
name: disassemble_data
arguments: tag: D42
datatype: f64
name: disassemble_data
arguments: tag: D121
datatype: byte[4]
name: disassemble_data
arguments: tag: D175
datatype: byte[4]

tool: {"D142": [0x00,0x00,0x80,0x3f]}

tool: D42: 0.5

tool: {"D121": [0x28,0x6b,0x6e,0x4e]}

tool: {"D175": [0x28,0x6b,0x6e,0xce]}

assistant: ```c
void pet_c_raycasting(float *x1, int nx1, float *y1, int ny1, float *z1, int nz1, float *x2, int nx2, float *y2, int ny2, float *z2, int nz2, int *enable, int nenable, int border, int ROIxy, int ROIz) {
  int i, chk1, chk2;
  float xd, yd, zd, xmin, ymin, zmin, xmax, ymax, zmax;
  float tmin, tmax, tymin, tymax, tzmin, tzmax, buf;
  float xi1, yi1, zi1, xp1, yp1, zp1, xp2, yp2, zp2;
  xmin = (float)border;
  xmax = (float)(border + ROIxy);
  ymin = (float)border;
  ymax = (float)(border + ROIxy);
  zmin = 0.0f;
  zmax = (float)ROIz;
  for (i = 0; i < nx1; ++i) {
    xi1 = x1[i];
    yi1 = y1[i];
    zi1 = z1[i];
    xd = x2[i] - xi1;
    yd = y2[i] - yi1;
    zd = z2[i] - zi1;
    tmin = -1e9f;
    tmax = 1e9f;
    if (xd != 0.0f) {
      tmin = (xmin - xi1) / xd;
      tmax = (xmax - xi1) / xd;
      if (tmin > tmax) {
        buf = tmin;
        tmin = tmax;
        tmax = buf;
      }
    }
    if (yd != 0.0f) {
      tymin = (ymin - yi1) / yd;
      tymax = (ymax - yi1) / yd;
      if (tymin > tymax) {
        buf = tymin;
        tymin = tymax;
        tymax = buf;
      }
      if (tymin > tmin) {
        tmin = tymin;
      }
      if (tymax < tmax) {
        tmax = tymax;
      }
    }
    if (zd != 0.0f) {
      tzmin = (zmin - zi1) / zd;
      tzmax = (zmax - zi1) / zd;
      if (tzmin > tzmax) {
        buf = tzmin;
        tzmin = tzmax;
        tzmax = buf;
      }
      if (tzmin > tmin) {
        tmin = tzmin;
      }
      if (tzmax < tmax) {
        tmax = tzmax;
      }
    }
    xp1 = xi1 + xd * tmin;
    yp1 = yi1 + yd * tmin;
    zp1 = zi1 + zd * tmin;
    xp2 = xi1 + xd * tmax;
    yp2 = yi1 + yd * tmax;
    zp2 = zi1 + zd * tmax;
    chk1 = 0;
    chk2 = 0;
    if (xp1 >= xmin && xp1 <= xmax) {
      if (yp1 >= ymin && yp1 <= ymax) {
        if (zp1 >= zmin && zp1 <= zmax) {
          xp1 -= border;
          yp1 -= border;
          if ((int)(xp1 + 0.5) == ROIxy) {
            xp1 = ROIxy - 1.0f;
          }
          if ((int)(yp1 + 0.5) == ROIxy) {
            yp1 = ROIxy - 1.0f;
          }
          if ((int)(zp1 + 0.5) == ROIz) {
            zp1 = ROIz - 1.0f;
          }
          x1[i] = xp1;
          y1[i] = yp1;
          z1[i] = zp1;
          chk1 = 1;
        } else {
          continue;
        }
      } else {
        continue;
      }
    } else {
      continue;
    }
    if (xp2 >= xmin && xp2 <= xmax) {
      if (yp2 >= ymin && yp2 <= ymax) {
        if (zp2 >= zmin && zp2 <= zmax) {
          xp2 -= border;
          yp2 -= border;
          if ((int)(xp2 + 0.5) == ROIxy) {
            xp2 = ROIxy - 1.0f;
          }
          if ((int)(yp2 + 0.5) == ROIxy) {
            yp2 = ROIxy - 1.0f;
          }
          if ((int)(zp2 + 0.5) == ROIz) {
            zp2 = ROIz - 1.0f;
          }
          x2[i] = xp2;
          y2[i] = yp2;
          z2[i] = zp2;
          chk2 = 1;
        } else {
          continue;
        }
      } else {
        continue;
      }
    } else {
      continue;
    }
    if (chk1 && chk2) {
      if ((int)xp1 == (int)xp2 && (int)yp1 == (int)yp2 && (int)zp1 == (int)zp2) {
        continue;
      }
      enable[i] = 1;
    }
  }
}
```