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

```asm
<addnod_>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdx,0x8(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    (%rsi),%eax
  mov    %eax,D271(%rip)
  cmp    $0x3,%eax
  jle    L7
  mov    %r8,%r13
  mov    %r9,%rbp
  lea    -0x1(%rax),%edx
  mov    %edx,D353(%rip)
  mov    (%rdi),%ecx
  test   %ecx,%ecx
  cmovg  %ecx,%edx
  mov    %edx,D614(%rip)
  lea    -0x8(%r8),%r14
  mov    0x10(%rsp),%r8
  lea    -0x8(%r8),%r12
  mov    0x8(%rsp),%rcx
  lea    -0x8(%rcx),%rbx
  cltq
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,D392(%rip)
  movsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,D656(%rip)
  movsd  (%r14,%rax,8),%xmm0
  movsd  %xmm0,D631(%rip)
  sub    $0x8,%rsp
  lea    D197(%rip),%rax
  push   %rax
  lea    D239(%rip),%rax
  push   %rax
  lea    D320(%rip),%rax
  push   %rax
  lea    D261(%rip),%rax
  push   %rax
  lea    D240(%rip),%rax
  push   %rax
  lea    D187(%rip),%rax
  push   %rax
  push   0xa0(%rsp)
  push   0xa0(%rsp)
  push   %r9
  mov    %r13,%r9
  lea    D353(%rip),%rdx
  lea    D392(%rip),%rsi
  lea    D614(%rip),%rdi
  call   <trfind_@plt>
  mov    D320(%rip),%eax
  add    $0x50,%rsp
  test   %eax,%eax
  je     L207
  mov    D197(%rip),%edx
  test   %edx,%edx
  je     L110
  mov    %eax,D49(%rip)
  movsd  D392(%rip),%xmm0
  cltq
  ucomisd (%rbx,%rax,8),%xmm0
  jp     L183
  jne    L183
  movsd  D656(%rip),%xmm1
  ucomisd (%r12,%rax,8),%xmm1
  jp     L183
  jne    L183
  movsd  D631(%rip),%xmm1
  ucomisd (%r14,%rax,8),%xmm1
  jp     L183
  je     L151
L183:
  mov    D239(%rip),%eax
  mov    %eax,D624(%rip)
  cltq
  ucomisd (%rbx,%rax,8),%xmm0
  jp     L233
  jne    L233
  movsd  D656(%rip),%xmm1
  ucomisd (%r12,%rax,8),%xmm1
  jp     L233
  jne    L233
  movsd  D631(%rip),%xmm1
  ucomisd (%r14,%rax,8),%xmm1
  jp     L233
  je     L151
L233:
  mov    %edx,D624(%rip)
  movslq %edx,%rax
  ucomisd (%rbx,%rax,8),%xmm0
  jp     L306
  jne    L306
  movsd  D656(%rip),%xmm0
  ucomisd (%r12,%rax,8),%xmm0
  jp     L306
  jne    L306
  movsd  D631(%rip),%xmm0
  ucomisd (%r14,%rax,8),%xmm0
  jp     L306
  jne    L306
L151:
  mov    D624(%rip),%eax
  mov    0x78(%rsp),%rsi
  mov    %eax,(%rsi)
  jmp    L141
L7:
  mov    0x78(%rsp),%rax
  movl   $0xffffffff,(%rax)
L141:
  mov    $0x0,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L207:
  mov    0x78(%rsp),%rax
  movl   $0xfffffffe,(%rax)
  jmp    L141
L306:
  push   0x70(%rsp)
  push   0x70(%rsp)
  mov    0x70(%rsp),%r9
  mov    %rbp,%r8
  lea    D197(%rip),%rcx
  lea    D239(%rip),%rdx
  lea    D320(%rip),%rsi
  lea    D271(%rip),%rdi
  call   <intadd_@plt>
  add    $0x10,%rsp
L63:
  mov    0x68(%rsp),%rax
  lea    -0x4(%rax),%r15
  lea    -0x4(%rbp),%rbx
  mov    0x60(%rsp),%rax
  lea    -0x4(%rax),%r14
  mov    0x78(%rsp),%rax
  movl   $0x0,(%rax)
  movslq D271(%rip),%rax
  mov    0x68(%rsp),%rsi
  movslq -0x4(%rsi,%rax,4),%rax
  mov    (%r14,%rax,4),%eax
  mov    %eax,D624(%rip)
  cltq
  mov    (%rbx,%rax,4),%edx
  mov    %edx,D361(%rip)
  mov    (%r14,%rax,4),%eax
  mov    %eax,D539(%rip)
  cltq
  mov    (%rbx,%rax,4),%edx
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  mov    %eax,D463(%rip)
  lea    D361(%rip),%r12
  mov    %r13,0x18(%rsp)
  mov    0x60(%rsp),%r13
  jmp    L81
L110:
  cmp    D239(%rip),%eax
  je     L87
  sub    $0x8,%rsp
  push   0x78(%rsp)
  mov    0x78(%rsp),%r9
  mov    0x70(%rsp),%r8
  mov    %rbp,%rcx
  lea    D239(%rip),%rdx
  lea    D320(%rip),%rsi
  lea    D271(%rip),%rdi
  call   <bdyadd_@plt>
  add    $0x10,%rsp
  jmp    L63
L87:
  mov    0x70(%rsp),%r9
  mov    0x68(%rsp),%r8
  mov    0x60(%rsp),%rcx
  mov    %rbp,%rdx
  lea    D320(%rip),%rsi
  lea    D271(%rip),%rdi
  call   <covsph_@plt>
  jmp    L63
L316:
  mov    D621(%rip),%eax
  jmp    L138
L128:
  mov    D539(%rip),%eax
  cmp    D624(%rip),%eax
  je     L141
  cltq
  cmpl   $0x0,(%rbx,%rax,4)
  js     L141
  mov    D463(%rip),%edx
  mov    %edx,D653(%rip)
  mov    (%r14,%rax,4),%eax
  mov    %eax,D653(%rip)
  cltq
  mov    (%rbx,%rax,4),%edx
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
L138:
  mov    %eax,D653(%rip)
L81:
  movslq D653(%rip),%rax
  lea    (%r15,%rax,4),%rdi
  mov    %r13,%rcx
  mov    %rbp,%rdx
  mov    %r12,%rsi
  call   <lstptr_@plt>
  cltq
  cmpl   $0x0,(%rbx,%rax,4)
  js     L128
  movslq (%r14,%rax,4),%rax
  mov    (%rbx,%rax,4),%edx
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  mov    %eax,D653(%rip)
  mov    D653(%rip),%eax
  mov    %eax,D653(%rip)
  sub    $0x8,%rsp
  push   0x20(%rsp)
  mov    0x20(%rsp),%r9
  mov    0x18(%rsp),%r8
  mov    %r12,%rcx
  lea    D653(%rip),%rdx
  lea    D271(%rip),%rsi
  lea    D653(%rip),%rdi
  call   <swptst_@plt>
  add    $0x10,%rsp
  test   %eax,%eax
  je     L128
  lea    D653(%rip),%rax
  push   %rax
  push   0x70(%rsp)
  mov    %r13,%r9
  mov    %rbp,%r8
  mov    %r12,%rcx
  lea    D653(%rip),%rdx
  lea    D271(%rip),%rsi
  lea    D653(%rip),%rdi
  call   <swap_@plt>
  add    $0x10,%rsp
  cmpl   $0x0,D653(%rip)
  jne    L316
  mov    D653(%rip),%eax
  mov    %eax,D633(%rip)
  jmp    L128
```

