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

```asm
<qrnzcnt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x108,%rsp
  mov    %edi,%r15d
  mov    %esi,%r14d
  mov    %rdx,0x18(%rsp)
  mov    %rcx,%r12
  mov    %r8,%r13
  mov    %r9,0x28(%rsp)
  mov    $0x0,%eax
  call   <intMalloc@plt>
  mov    %eax,0x70(%rsp)
  movslq %eax,%rbx
  mov    %r15d,%edi
  mov    $0x0,%eax
  call   <intMalloc@plt>
  mov    %eax,0x78(%rsp)
  movslq %eax,%rdx
  mov    %rdx,0x38(%rsp)
  mov    %r15d,0x54(%rsp)
  lea    0x1(%r15),%ebp
  mov    %ebp,%edi
  mov    $0x0,%eax
  call   <intMalloc@plt>
  mov    %eax,0x80(%rsp)
  movslq %eax,%r15
  mov    %ebp,%edi
  mov    $0x0,%eax
  call   <intMalloc@plt>
  mov    %eax,0x88(%rsp)
  movslq %eax,%rdx
  mov    %rdx,0x48(%rsp)
  mov    %ebp,%edi
  mov    $0x0,%eax
  call   <intMalloc@plt>
  mov    %eax,0x90(%rsp)
  movslq %eax,%rdx
  mov    %rdx,0xa0(%rsp)
  mov    %ebp,%edi
  mov    $0x0,%eax
  call   <intMalloc@plt>
  mov    %eax,0x98(%rsp)
  movslq %eax,%r11
  mov    %r11,0xa8(%rsp)
  mov    0x54(%rsp),%edi
  mov    $0x0,%eax
  call   <intMalloc@plt>
  mov    %eax,0xe0(%rsp)
  movslq %eax,%r11
  mov    %r11,0x10(%rsp)
  mov    0x54(%rsp),%edi
  lea    0x1(%r14,%rdi,2),%edi
  mov    $0x0,%eax
  call   <intMalloc@plt>
  mov    %eax,0xe8(%rsp)
  movslq %eax,%r11
  mov    %r11,0x20(%rsp)
  movslq %r14d,%r14
  lea    (%r11,%r14,4),%rsi
  mov    %rsi,0x60(%rsp)
  mov    0x54(%rsp),%edi
  movslq %edi,%rax
  lea    0x4(,%rax,4),%r14
  mov    %r14,0x58(%rsp)
  add    %r14,%rsi
  mov    %rsi,0x8(%rsp)
  mov    %edi,%r14d
  mov    $0x0,%eax
  call   <intMalloc@plt>
  mov    %eax,0xc8(%rsp)
  movslq %eax,%r8
  mov    %r8,0xd0(%rsp)
  mov    %r14d,0x54(%rsp)
  mov    %r14d,%edi
  mov    $0x0,%eax
  call   <intMalloc@plt>
  movslq %eax,%r8
  mov    %r8,0x68(%rsp)
  mov    %ebp,%edi
  mov    $0x0,%eax
  call   <intCalloc@plt>
  mov    %eax,0xec(%rsp)
  movslq %eax,%r14
  mov    0x54(%rsp),%ebp
  mov    %ebp,%edi
  mov    $0x0,%eax
  call   <intMalloc@plt>
  movslq %eax,%r8
  mov    %r8,0xb0(%rsp)
  mov    %ebp,0x54(%rsp)
  mov    %ebp,%edi
  mov    $0x0,%eax
  call   <intMalloc@plt>
  mov    %eax,0xc0(%rsp)
  movslq %eax,%rbp
  mov    0x54(%rsp),%edi
  mov    $0x0,%eax
  call   <intMalloc@plt>
  mov    %eax,0xcc(%rsp)
  movslq %eax,%r9
  mov    %r9,0xb8(%rsp)
  mov    0x54(%rsp),%edi
  test   %edi,%edi
  jle    L140
  movslq 0x78(%rsp),%rdx
  mov    %edi,%eax
  mov    %rdx,%rdi
  lea    (%rdx,%rax,4),%r11
  mov    %rdx,%rax
  movslq 0xc8(%rsp),%rcx
  mov    %rcx,(%rsp)
  mov    %rcx,%r10
  sub    %rdx,%r10
  movslq 0x70(%rsp),%rcx
  sub    %rdx,%rcx
  mov    0x160(%rsp),%r9
  sub    %rdx,%r9
  movslq 0xc0(%rsp),%rdx
  sub    %rdi,%rdx
  mov    0x168(%rsp),%r8
  sub    %rdi,%r8
  movslq 0x98(%rsp),%rsi
  mov    %rsi,0x40(%rsp)
  sub    %rdi,%rsi
L70:
  movl   $0xffffffff,(%rax)
  movl   $0xffffffff,(%r10,%rax,1)
  movl   $0xffffffff,(%rcx,%rax,1)
  movl   $0x0,(%r9,%rax,1)
  movl   $0x0,(%rdx,%rax,1)
  movl   $0x0,(%r8,%rax,1)
  movl   $0x0,(%rsi,%rax,1)
  add    $0x4,%rax
  cmp    %r11,%rax
  jne    L70
  mov    0x58(%rsp),%rax
  lea    -0x4(%rax),%rdi
  mov    %rdi,0xd8(%rsp)
  mov    0xa8(%rsp),%rdi
  movl   $0x0,-0x4(%rdi,%rax,1)
  mov    0x54(%rsp),%eax
  mov    %rax,0x30(%rsp)
  mov    (%rsp),%rsi
  mov    %rsi,%r8
  mov    $0x0,%r9d
  mov    $0x0,%r10d
  mov    0x40(%rsp),%rax
  sub    %rsi,%rax
  mov    %rax,0x40(%rsp)
  mov    %rbx,(%rsp)
  mov    %r15,0xf0(%rsp)
  mov    %rdi,%rbx
  mov    0x68(%rsp),%r15
  mov    %r14,0xf8(%rsp)
  jmp    L8
L190:
  movslq %r10d,%rax
  mov    %r11d,%ecx
  sub    %r10d,%ecx
  mov    0x168(%rsp),%rsi
  mov    %ecx,(%rsi,%rax,4)
  mov    %r11d,%r10d
L129:
  add    $0x1,%rdx
  cmp    %edx,(%rdi)
  jle    L185
L373:
  movslq (%r12,%rdx,4),%rax
  mov    0x0(%r13,%rax,4),%ecx
  movslq %ecx,%rsi
  lea    0x0(,%rsi,4),%rax
  addl   $0x1,0x0(%rbp,%rax,1)
  add    (%rsp),%rax
  cmpl   $0xffffffff,(%rax)
  jne    L129
  mov    %r11d,(%rax)
  mov    (%r8),%eax
  mov    %eax,(%r15,%rsi,4)
  mov    %ecx,(%r8)
  test   %r14d,%r14d
  je     L129
  cmp    %r14d,%r10d
  jne    L190
  jmp    L129
L185:
  add    $0x1,%r9
  add    $0x4,%r8
  cmp    0x30(%rsp),%r9
  je     L475
L8:
  mov    %r9d,%r11d
  mov    0x148(%rsp),%rax
  movslq (%rax,%r9,4),%rax
  addl   $0x1,(%rbx,%rax,4)
  mov    %r9d,%r14d
  test   %r9d,%r9d
  je     L530
  mov    0x40(%rsp),%rax
  cmpl   $0x1,(%rax,%r8,1)
  jle    L530
  movslq %r10d,%rax
  mov    %r9d,%edx
  sub    %r10d,%edx
  mov    0x168(%rsp),%rdi
  mov    %edx,(%rdi,%rax,4)
  mov    %r9d,%r10d
L530:
  mov    0x28(%rsp),%rax
  movslq (%rax,%r9,4),%rax
  mov    0x18(%rsp),%rdi
  mov    (%rdi,%rax,4),%edx
  lea    0x4(%rdi,%rax,4),%rdi
  cmp    (%rdi),%edx
  jge    L185
  movslq %edx,%rdx
  jmp    L373
L475:
  mov    (%rsp),%rbx
  mov    0xf0(%rsp),%r15
  mov    0xf8(%rsp),%r14
  movslq %r10d,%rax
  mov    0x54(%rsp),%edx
  sub    %r10d,%edx
  mov    0x168(%rsp),%rdi
  mov    %edx,(%rdi,%rax,4)
  mov    0x60(%rsp),%rax
  movl   $0x0,(%rax)
  mov    $0x0,%ecx
  mov    0x38(%rsp),%r10
  mov    %r15,(%rsp)
  mov    %rax,%r15
  mov    %r14,0x40(%rsp)
  jmp    L484
L317:
  mov    $0x0,%r8d
L92:
  add    (%r15,%rcx,4),%r8d
  mov    %r8d,0x4(%r15,%rcx,4)
  add    $0x1,%rcx
  cmp    0x30(%rsp),%rcx
  je     L255
L484:
  mov    %ecx,%r9d
  mov    0x28(%rsp),%rax
  mov    (%rax,%rcx,4),%eax
  mov    (%r15,%rcx,4),%edx
  mov    0x8(%rsp),%rdi
  mov    %edx,(%rdi,%rcx,4)
  cltq
  mov    0x18(%rsp),%rdi
  mov    (%rdi,%rax,4),%edx
  lea    0x4(%rdi,%rax,4),%rdi
  cmp    (%rdi),%edx
  jge    L317
  movslq %edx,%rdx
  mov    $0x0,%r8d
  jmp    L326
L255:
  mov    (%rsp),%r15
  mov    0x40(%rsp),%r14
  mov    0x58(%rsp),%rax
  movl   $0x0,-0x4(%r15,%rax,1)
  mov    0x54(%rsp),%eax
  lea    -0x1(%rax),%edx
  movslq 0xc0(%rsp),%rcx
  movslq %edx,%rax
  lea    (%rcx,%rax,4),%rax
  movslq 0xcc(%rsp),%rsi
  sub    %rcx,%rsi
  mov    %rsi,%r13
  movslq 0x70(%rsp),%rsi
  sub    %rcx,%rsi
  mov    %rsi,%r12
  movslq 0x78(%rsp),%r10
  sub    %rcx,%r10
  movslq 0x80(%rsp),%r9
  sub    %rcx,%r9
  mov    0x148(%rsp),%r11
  sub    %rcx,%r11
  movslq 0x88(%rsp),%r8
  sub    %rcx,%r8
  movslq 0x90(%rsp),%rdi
  sub    %rcx,%rdi
  movslq 0xe0(%rsp),%rsi
  sub    %rcx,%rsi
L69:
  movl   $0x1,(%rax)
  movl   $0x0,0x0(%r13,%rax,1)
  mov    %edx,(%r12,%rax,1)
  movl   $0xffffffff,(%r10,%rax,1)
  movslq (%r11,%rax,1),%rcx
  mov    (%r15,%rcx,4),%ecx
  add    $0x1,%ecx
  mov    %ecx,(%r9,%rax,1)
  movl   $0x1,(%r8,%rax,1)
  mov    %edx,(%rdi,%rax,1)
  movl   $0xffffffff,(%rsi,%rax,1)
  sub    $0x4,%rax
  sub    $0x1,%edx
  jns    L69
L221:
  mov    0xa0(%rsp),%r11
  mov    0xd8(%rsp),%rax
  movl   $0xffffffff,(%r11,%rax,1)
  mov    0x54(%rsp),%eax
  test   %eax,%eax
  jle    L72
  movslq 0x90(%rsp),%rdx
  lea    -0x1(%rax),%eax
  shl    $0x2,%rax
  mov    %rax,0xe0(%rsp)
  lea    0x4(%rdx,%rax,1),%r9
  mov    %rdx,%rax
  mov    0x148(%rsp),%r8
  sub    %rdx,%r8
  mov    0x150(%rsp),%rdi
  sub    %rdx,%rdi
  mov    0x48(%rsp),%r10
  jmp    L507
L172:
  add    $0x4,%rax
  cmp    %r9,%rax
  je     L491
L507:
  movslq (%r8,%rax,1),%rcx
  movl   $0x0,(%r10,%rcx,4)
  movl   $0x0,(%rdi,%rax,1)
  mov    (%rax),%esi
  lea    (%r11,%rcx,4),%rcx
  cmp    %esi,(%rcx)
  jle    L172
  mov    %esi,(%rcx)
  jmp    L172
L491:
  movslq 0x80(%rsp),%rax
  movslq 0xec(%rsp),%rdi
  mov    %rdi,0xd8(%rsp)
  movslq 0x88(%rsp),%rsi
  mov    %rsi,0xc0(%rsp)
  mov    0x54(%rsp),%ecx
  mov    %rcx,0x70(%rsp)
  mov    %rsi,0x18(%rsp)
  mov    %rax,%r10
  mov    $0x0,%r9d
  movl   $0x0,0x30(%rsp)
  movslq 0xc8(%rsp),%rcx
  sub    %rax,%rcx
  mov    %rcx,0x78(%rsp)
  sub    %rax,%rdx
  mov    %rdx,0x80(%rsp)
  movslq 0x98(%rsp),%rdx
  sub    %rax,%rdx
  mov    %rdx,0x98(%rsp)
  movslq 0xe8(%rsp),%rax
  mov    %rax,0x88(%rsp)
  add    $0x4,%rax
  mov    %rax,0x90(%rsp)
  mov    0xb0(%rsp),%r12
  mov    %rbp,0x40(%rsp)
  mov    0x148(%rsp),%rbp
  jmp    L137
L208:
  movslq %ecx,%rax
  mov    (%rbx,%rax,4),%esi
  movslq %esi,%rax
  mov    (%rbx,%rax,4),%eax
  cmp    %eax,%esi
  je     L5
L424:
  movslq %ecx,%rcx
  mov    %eax,(%rbx,%rcx,4)
  movslq %eax,%rcx
  mov    (%rbx,%rcx,4),%esi
  mov    %eax,%ecx
  movslq %esi,%rax
  mov    (%rbx,%rax,4),%eax
  cmp    %eax,%esi
  jne    L424
L5:
  add    0x40(%rsp),%rdi
  cltq
  mov    (%r10),%ecx
  add    (%rdi),%ecx
  sub    (%r15,%rax,4),%ecx
  mov    %ecx,(%rdi)
  mov    0x48(%rsp),%rdi
  subl   $0x1,(%rdi,%rax,4)
L309:
  mov    %ebp,0x0(%r13)
  mov    $0x1,%ecx
L506:
  mov    %ebp,(%r8)
L361:
  add    $0x4,%rdx
  cmp    %rdx,%r11
  je     L18
L426:
  mov    (%rdx),%eax
  cmp    %r9d,%eax
  jle    L361
  cltq
  lea    0x0(,%rax,4),%rdi
  mov    0x10(%rsp),%rsi
  lea    (%rsi,%rdi,1),%r8
  mov    (%rsp),%esi
  cmp    %esi,(%r8)
  jge    L506
  mov    0x18(%rsp),%rsi
  addl   $0x1,(%rsi)
  mov    0x38(%rsp),%rsi
  lea    (%rsi,%rdi,1),%r13
  mov    0x0(%r13),%ecx
  cmp    $0xffffffff,%ecx
  jne    L208
  add    0x40(%rsp),%rdi
  mov    (%r10),%ecx
  add    (%rdi),%ecx
  sub    (%r15,%rax,4),%ecx
  mov    %ecx,(%rdi)
  jmp    L309
L18:
  mov    0x58(%rsp),%rdi
  mov    0x148(%rsp),%rbp
  mov    0x0(%rbp,%r9,4),%eax
  movslq %eax,%rdx
  mov    0x48(%rsp),%rsi
  subl   $0x1,(%rsi,%rdx,4)
  cmp    $0x1,%ecx
  je     L423
L308:
  mov    0x98(%rsp),%rsi
  cmpl   $0x1,(%rsi,%r10,1)
  jle    L187
L423:
  test   %r9d,%r9d
  je     L370
  mov    0x30(%rsp),%r11d
  movslq %r11d,%rdx
  mov    0x28(%rsp),%esi
  mov    %esi,%ecx
  sub    %r11d,%ecx
  mov    0x160(%rsp),%r11
  mov    %ecx,(%r11,%rdx,4)
  mov    %esi,0x30(%rsp)
L152:
  movslq 0x30(%rsp),%rdx
  mov    %eax,(%rbx,%rdx,4)
  add    $0x1,%r9
  add    $0x4,%r10
  add    $0x4,%rdi
  addq   $0x4,0x18(%rsp)
  cmp    0x70(%rsp),%r9
  je     L226
L137:
  mov    %r9d,0x28(%rsp)
  mov    0x78(%rsp),%rax
  mov    (%rax,%r10,1),%eax
  cmp    $0xffffffff,%eax
  je     L333
  mov    0x68(%rsp),%r13
L350:
  cltq
  mov    (%r10),%edx
  sub    (%r15,%rax,4),%edx
  add    $0x1,%edx
  mov    %edx,(%r12,%rax,4)
  addl   $0x1,(%rdi)
  movslq 0x0(%rbp,%rax,4),%rdx
  subl   $0x1,(%r14,%rdx,4)
  mov    0x0(%r13,%rax,4),%eax
  cmp    $0xffffffff,%eax
  jne    L350
L333:
  mov    0x80(%rsp),%rax
  mov    (%rax,%r10,1),%eax
  mov    %eax,(%rsp)
  mov    0x60(%rsp),%rax
  mov    (%rax,%r9,4),%ecx
  mov    0x8(%rsp),%rax
  mov    (%rax,%r9,4),%eax
  cmp    %eax,%ecx
  jge    L405
  movslq %ecx,%rsi
  mov    0x88(%rsp),%rdx
  lea    (%rdx,%rsi,4),%rdx
  sub    $0x1,%eax
  sub    %ecx,%eax
  add    %rsi,%rax
  mov    0x90(%rsp),%rsi
  lea    (%rsi,%rax,4),%r11
  mov    $0x0,%ecx
  mov    %rdi,0x58(%rsp)
  mov    %rbp,0x148(%rsp)
  mov    0x28(%rsp),%ebp
  jmp    L426
L187:
  cmp    %eax,0x54(%rsp)
  jne    L152
  cmp    %r9d,(%rsp)
  jne    L152
  mov    0x160(%rsp),%rsi
  movl   $0x1,(%rsi,%r9,4)
  mov    0x28(%rsp),%esi
  mov    %esi,0x30(%rsp)
  jmp    L152
L370:
  mov    0x28(%rsp),%esi
  mov    %esi,0x30(%rsp)
  jmp    L152
L226:
  mov    0x40(%rsp),%rbp
  mov    0x158(%rsp),%rax
  movl   $0x0,(%rax)
  mov    0x150(%rsp),%rcx
  mov    0xe0(%rsp),%rdi
  lea    0x4(%rcx,%rdi,1),%rdi
  mov    0xd8(%rsp),%rax
  mov    %rax,%rdx
  movslq 0xcc(%rsp),%rsi
  sub    %rax,%rsi
  mov    0xc0(%rsp),%r9
  sub    %rax,%r9
  mov    0x148(%rsp),%r8
  sub    %rax,%r8
  mov    %rbx,(%rsp)
  mov    0xb8(%rsp),%r12
  mov    0x54(%rsp),%ebx
  mov    %rcx,%r13
  mov    0x158(%rsp),%r11
  jmp    L218
L324:
  mov    (%rsp),%rbx
L538:
  mov    0x30(%rsp),%edi
  movslq %edi,%rax
  mov    0x54(%rsp),%edx
  sub    %edi,%edx
  mov    0x160(%rsp),%rdi
  mov    %edx,(%rdi,%rax,4)
  mov    %rbx,%rdi
  call   <free@plt>
  mov    0x38(%rsp),%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  mov    0xa0(%rsp),%rdi
  call   <free@plt>
  mov    0xa8(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    0xd0(%rsp),%rdi
  call   <free@plt>
  mov    0x68(%rsp),%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    0xb0(%rsp),%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0xb8(%rsp),%rdi
  call   <free@plt>
  mov    $0x0,%eax
  add    $0x108,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L413:
  mov    (%rdx),%eax
  add    %eax,(%rcx)
L77:
  add    $0x4,%rcx
  add    $0x4,%rdx
  cmp    %rdi,%rcx
  je     L324
L218:
  lea    (%rsi,%rdx,1),%rax
  mov    (%rax),%r10d
  add    (%r9,%rdx,1),%r10d
  mov    %r10d,(%rax)
  add    %r10d,(%r11)
  mov    (%r8,%rdx,1),%eax
  cmp    %eax,%ebx
  je     L413
  cltq
  shl    $0x2,%rax
  add    %r10d,(%r12,%rax,1)
  mov    (%rdx),%r10d
  add    (%rcx),%r10d
  mov    %r10d,(%rcx)
  add    %r10d,0x0(%r13,%rax,1)
  jmp    L77
L405:
  mov    0x0(%rbp,%r9,4),%eax
  movslq %eax,%rdx
  mov    0x48(%rsp),%rsi
  subl   $0x1,(%rsi,%rdx,4)
  jmp    L308
L72:
  mov    0x158(%rsp),%rax
  movl   $0x0,(%rax)
  movl   $0x0,0x30(%rsp)
  jmp    L538
L167:
  add    0x0(%rbp,%rsi,4),%r8d
L275:
  add    $0x1,%rdx
  cmp    %edx,(%rdi)
  jle    L92
L326:
  movslq (%r12,%rdx,4),%rax
  movslq 0x0(%r13,%rax,4),%rsi
  mov    (%rbx,%rsi,4),%eax
  cmp    %ecx,%eax
  je     L167
  cltq
  shl    $0x2,%rax
  lea    (%r10,%rax,1),%rsi
  cmp    %ecx,(%rsi)
  jge    L275
  add    0x8(%rsp),%rax
  movslq (%rax),%r14
  mov    0x20(%rsp),%r11
  mov    %r9d,(%r11,%r14,4)
  addl   $0x1,(%rax)
  mov    %r9d,(%rsi)
  jmp    L275
L140:
  mov    0x58(%rsp),%rax
  lea    -0x4(%rax),%rdi
  mov    %rdi,0xd8(%rsp)
  mov    0xa8(%rsp),%rdi
  movl   $0x0,-0x4(%rdi,%rax,1)
  mov    0x168(%rsp),%rdi
  mov    0x54(%rsp),%esi
  mov    %esi,(%rdi)
  mov    0x60(%rsp),%rdi
  movl   $0x0,(%rdi)
  movl   $0x0,-0x4(%r15,%rax,1)
  jmp    L221
```

