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

```asm
<_compute_viterbi>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  movslq %r8d,%rcx
  lea    0x0(,%rcx,8),%r13
  mov    %rcx,%r14
  sub    $0x98,%rsp
  mov    %rdi,0x70(%rsp)
  mov    %r13,%rdi
  mov    %rsi,0x8(%rsp)
  mov    %rdx,0x58(%rsp)
  mov    %r9d,0x68(%rsp)
  mov    %rcx,(%rsp)
  call   <malloc@plt>
  mov    %r13,%rdi
  mov    %rax,%rbp
  call   <malloc@plt>
  mov    %r13,%rdi
  mov    %rax,%r15
  call   <malloc@plt>
  mov    %rax,%r12
  mov    0x68(%rsp),%eax
  imul   %r14d,%eax
  movslq %eax,%rdi
  mov    %eax,0x8c(%rsp)
  shl    $0x2,%rdi
  call   <malloc@plt>
  mov    %rax,0x60(%rsp)
  test   %rbp,%rbp
  je     L280
  test   %r15,%r15
  je     L280
  test   %r12,%r12
  je     L280
  test   %rax,%rax
  je     L280
  test   %r14d,%r14d
  mov    (%rsp),%rcx
  mov    0x8(%rsp),%r10
  jle    L204
  cmp    $0x1,%r14d
  je     L253
  mov    %r14d,%edx
  mov    0x58(%rsp),%rsi
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  shr    %edx
  shl    $0x4,%rdx
L235:
  movupd (%rsi,%rax,1),%xmm2
  movupd (%rbx,%rax,1),%xmm4
  mulpd  %xmm4,%xmm2
  addsd  %xmm2,%xmm0
  movups %xmm2,0x0(%rbp,%rax,1)
  unpckhpd %xmm2,%xmm2
  add    $0x10,%rax
  addsd  %xmm2,%xmm0
  cmp    %rdx,%rax
  jne    L235
  mov    %r14d,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%r14b
  je     L55
L101:
  mov    0x58(%rsp),%rdx
  cltq
  movsd  (%rdx,%rax,8),%xmm1
  mulsd  (%rbx,%rax,8),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm1,0x0(%rbp,%rax,8)
  cmp    $0x1,%r14d
  je     L211
L55:
  mov    %r14d,%edx
  movapd %xmm0,%xmm2
  mov    %rbp,%rax
  shr    %edx
  unpcklpd %xmm2,%xmm2
  shl    $0x4,%rdx
  add    %rbp,%rdx
L125:
  movupd (%rax),%xmm1
  add    $0x10,%rax
  divpd  %xmm2,%xmm1
  movups %xmm1,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L125
  mov    %r14d,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%r14b
  je     L204
L255:
  cltq
  lea    0x0(%rbp,%rax,8),%rax
  movsd  (%rax),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
L204:
  movslq 0x68(%rsp),%rax
  mov    0x70(%rsp),%rbx
  mov    %rax,%rdx
  shl    $0x2,%rax
  mov    %rax,0x78(%rsp)
  lea    -0x4(%rbx,%rax,1),%rax
  mov    %rax,0x80(%rsp)
  lea    -0x2(%rdx),%eax
  mov    %eax,0x88(%rsp)
  cmp    $0x1,%edx
  jle    L308
  mov    %r14d,%eax
  shl    $0x4,%rcx
  mov    %r14d,0x54(%rsp)
  mov    %r15,%r11
  shr    %eax
  mov    %rcx,%r8
  movl   $0x1,0x50(%rsp)
  mov    %r14d,%esi
  lea    -0x1(%rax),%ecx
  mov    %r14d,%eax
  and    $0xfffffffe,%eax
  add    $0x1,%rcx
  mov    %eax,0x4c(%rsp)
  lea    -0x1(%r14),%eax
  shl    $0x4,%rcx
  mov    %r13,%r14
  mov    %eax,0x6c(%rsp)
  mov    %rcx,%r15
  nop
L59:
  test   %esi,%esi
  jle    L212
  mov    0x6c(%rsp),%eax
  mov    0x60(%rsp),%rdx
  xor    %r13d,%r13d
  pxor   %xmm1,%xmm1
  mov    %r15,0x28(%rsp)
  mov    %r14,%r15
  mov    %r13,%r14
  mov    %r10,%r13
  mov    %rax,0x40(%rsp)
  movslq 0x54(%rsp),%rax
  mov    %r14d,%ebx
  mov    %r11,0x20(%rsp)
  lea    (%rdx,%rax,4),%rdx
  mov    %rdx,0x38(%rsp)
  mov    0x58(%rsp),%rdx
  lea    (%rdx,%rax,8),%rax
  mov    %rax,0x30(%rsp)
  cmp    $0x1,%esi
  je     L279
  nopl   0x0(%rax,%rax,1)
L103:
  mov    0x28(%rsp),%r11
  mov    %r13,%rdi
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L184:
  movsd  (%rdi),%xmm0
  movupd 0x0(%rbp,%rax,1),%xmm3
  movhpd (%rdi,%r15,1),%xmm0
  add    %r8,%rdi
  mulpd  %xmm3,%xmm0
  movups %xmm0,(%r12,%rax,1)
  add    $0x10,%rax
  cmp    %r11,%rax
  jne    L184
  mov    0x4c(%rsp),%eax
  cmp    %esi,%eax
  je     L180
L56:
  movslq %eax,%rdi
  imul   %esi,%eax
  add    %ebx,%eax
  cltq
  movsd  (%r10,%rax,8),%xmm0
  mulsd  0x0(%rbp,%rdi,8),%xmm0
  movsd  %xmm0,(%r12,%rdi,8)
L180:
  mov    %r12,%rdi
  xor    %eax,%eax
  mov    %r10,0x18(%rsp)
  add    $0x8,%r13
  mov    %r8,0x10(%rsp)
  mov    %esi,(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <argmax@plt>
  mov    0x38(%rsp),%rcx
  mov    (%rsp),%esi
  movslq %eax,%rdi
  mov    0x30(%rsp),%rdx
  mov    0x18(%rsp),%r10
  movsd  0x0(%rbp,%rdi,8),%xmm0
  movsd  0x8(%rsp),%xmm1
  mov    %eax,(%rcx,%r14,4)
  imul   %esi,%eax
  mulsd  (%rdx,%r14,8),%xmm0
  mov    0x10(%rsp),%r8
  add    %ebx,%eax
  cmp    0x40(%rsp),%r14
  cltq
  mulsd  (%r10,%rax,8),%xmm0
  mov    0x20(%rsp),%rax
  addsd  %xmm0,%xmm1
  movsd  %xmm0,(%rax,%r14,8)
  lea    0x1(%r14),%rax
  je     L30
  mov    %rax,%r14
  mov    %r14d,%ebx
  cmp    $0x1,%esi
  jne    L103
L279:
  xor    %eax,%eax
  jmp    L56
  nopw   0x0(%rax,%rax,1)
L30:
  mov    %r15,%r14
  mov    0x20(%rsp),%r11
  mov    0x28(%rsp),%r15
  cmp    $0x1,%esi
  je     L195
  movapd %xmm1,%xmm2
  mov    %r11,%rax
  lea    (%r11,%r15,1),%rdi
  unpcklpd %xmm2,%xmm2
  nopl   (%rax)
L38:
  movupd (%rax),%xmm0
  add    $0x10,%rax
  divpd  %xmm2,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rax,%rdi
  jne    L38
  movslq 0x4c(%rsp),%rax
  cmp    %esi,%eax
  je     L212
L141:
  lea    (%r11,%rax,8),%rax
  movsd  (%rax),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
L212:
  addl   $0x1,0x50(%rsp)
  mov    0x50(%rsp),%eax
  add    %esi,0x54(%rsp)
  cmp    %eax,0x68(%rsp)
  je     L127
  mov    %rbp,%rax
  mov    %r11,%rbp
  mov    %rax,%r11
  jmp    L59
L127:
  mov    %r11,%rdi
  xor    %eax,%eax
  mov    %r11,%r15
  mov    %esi,%r14d
  call   <argmax@plt>
  mov    0x80(%rsp),%rcx
  mov    %eax,(%rcx)
L327:
  cmp    $0x1,%r14d
  jne    L72
  mov    0x78(%rsp),%rax
  mov    0x70(%rsp),%rsi
  mov    0x60(%rsp),%rcx
  mov    -0x4(%rsi,%rax,1),%edx
  movslq 0x88(%rsp),%rax
  nopw   0x0(%rax,%rax,1)
L86:
  lea    0x1(%rdx,%rax,1),%edx
  movslq %edx,%rdx
  mov    (%rcx,%rdx,4),%edx
  mov    %edx,(%rsi,%rax,4)
  sub    $0x1,%rax
  test   %eax,%eax
  jns    L86
L100:
  xor    %r13d,%r13d
L146:
  mov    %r15,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  call   <free@plt>
  add    $0x98,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L211:
  xor    %eax,%eax
  jmp    L255
L195:
  xor    %eax,%eax
  jmp    L141
L72:
  mov    0x70(%rsp),%rdi
  mov    0x78(%rsp),%rax
  mov    0x8c(%rsp),%ecx
  movslq 0x88(%rsp),%rdx
  mov    -0x4(%rdi,%rax,1),%eax
  mov    0x60(%rsp),%rsi
  sub    %r14d,%ecx
L281:
  add    %ecx,%eax
  sub    %r14d,%ecx
  cltq
  mov    (%rsi,%rax,4),%eax
  mov    %eax,(%rdi,%rdx,4)
  sub    $0x1,%rdx
  test   %edx,%edx
  jns    L281
  jmp    L100
L308:
  mov    %rbp,%rdi
  mov    %r14d,%esi
  xor    %eax,%eax
  call   <argmax@plt>
  mov    0x80(%rsp),%rcx
  mov    %eax,(%rcx)
  mov    %r15,%rax
  mov    %rbp,%r15
  mov    %rax,%rbp
  mov    0x88(%rsp),%eax
  test   %eax,%eax
  js     L100
  jmp    L327
  nopl   0x0(%rax,%rax,1)
L253:
  pxor   %xmm0,%xmm0
  xor    %eax,%eax
  jmp    L101
L280:
  xchg   %rbp,%r15
  mov    $0x2,%r13d
  jmp    L146
```