assistant: ```c
int addnod_(int *nst, int *k, double *x, double *y, double *z__, int *list, int *lptr, int *lend, int *lnew, int *ier) {
  int i__1;
  static int l;
  static double p[3], b1, b2, b3;
  static int i1, i2, i3, kk, lp, in1, io1, io2, km1, lpf, ist, lpo1;
  static int lpo1s;
  --lend;
  --z__;
  --y;
  --x;
  --list;
  --lptr;
  kk = *k;
  if (kk < 4) {
    goto L3;
  }
  km1 = kk - 1;
  ist = *nst;
  if (ist < 1) {
    ist = km1;
  }
  p[0] = x[kk];
  p[1] = y[kk];
  p[2] = z__[kk];
  trfind_(&ist, p, &km1, &x[1], &y[1], &z__[1], &list[1], &lptr[1], &lend[1], &b1, &b2, &b3, &i1, &i2, &i3);
  if (i1 == 0) {
    goto L4;
  }
  if (i3 != 0) {
    l = i1;
    if (p[0] == x[l] && p[1] == y[l] && p[2] == z__[l]) {
      goto L5;
    }
    l = i2;
    if (p[0] == x[l] && p[1] == y[l] && p[2] == z__[l]) {
      goto L5;
    }
    l = i3;
    if (p[0] == x[l] && p[1] == y[l] && p[2] == z__[l]) {
      goto L5;
    }
    intadd_(&kk, &i1, &i2, &i3, &list[1], &lptr[1], &lend[1], lnew);
  } else {
    if (i1 != i2) {
      bdyadd_(&kk, &i1, &i2, &list[1], &lptr[1], &lend[1], lnew);
    } else {
      covsph_(&kk, &i1, &list[1], &lptr[1], &lend[1], lnew);
    }
  }
  *ier = 0;
  lp = lend[kk];
  lpf = lptr[lp];
  io2 = list[lpf];
  lpo1 = lptr[lpf];
  io1 = (i__1 = list[lpo1], ((i__1) >= 0 ? (i__1) : -(i__1)));
L1:
  lp = lstptr_(&lend[io1], &io2, &list[1], &lptr[1]);
  if (list[lp] < 0) {
    goto L2;
  }
  lp = lptr[lp];
  in1 = (i__1 = list[lp], ((i__1) >= 0 ? (i__1) : -(i__1)));
  lpo1s = lpo1;
  if (!swptst_(&in1, &kk, &io1, &io2, &x[1], &y[1], &z__[1])) {
    goto L2;
  }
  swap_(&in1, &kk, &io1, &io2, &list[1], &lptr[1], &lend[1], &lpo1);
  if (lpo1 == 0) {
    lpo1 = lpo1s;
    goto L2;
  }
  io1 = in1;
  goto L1;
L2:
  if (lpo1 == lpf || list[lpo1] < 0) {
    return 0;
  }
  io2 = io1;
  lpo1 = lptr[lpo1];
  io1 = (i__1 = list[lpo1], ((i__1) >= 0 ? (i__1) : -(i__1)));
  goto L1;
L3:
  *ier = -1;
  return 0;
L4:
  *ier = -2;
  return 0;
L5:
  *ier = l;
  return 0;
}
```