user: Converte this assembly snippet into its equivalent C code:

```asm
<pet_c_raycasting>:
  endbr64
  push   %rbp
  pxor   %xmm7,%xmm7
  pxor   %xmm14,%xmm14
  push   %rbx
  mov    0x60(%rsp),%ebx
  mov    0x58(%rsp),%eax
  mov    0x18(%rsp),%r9
  mov    0x28(%rsp),%r10
  mov    0x38(%rsp),%r11
  cvtsi2ssl 0x58(%rsp),%xmm7
  add    %ebx,%eax
  cvtsi2ssl 0x68(%rsp),%xmm14
  test   %esi,%esi
  jle    L262
  pxor   %xmm13,%xmm13
  mov    %rdi,%rcx
  pxor   %xmm6,%xmm6
  mov    %rdx,%rdi
  movsd  D63(%rip),%xmm8
  cvtsi2ss %eax,%xmm13
  movslq %esi,%rdx
  xor    %eax,%eax
  nop
L332:
  movss  (%rcx,%rax,4),%xmm5
  movss  (%r9,%rax,4),%xmm1
  movss  (%rdi,%rax,4),%xmm11
  movss  (%r8,%rax,4),%xmm9
  subss  %xmm5,%xmm1
  movss  (%r10,%rax,4),%xmm3
  movss  (%r11,%rax,4),%xmm10
  subss  %xmm11,%xmm3
  subss  %xmm9,%xmm10
  ucomiss %xmm6,%xmm1
  jp     L46
  je     L337
L46:
  movaps %xmm7,%xmm0
  movaps %xmm13,%xmm4
  subss  %xmm5,%xmm0
  subss  %xmm5,%xmm4
  divss  %xmm1,%xmm0
  divss  %xmm1,%xmm4
  comiss %xmm4,%xmm0
  jbe    L169
  movaps %xmm0,%xmm2
  movaps %xmm4,%xmm0
  movaps %xmm2,%xmm4
L169:
  ucomiss %xmm6,%xmm3
  jp     L32
  je     L303
L32:
  movaps %xmm7,%xmm12
  movaps %xmm13,%xmm2
  subss  %xmm11,%xmm12
  subss  %xmm11,%xmm2
  divss  %xmm3,%xmm12
  divss  %xmm3,%xmm2
  comiss %xmm2,%xmm12
  jbe    L204
  movaps %xmm12,%xmm15
  movaps %xmm2,%xmm12
  movaps %xmm15,%xmm2
L204:
  maxss  %xmm0,%xmm12
  minss  %xmm4,%xmm2
  movaps %xmm12,%xmm0
  movaps %xmm2,%xmm4
L303:
  ucomiss %xmm6,%xmm10
  jp     L43
  je     L265
L43:
  movaps %xmm6,%xmm12
  movaps %xmm14,%xmm2
  subss  %xmm9,%xmm12
  subss  %xmm9,%xmm2
  divss  %xmm10,%xmm12
  divss  %xmm10,%xmm2
  comiss %xmm2,%xmm12
  jbe    L67
  movaps %xmm12,%xmm15
  movaps %xmm2,%xmm12
  movaps %xmm15,%xmm2
L67:
  maxss  %xmm0,%xmm12
  minss  %xmm4,%xmm2
  movaps %xmm12,%xmm0
  movaps %xmm2,%xmm4
L265:
  movaps %xmm0,%xmm2
  mulss  %xmm1,%xmm2
  addss  %xmm5,%xmm2
  comiss %xmm7,%xmm2
  jb     L327
  comiss %xmm2,%xmm13
  jb     L327
  movaps %xmm0,%xmm12
  mulss  %xmm3,%xmm12
  addss  %xmm11,%xmm12
  comiss %xmm7,%xmm12
  jb     L327
  comiss %xmm12,%xmm13
  jb     L327
  mulss  %xmm10,%xmm0
  addss  %xmm9,%xmm0
  comiss %xmm6,%xmm0
  jb     L327
  comiss %xmm0,%xmm14
  jb     L327
  subss  %xmm7,%xmm2
  pxor   %xmm15,%xmm15
  subss  %xmm7,%xmm12
  cvtss2sd %xmm2,%xmm15
  addsd  %xmm8,%xmm15
  cvttsd2si %xmm15,%esi
  cmp    %ebx,%esi
  jne    L297
  pxor   %xmm2,%xmm2
  cvtsi2ss %ebx,%xmm2
  subss  D36(%rip),%xmm2
L297:
  pxor   %xmm15,%xmm15
  cvtss2sd %xmm12,%xmm15
  addsd  %xmm8,%xmm15
  cvttsd2si %xmm15,%esi
  cmp    %ebx,%esi
  jne    L77
  pxor   %xmm12,%xmm12
  cvtsi2ss %ebx,%xmm12
  subss  D36(%rip),%xmm12
L77:
  pxor   %xmm15,%xmm15
  cvtss2sd %xmm0,%xmm15
  addsd  %xmm8,%xmm15
  cvttsd2si %xmm15,%esi
  cmp    0x68(%rsp),%esi
  jne    L129
  movaps %xmm14,%xmm0
  subss  D36(%rip),%xmm0
L129:
  mulss  %xmm4,%xmm1
  movss  %xmm2,(%rcx,%rax,4)
  movss  %xmm12,(%rdi,%rax,4)
  movss  %xmm0,(%r8,%rax,4)
  addss  %xmm5,%xmm1
  comiss %xmm7,%xmm1
  jb     L327
  comiss %xmm1,%xmm13
  jb     L327
  mulss  %xmm4,%xmm3
  addss  %xmm11,%xmm3
  comiss %xmm7,%xmm3
  jb     L327
  comiss %xmm3,%xmm13
  jb     L327
  mulss  %xmm10,%xmm4
  addss  %xmm9,%xmm4
  comiss %xmm6,%xmm4
  jb     L327
  comiss %xmm4,%xmm14
  jb     L327
  subss  %xmm7,%xmm1
  pxor   %xmm5,%xmm5
  subss  %xmm7,%xmm3
  cvtss2sd %xmm1,%xmm5
  addsd  %xmm8,%xmm5
  cvttsd2si %xmm5,%esi
  cmp    %ebx,%esi
  jne    L200
  pxor   %xmm1,%xmm1
  cvtsi2ss %ebx,%xmm1
  subss  D36(%rip),%xmm1
L200:
  pxor   %xmm5,%xmm5
  cvtss2sd %xmm3,%xmm5
  addsd  %xmm8,%xmm5
  cvttsd2si %xmm5,%esi
  cmp    %ebx,%esi
  jne    L48
  pxor   %xmm3,%xmm3
  cvtsi2ss %ebx,%xmm3
  subss  D36(%rip),%xmm3
L48:
  pxor   %xmm5,%xmm5
  cvtss2sd %xmm4,%xmm5
  addsd  %xmm8,%xmm5
  cvttsd2si %xmm5,%esi
  cmp    0x68(%rsp),%esi
  jne    L209
  movaps %xmm14,%xmm4
  subss  D36(%rip),%xmm4
L209:
  cvttss2si %xmm2,%esi
  movss  %xmm1,(%r9,%rax,4)
  cvttss2si %xmm1,%ebp
  movss  %xmm3,(%r10,%rax,4)
  movss  %xmm4,(%r11,%rax,4)
  cmp    %ebp,%esi
  je     L305
L75:
  mov    0x48(%rsp),%rsi
  movl   $0x1,(%rsi,%rax,4)
  xchg   %ax,%ax
L327:
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L332
L262:
  pop    %rbx
  pop    %rbp
  ret
L337:
  movss  D55(%rip),%xmm4
  movss  D52(%rip),%xmm0
  jmp    L169
L305:
  cvttss2si %xmm12,%ebp
  cvttss2si %xmm3,%esi
  cmp    %esi,%ebp
  jne    L75
  cvttss2si %xmm0,%ebp
  cvttss2si %xmm4,%esi
  cmp    %esi,%ebp
  jne    L75
  jmp    L327
```

tool_calls: name: retrieve_data
arguments: data_label: D63
type_infered: f64
name: retrieve_data
arguments: data_label: D36
type_infered: byte[4]
name: retrieve_data
arguments: data_label: D55
type_infered: byte[4]
name: retrieve_data
arguments: data_label: D52
type_infered: byte[4]

tool: D63: 0.5

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

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

tool: {"D52": [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;
    }
  }
}
```