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

```asm
<InitEtaN>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbp
  mov    %rsi,0x10(%rsp)
  mov    %edx,%ebx
  test   %edx,%edx
  jle    L62
  lea    0x1(%rdx),%edx
  imul   %ebx,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  lea    -0x1(%rbx),%esi
  mov    %esi,0x18(%rsp)
  movl   $0x0,0x4(%rsp)
  movl   $0xffffffff,0xc(%rsp)
  add    $0x1,%eax
  mov    %eax,0x1c(%rsp)
L132:
  mov    0xc(%rsp),%edi
  mov    %edi,%r14d
  cmp    %edi,%ebx
  jle    L5
  lea    0x2(%rdi),%edx
  lea    0x1(%rdi),%eax
  imul   %eax,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  neg    %eax
  mov    %eax,0x8(%rsp)
  mov    0x1c(%rsp),%r15d
  add    %edi,%r15d
  mov    %edi,%r13d
L117:
  mov    0x8(%rsp),%r12d
  add    0x4(%rsp),%r12d
  add    %r13d,%r12d
  cmp    %r13d,%r14d
  cmove  %r15d,%r12d
  mov    $0x8,%edi
  call   <malloc@plt>
  movslq %r12d,%r12
  mov    %rax,0x0(%rbp,%r12,8)
  movl   $0x0,(%rax)
  movl   $0xffffffff,0x4(%rax)
  add    $0x1,%r13d
  cmp    %r13d,%ebx
  jne    L117
L5:
  addl   $0x1,0xc(%rsp)
  mov    0xc(%rsp),%eax
  add    %ebx,0x4(%rsp)
  cmp    0x18(%rsp),%eax
  jne    L132
L62:
  mov    0x10(%rsp),%rax
  mov    (%rax),%r10d
  cmp    $0xffffffff,%r10d
  je     L113
  lea    0x1(%rbx),%eax
  imul   %ebx,%eax
  mov    %eax,%r12d
  shr    $0x1f,%r12d
  add    %eax,%r12d
  sar    %r12d
  mov    $0x0,%r13d
  add    $0x1,%r12d
  jmp    L25
L48:
  add    $0x1,%edx
  cmp    %edx,%ebx
  je     L3
L147:
  lea    (%rsi,%rdx,1),%eax
  cmp    %ecx,%edx
  cmove  %edi,%eax
  cltq
  lea    0x0(%rbp,%rax,8),%rax
  mov    (%rax),%r14
  addl   $0x1,(%r14)
  mov    (%rax),%rax
  cmpl   $0xffffffff,0x4(%rax)
  jne    L48
  mov    %r9d,0x4(%rax)
  jmp    L48
L3:
  add    %ebx,%r8d
  add    $0x1,%ecx
  cmp    %r11d,%ecx
  je     L127
L74:
  cmp    %r10d,%ebx
  jle    L3
  lea    0x2(%rcx),%edx
  lea    0x1(%rcx),%eax
  imul   %eax,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  lea    (%r12,%rcx,1),%edi
  mov    %r10d,%edx
  mov    %r8d,%esi
  sub    %eax,%esi
  jmp    L147
L127:
  add    $0x1,%r13
  mov    0x10(%rsp),%rax
  mov    (%rax,%r13,4),%r10d
  cmp    $0xffffffff,%r10d
  je     L113
L25:
  mov    %r13d,%r9d
  test   %r10d,%r10d
  js     L127
  mov    %r10d,%r11d
  mov    $0xffffffff,%ecx
  mov    $0x0,%r8d
  jmp    L74
L113:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void InitEtaN(int **etaN, const int *nicks, int seqlength) {
  int i, j, k, nick;
  int indexE;
  for (i = 0; i <= seqlength - 1; i++) {
    for (j = i - 1; j <= seqlength - 1; j++) {
      indexE = ((j) == (i)-1 ? (seqlength) * ((seqlength) + 1) / 2 + (i) : ((i) * (seqlength) + (j) - (i) * (1 + (i)) / 2));
      etaN[indexE] = (int *)malloc(2 * sizeof(int));
      etaN[indexE][0] = 0;
      etaN[indexE][1] = -1;
    }
  }
  k = 0;
  nick = nicks[k];
  while (nick != -1) {
    for (i = 0; i <= nick; i++) {
      for (j = nick; j <= seqlength - 1; j++) {
        indexE = ((j) == (i)-1 ? (seqlength) * ((seqlength) + 1) / 2 + (i) : ((i) * (seqlength) + (j) - (i) * (1 + (i)) / 2));
        etaN[indexE][0]++;
        if (etaN[indexE][1] == -1) {
          etaN[indexE][1] = k;
        }
      }
    }
    nick = nicks[++k];
  }
}
```