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

```asm
<prj2plane>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x158,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rcx,%rbp
  movq   %xmm0,%r14
  mov    %r8,(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x148(%rsp)
  xor    %eax,%eax
  mov    D26(%rip),%rax
  mov    %rax,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  movq   $0x0,0x30(%rsp)
  mov    D3(%rip),%rax
  mov    %rax,0x38(%rsp)
  lea    0xf0(%rsp),%r9
  lea    0x18(%rsp),%r8
  mov    %rdx,%rcx
  mov    %rsi,%rdx
  mov    %rdi,%rsi
  mov    $0x1,%edi
  call   <bring_atoms@plt>
  mov    $0x3,%ecx
  mov    $0x1,%edx
  mov    0x18(%rsp),%esi
  mov    $0x1,%edi
  call   <dmatrix@plt>
  mov    %rax,%r12
  mov    0x18(%rsp),%rax
  test   %rax,%rax
  jle    L132
  lea    0xf8(%rsp),%rsi
  mov    $0x1,%edx
  jmp    L73
L134:
  add    $0x1,%rdx
  mov    0x18(%rsp),%rax
  add    $0x8,%rsi
  cmp    %rdx,%rax
  jl     L132
L73:
  mov    $0x8,%eax
L99:
  mov    (%rsi),%rcx
  mov    0x0(%rbp,%rcx,8),%rcx
  movsd  (%rcx,%rax,1),%xmm0
  mov    (%r12,%rdx,8),%rcx
  movsd  %xmm0,(%rcx,%rax,1)
  add    $0x8,%rax
  cmp    $0x20,%rax
  jne    L99
  jmp    L134
L132:
  lea    0x60(%rsp),%rbx
  lea    0x80(%rsp),%r13
  lea    0xa0(%rsp),%r9
  lea    0x10(%rsp),%r8
  mov    %rbx,%rcx
  mov    %r13,%rdx
  mov    %rax,%rsi
  mov    %r12,%rdi
  call   <ls_plane@plt>
  mov    (%rsp),%r8
  mov    %r13,%rcx
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  mov    0x8(%rsp),%rdi
  call   <plane_xyz@plt>
  mov    $0x3,%ecx
  mov    $0x1,%edx
  mov    $0x3,%esi
  mov    $0x1,%edi
  call   <dmatrix@plt>
  mov    %rax,%r15
  movq   %r14,%xmm1
  ucomisd D27(%rip),%xmm1
  jp     L59
  jne    L59
L144:
  mov    $0x3,%r8d
  mov    $0x1,%ecx
  mov    0x18(%rsp),%edx
  mov    $0x1,%esi
  mov    %r12,%rdi
  call   <free_dmatrix@plt>
  mov    $0x3,%r8d
  mov    $0x1,%ecx
  mov    $0x3,%edx
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <free_dmatrix@plt>
  mov    0x148(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L128
  add    $0x158,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L59:
  lea    0x40(%rsp),%r14
  lea    0x20(%rsp),%rbx
  lea    0x80(%rsp),%r13
  mov    %r14,%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <cross@plt>
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <magang@plt>
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <arb_rotation@plt>
  mov    $0x1,%r13d
  cmpq   $0x0,0x8(%rsp)
  jg     L15
  jmp    L144
L91:
  add    $0x1,%r13
  cmp    %r13,0x8(%rsp)
  jl     L29
L15:
  mov    $0x8,%ebx
L54:
  mov    (%rsp),%rax
  mov    %rbx,%r14
  add    (%rax,%r13,8),%r14
  mov    (%r15,%rbx,1),%rsi
  mov    0x0(%rbp,%r13,8),%rdi
  call   <dot@plt>
  movsd  %xmm0,(%r14)
  add    $0x8,%rbx
  cmp    $0x20,%rbx
  jne    L54
  jmp    L91
L29:
  mov    (%rsp),%rax
  add    $0x8,%rax
  mov    0x8(%rsp),%rbx
  lea    (%rax,%rbx,8),%rsi
L39:
  mov    (%rax),%rdx
  mov    (%rsp),%rdi
  mov    0x8(%rdi),%rcx
  movsd  0x18(%rdx),%xmm0
  subsd  0x18(%rcx),%xmm0
  movsd  %xmm0,0x18(%rdx)
  add    $0x8,%rax
  cmp    %rax,%rsi
  jne    L39
  jmp    L144
L128:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D26
type: byte[8]
name: parse_data
arguments: tag: D3
type: f64
name: parse_data
arguments: tag: D27
type: f64

tool: {"D26": [0x85,0xeb,0x51,0xb8,0xfe,0x87,0xc3,0xc0]}

tool: D3: 1

tool: D27: 0

assistant: ```c
void prj2plane(long num, long rnum, char **AtomName, double **xyz, double z0, double **nxyz) {
  double ang, temp;
  double zaxis[4] = {-9999.99, 0.0, 0.0, 1.0};
  double adist[10], hinge[4], ppos[4], z[4];
  double **bxyz, **rmtx;
  long i, j, nmatch;
  long batom[10];
  bring_atoms(1, num, rnum, AtomName, &nmatch, batom);
  bxyz = dmatrix(1, nmatch, 1, 3);
  for (i = 1; i <= nmatch; i++)
    for (j = 1; j <= 3; j++)
      bxyz[i][j] = xyz[batom[i]][j];
  ls_plane(bxyz, nmatch, z, ppos, &temp, adist);
  plane_xyz(num, xyz, ppos, z, nxyz);
  rmtx = dmatrix(1, 3, 1, 3);
  if (z0) {
    cross(z, zaxis, hinge);
    ang = magang(z, zaxis);
    arb_rotation(hinge, ang, rmtx);
    for (i = 1; i <= num; i++)
      for (j = 1; j <= 3; j++)
        nxyz[i][j] = dot(xyz[i], rmtx[j]);
    for (i = 1; i <= num; i++)
      nxyz[i][3] -= nxyz[1][3];
  }
  free_dmatrix(bxyz, 1, nmatch, 1, 3);
  free_dmatrix(rmtx, 1, 3, 1, 3);
}
```