user: Converte this assembly snippet into its equivalent C code:

```asm
<normalizeC>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %esi,0xc(%rsp)
  test   %esi,%esi
  jle    L73
  mov    %edi,%eax
  movl   $0x0,0x8(%rsp)
  movslq %edi,%r10
  mov    %edi,%r15d
  shr    %eax
  movsd  D1(%rip),%xmm6
  mov    %edi,%r14d
  mov    %rdx,%r12
  lea    -0x1(%rax),%r13d
  mov    %rcx,%rbp
  shl    $0x3,%r10
  and    $0xfffffffe,%r15d
  add    $0x1,%r13
  xor    %ebx,%ebx
  pxor   %xmm5,%xmm5
  shl    $0x4,%r13
  nopl   0x0(%rax,%rax,1)
L0:
  test   %r14d,%r14d
  jle    L107
  movslq %ebx,%r11
  lea    -0x1(%r14),%eax
  mov    %r12,%rsi
  xor    %ecx,%ecx
  lea    0x0(%rbp,%r11,8),%rdi
  add    %r11,%rax
  movapd %xmm5,%xmm1
  mov    %rdi,%r8
  lea    0x8(%rbp,%rax,8),%r9
  nopl   0x0(%rax)
L26:
  movsd  (%r8),%xmm3
  cmp    $0x1,%r14d
  je     L54
  movapd %xmm3,%xmm4
  xor    %eax,%eax
  unpcklpd %xmm4,%xmm4
  nopl   0x0(%rax)
L50:
  movupd (%rdi,%rax,1),%xmm0
  movupd (%rsi,%rax,1),%xmm7
  add    $0x10,%rax
  mulpd  %xmm4,%xmm0
  mulpd  %xmm7,%xmm0
  addsd  %xmm0,%xmm1
  unpckhpd %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %r13,%rax
  jne    L50
  mov    %r15d,%eax
  cmp    %r14d,%r15d
  je     L58
L76:
  lea    (%rbx,%rax,1),%edx
  add    %ecx,%eax
  movslq %edx,%rdx
  cltq
  mulsd  0x0(%rbp,%rdx,8),%xmm3
  movapd %xmm3,%xmm0
  mulsd  (%r12,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
L58:
  add    $0x8,%r8
  add    %r14d,%ecx
  add    %r10,%rsi
  cmp    %r9,%r8
  jne    L26
  ucomisd %xmm1,%xmm5
  ja     L70
  sqrtsd %xmm1,%xmm1
  movapd %xmm6,%xmm2
  divsd  %xmm1,%xmm2
L30:
  cmp    $0x1,%r14d
  je     L136
  movapd %xmm2,%xmm1
  lea    0x0(%rbp,%r11,8),%rax
  unpcklpd %xmm1,%xmm1
  lea    0x0(%r13,%rax,1),%rdx
  nopw   0x0(%rax,%rax,1)
L104:
  movupd (%rax),%xmm0
  add    $0x10,%rax
  mulpd  %xmm1,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rax,%rdx
  jne    L104
  mov    %r15d,%eax
  cmp    %r14d,%r15d
  je     L107
L65:
  add    %ebx,%eax
  cltq
  lea    0x0(%rbp,%rax,8),%rax
  mulsd  (%rax),%xmm2
  movsd  %xmm2,(%rax)
L107:
  addl   $0x1,0x8(%rsp)
  add    %r14d,%ebx
  mov    0x8(%rsp),%eax
  cmp    %eax,0xc(%rsp)
  jne    L0
L73:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L54:
  xor    %eax,%eax
  jmp    L76
L136:
  xor    %eax,%eax
  jmp    L65
L70:
  movapd %xmm1,%xmm0
  mov    %r10,0x18(%rsp)
  mov    %r11,0x10(%rsp)
  call   <sqrt@plt>
  mov    0x18(%rsp),%r10
  mov    0x10(%rsp),%r11
  pxor   %xmm5,%xmm5
  movsd  D1(%rip),%xmm1
  movapd %xmm1,%xmm2
  movapd %xmm1,%xmm6
  divsd  %xmm0,%xmm2
  jmp    L30
```

tool_calls: name: unpack_data
arguments: data_label: D1
datatype: f64

tool: D1: 1

assistant: ```c
void normalizeC(int nBasis, int nOcc, double *S, double *C) {
  double sum;
  int i, j, k;
  for (k = 0; k < nOcc; k++) {
    sum = 0.0;
    for (i = 0; i < nBasis; i++)
      for (j = 0; j < nBasis; j++)
        sum += C[k * nBasis + i] * C[k * nBasis + j] * S[i * nBasis + j];
    sum = 1.0 / sqrt(sum);
    for (i = 0; i < nBasis; i++)
      C[k * nBasis + i] = sum * C[k * nBasis + i];
  }
  return;
}
```