user: Please show me the C implementation that matches the assembly code listed below:

```asm
<_glp_qmd_qmdmrg>:
  endbr64
  push   %r15
  mov    %rcx,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x40(%rsp),%rcx
  mov    %rsi,-0x30(%rsp)
  mov    (%rcx),%esi
  mov    %rdx,-0x10(%rsp)
  test   %esi,%esi
  jle    L139
  mov    0x48(%rsp),%rsi
  mov    %rdi,%rbx
  mov    $0x1,%eax
  nopw   0x0(%rax,%rax,1)
L222:
  movslq (%rsi,%rax,4),%rdx
  add    $0x1,%rax
  movl   $0x0,(%r9,%rdx,4)
  mov    (%rcx),%edx
  cmp    %eax,%edx
  jge    L222
  test   %edx,%edx
  jle    L139
  movq   $0x1,-0x38(%rsp)
  mov    -0x30(%rsp),%rax
  add    $0x4,%rax
  mov    %rax,-0x28(%rsp)
  mov    0x58(%rsp),%rax
  add    $0x8,%rax
  mov    %rax,-0x18(%rsp)
  mov    0x50(%rsp),%rax
  add    $0x8,%rax
  mov    %rax,-0x8(%rsp)
  nopl   0x0(%rax)
L155:
  mov    0x48(%rsp),%rax
  mov    -0x38(%rsp),%rcx
  xor    %ebp,%ebp
  xor    %r10d,%r10d
  mov    0x50(%rsp),%rdi
  mov    0x58(%rsp),%r11
  xor    %r12d,%r12d
  movslq (%rax,%rcx,4),%rax
  movl   $0xffffffff,(%r9,%rax,4)
L40:
  mov    (%rbx,%rax,4),%ecx
  mov    0x4(%rbx,%rax,4),%eax
  cmp    %ecx,%eax
  jle    L133
  sub    %ecx,%eax
  movslq %ecx,%rsi
  mov    -0x30(%rsp),%rdx
  mov    -0x28(%rsp),%rcx
  sub    $0x1,%eax
  add    %rsi,%rax
  lea    (%rdx,%rsi,4),%rdx
  lea    (%rcx,%rax,4),%r14
  jmp    L121
  nopw   0x0(%rax,%rax,1)
L15:
  add    $0x1,%ebp
  movslq %ebp,%rsi
  mov    %eax,(%rdi,%rsi,4)
  add    (%r15,%r13,4),%r12d
  movl   $0x1,(%rcx)
L159:
  add    $0x4,%rdx
  cmp    %rdx,%r14
  je     L133
L121:
  mov    (%rdx),%eax
  test   %eax,%eax
  js     L113
  je     L133
  movslq %eax,%r13
  lea    (%r9,%r13,4),%rcx
  mov    (%rcx),%esi
  test   %esi,%esi
  je     L15
  cmp    $0x1,%esi
  jne    L159
  add    $0x1,%r10d
  add    $0x4,%rdx
  movslq %r10d,%rsi
  mov    %eax,(%r11,%rsi,4)
  movl   $0x2,(%rcx)
  cmp    %rdx,%r14
  jne    L121
  nopl   0x0(%rax)
L133:
  test   %r10d,%r10d
  je     L23
  mov    0x58(%rsp),%rax
  mov    -0x18(%rsp),%rcx
  xor    %r14d,%r14d
  xor    %r13d,%r13d
  mov    %r12d,-0x20(%rsp)
  mov    -0x28(%rsp),%r12
  lea    0x4(%rax),%rsi
  lea    -0x1(%r10),%eax
  mov    %ebp,-0x1c(%rsp)
  mov    -0x30(%rsp),%rbp
  lea    (%rcx,%rax,4),%rax
  mov    %rax,-0x40(%rsp)
  nopl   (%rax)
L184:
  movslq (%rsi),%rcx
  mov    (%rbx,%rcx,4),%edi
  mov    0x4(%rbx,%rcx,4),%edx
  mov    %rcx,%r10
  cmp    %edi,%edx
  jle    L75
  sub    %edi,%edx
  movslq %edi,%r11
  sub    $0x1,%edx
  lea    0x0(%rbp,%r11,4),%rax
  add    %r11,%rdx
  lea    (%r12,%rdx,4),%rdi
  jmp    L101
  nopl   0x0(%rax,%rax,1)
L110:
  add    $0x4,%rax
  cmp    %rax,%rdi
  je     L75
L101:
  movslq (%rax),%rdx
  mov    (%r9,%rdx,4),%edx
  test   %edx,%edx
  jne    L110
  movl   $0x1,(%r9,%rcx,4)
L34:
  add    $0x4,%rsi
  cmp    %rsi,-0x40(%rsp)
  jne    L184
  mov    -0x20(%rsp),%r12d
  mov    -0x1c(%rsp),%ebp
  test   %r13d,%r13d
  jle    L23
  mov    0x38(%rsp),%rax
  mov    -0x10(%rsp),%rcx
  mov    %r14d,(%r15,%r13,4)
  add    (%rax),%r12d
  lea    -0x1(%r12),%eax
  mov    %eax,(%rcx,%r13,4)
  movl   $0x2,(%r9,%r13,4)
L23:
  mov    0x48(%rsp),%rax
  mov    -0x38(%rsp),%rcx
  movslq (%rax,%rcx,4),%rax
  movl   $0x0,(%r9,%rax,4)
  test   %ebp,%ebp
  jne    L35
L161:
  mov    0x40(%rsp),%rcx
  addq   $0x1,-0x38(%rsp)
  mov    -0x38(%rsp),%rax
  cmp    %eax,(%rcx)
  jge    L155
L139:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L75:
  add    (%r15,%rcx,4),%r14d
  movl   $0xffffffff,(%r9,%rcx,4)
  movslq %r10d,%rax
  nop
L247:
  lea    (%r8,%rax,4),%rdx
  movslq (%rdx),%rax
  test   %eax,%eax
  jg     L247
  mov    %r13d,(%rdx)
  movslq %r10d,%r13
  jmp    L34
L113:
  neg    %eax
  cltq
  jmp    L40
L35:
  mov    0x50(%rsp),%rax
  mov    -0x8(%rsp),%rcx
  lea    -0x1(%rbp),%edx
  add    $0x4,%rax
  lea    (%rcx,%rdx,4),%rcx
  nopl   0x0(%rax)
L78:
  movslq (%rax),%rdx
  add    $0x4,%rax
  movl   $0x0,(%r9,%rdx,4)
  cmp    %rax,%rcx
  jne    L78
  jmp    L161
```