assistant: ```c
int qrnzcnt(int neqns, int adjlen, int *xadj, int *adjncy, int *zfdperm, int *perm, int *invp, int *etpar, int *colcnt_h, int *nlnz, int *part_super_ata, int *part_super_h) {
  int temp, last1, last2, i, j, k, lflag, pleaf, hinbr, jstop, jstrt, ifdesc, oldnbr, parent, lownbr, lca;
  int xsup;
  int *set, *prvlf, *level, *weight, *fdesc, *nchild, *prvnbr;
  int *fnz;
  int *marker;
  int *fnz_hadj;
  int *hadj_begin;
  int *hadj_end;
  int *first;
  int *firstset;
  int *weight_h;
  int *rowcnt;
  int *colcnt;
  int *rowcnt_h;
  int nsuper;
  int nhnz;
  set = intMalloc(neqns);
  prvlf = intMalloc(neqns);
  level = intMalloc(neqns + 1);
  weight = intMalloc(neqns + 1);
  fdesc = intMalloc(neqns + 1);
  nchild = intMalloc(neqns + 1);
  prvnbr = intMalloc(neqns);
  fnz_hadj = intMalloc(adjlen + 2 * neqns + 1);
  hadj_begin = fnz_hadj + adjlen;
  hadj_end = hadj_begin + neqns + 1;
  fnz = set;
  marker = prvlf;
  first = intMalloc(neqns);
  firstset = intMalloc(neqns);
  weight_h = intCalloc(neqns + 1);
  rowcnt_h = intMalloc(neqns);
  rowcnt = intMalloc(neqns);
  colcnt = intMalloc(neqns);
  for (k = 0; k < neqns; ++k) {
    fnz[k] = first[k] = marker[k] = (-1);
    rowcnt[k] = part_super_ata[k] = 0;
    part_super_h[k] = 0;
    nchild[k] = 0;
  }
  nchild[(neqns)] = 0;
  xsup = 0;
  for (k = 0; k < neqns; ++k) {
    parent = etpar[k];
    ++nchild[parent];
    if (k != 0 && nchild[k] >= 2) {
      part_super_h[xsup] = k - xsup;
      xsup = k;
    }
    oldnbr = perm[k];
    for (j = xadj[oldnbr]; j < xadj[oldnbr + 1]; ++j) {
      i = zfdperm[adjncy[j]];
      ++rowcnt[i];
      if (fnz[i] == (-1)) {
        fnz[i] = k;
        firstset[i] = first[k];
        first[k] = i;
        if (k != 0 && xsup != k) {
          part_super_h[xsup] = k - xsup;
          xsup = k;
        }
      }
    }
  }
  part_super_h[xsup] = neqns - xsup;
  hadj_begin[0] = 0;
  for (k = 0; k < neqns; ++k) {
    temp = 0;
    oldnbr = perm[k];
    hadj_end[k] = hadj_begin[k];
    for (j = xadj[oldnbr]; j < xadj[oldnbr + 1]; ++j) {
      hinbr = zfdperm[adjncy[j]];
      jstrt = fnz[hinbr];
      if (jstrt != k && marker[jstrt] < k) {
        fnz_hadj[hadj_end[jstrt]] = k;
        ++hadj_end[jstrt];
        marker[jstrt] = k;
      }
      if (jstrt == k)
        temp += rowcnt[hinbr];
    }
    hadj_begin[k + 1] = hadj_begin[k] + temp;
  }
  level[(neqns)] = 0;
  for (k = neqns - 1; k >= 0; --k) {
    rowcnt[k] = 1;
    colcnt[k] = 0;
    set[k] = k;
    prvlf[k] = (-1);
    level[k] = level[etpar[k]] + 1;
    weight[k] = 1;
    fdesc[k] = k;
    prvnbr[k] = (-1);
  }
  fdesc[(neqns)] = (-1);
  for (k = 0; k < neqns; ++k) {
    parent = etpar[k];
    weight[parent] = 0;
    colcnt_h[k] = 0;
    ifdesc = fdesc[k];
    if (ifdesc < fdesc[parent]) {
      fdesc[parent] = ifdesc;
    }
  }
  xsup = 0;
  nsuper = 0;
  for (lownbr = 0; lownbr < neqns; ++lownbr) {
    for (i = first[lownbr]; i != (-1); i = firstset[i]) {
      rowcnt_h[i] = 1 + (level[lownbr] - level[i]);
      ++weight_h[lownbr];
      parent = etpar[i];
      --weight_h[parent];
    }
    lflag = 0;
    ifdesc = fdesc[lownbr];
    jstrt = hadj_begin[lownbr];
    jstop = hadj_end[lownbr];
    for (j = jstrt; j < jstop; ++j) {
      hinbr = fnz_hadj[j];
      if (hinbr > lownbr) {
        if (ifdesc > prvnbr[hinbr]) {
          ++weight[lownbr];
          pleaf = prvlf[hinbr];
          if (pleaf == (-1)) {
            rowcnt[hinbr] = rowcnt[hinbr] + level[lownbr] - level[hinbr];
          } else {
            last1 = pleaf;
            last2 = set[last1];
            lca = set[last2];
            while (lca != last2) {
              set[last1] = lca;
              last1 = lca;
              last2 = set[last1];
              lca = set[last2];
            }
            rowcnt[hinbr] = rowcnt[hinbr] + level[lownbr] - level[lca];
            --weight[lca];
          }
          prvlf[hinbr] = lownbr;
          lflag = 1;
        }
        prvnbr[hinbr] = lownbr;
      }
    }
    parent = etpar[lownbr];
    --weight[parent];
    if (lflag == 1 || nchild[lownbr] >= 2) {
      if (lownbr != 0)
        part_super_ata[xsup] = lownbr - xsup;
      ++nsuper;
      xsup = lownbr;
    } else {
      if (parent == (neqns) && ifdesc == lownbr) {
        part_super_ata[lownbr] = 1;
        ++nsuper;
        xsup = lownbr;
      }
    }
    set[xsup] = parent;
  }
  *nlnz = nhnz = 0;
  for (k = 0; k < neqns; ++k) {
    temp = colcnt[k] + weight[k];
    colcnt[k] = temp;
    *nlnz += temp;
    parent = etpar[k];
    if (parent != (neqns)) {
      colcnt[parent] += temp;
    }
    temp = colcnt_h[k] + weight_h[k];
    colcnt_h[k] = temp;
    nhnz += temp;
    if (parent != (neqns)) {
      colcnt_h[parent] += temp;
    }
  }
  part_super_ata[xsup] = neqns - xsup;
  free(set);
  free(prvlf);
  free(level);
  free(weight);
  free(fdesc);
  free(nchild);
  free(prvnbr);
  free(fnz_hadj);
  free(first);
  free(firstset);
  free(weight_h);
  free(rowcnt_h);
  free(rowcnt);
  free(colcnt);
  return 0;
}
```