assistant: ```c
int _compute_viterbi(int *path, const double *A, const double *pobs, const double *pi, int N, int T) {
  int i, j, t, maxi, result;
  double sum;
  double *v, *vnext, *h, *vh;
  int *ptr;
  result = 0;
  v = (double *)malloc(N * sizeof(double));
  vnext = (double *)malloc(N * sizeof(double));
  h = (double *)malloc(N * sizeof(double));
  ptr = (int *)malloc(T * N * sizeof(int));
  if (!v || !vnext || !h || !ptr) {
    result = 2;
    goto error;
  }
  sum = 0.0;
  for (i = 0; i < N; i++) {
    v[i] = pobs[i] * pi[i];
    sum += v[i];
  }
  for (i = 0; i < N; i++) {
    v[i] /= sum;
  }
  for (t = 1; t < T; t++) {
    sum = 0.0;
    for (j = 0; j < N; j++) {
      for (i = 0; i < N; i++) {
        h[i] = v[i] * A[i * N + j];
      }
      maxi = argmax(h, N);
      ptr[t * N + j] = maxi;
      vnext[j] = pobs[t * N + j] * v[maxi] * A[maxi * N + j];
      sum += vnext[j];
    }
    for (i = 0; i < N; i++) {
      vnext[i] /= sum;
    }
    vh = v;
    v = vnext;
    vnext = vh;
  }
  path[T - 1] = argmax(v, N);
  for (t = T - 2; t >= 0; t--) {
    path[t] = ptr[(t + 1) * N + path[t + 1]];
  }
error:
  free(v);
  free(vnext);
  free(h);
  free(ptr);
  return result;
}
```