assistant: ```c
void _glp_qmd_qmdmrg(int xadj[], int adjncy[], int deg[], int qsize[], int qlink[], int marker[], int *_deg0, int *_nhdsze, int nbrhd[], int rchset[], int ovrlp[]) {
  int deg1, head, inhd, iov, irch, j, jstop, jstrt, link, lnode, mark, mrgsze, nabor, node, novrlp, rchsze, root;
  if ((*_nhdsze) <= 0)
    return;
  for (inhd = 1; inhd <= (*_nhdsze); inhd++) {
    root = nbrhd[inhd];
    marker[root] = 0;
  }
  for (inhd = 1; inhd <= (*_nhdsze); inhd++) {
    root = nbrhd[inhd];
    marker[root] = -1;
    rchsze = 0;
    novrlp = 0;
    deg1 = 0;
  s200:
    jstrt = xadj[root];
    jstop = xadj[root + 1] - 1;
    for (j = jstrt; j <= jstop; j++) {
      nabor = adjncy[j];
      root = -nabor;
      if (nabor < 0)
        goto s200;
      if (nabor == 0)
        break;
      mark = marker[nabor];
      if (mark == 0) {
        rchsze++;
        rchset[rchsze] = nabor;
        deg1 += qsize[nabor];
        marker[nabor] = 1;
      } else if (mark == 1) {
        novrlp++;
        ovrlp[novrlp] = nabor;
        marker[nabor] = 2;
      }
    }
    head = 0;
    mrgsze = 0;
    for (iov = 1; iov <= novrlp; iov++) {
      node = ovrlp[iov];
      jstrt = xadj[node];
      jstop = xadj[node + 1] - 1;
      for (j = jstrt; j <= jstop; j++) {
        nabor = adjncy[j];
        if (marker[nabor] == 0) {
          marker[node] = 1;
          goto s1100;
        }
      }
      mrgsze += qsize[node];
      marker[node] = -1;
      lnode = node;
    s900:
      link = qlink[lnode];
      if (link > 0) {
        lnode = link;
        goto s900;
      }
      qlink[lnode] = head;
      head = node;
    s1100:;
    }
    if (head > 0) {
      qsize[head] = mrgsze;
      deg[head] = (*_deg0) + deg1 - 1;
      marker[head] = 2;
    }
    root = nbrhd[inhd];
    marker[root] = 0;
    if (rchsze > 0) {
      for (irch = 1; irch <= rchsze; irch++) {
        node = rchset[irch];
        marker[node] = 0;
      }
    }
  }
  return;
}
```