user: 请从给定的汇编指令推导出C源代码:

```asm
<HDsSymidxMax>:
  endbr64
  push   %r13
  mov    %r9,%r13
  push   %r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x108,%rsp
  movsd  0x18(%rdx),%xmm2
  movsd  0x30(%rdx),%xmm4
  mov    %fs:0x28,%rax
  mov    %rax,0xf8(%rsp)
  xor    %eax,%eax
  movsd  0x38(%rdx),%xmm5
  movsd  (%rdx),%xmm0
  lea    0xb0(%rsp),%rdi
  movsd  %xmm2,0x10(%rsp)
  mov    0x130(%rsp),%r12d
  movsd  %xmm2,0x68(%rsp)
  movsd  0x8(%rdx),%xmm2
  movsd  %xmm4,0x18(%rsp)
  movsd  %xmm4,0x70(%rsp)
  movsd  0x20(%rdx),%xmm4
  movsd  %xmm2,0x20(%rsp)
  movsd  %xmm2,0x78(%rsp)
  movsd  0x10(%rdx),%xmm2
  movsd  %xmm4,0x28(%rsp)
  movsd  %xmm4,0x80(%rsp)
  movsd  0x28(%rdx),%xmm4
  movsd  %xmm5,0x30(%rsp)
  movsd  %xmm5,0x88(%rsp)
  movsd  0x40(%rdx),%xmm5
  movsd  %xmm0,0x8(%rsp)
  movsd  %xmm2,0x38(%rsp)
  movsd  %xmm2,0x90(%rsp)
  movsd  %xmm4,0x40(%rsp)
  movsd  %xmm4,0x98(%rsp)
  movsd  %xmm5,0x48(%rsp)
  movsd  %xmm5,0xa0(%rsp)
  jmp    L22
L31:
  movsd  0x60(%rsp,%rax,1),%xmm0
L22:
  movsd  %xmm0,(%rdi,%rax,1)
  add    $0x8,%rax
  cmp    $0x48,%rax
  jne    L31
  mov    $0x3,%esi
  call   <minv@plt>
  test   %r12d,%r12d
  jle    L11
  movsd  0xc8(%rsp),%xmm2
  lea    -0x1(%r12),%eax
  mov    %r13,%r9
  movsd  0xd0(%rsp),%xmm4
  movsd  0xe0(%rsp),%xmm15
  lea    0x4(%r13,%rax,4),%rdx
  movsd  0xe8(%rsp),%xmm14
  movsd  0xf0(%rsp),%xmm13
  movsd  %xmm2,0x50(%rsp)
  movsd  0xb0(%rsp),%xmm12
  movsd  0xb8(%rsp),%xmm11
  movsd  %xmm4,0x58(%rsp)
  movsd  0xc0(%rsp),%xmm10
  movsd  0xd8(%rsp),%xmm9
  nopl   0x0(%rax)
L16:
  mov    (%r9),%eax
  movapd %xmm15,%xmm7
  add    $0x4,%r9
  movapd %xmm14,%xmm1
  movsd  0x38(%rsp),%xmm5
  movsd  0x40(%rsp),%xmm3
  lea    (%rax,%rax,2),%eax
  movsd  0x50(%rsp),%xmm8
  add    %eax,%eax
  cltq
  lea    (%rbx,%rax,8),%rax
  movsd  (%rax),%xmm0
  movsd  0x8(%rax),%xmm2
  movsd  0x20(%rax),%xmm4
  mulsd  %xmm2,%xmm1
  movapd %xmm0,%xmm6
  mulsd  %xmm0,%xmm7
  mulsd  %xmm4,%xmm3
  mulsd  %xmm12,%xmm6
  mulsd  %xmm0,%xmm8
  addsd  %xmm1,%xmm7
  movsd  0x18(%rax),%xmm1
  mulsd  %xmm1,%xmm5
  addsd  %xmm13,%xmm7
  addsd  %xmm3,%xmm5
  movapd %xmm2,%xmm3
  addsd  0x48(%rsp),%xmm5
  mulsd  %xmm11,%xmm3
  addsd  %xmm6,%xmm3
  movapd %xmm1,%xmm6
  addsd  %xmm10,%xmm3
  divsd  %xmm7,%xmm3
  subsd  %xmm3,%xmm6
  movsd  0x58(%rsp),%xmm3
  mulsd  %xmm2,%xmm3
  mulsd  %xmm6,%xmm6
  addsd  %xmm8,%xmm3
  addsd  %xmm9,%xmm3
  divsd  %xmm7,%xmm3
  movapd %xmm4,%xmm7
  subsd  %xmm3,%xmm7
  movsd  0x10(%rsp),%xmm3
  mulsd  %xmm4,%xmm3
  mulsd  %xmm7,%xmm7
  mulsd  0x28(%rsp),%xmm4
  addsd  %xmm7,%xmm6
  movsd  0x8(%rsp),%xmm7
  mulsd  %xmm1,%xmm7
  mulsd  0x20(%rsp),%xmm1
  addsd  %xmm7,%xmm3
  addsd  0x18(%rsp),%xmm3
  addsd  %xmm4,%xmm1
  addsd  0x30(%rsp),%xmm1
  divsd  %xmm5,%xmm3
  divsd  %xmm5,%xmm1
  subsd  %xmm3,%xmm0
  mulsd  %xmm0,%xmm0
  subsd  %xmm1,%xmm2
  mulsd  %xmm2,%xmm2
  addsd  %xmm2,%xmm0
  maxsd  %xmm6,%xmm0
  movsd  %xmm0,0x0(%rbp)
  cmp    %r9,%rdx
  jne    L16
L11:
  mov    0xf8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L46
  add    $0x108,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L46:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void HDsSymidxMax(const double *lin, const double *mu, const double *H, double *p, int len, int *idx, int siz) {
  int i, mi;
  double Hinv[9], H1[9];
  const double *u;
  double a, b, xa, ya, d1, d2, xdiff, ydiff;
  Hinv[0] = H[0];
  Hinv[1] = H[3];
  Hinv[2] = H[6];
  Hinv[3] = H[1];
  Hinv[4] = H[4];
  Hinv[5] = H[7];
  Hinv[6] = H[2];
  Hinv[7] = H[5];
  Hinv[8] = H[8];
  for (i = 0; i < 9; i++)
    H1[i] = Hinv[i];
  minv(H1, 3);
  for (mi = 0; mi < siz; mi++) {
    i = idx[mi];
    u = mu + 6 * i;
    a = H1[6] * u[0] + H1[7] * u[1] + H1[8];
    b = Hinv[6] * u[3] + Hinv[7] * u[4] + Hinv[8];
    xa = (H1[0] * u[0] + H1[1] * u[1] + H1[2]) / a;
    ya = (H1[3] * u[0] + H1[4] * u[1] + H1[5]) / a;
    xdiff = u[3] - xa;
    ydiff = u[4] - ya;
    d1 = xdiff * xdiff + ydiff * ydiff;
    xa = (Hinv[0] * u[3] + Hinv[1] * u[4] + Hinv[2]) / b;
    ya = (Hinv[3] * u[3] + Hinv[4] * u[4] + Hinv[5]) / b;
    xdiff = u[0] - xa;
    ydiff = u[1] - ya;
    d2 = xdiff * xdiff + ydiff * ydiff;
    *p = ((d1) < (d2) ? (d2) : (d1));
  }
}
```