user: 请将以下的汇编代码转换成C语言代码：

```asm
<lb_kim_hierarchy>:
  endbr64
  movslq %edx,%rax
  mov    %ecx,%edx
  movsd  (%rsi),%xmm9
  movapd %xmm0,%xmm7
  movsd  (%rdi,%rax,8),%xmm6
  mov    %rax,%r8
  lea    0x0(,%rax,8),%rcx
  lea    -0x1(%rax,%rdx,1),%eax
  cltq
  movsd  (%rdi,%rax,8),%xmm3
  subsd  %xmm0,%xmm6
  movslq %edx,%rax
  shl    $0x3,%rax
  subsd  %xmm0,%xmm3
  movsd  -0x8(%rsi,%rax,1),%xmm8
  divsd  %xmm1,%xmm6
  divsd  %xmm1,%xmm3
  movapd %xmm6,%xmm0
  subsd  %xmm9,%xmm0
  mulsd  %xmm0,%xmm0
  movapd %xmm3,%xmm4
  subsd  %xmm8,%xmm4
  mulsd  %xmm4,%xmm4
  addsd  %xmm4,%xmm0
  comisd %xmm2,%xmm0
  jae    L37
  movsd  0x8(%rdi,%rcx,1),%xmm4
  movsd  0x8(%rsi),%xmm11
  movapd %xmm6,%xmm10
  subsd  %xmm7,%xmm4
  subsd  %xmm11,%xmm10
  divsd  %xmm1,%xmm4
  mulsd  %xmm10,%xmm10
  movapd %xmm4,%xmm5
  subsd  %xmm9,%xmm5
  mulsd  %xmm5,%xmm5
  minsd  %xmm10,%xmm5
  movapd %xmm4,%xmm10
  subsd  %xmm11,%xmm10
  mulsd  %xmm10,%xmm10
  minsd  %xmm10,%xmm5
  addsd  %xmm5,%xmm0
  comisd %xmm2,%xmm0
  jae    L37
  lea    -0x2(%r8,%rdx,1),%r9d
  movsd  -0x10(%rsi,%rax,1),%xmm10
  movapd %xmm3,%xmm12
  movslq %r9d,%r9
  movsd  (%rdi,%r9,8),%xmm13
  subsd  %xmm10,%xmm12
  subsd  %xmm7,%xmm13
  mulsd  %xmm12,%xmm12
  divsd  %xmm1,%xmm13
  movapd %xmm13,%xmm5
  subsd  %xmm8,%xmm5
  mulsd  %xmm5,%xmm5
  minsd  %xmm12,%xmm5
  movapd %xmm13,%xmm12
  subsd  %xmm10,%xmm12
  mulsd  %xmm12,%xmm12
  minsd  %xmm12,%xmm5
  addsd  %xmm5,%xmm0
  comisd %xmm2,%xmm0
  jae    L37
  movsd  0x10(%rdi,%rcx,1),%xmm5
  movsd  0x10(%rsi),%xmm12
  subsd  %xmm7,%xmm5
  subsd  %xmm12,%xmm6
  subsd  %xmm12,%xmm4
  divsd  %xmm1,%xmm5
  mulsd  %xmm4,%xmm4
  mulsd  %xmm6,%xmm6
  minsd  %xmm4,%xmm6
  movapd %xmm5,%xmm4
  subsd  %xmm12,%xmm4
  mulsd  %xmm4,%xmm4
  minsd  %xmm4,%xmm6
  movapd %xmm5,%xmm4
  subsd  %xmm9,%xmm5
  subsd  %xmm11,%xmm4
  mulsd  %xmm5,%xmm5
  mulsd  %xmm4,%xmm4
  minsd  %xmm4,%xmm6
  minsd  %xmm5,%xmm6
  addsd  %xmm6,%xmm0
  comisd %xmm2,%xmm0
  jae    L37
  lea    -0x3(%r8,%rdx,1),%edx
  movsd  -0x18(%rsi,%rax,1),%xmm4
  movslq %edx,%rdx
  movsd  (%rdi,%rdx,8),%xmm2
  subsd  %xmm4,%xmm3
  subsd  %xmm4,%xmm13
  subsd  %xmm7,%xmm2
  mulsd  %xmm3,%xmm3
  mulsd  %xmm13,%xmm13
  divsd  %xmm1,%xmm2
  minsd  %xmm13,%xmm3
  movapd %xmm2,%xmm1
  subsd  %xmm4,%xmm1
  mulsd  %xmm1,%xmm1
  minsd  %xmm1,%xmm3
  movapd %xmm2,%xmm1
  subsd  %xmm8,%xmm2
  subsd  %xmm10,%xmm1
  mulsd  %xmm2,%xmm2
  mulsd  %xmm1,%xmm1
  minsd  %xmm1,%xmm3
  minsd  %xmm2,%xmm3
  addsd  %xmm3,%xmm0
L37:
  ret
```

