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

```asm
<_glp_qmd_qmdupd>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,0x30(%rsp)
  mov    %rsi,0x10(%rsp)
  mov    %r9,0x18(%rsp)
  mov    0xa0(%rsp),%rax
  mov    %rax,0x38(%rsp)
  mov    0xa8(%rsp),%rbx
  mov    0xb0(%rsp),%rax
  mov    %rax,0x28(%rsp)
  mov    0xb8(%rsp),%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  cmpl   $0x0,(%rdx)
  jle    L64
  mov    %rdx,%r15
  mov    %rcx,%r13
  mov    %r8,%rbp
  movl   $0x0,0x48(%rsp)
  movl   $0x0,0x4c(%rsp)
  mov    $0x1,%r9d
  movb   $0x0,0x8(%rsp)
  mov    $0x0,%r8d
  mov    $0x0,%r10d
  lea    0x4(%rsi),%r12
  mov    %r12,0x20(%rsp)
  mov    %rdi,%r12
  jmp    L83
L50:
  add    $0x4,%rax
  cmp    %rdi,%rax
  je     L88
L127:
  mov    (%rax),%ecx
  movslq %ecx,%rdx
  lea    (%rbx,%rdx,4),%rsi
  cmpl   $0x0,(%rsi)
  jne    L50
  cmpl   $0x0,0x0(%rbp,%rdx,4)
  jns    L50
  movl   $0xffffffff,(%rsi)
  add    $0x1,%r8d
  movslq %r8d,%rdx
  mov    %ecx,(%r14,%rdx,4)
  movb   $0x1,0x8(%rsp)
  jmp    L50
L88:
  add    $0x1,%r9
  cmp    %r9d,(%r15)
  jl     L70
L83:
  mov    0x0(%r13,%r9,4),%r11d
  movslq %r11d,%rax
  mov    0x18(%rsp),%rdi
  add    (%rdi,%rax,4),%r10d
  mov    (%r12,%rax,4),%ecx
  mov    0x4(%r12,%rax,4),%edx
  cmp    %ecx,%edx
  jle    L88
  movslq %ecx,%rsi
  mov    0x10(%rsp),%rax
  lea    (%rax,%rsi,4),%rax
  sub    %ecx,%edx
  lea    -0x1(%rdx),%edx
  add    %rsi,%rdx
  mov    0x20(%rsp),%rdi
  lea    (%rdi,%rdx,4),%rdi
  jmp    L127
L70:
  mov    %r10d,0x48(%rsp)
  mov    %r11d,0x50(%rsp)
  cmpb   $0x0,0x8(%rsp)
  je     L31
  mov    %r8d,0x4c(%rsp)
  test   %r8d,%r8d
  jle    L31
  sub    $0x8,%rsp
  movslq %r8d,%r8
  lea    0x4(%r14,%r8,4),%rax
  push   %rax
  push   0x38(%rsp)
  push   %r14
  lea    0x6c(%rsp),%rax
  push   %rax
  lea    0x70(%rsp),%rax
  push   %rax
  mov    %rbx,%r9
  mov    0x68(%rsp),%r8
  mov    0x48(%rsp),%rcx
  mov    %rbp,%rdx
  mov    0x40(%rsp),%rsi
  mov    0x60(%rsp),%rdi
  call   <_glp_qmd_qmdmrg@plt>
  add    $0x30,%rsp
L31:
  cmpl   $0x0,(%r15)
  jle    L64
  mov    $0x1,%r12d
  lea    0x54(%rsp),%rax
  mov    %rax,0x20(%rsp)
  mov    %r14,0x8(%rsp)
  mov    0x18(%rsp),%r14
  jmp    L121
L131:
  mov    0x28(%rsp),%rdi
  lea    0x4(%rdi),%rax
  lea    -0x1(%rcx),%ecx
  lea    0x8(%rdi,%rcx,4),%rsi
L3:
  movslq (%rax),%rcx
  add    (%r14,%rcx,4),%edx
  movl   $0x0,(%rbx,%rcx,4)
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L3
  jmp    L47
L177:
  add    $0x1,%r12
  cmp    %r12d,(%r15)
  jl     L64
L121:
  mov    0x0(%r13,%r12,4),%eax
  mov    %eax,0x50(%rsp)
  cltq
  lea    (%rbx,%rax,4),%rax
  cmpl   $0x1,(%rax)
  ja     L177
  movl   $0x2,(%rax)
  lea    0x50(%rsp),%rdi
  sub    $0x8,%rsp
  push   0x10(%rsp)
  lea    0x5c(%rsp),%rax
  push   %rax
  push   0x40(%rsp)
  mov    0x40(%rsp),%r9
  mov    %rbx,%r8
  mov    %rbp,%rcx
  mov    0x30(%rsp),%rdx
  mov    0x50(%rsp),%rsi
  call   <_glp_qmd_qmdrch@plt>
  mov    0x68(%rsp),%edx
  mov    0x74(%rsp),%ecx
  add    $0x20,%rsp
  test   %ecx,%ecx
  jg     L131
L47:
  movslq 0x50(%rsp),%rax
  sub    $0x1,%edx
  mov    %edx,0x0(%rbp,%rax,4)
  mov    0x4c(%rsp),%edx
  test   %edx,%edx
  jle    L177
  mov    0x8(%rsp),%rdi
  lea    0x4(%rdi),%rax
  lea    -0x1(%rdx),%edx
  lea    0x8(%rdi,%rdx,4),%rcx
L39:
  movslq (%rax),%rdx
  movl   $0x0,(%rbx,%rdx,4)
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L39
  jmp    L177
L64:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L167
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L167:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void _glp_qmd_qmdupd(int xadj[], int adjncy[], int *_nlist, int list[], int deg[], int qsize[], int qlink[], int marker[], int rchset[], int nbrhd[]) {
  int deg0, deg1, il, inhd, inode, irch, j, jstop, jstrt, mark, nabor, nhdsze, node, rchsze;
  if ((*_nlist) <= 0)
    return;
  deg0 = 0;
  nhdsze = 0;
  for (il = 1; il <= (*_nlist); il++) {
    node = list[il];
    deg0 += qsize[node];
    jstrt = xadj[node];
    jstop = xadj[node + 1] - 1;
    for (j = jstrt; j <= jstop; j++) {
      nabor = adjncy[j];
      if (marker[nabor] == 0 && deg[nabor] < 0) {
        marker[nabor] = -1;
        nhdsze++;
        nbrhd[nhdsze] = nabor;
      }
    }
  }
  if (nhdsze > 0)
    _glp_qmd_qmdmrg(xadj, adjncy, deg, qsize, qlink, marker, &deg0, &nhdsze, nbrhd, rchset, &nbrhd[nhdsze + 1]);
  for (il = 1; il <= (*_nlist); il++) {
    node = list[il];
    mark = marker[node];
    if (mark == 0 || mark == 1) {
      marker[node] = 2;
      _glp_qmd_qmdrch(&node, xadj, adjncy, deg, marker, &rchsze, rchset, &nhdsze, nbrhd);
      deg1 = deg0;
      if (rchsze > 0) {
        for (irch = 1; irch <= rchsze; irch++) {
          inode = rchset[irch];
          deg1 += qsize[inode];
          marker[inode] = 0;
        }
      }
      deg[node] = deg1 - 1;
      if (nhdsze > 0) {
        for (inhd = 1; inhd <= nhdsze; inhd++) {
          inode = nbrhd[inhd];
          marker[inode] = 0;
        }
      }
    }
  }
  return;
}
```