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

```asm
<lineClip>:
  endbr64
  push   %r15
  movslq %edi,%rax
  movapd %xmm0,%xmm1
  mov    %r9d,%edi
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  mov    %r9d,%r13d
  push   %r12
  mov    %rax,%r12
  lea    -0x8(,%rax,8),%rax
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x48,%rsp
  mov    %rax,0x30(%rsp)
  add    %rsi,%rax
  movsd  %xmm0,(%rsp)
  movsd  (%rax),%xmm0
  mov    %rcx,0x18(%rsp)
  mov    %r8,0x20(%rsp)
  mov    %rax,0x38(%rsp)
  call   <inPlane@plt>
  mov    %eax,0x2c(%rsp)
  test   %r12d,%r12d
  jle    L28
  mov    0x2c(%rsp),%edx
  xor    %ecx,%ecx
  mov    %r12d,0x28(%rsp)
  mov    %r14d,%r15d
  mov    %rbx,%r12
  movsd  (%rsp),%xmm1
  mov    %ecx,%ebx
  test   %edx,%edx
  je     L103
  nopl   (%rax)
L16:
  movslq %ebx,%r8
  mov    %r13d,%edi
  movsd  %xmm1,(%rsp)
  lea    0x0(,%r8,8),%r10
  mov    %r8,0x10(%rsp)
  lea    0x0(%rbp,%r10,1),%r14
  mov    %r10,0x8(%rsp)
  movsd  (%r14),%xmm0
  call   <inPlane@plt>
  movslq %r15d,%rdx
  add    $0x1,%r15d
  movsd  (%rsp),%xmm1
  mov    %eax,%r11d
  mov    0x18(%rsp),%rax
  shl    $0x3,%rdx
  mov    0x8(%rsp),%r10
  mov    0x10(%rsp),%r8
  lea    (%rax,%rdx,1),%rdi
  add    0x20(%rsp),%rdx
  lea    0x1(%rbx),%eax
  test   %r11d,%r11d
  je     L137
  movsd  (%r14),%xmm0
  movsd  %xmm0,(%rdi)
  movsd  (%r12,%r8,8),%xmm0
  movsd  %xmm0,(%rdx)
  cmp    %eax,0x28(%rsp)
  jle    L8
  mov    0x2c(%rsp),%edx
  mov    %eax,%ebx
  test   %edx,%edx
  jne    L16
L103:
  mov    %ebx,%eax
L37:
  movslq %eax,%rdx
  mov    %rbp,0x10(%rsp)
  mov    %r12,%rax
  lea    0x0(%rbp,%rdx,8),%r14
  mov    %rdx,%rbx
  mov    %r14,%r12
  mov    %rax,%r14
L14:
  movsd  (%r12),%xmm0
  mov    %r13d,%edi
  mov    %ebx,0x8(%rsp)
  lea    0x0(,%rbx,8),%rbp
  movsd  %xmm1,(%rsp)
  call   <inPlane@plt>
  movsd  (%rsp),%xmm1
  lea    0x1(%rbx),%esi
  test   %eax,%eax
  je     L135
  mov    0x8(%rsp),%eax
  mov    %rbp,%r10
  mov    %esi,%ebx
  mov    %r14,%rsi
  mov    %r12,%r14
  mov    0x10(%rsp),%rbp
  mov    %rsi,%r12
  lea    (%rsi,%r10,1),%rdx
  movsd  (%r14),%xmm2
  test   %eax,%eax
  je     L58
  movsd  -0x8(%rsi,%r10,1),%xmm3
  movsd  -0x8(%rbp,%r10,1),%xmm4
  movsd  (%rdx),%xmm0
L143:
  movapd %xmm1,%xmm5
  subsd  %xmm3,%xmm0
  subsd  %xmm4,%xmm2
  movslq %r15d,%rax
  subsd  %xmm4,%xmm5
  mov    0x18(%rsp),%rcx
  mov    0x20(%rsp),%rsi
  lea    0x0(,%rax,8),%rdi
  movl   $0x1,0x2c(%rsp)
  add    $0x2,%r15d
  movsd  %xmm1,(%rcx,%rax,8)
  mulsd  %xmm5,%xmm0
  divsd  %xmm2,%xmm0
  addsd  %xmm3,%xmm0
  movsd  %xmm0,(%rsi,%rax,8)
  movsd  (%r14),%xmm0
  movsd  %xmm0,0x8(%rcx,%rdi,1)
  movsd  (%rdx),%xmm0
  movsd  %xmm0,0x8(%rsi,%rdi,1)
  cmp    0x28(%rsp),%ebx
  jl     L16
L8:
  mov    %r15d,%r14d
L28:
  add    $0x48,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L135:
  add    $0x1,%rbx
  add    $0x8,%r12
  cmp    %ebx,0x28(%rsp)
  jg     L14
  jmp    L8
  nopl   0x0(%rax)
L137:
  test   %ebx,%ebx
  je     L76
  movsd  -0x8(%r12,%r10,1),%xmm3
  movsd  -0x8(%rbp,%r10,1),%xmm4
  movapd %xmm1,%xmm2
  movsd  (%r12,%r8,8),%xmm0
  subsd  %xmm4,%xmm2
  subsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  (%r14),%xmm2
  subsd  %xmm4,%xmm2
  divsd  %xmm2,%xmm0
  addsd  %xmm3,%xmm0
L57:
  movsd  %xmm1,(%rdi)
  movsd  %xmm0,(%rdx)
  cmp    %eax,0x28(%rsp)
  jg     L37
  jmp    L8
  nopl   (%rax)
L58:
  mov    0x30(%rsp),%rax
  movsd  (%rsi),%xmm0
  movsd  (%rsi,%rax,1),%xmm3
  mov    0x38(%rsp),%rax
  movsd  (%rax),%xmm4
  jmp    L143
  nopl   0x0(%rax)
L76:
  mov    0x30(%rsp),%rcx
  mov    0x38(%rsp),%rsi
  movapd %xmm1,%xmm2
  movsd  (%r12),%xmm0
  movsd  (%r12,%rcx,1),%xmm3
  movsd  (%rsi),%xmm4
  subsd  %xmm3,%xmm0
  subsd  %xmm4,%xmm2
  mulsd  %xmm2,%xmm0
  movsd  0x0(%rbp),%xmm2
  subsd  %xmm4,%xmm2
  divsd  %xmm2,%xmm0
  addsd  %xmm3,%xmm0
  jmp    L57
```

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;
}
```