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

```asm
<compute_dos_log>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  movsd  %xmm0,-0x38(%rbp)
  movsd  %xmm1,-0x40(%rbp)
  mov    %edx,-0x30(%rbp)
  movsd  -0x38(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  mov    $0x0,%edi
  call   <X_imp@plt>
  movsd  D68(%rip),%xmm1
  subsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  mov    %eax,%edi
  call   <log@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  mov    $0x0,%edi
  call   <log@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm4
  addsd  -0x10(%rbp),%xmm4
  movsd  %xmm4,-0x48(%rbp)
  movsd  -0x38(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  mov    $0x0,%edi
  call   <X_imp@plt>
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x38(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  mov    $0x1,%edi
  call   <X_imp@plt>
  movsd  -0x50(%rbp),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  D95(%rip),%xmm0
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <log@plt>
  addsd  -0x48(%rbp),%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  cmpl   $0x1,-0x30(%rbp)
  jne    L50
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x2c(%rbp),%xmm0
  subsd  -0x40(%rbp),%xmm0
  movsd  D95(%rip),%xmm1
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L42
L50:
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x14(%rbp)
L42:
  movl   $0x1,-0x1c(%rbp)
  jmp    L62
L75:
  mov    -0x1c(%rbp),%eax
  lea    -0x1(%rax),%edx
  movsd  -0x38(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  mov    %edx,%edi
  call   <X_imp@plt>
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <log@plt>
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    $0x0,%edi
  call   <log@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm5
  addsd  -0x10(%rbp),%xmm5
  movsd  %xmm5,-0x48(%rbp)
  movsd  -0x38(%rbp),%xmm0
  mov    -0x40(%rbp),%rdx
  mov    -0x1c(%rbp),%eax
  movapd %xmm0,%xmm1
  movq   %rdx,%xmm0
  mov    %eax,%edi
  call   <X_imp@plt>
  movsd  %xmm0,-0x50(%rbp)
  mov    -0x1c(%rbp),%eax
  lea    0x1(%rax),%edx
  movsd  -0x38(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  mov    %edx,%edi
  call   <X_imp@plt>
  movsd  -0x50(%rbp),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  D95(%rip),%xmm0
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <log@plt>
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x1c(%rbp)
L62:
  mov    -0x1c(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L75
  cmpl   $0x1,-0x30(%rbp)
  jne    L27
  movsd  -0x38(%rbp),%xmm0
  mov    -0x40(%rbp),%rdx
  mov    -0x1c(%rbp),%eax
  movapd %xmm0,%xmm1
  movq   %rdx,%xmm0
  mov    %eax,%edi
  call   <X_imp@plt>
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <log@plt>
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movl   $0x0,-0x18(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L22
L37:
  mov    $0x0,%edi
  call   <log@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm6
  addsd  -0x10(%rbp),%xmm6
  movsd  %xmm6,-0x48(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x18(%rbp),%xmm1
  movsd  -0x40(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  pxor   %xmm3,%xmm3
  cvtsi2sdl -0x18(%rbp),%xmm3
  movsd  -0x40(%rbp),%xmm1
  movapd %xmm1,%xmm2
  subsd  %xmm3,%xmm2
  movsd  D95(%rip),%xmm1
  addsd  %xmm1,%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  mov    -0x18(%rbp),%eax
  add    $0x1,%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movsd  -0x40(%rbp),%xmm0
  subsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x18(%rbp),%eax
  add    $0x1,%eax
  pxor   %xmm3,%xmm3
  cvtsi2sd %eax,%xmm3
  movsd  -0x40(%rbp),%xmm1
  movapd %xmm1,%xmm2
  subsd  %xmm3,%xmm2
  movsd  D95(%rip),%xmm1
  addsd  %xmm1,%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  D95(%rip),%xmm0
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <log@plt>
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x18(%rbp),%xmm1
  movsd  -0x40(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  pxor   %xmm3,%xmm3
  cvtsi2sdl -0x18(%rbp),%xmm3
  movsd  -0x40(%rbp),%xmm1
  movapd %xmm1,%xmm2
  subsd  %xmm3,%xmm2
  movsd  D95(%rip),%xmm1
  addsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <log@plt>
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  addl   $0x1,-0x18(%rbp)
  addl   $0x1,-0x1c(%rbp)
L22:
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x1c(%rbp)
  jl     L37
  addl   $0x1,-0x1c(%rbp)
  mov    -0x18(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  -0x40(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  mov    -0x18(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm3,%xmm3
  cvtsi2sd %eax,%xmm3
  movsd  -0x40(%rbp),%xmm1
  movapd %xmm1,%xmm2
  subsd  %xmm3,%xmm2
  movsd  D95(%rip),%xmm1
  addsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <log@plt>
  movapd %xmm0,%xmm1
  movsd  -0x10(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x18(%rbp),%xmm1
  movsd  -0x40(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movq   D32(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  pxor   %xmm3,%xmm3
  cvtsi2sdl -0x18(%rbp),%xmm3
  movsd  -0x40(%rbp),%xmm1
  movapd %xmm1,%xmm2
  subsd  %xmm3,%xmm2
  movsd  D95(%rip),%xmm1
  addsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    $0x0,%edi
  call   <log@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm7
  addsd  -0x10(%rbp),%xmm7
  movsd  %xmm7,-0x48(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x18(%rbp),%xmm1
  movsd  -0x40(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  pxor   %xmm3,%xmm3
  cvtsi2sdl -0x18(%rbp),%xmm3
  movsd  -0x40(%rbp),%xmm1
  movapd %xmm1,%xmm2
  subsd  %xmm3,%xmm2
  movsd  D95(%rip),%xmm1
  addsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x8(%rbp),%xmm1
  movsd  D95(%rip),%xmm0
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <log@plt>
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L61
L27:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  lea    -0x1(%rax),%edx
  movsd  -0x38(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  mov    %edx,%edi
  call   <X_imp@plt>
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <log@plt>
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x38(%rbp),%xmm0
  mov    -0x40(%rbp),%rdx
  mov    -0x1c(%rbp),%eax
  movapd %xmm0,%xmm1
  movq   %rdx,%xmm0
  mov    %eax,%edi
  call   <X_imp@plt>
  movq   %xmm0,%rax
  movq   D32(%rip),%xmm0
  movq   %rax,%xmm4
  xorpd  %xmm0,%xmm4
  movapd %xmm4,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    $0x0,%edi
  call   <log@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm5
  addsd  -0x10(%rbp),%xmm5
  movsd  %xmm5,-0x48(%rbp)
  movsd  -0x38(%rbp),%xmm0
  mov    -0x40(%rbp),%rdx
  mov    -0x1c(%rbp),%eax
  movapd %xmm0,%xmm1
  movq   %rdx,%xmm0
  mov    %eax,%edi
  call   <X_imp@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm1
  mulsd  -0x8(%rbp),%xmm1
  movsd  D95(%rip),%xmm0
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <log@plt>
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L61:
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D68
type_infered: f64
name: parse_data
arguments: label: D95
type_infered: byte[8]
name: parse_data
arguments: label: D32
type_infered: byte[8]

tool: D68: 2

tool: {"D95": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: {"D32": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

assistant: ```c
void compute_dos_log(double *gl, int N, double P, double K, int live) {
  int i, j, lim;
  double Xf;
  double m;
  m = log(2. - X_imp(0, K, P));
  gl[0] = log(0.5) + m + log(1 - X_imp(0, K, P) * X_imp(1, K, P));
  if (live == 1) {
    lim = (N - K - 1);
  } else {
    lim = (N - 1);
  }
  for (i = 1; i < lim; ++i) {
    m += log(X_imp(i - 1, K, P));
    gl[i] = log(0.5) + m + log(1 - X_imp(i, K, P) * X_imp(i + 1, K, P));
  }
  if (live == 1) {
    m += log(X_imp(i, K, P));
    j = 0;
    for (i = lim; i < (N - 1); ++i) {
      gl[i] = log(0.5) + m + log(1 - (K - j) / (K - j + 1) * (K - (j + 1)) / (K - (j + 1) + 1));
      m += log((K - j) / (K - j + 1));
      ++j;
    }
    ++i;
    m -= log((K - (j - 1)) / (K - (j - 1) + 1));
    Xf = -(K - j) / (K - j + 1);
    gl[N - 1] = log(0.5) + m + log(1 - (K - j) / (K - j + 1) * Xf);
  } else {
    ++i;
    m += log(X_imp(i - 1, K, P));
    Xf = -X_imp(i, K, P);
    gl[N - 1] = log(0.5) + m + log(1 - X_imp(i, K, P) * Xf);
  }
}
```