user: Please show me the C implementation that matches the assembly code listed below:

```asm
<build_SPD_Phi>:
  endbr64
  push   %r15
  mov    %edi,%eax
  push   %r14
  imul   %eax,%eax
  mov    %rdx,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    $0x1ab,%esi
  sub    $0x48,%rsp
  mov    %edi,0x1c(%rsp)
  mov    D6(%rip),%rdi
  mov    %rcx,0x10(%rsp)
  mov    %fs:0x28,%rdx
  mov    %rdx,0x38(%rsp)
  xor    %edx,%edx
  mov    %rdi,0x28(%rsp)
  lea    0x0(,%rax,8),%edx
  lea    D35(%rip),%rdi
  movq   $0x0,0x30(%rsp)
  call   <fgls_malloc_impl@plt>
  mov    0x1c(%rsp),%r12d
  mov    %rax,%rbp
  test   %r12d,%r12d
  jle    L42
  lea    -0x1(%r12),%edx
  mov    %r12d,%ecx
  movslq %r12d,%r13
  mov    %r12d,%r9d
  mov    %rdx,%r15
  shl    $0x3,%rdx
  mov    %r14,%rdi
  and    $0xfffffffe,%r9d
  lea    0x8(%r14,%rdx,1),%rsi
  shr    %ecx
  sub    %rbx,%rdx
  shl    $0x3,%r13
  add    $0x8,%rdx
  lea    -0x1(%rcx),%r8d
  mov    %rsi,(%rsp)
  mov    %rbx,%rcx
  mov    %rdx,0x8(%rsp)
  add    $0x1,%r8
  xor    %esi,%esi
  shl    $0x4,%r8
  nopl   0x0(%rax)
L20:
  lea    0x8(%rcx),%r10
  mov    %rdi,%rdx
  add    $0x8,%rdi
  cmp    %r10,%rax
  setne  %r11b
  cmp    $0x1,%r15d
  seta   %r10b
  test   %r10b,%r11b
  lea    (%rax,%r13,1),%r10
  je     L73
  cmp    %r10,%rdx
  setae  %r14b
  cmp    %rdi,%rax
  setae  %r11b
  or     %r14b,%r11b
  je     L73
  movsd  (%rdx),%xmm1
  xor    %r11d,%r11d
  unpcklpd %xmm1,%xmm1
  nopl   0x0(%rax)
L28:
  movupd (%rcx,%r11,1),%xmm0
  mulpd  %xmm1,%xmm0
  movups %xmm0,(%rax,%r11,1)
  add    $0x10,%r11
  cmp    %r11,%r8
  jne    L28
  cmp    %r9d,%r12d
  je     L86
  lea    (%rsi,%r9,1),%eax
  cltq
  movsd  (%rbx,%rax,8),%xmm0
  mulsd  (%rdx),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
L86:
  add    %r13,%rcx
  mov    %r10,%rax
  add    %r12d,%esi
  cmp    (%rsp),%rdi
  jne    L20
L42:
  lea    0x1c(%rsp),%rdx
  sub    $0x8,%rsp
  lea    D19(%rip),%rdi
  push   %rdx
  mov    %rdx,%r8
  mov    %rdx,%rcx
  lea    D27(%rip),%rsi
  push   0x20(%rsp)
  lea    0x48(%rsp),%rax
  push   %rax
  push   %rdx
  push   %rbx
  push   %rdx
  push   %rbp
  lea    0x68(%rsp),%r9
  call   <dgemm_@plt>
  add    $0x40,%rsp
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L73:
  mov    0x8(%rsp),%r14
  mov    %rcx,%rax
  sub    %rbx,%rax
  lea    (%r14,%rcx,1),%r11
  nop
L30:
  movsd  (%rbx,%rax,1),%xmm0
  mulsd  (%rdx),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,1)
  add    $0x8,%rax
  cmp    %r11,%rax
  jne    L30
  jmp    L86
L4:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D6
type_guessed: f64
name: read_data
arguments: label: D35
type_guessed: string
name: read_data
arguments: label: D19
type_guessed: string
name: read_data
arguments: label: D27
type_guessed: string

tool: D6: 1

tool: D35: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/lucasb-eyer/OmicABEL/refs/heads/master/src/fgls_chol.c

tool: D19: N

tool: D27: T

assistant: ```c
void build_SPD_Phi(int n, double *eigVecs, double *eigVals, double *Phi) {
  double ONE = 1.0, ZERO = 0.0, *tmp;
  int i, j;
  tmp = fgls_malloc_impl("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/lucasb-eyer/OmicABEL/refs/heads/master/src/fgls_chol.c", 427, n * n * sizeof(double));
  for (j = 0; j < n; j++)
    for (i = 0; i < n; i++)
      tmp[j * n + i] = eigVecs[j * n + i] * eigVals[j];
  dgemm_("N", "T", &n, &n, &n, &ONE, tmp, &n, eigVecs, &n, &ZERO, Phi, &n);
  free(tmp);
}
```