assistant: ```c
double lb_kim_hierarchy(double *t, double *q, int j, int len, double mean, double std, double bsf) {
  double d, lb;
  double x0 = (t[j] - mean) / std;
  double y0 = (t[(len - 1 + j)] - mean) / std;
  lb = ((x0 - q[0]) * (x0 - q[0])) + ((y0 - q[len - 1]) * (y0 - q[len - 1]));
  if (lb >= bsf)
    return lb;
  double x1 = (t[(j + 1)] - mean) / std;
  d = ((((x1 - q[0]) * (x1 - q[0]))) < (((x0 - q[1]) * (x0 - q[1]))) ? (((x1 - q[0]) * (x1 - q[0]))) : (((x0 - q[1]) * (x0 - q[1]))));
  d = ((d) < (((x1 - q[1]) * (x1 - q[1]))) ? (d) : (((x1 - q[1]) * (x1 - q[1]))));
  lb += d;
  if (lb >= bsf)
    return lb;
  double y1 = (t[(len - 2 + j)] - mean) / std;
  d = ((((y1 - q[len - 1]) * (y1 - q[len - 1]))) < (((y0 - q[len - 2]) * (y0 - q[len - 2]))) ? (((y1 - q[len - 1]) * (y1 - q[len - 1]))) : (((y0 - q[len - 2]) * (y0 - q[len - 2]))));
  d = ((d) < (((y1 - q[len - 2]) * (y1 - q[len - 2]))) ? (d) : (((y1 - q[len - 2]) * (y1 - q[len - 2]))));
  lb += d;
  if (lb >= bsf)
    return lb;
  double x2 = (t[(j + 2)] - mean) / std;
  d = ((((x0 - q[2]) * (x0 - q[2]))) < (((x1 - q[2]) * (x1 - q[2]))) ? (((x0 - q[2]) * (x0 - q[2]))) : (((x1 - q[2]) * (x1 - q[2]))));
  d = ((d) < (((x2 - q[2]) * (x2 - q[2]))) ? (d) : (((x2 - q[2]) * (x2 - q[2]))));
  d = ((d) < (((x2 - q[1]) * (x2 - q[1]))) ? (d) : (((x2 - q[1]) * (x2 - q[1]))));
  d = ((d) < (((x2 - q[0]) * (x2 - q[0]))) ? (d) : (((x2 - q[0]) * (x2 - q[0]))));
  lb += d;
  if (lb >= bsf)
    return lb;
  double y2 = (t[(len - 3 + j)] - mean) / std;
  d = ((((y0 - q[len - 3]) * (y0 - q[len - 3]))) < (((y1 - q[len - 3]) * (y1 - q[len - 3]))) ? (((y0 - q[len - 3]) * (y0 - q[len - 3]))) : (((y1 - q[len - 3]) * (y1 - q[len - 3]))));
  d = ((d) < (((y2 - q[len - 3]) * (y2 - q[len - 3]))) ? (d) : (((y2 - q[len - 3]) * (y2 - q[len - 3]))));
  d = ((d) < (((y2 - q[len - 2]) * (y2 - q[len - 2]))) ? (d) : (((y2 - q[len - 2]) * (y2 - q[len - 2]))));
  d = ((d) < (((y2 - q[len - 1]) * (y2 - q[len - 1]))) ? (d) : (((y2 - q[len - 1]) * (y2 - q[len - 1]))));
  lb += d;
  return lb;
}
```