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

```asm
<_forward>:
  endbr64
  push   %r15
  push   %r14
  mov    %r8d,%r14d
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %r9d,%ebx
  sub    $0x48,%rsp
  mov    %rsi,0x20(%rsp)
  test   %r8d,%r8d
  jle    L172
  lea    0x8(%rcx),%rax
  mov    %rcx,%rdx
  cmp    %rax,%rdi
  lea    0x8(%r12),%rax
  setne  %cl
  cmp    %rax,%rdi
  setne  %al
  test   %al,%cl
  je     L130
  lea    -0x1(%r8),%eax
  cmp    $0x1,%eax
  jbe    L130
  mov    %r8d,%ecx
  pxor   %xmm3,%xmm3
  xor    %eax,%eax
  shr    %ecx
  movapd %xmm3,%xmm1
  shl    $0x4,%rcx
L169:
  movupd (%rdx,%rax,1),%xmm2
  movupd (%r12,%rax,1),%xmm5
  mulpd  %xmm5,%xmm2
  addsd  %xmm2,%xmm1
  movups %xmm2,0x0(%rbp,%rax,1)
  unpckhpd %xmm2,%xmm2
  add    $0x10,%rax
  addsd  %xmm2,%xmm1
  cmp    %rcx,%rax
  jne    L169
  mov    %r14d,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%r14b
  je     L7
  movsd  (%rdx,%rax,8),%xmm0
  mulsd  (%r12,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
  movsd  %xmm0,0x0(%rbp,%rax,8)
L7:
  movapd %xmm1,%xmm0
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <log@plt>
  movsd  0x8(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm3
  movapd %xmm0,%xmm4
  ucomisd %xmm3,%xmm1
  jp     L131
  jne    L131
L116:
  lea    -0x1(%rbx),%eax
  mov    %eax,0x1c(%rsp)
  test   %eax,%eax
  jle    L194
  mov    %r14d,%eax
  lea    -0x1(%r14),%edi
  movslq %r14d,%rbx
  xor    %r15d,%r15d
  shr    %eax
  mov    %edi,0x30(%rsp)
  lea    0x8(%rbp),%rdi
  shl    $0x3,%rbx
  lea    -0x1(%rax),%edx
  mov    %rdi,0x28(%rsp)
  mov    %r14d,%eax
  add    $0x1,%rdx
  and    $0xfffffffe,%eax
  shl    $0x4,%rdx
  mov    %eax,0x34(%rsp)
  xor    %eax,%eax
  mov    %rdx,0x38(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L290:
  add    $0x1,%r15d
  test   %r14d,%r14d
  jle    L33
  lea    (%rax,%r14,1),%r13d
  mov    0x30(%rsp),%r9d
  mov    0x28(%rsp),%rsi
  lea    0x0(%rbp,%rax,8),%r11
  movslq %r13d,%r8
  mov    0x20(%rsp),%rdi
  movapd %xmm3,%xmm2
  shl    $0x3,%r8
  add    %r9,%rax
  lea    (%rsi,%rax,8),%rcx
  lea    (%r12,%r8,1),%r10
  xor    %esi,%esi
  add    %rbp,%r8
L65:
  mov    %rdi,%rdx
  mov    %r11,%rax
  movapd %xmm3,%xmm1
  nopw   0x0(%rax,%rax,1)
L193:
  movsd  (%rax),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %rbx,%rdx
  addsd  %xmm0,%xmm1
  cmp    %rcx,%rax
  jne    L193
  mulsd  (%r10,%rsi,8),%xmm1
  lea    0x1(%rsi),%rax
  add    $0x8,%rdi
  addsd  %xmm1,%xmm2
  movsd  %xmm1,(%r8,%rsi,8)
  cmp    %r9,%rsi
  je     L293
  mov    %rax,%rsi
  jmp    L65
  nopw   0x0(%rax,%rax,1)
L293:
  ucomisd %xmm3,%xmm2
  jp     L47
  jne    L47
L163:
  movapd %xmm2,%xmm0
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm4,0x8(%rsp)
  call   <log@plt>
  movsd  0x8(%rsp),%xmm4
  cmp    %r15d,0x1c(%rsp)
  movslq %r13d,%rax
  movsd  0x10(%rsp),%xmm3
  addsd  %xmm0,%xmm4
  jne    L290
L194:
  add    $0x48,%rsp
  movapd %xmm4,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L47:
  cmp    $0x1,%r14d
  je     L227
  mov    0x38(%rsp),%rax
  movapd %xmm2,%xmm1
  unpcklpd %xmm1,%xmm1
  add    %r8,%rax
  nopl   0x0(%rax,%rax,1)
L155:
  movupd (%r8),%xmm0
  add    $0x10,%r8
  divpd  %xmm1,%xmm0
  movups %xmm0,-0x10(%r8)
  cmp    %rax,%r8
  jne    L155
  mov    0x34(%rsp),%eax
  cmp    %eax,%r14d
  je     L163
L109:
  add    %r13d,%eax
  cltq
  lea    0x0(%rbp,%rax,8),%rax
  movsd  (%rax),%xmm0
  divsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L163
L33:
  movapd %xmm3,%xmm2
  lea    (%rax,%r14,1),%r13d
  jmp    L163
L130:
  pxor   %xmm3,%xmm3
  mov    %r14d,%ecx
  xor    %eax,%eax
  movapd %xmm3,%xmm1
L95:
  movsd  (%r12,%rax,8),%xmm0
  mulsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  addsd  %xmm0,%xmm1
  cmp    %rcx,%rax
  jne    L95
  movapd %xmm1,%xmm0
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <log@plt>
  movsd  0x8(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm3
  movapd %xmm0,%xmm4
  ucomisd %xmm3,%xmm1
  jp     L289
  je     L116
L289:
  cmp    $0x1,%r14d
  je     L274
L131:
  mov    %r14d,%edx
  movapd %xmm1,%xmm2
  mov    %rbp,%rax
  shr    %edx
  unpcklpd %xmm2,%xmm2
  sub    $0x1,%edx
  shl    $0x4,%rdx
  lea    0x10(%rbp,%rdx,1),%rdx
L17:
  movupd (%rax),%xmm0
  add    $0x10,%rax
  divpd  %xmm2,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L17
  mov    %r14d,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%r14b
  je     L116
L180:
  cltq
  lea    0x0(%rbp,%rax,8),%rax
  movsd  (%rax),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L116
L227:
  xor    %eax,%eax
  jmp    L109
L172:
  pxor   %xmm3,%xmm3
  movapd %xmm3,%xmm0
  movsd  %xmm3,0x8(%rsp)
  call   <log@plt>
  movsd  0x8(%rsp),%xmm3
  movapd %xmm0,%xmm4
  jmp    L116
L274:
  xor    %eax,%eax
  jmp    L180
```

assistant: ```c
double _forward(double *alpha, const double *A, const double *pobs, const double *pi, int N, int T) {
  int i, j, t;
  double sum, logprob, scaling;
  scaling = 0.0;
  for (i = 0; i < N; i++) {
    alpha[i] = pi[i] * pobs[i];
    scaling += alpha[i];
  }
  logprob = log(scaling);
  if (scaling != 0)
    for (i = 0; i < N; i++)
      alpha[i] /= scaling;
  for (t = 0; t < T - 1; t++) {
    scaling = 0.0;
    for (j = 0; j < N; j++) {
      sum = 0.0;
      for (i = 0; i < N; i++) {
        sum += alpha[t * N + i] * A[i * N + j];
      }
      alpha[(t + 1) * N + j] = sum * pobs[(t + 1) * N + j];
      scaling += alpha[(t + 1) * N + j];
    }
    if (scaling != 0)
      for (j = 0; j < N; j++)
        alpha[(t + 1) * N + j] /= scaling;
    logprob += log(scaling);
  }
  return logprob;
}
```