user: Translate the below assembly code into C programming language:

```asm
<renumber_groups>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x28(%rbp)
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <ckalloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L67
L59:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  addl   $0x1,-0x14(%rbp)
L67:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L59
  movl   $0x0,-0xc(%rbp)
  cmpl   $0x0,-0x28(%rbp)
  jle    L87
  movl   $0x0,-0x14(%rbp)
  jmp    L46
L49:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x28(%rbp)
  jne    L22
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movl   $0x1,(%rax)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L22:
  addl   $0x1,-0x14(%rbp)
L46:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L49
  addl   $0x1,-0xc(%rbp)
L87:
  movl   $0x0,-0x14(%rbp)
  jmp    L56
L50:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L117
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  jmp    L32
L109:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L116
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    -0xc(%rbp),%edx
  add    $0x1,%edx
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L116:
  addl   $0x1,-0x10(%rbp)
L32:
  mov    -0x10(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L109
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    -0xc(%rbp),%edx
  add    $0x1,%edx
  mov    %edx,(%rax)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  addl   $0x1,-0xc(%rbp)
L117:
  addl   $0x1,-0x14(%rbp)
L56:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L50
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <ckfree@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  leave
  ret
```

assistant: ```c
int renumber_groups(int nseqs, int *aligned_group, int first_group) {
  int i, j;
  int naligned_groups;
  int *tmp;
  tmp = (int *)ckalloc((nseqs + 1) * sizeof(int));
  for (i = 0; i < nseqs; i++) {
    tmp[i] = aligned_group[i];
    aligned_group[i] = 0;
  }
  naligned_groups = 0;
  if (first_group > 0) {
    for (i = 0; i < nseqs; i++)
      if (tmp[i] == first_group) {
        aligned_group[i] = 1;
        tmp[i] = 0;
      }
    naligned_groups++;
  }
  for (i = 0; i < nseqs; i++)
    if (tmp[i] != 0) {
      for (j = i + 1; j < nseqs; j++)
        if (tmp[j] == tmp[i]) {
          aligned_group[j] = naligned_groups + 1;
          tmp[j] = 0;
        }
      aligned_group[i] = naligned_groups + 1;
      tmp[i] = 0;
      naligned_groups++;
    }
  tmp = ckfree(tmp);
  return naligned_groups;
}
```