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

```asm
<_backward>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x3c(%rbp)
  mov    %r8d,-0x40(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L26
L102:
  mov    -0x40(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  D6(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x40(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  addl   $0x1,-0x1c(%rbp)
L26:
  mov    -0x1c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L102
  movl   $0x0,-0x1c(%rbp)
  jmp    L124
L40:
  mov    -0x40(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x40(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x1c(%rbp)
L124:
  mov    -0x1c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L40
  mov    -0x40(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L106
L46:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L105
L47:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L9
L37:
  mov    -0x1c(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  addl   $0x1,-0x18(%rbp)
L9:
  mov    -0x18(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L37
  mov    -0x14(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x8(%rbp),%xmm0
  addsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  addl   $0x1,-0x1c(%rbp)
L105:
  mov    -0x1c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L47
  pxor   %xmm0,%xmm0
  ucomisd -0x8(%rbp),%xmm0
  jp     L74
  pxor   %xmm0,%xmm0
  ucomisd -0x8(%rbp),%xmm0
  je     L16
L74:
  movl   $0x0,-0x18(%rbp)
  jmp    L130
L96:
  mov    -0x14(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x14(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x18(%rbp)
L130:
  mov    -0x18(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L96
L16:
  subl   $0x1,-0x14(%rbp)
L106:
  cmpl   $0x0,-0x14(%rbp)
  jns    L46
  nop
  nop
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D6
data_type: f64

tool: D6: 1

assistant: ```c
void _backward(double *beta, const double *A, const double *pobs, int N, int T) {
  int i, j, t;
  double sum, scaling;
  scaling = 0.0;
  for (i = 0; i < N; i++) {
    beta[(T - 1) * N + i] = 1.0;
    scaling += beta[(T - 1) * N + i];
  }
  for (i = 0; i < N; i++)
    beta[(T - 1) * N + i] /= scaling;
  for (t = T - 2; t >= 0; t--) {
    scaling = 0.0;
    for (i = 0; i < N; i++) {
      sum = 0.0;
      for (j = 0; j < N; j++) {
        sum += A[i * N + j] * pobs[(t + 1) * N + j] * beta[(t + 1) * N + j];
      }
      beta[t * N + i] = sum;
      scaling += sum;
    }
    if (scaling != 0)
      for (j = 0; j < N; j++)
        beta[t * N + j] /= scaling;
  }
}
```