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

```asm
<lineClip>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  movsd  %xmm0,-0x50(%rbp)
  mov    %r9d,-0x28(%rbp)
  movl   $0x0,-0x10(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x28(%rbp),%edx
  movsd  -0x50(%rbp),%xmm0
  mov    %edx,%edi
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <inPlane@plt>
  mov    %eax,-0xc(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L88
L93:
  cmpl   $0x0,-0xc(%rbp)
  je     L89
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x28(%rbp),%edx
  movsd  -0x50(%rbp),%xmm0
  mov    %edx,%edi
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <inPlane@plt>
  test   %eax,%eax
  je     L38
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x10(%rbp)
  jmp    L73
L38:
  cmpl   $0x0,-0x14(%rbp)
  jne    L11
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x38(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  movapd %xmm0,%xmm1
  subsd  %xmm3,%xmm1
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  movsd  -0x50(%rbp),%xmm0
  subsd  %xmm3,%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  subsd  %xmm3,%xmm1
  divsd  %xmm1,%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L12
L11:
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  movapd %xmm0,%xmm1
  subsd  %xmm3,%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  movsd  -0x50(%rbp),%xmm0
  subsd  %xmm3,%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  subsd  %xmm3,%xmm1
  divsd  %xmm1,%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L12:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x50(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L73
L89:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x28(%rbp),%edx
  movsd  -0x50(%rbp),%xmm0
  mov    %edx,%edi
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <inPlane@plt>
  test   %eax,%eax
  je     L73
  cmpl   $0x0,-0x14(%rbp)
  jne    L5
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x38(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  movapd %xmm0,%xmm1
  subsd  %xmm3,%xmm1
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  movsd  -0x50(%rbp),%xmm0
  subsd  %xmm3,%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  subsd  %xmm3,%xmm1
  divsd  %xmm1,%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L101
L5:
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  movapd %xmm0,%xmm1
  subsd  %xmm3,%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  movsd  -0x50(%rbp),%xmm0
  subsd  %xmm3,%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm3
  subsd  %xmm3,%xmm1
  divsd  %xmm1,%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L101:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x50(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x10(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x10(%rbp)
  movl   $0x1,-0xc(%rbp)
L73:
  addl   $0x1,-0x14(%rbp)
L88:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L93
  mov    -0x10(%rbp),%eax
  leave
  ret
```

assistant: ```c
int lineClip(int n, double *x, double *y, double *nx, double *ny, double val, int dir) {
  int i;
  int nout;
  int last;
  double ycross;
  nout = 0;
  last = inPlane(x[n - 1], val, dir);
  for (i = 0; i < n; ++i) {
    if (last) {
      if (inPlane(x[i], val, dir)) {
        nx[nout] = x[i];
        ny[nout] = y[i];
        ++nout;
      } else {
        if (i == 0)
          ycross = y[n - 1] + (y[0] - y[n - 1]) * (val - x[n - 1]) / (x[0] - x[n - 1]);
        else
          ycross = y[i - 1] + (y[i] - y[i - 1]) * (val - x[i - 1]) / (x[i] - x[i - 1]);
        nx[nout] = val;
        ny[nout] = ycross;
        ++nout;
        last = 0;
      }
    } else {
      if (inPlane(x[i], val, dir)) {
        if (i == 0)
          ycross = y[n - 1] + (y[0] - y[n - 1]) * (val - x[n - 1]) / (x[i] - x[n - 1]);
        else
          ycross = y[i - 1] + (y[i] - y[i - 1]) * (val - x[i - 1]) / (x[i] - x[i - 1]);
        nx[nout] = val;
        ny[nout] = ycross;
        ++nout;
        nx[nout] = x[i];
        ny[nout] = y[i];
        ++nout;
        last = 1;
      } else {
      }
    }
  }
  return nout;
}
```