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

```asm
<pairdist_squared_rows>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x58,%rsp
  mov    %rdx,0x20(%rsp)
  mov    0x90(%rsp),%edx
  mov    %rdi,0x18(%rsp)
  mov    %r9d,0x2c(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    D15(%rip),%rax
  movb   $0x4e,0x36(%rsp)
  movb   $0x54,0x37(%rsp)
  mov    %rax,0x38(%rsp)
  mov    D7(%rip),%rax
  mov    %rax,0x40(%rsp)
  test   %edx,%edx
  jle    L120
  mov    %r9d,%r12d
  test   %r9d,%r9d
  jle    L120
  sub    $0x1,%edx
  movslq %r9d,%r15
  mov    %r8,%rax
  mov    %r12d,%r13d
  lea    0x8(%rcx,%rdx,8),%rdi
  mov    %r9d,%edx
  mov    %rcx,%r8
  shl    $0x3,%r15
  mov    %rdi,0x8(%rsp)
  mov    %r12d,%edi
  shr    %edx
  xor    %ecx,%ecx
  and    $0xfffffffe,%edi
  lea    -0x1(%rdx),%r9d
  mov    %edi,%edx
  add    $0x1,%r9
  lea    (%rsi,%rdx,8),%r10
  lea    0x8(%rsi),%rdx
  shl    $0x4,%r9
  mov    %rdx,0x10(%rsp)
  lea    -0x1(%r12),%edx
  mov    %edx,0x28(%rsp)
  nop
L117:
  mov    %r8,%rdx
  add    $0x8,%r8
  cmp    0x10(%rsp),%rax
  setne  %bpl
  cmpl   $0x1,0x28(%rsp)
  seta   %r11b
  test   %r11b,%bpl
  lea    (%rax,%r15,1),%r11
  je     L80
  cmp    %r11,%rdx
  setae  %r14b
  cmp    %r8,%rax
  setae  %bpl
  or     %r14b,%bpl
  je     L80
  movsd  (%rdx),%xmm1
  xor    %ebp,%ebp
  unpcklpd %xmm1,%xmm1
  nopw   0x0(%rax,%rax,1)
L39:
  movupd (%rsi,%rbp,1),%xmm0
  addpd  %xmm1,%xmm0
  movups %xmm0,(%rax,%rbp,1)
  add    $0x10,%rbp
  cmp    %r9,%rbp
  jne    L39
  cmp    %edi,%r12d
  je     L67
  movsd  (%r10),%xmm0
  addsd  (%rdx),%xmm0
  lea    (%rcx,%rdi,1),%eax
  cltq
  movsd  %xmm0,(%rbx,%rax,8)
L67:
  mov    %r11,%rax
  add    %r12d,%ecx
  cmp    0x8(%rsp),%r8
  jne    L117
L120:
  lea    0x2c(%rsp),%rdx
  lea    0x37(%rsp),%rsi
  lea    0x36(%rsp),%rdi
  sub    $0x8,%rsp
  push   %rdx
  push   %rbx
  lea    0x58(%rsp),%rax
  push   %rax
  lea    0xb0(%rsp),%rax
  push   %rax
  mov    0x48(%rsp),%r14
  mov    %rax,%rcx
  push   %r14
  push   %rdx
  mov    0x50(%rsp),%r15
  push   %r15
  lea    0x78(%rsp),%r9
  lea    0xd8(%rsp),%r8
  call   <dgemm@plt>
  add    $0x40,%rsp
  cmp    %r14,%r15
  je     L116
L64:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L144
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L80:
  xor    %ebp,%ebp
  nopw   0x0(%rax,%rax,1)
L18:
  movsd  (%rsi,%rbp,8),%xmm0
  addsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax,%rbp,8)
  add    $0x1,%rbp
  cmp    %rbp,%r13
  jne    L18
  jmp    L67
L116:
  mov    0x90(%rsp),%edx
  cmp    %edx,0x2c(%rsp)
  jne    L64
  test   %edx,%edx
  jle    L64
  movslq %edx,%rax
  lea    0x8(,%rax,8),%rcx
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L149:
  add    $0x1,%eax
  movq   $0x0,(%rbx)
  add    %rcx,%rbx
  cmp    %eax,%edx
  jne    L149
  jmp    L64
L144:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D15
datatype: byte[8]
name: retrieve_data
arguments: tag: D7
datatype: f64

tool: {"D15": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0]}

tool: D7: 1

assistant: ```c
void pairdist_squared_rows(double *vectsX, double *normsqrX, double *vectsY, double *normsqrY, double *dists, int M, int N, int D) {
  int m, n;
  char chn = 'N', cht = 'T';
  double minus2 = -2.0, one = 1.0;
  for (n = 0; n < N; n++) {
    for (m = 0; m < M; m++) {
      dists[m + n * M] = normsqrX[m] + normsqrY[n];
    }
  }
  dgemm(&chn, &cht, &M, &N, &D, &minus2, vectsX, &M, vectsY, &N, &one, dists, &M);
  if ((vectsX == vectsY) && (M == N)) {
    for (n = 0; n < N; n++) {
      dists[n + n * N] = 0;
    }
  }
}
```