user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<compute_dos_log>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r14
  mov    %esi,%r15d
  movsd  %xmm0,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  mov    %edx,%ebp
  movapd %xmm0,%xmm1
  movsd  0x8(%rsp),%xmm0
  mov    $0x0,%edi
  call   <X_imp@plt>
  movapd %xmm0,%xmm1
  movsd  D93(%rip),%xmm0
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edi
  call   <log@plt>
  movsd  %xmm0,0x18(%rsp)
  mov    $0x0,%edi
  call   <log@plt>
  movapd %xmm0,%xmm5
  addsd  0x18(%rsp),%xmm5
  movsd  %xmm5,0x20(%rsp)
  movsd  0x10(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  mov    $0x0,%edi
  call   <X_imp@plt>
  movq   %xmm0,%rbx
  movsd  0x10(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  mov    $0x1,%edi
  call   <X_imp@plt>
  movq   %rbx,%xmm6
  mulsd  %xmm0,%xmm6
  movsd  D57(%rip),%xmm1
  subsd  %xmm6,%xmm1
  cvttsd2si %xmm1,%edi
  call   <log@plt>
  addsd  0x20(%rsp),%xmm0
  movsd  %xmm0,(%r14)
  cmp    $0x1,%ebp
  je     L17
  lea    -0x1(%r15),%r13d
  cmp    $0x1,%r13d
  jle    L31
L74:
  lea    0x8(%r14),%r12
  mov    $0x1,%ebx
L9:
  lea    -0x1(%rbx),%edi
  movsd  0x10(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  call   <X_imp@plt>
  cvttsd2si %xmm0,%edi
  call   <log@plt>
  addsd  0x18(%rsp),%xmm0
  movsd  %xmm0,0x18(%rsp)
  mov    $0x0,%edi
  call   <log@plt>
  movapd %xmm0,%xmm3
  addsd  0x18(%rsp),%xmm3
  movsd  %xmm3,0x20(%rsp)
  movsd  0x10(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  mov    %ebx,%edi
  call   <X_imp@plt>
  movsd  %xmm0,0x28(%rsp)
  add    $0x1,%ebx
  movsd  0x10(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  mov    %ebx,%edi
  call   <X_imp@plt>
  mulsd  0x28(%rsp),%xmm0
  movsd  D57(%rip),%xmm1
  subsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%edi
  call   <log@plt>
  addsd  0x20(%rsp),%xmm0
  movsd  %xmm0,(%r12)
  add    $0x8,%r12
  cmp    %r13d,%ebx
  jne    L9
  cmp    $0x1,%ebp
  je     L72
L43:
  lea    0x1(%r13),%ebx
  movsd  0x10(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  mov    %r13d,%edi
  call   <X_imp@plt>
  cvttsd2si %xmm0,%edi
  call   <log@plt>
  addsd  0x18(%rsp),%xmm0
  movsd  %xmm0,0x18(%rsp)
  movsd  0x10(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  mov    %ebx,%edi
  call   <X_imp@plt>
  movq   %xmm0,%r12
  mov    $0x0,%edi
  call   <log@plt>
  movapd %xmm0,%xmm5
  addsd  0x18(%rsp),%xmm5
  movsd  %xmm5,0x18(%rsp)
  movsd  0x10(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  mov    %ebx,%edi
  call   <X_imp@plt>
  movq   %r12,%xmm6
  mulsd  %xmm0,%xmm6
  movapd %xmm6,%xmm0
  addsd  D57(%rip),%xmm0
  cvttsd2si %xmm0,%edi
  call   <log@plt>
  movslq %r15d,%r15
  addsd  0x18(%rsp),%xmm0
  movsd  %xmm0,-0x8(%r14,%r15,8)
L27:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L17:
  pxor   %xmm0,%xmm0
  cvtsi2sd %r15d,%xmm0
  subsd  0x8(%rsp),%xmm0
  subsd  D57(%rip),%xmm0
  cvttsd2si %xmm0,%r13d
  cmp    $0x1,%r13d
  jg     L74
  jmp    L80
L72:
  mov    %r13d,%ebp
L80:
  movsd  0x10(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  mov    %ebp,%edi
  call   <X_imp@plt>
  cvttsd2si %xmm0,%edi
  call   <log@plt>
  addsd  0x18(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  lea    -0x1(%r15),%eax
  cmp    %r13d,%eax
  jle    L63
  movslq %r13d,%rax
  lea    (%r14,%rax,8),%rbx
  lea    -0x1(%r15),%ebp
  sub    %r13d,%ebp
  mov    $0x0,%r12d
L46:
  mov    $0x0,%edi
  call   <log@plt>
  addsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x18(%rsp)
  pxor   %xmm1,%xmm1
  cvtsi2sd %r12d,%xmm1
  movsd  0x8(%rsp),%xmm6
  movapd %xmm6,%xmm0
  subsd  %xmm1,%xmm0
  movsd  D57(%rip),%xmm1
  addsd  %xmm0,%xmm1
  movapd %xmm0,%xmm7
  divsd  %xmm1,%xmm7
  add    $0x1,%r12d
  pxor   %xmm1,%xmm1
  cvtsi2sd %r12d,%xmm1
  subsd  %xmm1,%xmm6
  movapd %xmm6,%xmm0
  movsd  %xmm7,0x20(%rsp)
  movapd %xmm7,%xmm1
  mulsd  %xmm6,%xmm1
  addsd  D57(%rip),%xmm0
  divsd  %xmm0,%xmm1
  movsd  D57(%rip),%xmm4
  subsd  %xmm1,%xmm4
  cvttsd2si %xmm4,%edi
  call   <log@plt>
  addsd  0x18(%rsp),%xmm0
  movsd  %xmm0,(%rbx)
  cvttsd2si 0x20(%rsp),%edi
  call   <log@plt>
  addsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  add    $0x8,%rbx
  cmp    %ebp,%r12d
  jne    L46
L0:
  lea    -0x1(%r12),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  0x8(%rsp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  D57(%rip),%xmm1
  addsd  %xmm0,%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edi
  call   <log@plt>
  movsd  0x10(%rsp),%xmm6
  subsd  %xmm0,%xmm6
  movsd  %xmm6,0x18(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sd %r12d,%xmm0
  movsd  0x8(%rsp),%xmm5
  subsd  %xmm0,%xmm5
  movsd  D57(%rip),%xmm2
  addsd  %xmm5,%xmm2
  movsd  %xmm5,0x8(%rsp)
  movapd %xmm5,%xmm6
  xorpd  D47(%rip),%xmm6
  movapd %xmm6,%xmm5
  movsd  %xmm2,0x10(%rsp)
  divsd  %xmm2,%xmm5
  movsd  %xmm5,0x20(%rsp)
  mov    $0x0,%edi
  call   <log@plt>
  movapd %xmm0,%xmm4
  addsd  0x18(%rsp),%xmm4
  movsd  %xmm4,0x18(%rsp)
  movsd  0x8(%rsp),%xmm0
  divsd  0x10(%rsp),%xmm0
  mulsd  0x20(%rsp),%xmm0
  movsd  D57(%rip),%xmm1
  subsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%edi
  call   <log@plt>
  movslq %r15d,%rax
  addsd  0x18(%rsp),%xmm0
  movsd  %xmm0,-0x8(%r14,%rax,8)
  jmp    L27
L63:
  mov    $0x0,%r12d
  jmp    L0
L31:
  mov    $0x1,%r13d
  jmp    L43
```

tool_calls: name: unpack_data
arguments: tag: D93
type: f64
name: unpack_data
arguments: tag: D57
type: byte[8]
name: unpack_data
arguments: tag: D47
type: byte[16]

tool: D93: 2

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

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

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);
  }
}
```