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,D233(%rip)
  cmp    $0x3,%eax
  jle    L7
  mov    %r8,%r13
  mov    %r9,%rbp
  lea    -0x1(%rax),%edx
  mov    %edx,D421(%rip)
  mov    (%rdi),%ecx
  test   %ecx,%ecx
  cmovg  %ecx,%edx
  mov    %edx,D465(%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,D598(%rip)
  movsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,D324(%rip)
  movsd  (%r14,%rax,8),%xmm0
  movsd  %xmm0,D600(%rip)
  sub    $0x8,%rsp
  lea    D213(%rip),%rax
  push   %rax
  lea    D112(%rip),%rax
  push   %rax
  lea    D626(%rip),%rax
  push   %rax
  lea    D342(%rip),%rax
  push   %rax
  lea    D339(%rip),%rax
  push   %rax
  lea    D425(%rip),%rax
  push   %rax
  push   0xa0(%rsp)
  push   0xa0(%rsp)
  push   %r9
  mov    %r13,%r9
  lea    D421(%rip),%rdx
  lea    D598(%rip),%rsi
  lea    D465(%rip),%rdi
  call   <trfind_@plt>
  mov    D626(%rip),%eax
  add    $0x50,%rsp
  test   %eax,%eax
  je     L28
  mov    D213(%rip),%edx
  test   %edx,%edx
  je     L243
  mov    %eax,D254(%rip)
  movsd  D598(%rip),%xmm0
  cltq
  ucomisd (%rbx,%rax,8),%xmm0
  jp     L138
  jne    L138
  movsd  D324(%rip),%xmm1
  ucomisd (%r12,%rax,8),%xmm1
  jp     L138
  jne    L138
  movsd  D600(%rip),%xmm1
  ucomisd (%r14,%rax,8),%xmm1
  jp     L138
  je     L122
L138:
  mov    D112(%rip),%eax
  mov    %eax,D330(%rip)
  cltq
  ucomisd (%rbx,%rax,8),%xmm0
  jp     L182
  jne    L182
  movsd  D324(%rip),%xmm1
  ucomisd (%r12,%rax,8),%xmm1
  jp     L182
  jne    L182
  movsd  D600(%rip),%xmm1
  ucomisd (%r14,%rax,8),%xmm1
  jp     L182
  je     L122
L182:
  mov    %edx,D330(%rip)
  movslq %edx,%rax
  ucomisd (%rbx,%rax,8),%xmm0
  jp     L187
  jne    L187
  movsd  D324(%rip),%xmm0
  ucomisd (%r12,%rax,8),%xmm0
  jp     L187
  jne    L187
  movsd  D600(%rip),%xmm0
  ucomisd (%r14,%rax,8),%xmm0
  jp     L187
  jne    L187
L122:
  mov    D330(%rip),%eax
  mov    0x78(%rsp),%rsi
  mov    %eax,(%rsi)
  jmp    L107
L7:
  mov    0x78(%rsp),%rax
  movl   $0xffffffff,(%rax)
L107:
  mov    $0x0,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L28:
  mov    0x78(%rsp),%rax
  movl   $0xfffffffe,(%rax)
  jmp    L107
L187:
  push   0x70(%rsp)
  push   0x70(%rsp)
  mov    0x70(%rsp),%r9
  mov    %rbp,%r8
  lea    D213(%rip),%rcx
  lea    D112(%rip),%rdx
  lea    D626(%rip),%rsi
  lea    D233(%rip),%rdi
  call   <intadd_@plt>
  add    $0x10,%rsp
L115:
  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 D233(%rip),%rax
  mov    0x68(%rsp),%rsi
  movslq -0x4(%rsi,%rax,4),%rax
  mov    (%r14,%rax,4),%eax
  mov    %eax,D330(%rip)
  cltq
  mov    (%rbx,%rax,4),%edx
  mov    %edx,D172(%rip)
  mov    (%r14,%rax,4),%eax
  mov    %eax,D389(%rip)
  cltq
  mov    (%rbx,%rax,4),%edx
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  mov    %eax,D227(%rip)
  lea    D172(%rip),%r12
  mov    %r13,0x18(%rsp)
  mov    0x60(%rsp),%r13
  jmp    L301
L243:
  cmp    D112(%rip),%eax
  je     L170
  sub    $0x8,%rsp
  push   0x78(%rsp)
  mov    0x78(%rsp),%r9
  mov    0x70(%rsp),%r8
  mov    %rbp,%rcx
  lea    D112(%rip),%rdx
  lea    D626(%rip),%rsi
  lea    D233(%rip),%rdi
  call   <bdyadd_@plt>
  add    $0x10,%rsp
  jmp    L115
L170:
  mov    0x70(%rsp),%r9
  mov    0x68(%rsp),%r8
  mov    0x60(%rsp),%rcx
  mov    %rbp,%rdx
  lea    D626(%rip),%rsi
  lea    D233(%rip),%rdi
  call   <covsph_@plt>
  jmp    L115
L247:
  mov    D147(%rip),%eax
  jmp    L303
L140:
  mov    D389(%rip),%eax
  cmp    D330(%rip),%eax
  je     L107
  cltq
  cmpl   $0x0,(%rbx,%rax,4)
  js     L107
  mov    D227(%rip),%edx
  mov    %edx,D72(%rip)
  mov    (%r14,%rax,4),%eax
  mov    %eax,D72(%rip)
  cltq
  mov    (%rbx,%rax,4),%edx
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
L303:
  mov    %eax,D72(%rip)
L301:
  movslq D72(%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     L140
  movslq (%r14,%rax,4),%rax
  mov    (%rbx,%rax,4),%edx
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  mov    %eax,D72(%rip)
  mov    D72(%rip),%eax
  mov    %eax,D72(%rip)
  sub    $0x8,%rsp
  push   0x20(%rsp)
  mov    0x20(%rsp),%r9
  mov    0x18(%rsp),%r8
  mov    %r12,%rcx
  lea    D72(%rip),%rdx
  lea    D233(%rip),%rsi
  lea    D72(%rip),%rdi
  call   <swptst_@plt>
  add    $0x10,%rsp
  test   %eax,%eax
  je     L140
  lea    D72(%rip),%rax
  push   %rax
  push   0x70(%rsp)
  mov    %r13,%r9
  mov    %rbp,%r8
  mov    %r12,%rcx
  lea    D72(%rip),%rdx
  lea    D233(%rip),%rsi
  lea    D72(%rip),%rdi
  call   <swap_@plt>
  add    $0x10,%rsp
  cmpl   $0x0,D72(%rip)
  jne    L247
  mov    D72(%rip),%eax
  mov    %eax,D384(%rip)
  jmp    L140
```

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