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

```asm
<getK>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %edi,%r14d
  mov    %edi,0xc(%rsp)
  mov    %rsi,0x48(%rsp)
  mov    %rdx,%r15
  mov    %rcx,0x68(%rsp)
  mov    %edi,%eax
  imul   %edi,%eax
  mov    %eax,%ebx
  mov    %eax,0x2c(%rsp)
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  test   %r14d,%r14d
  jle    L19
  mov    %rax,%rdx
  mov    %r14d,%eax
  mov    %rax,0x60(%rsp)
  movslq %r14d,%rax
  shl    $0x3,%rax
  mov    %rax,0x30(%rsp)
  lea    -0x1(%rbx),%eax
  lea    0x8(%rdx,%rax,8),%rax
  mov    %rax,0x40(%rsp)
  movl   $0x0,0x5c(%rsp)
  movq   $0x0,0x50(%rsp)
  jmp    L86
L73:
  cmpl   $0x0,0x2c(%rsp)
  jle    L108
  mov    0x10(%rsp),%rcx
  mov    %rcx,%rax
  pxor   %xmm1,%xmm1
  mov    0x48(%rsp),%rdx
  sub    %rcx,%rdx
  mov    0x40(%rsp),%rcx
L67:
  movsd  (%rdx,%rax,1),%xmm0
  mulsd  (%rax),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L67
L31:
  mov    0x20(%rsp),%rdi
  movsd  %xmm1,(%rdi)
  mov    0x38(%rsp),%rcx
  mov    0x18(%rsp),%rax
  movsd  %xmm1,(%rcx,%rax,8)
  add    $0x1,%rax
  mov    %rax,0x18(%rsp)
  mov    0x30(%rsp),%rdx
  add    %rdx,%rdi
  mov    %rdi,0x20(%rsp)
  cmp    %eax,0x58(%rsp)
  jl     L41
L114:
  mov    0x18(%rsp),%r14d
  movl   $0x0,0x28(%rsp)
  mov    $0x0,%r13d
L17:
  movslq 0x28(%rsp),%rax
  mov    0x10(%rsp),%rcx
  lea    (%rcx,%rax,8),%r12
  mov    $0x0,%ebx
L63:
  mov    %ebx,%ecx
  mov    %r14d,%edx
  mov    %r13d,%esi
  mov    0x8(%rsp),%edi
  call   <ijkl2intindex@plt>
  mov    %eax,%ebp
  mov    %r13d,%ecx
  mov    %r14d,%edx
  mov    %ebx,%esi
  mov    0x8(%rsp),%edi
  call   <ijkl2intindex@plt>
  movslq %ebp,%rbp
  cltq
  movsd  (%r15,%rbp,8),%xmm0
  addsd  (%r15,%rax,8),%xmm0
  mulsd  D7(%rip),%xmm0
  movsd  %xmm0,(%r12)
  mov    %ebx,%eax
  add    $0x1,%ebx
  add    $0x8,%r12
  cmp    %ebx,0xc(%rsp)
  jne    L63
  add    %ebx,0x28(%rsp)
  lea    0x1(%r13),%edx
  cmp    %eax,%r13d
  je     L73
  mov    %edx,%r13d
  jmp    L17
L108:
  pxor   %xmm1,%xmm1
  jmp    L31
L41:
  addq   $0x1,0x50(%rsp)
  mov    0x50(%rsp),%rax
  mov    0xc(%rsp),%ecx
  add    %ecx,0x5c(%rsp)
  cmp    0x60(%rsp),%rax
  je     L19
L86:
  mov    0x50(%rsp),%rax
  mov    %eax,0x8(%rsp)
  mov    %eax,0x58(%rsp)
  test   %eax,%eax
  js     L41
  mov    0x68(%rsp),%rdx
  lea    (%rdx,%rax,8),%rax
  mov    %rax,0x20(%rsp)
  movslq 0x5c(%rsp),%rax
  lea    (%rdx,%rax,8),%rax
  mov    %rax,0x38(%rsp)
  movq   $0x0,0x18(%rsp)
  jmp    L114
L19:
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: tag: D7
type: f64

tool: D7: 0.5

assistant: ```c
void getK(int nbf, double *D, double *Ints, double *K) {
  int i, j, k, l, kl, ikjl, iljk;
  double *tmp;
  double val = 0.;
  tmp = (double *)malloc(nbf * nbf * sizeof(double));
  for (i = 0; i < nbf; i++) {
    for (j = 0; j < i + 1; j++) {
      kl = 0;
      for (k = 0; k < nbf; k++) {
        for (l = 0; l < nbf; l++) {
          ikjl = ijkl2intindex(i, k, j, l);
          iljk = ijkl2intindex(i, l, j, k);
          tmp[kl] = 0.5 * (Ints[ikjl] + Ints[iljk]);
          kl += 1;
        }
      }
      val = 0;
      for (kl = 0; kl < nbf * nbf; kl++)
        val += tmp[kl] * D[kl];
      K[i + j * nbf] = val;
      K[j + i * nbf] = val;
    }
  }
  free(tmp);
}
```