user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<make_nucleon_2pt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  push   %rbx
  sub    $0xd8,%rsp
  mov    0x110(%rsp),%rax
  mov    0x140(%rsp),%r15
  mov    %rdi,0x70(%rsp)
  mov    0x150(%rsp),%ebp
  mov    0x118(%rsp),%rbx
  mov    %rsi,0x78(%rsp)
  mov    0x120(%rsp),%rcx
  mov    0x130(%rsp),%rsi
  mov    %rax,0x18(%rsp)
  mov    0x138(%rsp),%rdi
  mov    0x170(%rsp),%eax
  mov    %r15,0x38(%rsp)
  mov    0x128(%rsp),%rdx
  mov    0x148(%rsp),%r15
  mov    %r8,0xa8(%rsp)
  mov    %r9,0xb0(%rsp)
  mov    %rbx,0xb8(%rsp)
  mov    0x160(%rsp),%ebx
  mov    %rcx,0xc0(%rsp)
  mov    0x158(%rsp),%ecx
  mov    %rsi,0x20(%rsp)
  mov    0x168(%rsp),%esi
  mov    %rdi,0x28(%rsp)
  mov    %r15,0x40(%rsp)
  mov    %rdx,0xc8(%rsp)
  mov    0x178(%rsp),%edx
  mov    %eax,0x14(%rsp)
  imul   %ebp,%eax
  mov    0x188(%rsp),%r15d
  mov    0x180(%rsp),%edi
  mov    %ebp,0x10(%rsp)
  mov    %edx,0xa0(%rsp)
  mov    0x190(%rsp),%r14d
  imul   %ecx,%eax
  mov    %edi,0xa4(%rsp)
  mov    %esi,0x8(%rsp)
  mov    %ecx,0xc(%rsp)
  imul   %ebp,%eax
  imul   %ecx,%eax
  imul   %esi,%eax
  imul   %ebp,%eax
  imul   %ecx,%eax
  imul   %r15d,%eax
  lea    0x0(,%rax,8),%ebp
  mov    %ebp,%edi
  call   <malloc@plt>
  mov    %ebp,%edi
  mov    %rax,0x48(%rsp)
  call   <malloc@plt>
  mov    %ebp,%edi
  mov    %rax,0x50(%rsp)
  call   <malloc@plt>
  mov    %ebp,%edi
  mov    %rax,0x58(%rsp)
  call   <malloc@plt>
  sub    $0x8,%rsp
  mov    %rax,0x68(%rsp)
  push   %r15
  mov    0xb4(%rsp),%r11d
  push   %r11
  mov    0xb8(%rsp),%r10d
  push   %r10
  mov    0x34(%rsp),%edx
  push   %rdx
  mov    0x30(%rsp),%esi
  mov    %r13,%rdx
  push   %rsi
  push   %rbx
  mov    0x44(%rsp),%ecx
  push   %rcx
  mov    0x50(%rsp),%ebp
  mov    %r12,%rcx
  push   %rbp
  push   0x70(%rsp)
  push   0x70(%rsp)
  push   0x70(%rsp)
  mov    0x110(%rsp),%r9
  mov    0x108(%rsp),%r8
  mov    0xb0(%rsp),%rsi
  mov    0xa8(%rsp),%rdi
  call   <make_local_block@plt>
  add    $0x58,%rsp
  push   %r15
  mov    0xb4(%rsp),%r11d
  push   %r11
  mov    0xb8(%rsp),%r10d
  push   %r10
  mov    0x34(%rsp),%edx
  push   %rdx
  mov    0x30(%rsp),%esi
  mov    %r13,%rdx
  push   %rsi
  push   %rbx
  mov    0x44(%rsp),%ecx
  push   %rcx
  mov    %r12,%rcx
  push   %rbp
  push   0x70(%rsp)
  push   0x70(%rsp)
  push   0x120(%rsp)
  mov    0x120(%rsp),%r9
  mov    0x118(%rsp),%r8
  mov    0xc0(%rsp),%rsi
  mov    0xb8(%rsp),%rdi
  call   <make_local_block@plt>
  mov    0x100(%rsp),%r11d
  add    $0x60,%rsp
  test   %r11d,%r11d
  jle    L194
  movl   $0x0,0x9c(%rsp)
  mov    0x18(%rsp),%rax
  mov    0x9c(%rsp),%ebx
  mov    %rax,0x68(%rsp)
L137:
  mov    0xa4(%rsp),%ebp
  xor    %esi,%esi
  mov    %ebx,%edi
  mov    %ebp,%edx
  call   <index_2d@plt>
  mov    %ebp,%edx
  xor    %esi,%esi
  mov    %ebx,%edi
  mov    0xa8(%rsp),%r13
  mov    0x0(%r13,%rax,4),%eax
  mov    %eax,0x18(%rsp)
  call   <index_2d@plt>
  mov    %ebp,%edx
  mov    $0x1,%esi
  mov    %ebx,%edi
  mov    0xb0(%rsp),%r12
  mov    (%r12,%rax,4),%eax
  mov    %eax,0x20(%rsp)
  call   <index_2d@plt>
  mov    %ebp,%edx
  mov    $0x1,%esi
  mov    %ebx,%edi
  mov    0x0(%r13,%rax,4),%eax
  mov    %eax,0x28(%rsp)
  call   <index_2d@plt>
  mov    %ebp,%edx
  mov    $0x2,%esi
  mov    %ebx,%edi
  mov    (%r12,%rax,4),%eax
  mov    %eax,0x30(%rsp)
  call   <index_2d@plt>
  mov    %ebp,%edx
  mov    $0x2,%esi
  mov    %ebx,%edi
  mov    0x0(%r13,%rax,4),%eax
  mov    %eax,0x34(%rsp)
  call   <index_2d@plt>
  mov    (%r12,%rax,4),%eax
  mov    %eax,0x98(%rsp)
  test   %r15d,%r15d
  jle    L131
  test   %r14d,%r14d
  jle    L131
  mov    0x14(%rsp),%r10d
  test   %r10d,%r10d
  jle    L131
  mov    0x8(%rsp),%r9d
  xor    %r13d,%r13d
  test   %r9d,%r9d
  jle    L131
L46:
  xor    %r12d,%r12d
L62:
  xor    %ebp,%ebp
  nopw   0x0(%rax,%rax,1)
L95:
  xor    %ebx,%ebx
  nopw   0x0(%rax,%rax,1)
L170:
  mov    0x68(%rsp),%rax
  mov    %ebx,%edi
  mov    %r14d,%edx
  mov    %r12d,%esi
  movsd  (%rax),%xmm2
  movsd  %xmm2,0x80(%rsp)
  call   <index_2d@plt>
  mov    0x38(%rsp),%rdx
  sub    $0x8,%rsp
  mov    %ebp,%edi
  mov    %ebx,%r9d
  movsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,0x90(%rsp)
  push   %r15
  mov    0x18(%rsp),%eax
  push   %rax
  mov    0x24(%rsp),%ecx
  push   %rcx
  mov    0x30(%rsp),%edx
  push   %rdx
  push   %r13
  mov    0x60(%rsp),%esi
  push   %rsi
  mov    0x60(%rsp),%r8d
  push   %r8
  mov    0xd8(%rsp),%r8d
  mov    0x74(%rsp),%ecx
  mov    0x60(%rsp),%edx
  mov    0x58(%rsp),%esi
  call   <Blocal_index@plt>
  mov    0x88(%rsp),%rdi
  mov    %r14d,%edx
  mov    %r12d,%esi
  movsd  0xc8(%rsp),%xmm0
  mulsd  (%rdi,%rax,8),%xmm0
  mov    %ebx,%edi
  movsd  %xmm0,0xd0(%rsp)
  add    $0x40,%rsp
  call   <index_2d@plt>
  mov    0x40(%rsp),%r10
  movsd  (%r10,%rax,8),%xmm1
  movsd  %xmm1,0x88(%rsp)
  sub    $0x8,%rsp
  push   %r15
  mov    0x18(%rsp),%eax
  push   %rax
  mov    0x24(%rsp),%edi
  push   %rdi
  mov    0x30(%rsp),%r10d
  mov    %ebp,%edi
  push   %r10
  push   %r13
  mov    0x60(%rsp),%r11d
  push   %r11
  mov    0x60(%rsp),%r9d
  push   %r9
  mov    0x74(%rsp),%ecx
  mov    %ebx,%r9d
  mov    0x60(%rsp),%edx
  mov    0x58(%rsp),%esi
  mov    0xd8(%rsp),%r8d
  call   <Blocal_index@plt>
  mov    %r14d,%r9d
  mov    %ebp,%ecx
  mov    %r12d,%edx
  mov    0x90(%rsp),%rsi
  xor    %edi,%edi
  movsd  0xc8(%rsp),%xmm1
  movsd  0xd0(%rsp),%xmm0
  mulsd  (%rsi,%rax,8),%xmm1
  mov    %r13d,%esi
  subsd  %xmm1,%xmm0
  mulsd  0xc0(%rsp),%xmm0
  movsd  %xmm0,0xc0(%rsp)
  mov    0x54(%rsp),%r8d
  add    $0x38,%rsp
  push   %r8
  mov    %r15d,%r8d
  call   <index_4d@plt>
  mov    0x78(%rsp),%rcx
  mov    %ebx,%edi
  mov    %r14d,%edx
  mov    0x80(%rsp),%r11
  mov    %r12d,%esi
  movsd  0x90(%rsp),%xmm0
  lea    (%r11,%rax,8),%rax
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  movsd  (%rcx),%xmm3
  movsd  %xmm3,0x90(%rsp)
  call   <index_2d@plt>
  mov    0x48(%rsp),%rdx
  movsd  (%rdx,%rax,8),%xmm0
  mov    0x18(%rsp),%eax
  mov    %r15d,(%rsp)
  movsd  %xmm0,0x98(%rsp)
  push   %rax
  mov    0x24(%rsp),%edi
  push   %rdi
  mov    0x30(%rsp),%r10d
  mov    %ebp,%edi
  push   %r10
  push   %r13
  mov    0x60(%rsp),%r11d
  push   %r11
  mov    0x60(%rsp),%r9d
  push   %r9
  mov    0xd8(%rsp),%r8d
  mov    %ebx,%r9d
  mov    0x74(%rsp),%ecx
  mov    0x60(%rsp),%edx
  mov    0x58(%rsp),%esi
  call   <Blocal_index@plt>
  mov    0x90(%rsp),%rsi
  mov    %ebx,%edi
  mov    %r14d,%edx
  movsd  0xc8(%rsp),%xmm0
  mulsd  (%rsi,%rax,8),%xmm0
  mov    %r12d,%esi
  movsd  %xmm0,0xd0(%rsp)
  add    $0x40,%rsp
  call   <index_2d@plt>
  mov    0x40(%rsp),%r10
  movsd  (%r10,%rax,8),%xmm1
  movsd  %xmm1,0x88(%rsp)
  sub    $0x8,%rsp
  push   %r15
  mov    0x18(%rsp),%eax
  push   %rax
  mov    0x24(%rsp),%edi
  push   %rdi
  mov    0x30(%rsp),%r10d
  mov    %ebp,%edi
  push   %r10
  push   %r13
  mov    0x60(%rsp),%r11d
  push   %r11
  mov    0x60(%rsp),%r9d
  push   %r9
  mov    0x74(%rsp),%ecx
  mov    %ebx,%r9d
  add    $0x1,%ebx
  mov    0x60(%rsp),%edx
  mov    0x58(%rsp),%esi
  mov    0xd8(%rsp),%r8d
  call   <Blocal_index@plt>
  mov    %ebp,%ecx
  mov    %r14d,%r9d
  mov    %r12d,%edx
  mov    0x88(%rsp),%rdi
  mov    %r13d,%esi
  movsd  0xc8(%rsp),%xmm1
  movsd  0xd0(%rsp),%xmm0
  mulsd  (%rdi,%rax,8),%xmm1
  xor    %edi,%edi
  subsd  %xmm1,%xmm0
  mulsd  0xc0(%rsp),%xmm0
  movsd  %xmm0,0xc0(%rsp)
  mov    0x54(%rsp),%r8d
  add    $0x38,%rsp
  push   %r8
  mov    %r15d,%r8d
  call   <index_4d@plt>
  mov    0x88(%rsp),%rcx
  movsd  0x90(%rsp),%xmm0
  lea    (%rcx,%rax,8),%rax
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  pop    %rdi
  pop    %r8
  cmp    %ebx,0x8(%rsp)
  jne    L170
  add    $0x1,%ebp
  cmp    %ebp,0x14(%rsp)
  jne    L95
  add    $0x1,%r12d
  cmp    %r12d,%r14d
  jne    L62
  add    $0x1,%r13d
  cmp    %r13d,%r15d
  jne    L46
L131:
  mov    0x9c(%rsp),%eax
  addq   $0x8,0x68(%rsp)
  add    $0x1,%eax
  cmp    %eax,0xa0(%rsp)
  je     L30
  mov    %eax,0x9c(%rsp)
  mov    %eax,%ebx
  jmp    L137
L194:
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  mov    0x50(%rsp),%rdi
  call   <free@plt>
  mov    0x58(%rsp),%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  add    $0xd8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10a0 <free@plt>
L30:
  mov    0xc8(%rsp),%rax
  movl   $0x0,0xa0(%rsp)
  mov    0xa0(%rsp),%ebx
  mov    %rax,0x68(%rsp)
L93:
  mov    0xa4(%rsp),%ebp
  xor    %esi,%esi
  mov    %ebx,%edi
  mov    %ebp,%edx
  call   <index_2d@plt>
  mov    %ebp,%edx
  xor    %esi,%esi
  mov    %ebx,%edi
  mov    0xb8(%rsp),%r13
  mov    0x0(%r13,%rax,4),%eax
  mov    %eax,0x18(%rsp)
  call   <index_2d@plt>
  mov    %ebp,%edx
  mov    $0x1,%esi
  mov    %ebx,%edi
  mov    0xc0(%rsp),%r12
  mov    (%r12,%rax,4),%eax
  mov    %eax,0x20(%rsp)
  call   <index_2d@plt>
  mov    %ebp,%edx
  mov    $0x1,%esi
  mov    %ebx,%edi
  mov    0x0(%r13,%rax,4),%eax
  mov    %eax,0x28(%rsp)
  call   <index_2d@plt>
  mov    %ebp,%edx
  mov    $0x2,%esi
  mov    %ebx,%edi
  mov    (%r12,%rax,4),%eax
  mov    %eax,0x30(%rsp)
  call   <index_2d@plt>
  mov    %ebp,%edx
  mov    $0x2,%esi
  mov    %ebx,%edi
  mov    0x0(%r13,%rax,4),%eax
  mov    %eax,0x34(%rsp)
  call   <index_2d@plt>
  mov    (%r12,%rax,4),%eax
  mov    %eax,0x98(%rsp)
  test   %r15d,%r15d
  jle    L114
  test   %r14d,%r14d
  jle    L114
  mov    0x14(%rsp),%esi
  test   %esi,%esi
  jle    L114
  mov    0x8(%rsp),%ecx
  xor    %r13d,%r13d
  test   %ecx,%ecx
  jle    L114
L189:
  xor    %r12d,%r12d
  nop
L25:
  xor    %ebp,%ebp
  nopw   0x0(%rax,%rax,1)
L70:
  xor    %ebx,%ebx
  nopw   0x0(%rax,%rax,1)
L164:
  mov    0x68(%rsp),%rax
  mov    %ebx,%edi
  mov    %r14d,%edx
  mov    %r12d,%esi
  movsd  (%rax),%xmm4
  movsd  %xmm4,0x80(%rsp)
  call   <index_2d@plt>
  mov    0x38(%rsp),%rdx
  sub    $0x8,%rsp
  mov    %ebp,%edi
  mov    %ebx,%r9d
  movsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,0x90(%rsp)
  push   %r15
  mov    0x18(%rsp),%eax
  push   %rax
  mov    0x24(%rsp),%ecx
  push   %rcx
  mov    0x30(%rsp),%edx
  push   %rdx
  push   %r13
  mov    0x60(%rsp),%esi
  push   %rsi
  mov    0x60(%rsp),%r8d
  push   %r8
  mov    0xd8(%rsp),%r8d
  mov    0x74(%rsp),%ecx
  mov    0x60(%rsp),%edx
  mov    0x58(%rsp),%esi
  call   <Blocal_index@plt>
  mov    0x98(%rsp),%rdi
  mov    %r14d,%edx
  mov    %r12d,%esi
  movsd  0xc8(%rsp),%xmm0
  mulsd  (%rdi,%rax,8),%xmm0
  mov    %ebx,%edi
  movsd  %xmm0,0xd0(%rsp)
  add    $0x40,%rsp
  call   <index_2d@plt>
  mov    0x40(%rsp),%r11
  movsd  (%r11,%rax,8),%xmm1
  movsd  %xmm1,0x88(%rsp)
  sub    $0x8,%rsp
  push   %r15
  mov    0x18(%rsp),%eax
  push   %rax
  mov    0x24(%rsp),%edi
  push   %rdi
  mov    0x30(%rsp),%r10d
  mov    %ebp,%edi
  push   %r10
  push   %r13
  mov    0x60(%rsp),%r11d
  push   %r11
  mov    0x60(%rsp),%r9d
  push   %r9
  mov    0x74(%rsp),%ecx
  mov    %ebx,%r9d
  mov    0x60(%rsp),%edx
  mov    0x58(%rsp),%esi
  mov    0xd8(%rsp),%r8d
  call   <Blocal_index@plt>
  mov    %r14d,%r9d
  mov    %ebp,%ecx
  mov    %r12d,%edx
  mov    0xa0(%rsp),%rsi
  mov    $0x1,%edi
  movsd  0xc8(%rsp),%xmm1
  movsd  0xd0(%rsp),%xmm0
  mulsd  (%rsi,%rax,8),%xmm1
  mov    %r13d,%esi
  subsd  %xmm1,%xmm0
  mulsd  0xc0(%rsp),%xmm0
  movsd  %xmm0,0xc0(%rsp)
  mov    0x54(%rsp),%r8d
  add    $0x38,%rsp
  push   %r8
  mov    %r15d,%r8d
  call   <index_4d@plt>
  mov    0x78(%rsp),%rcx
  mov    %ebx,%edi
  mov    %r14d,%edx
  mov    0x80(%rsp),%r10
  mov    %r12d,%esi
  movsd  0x90(%rsp),%xmm0
  lea    (%r10,%rax,8),%rax
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  movsd  (%rcx),%xmm5
  movsd  %xmm5,0x90(%rsp)
  call   <index_2d@plt>
  mov    0x48(%rsp),%rdx
  movsd  (%rdx,%rax,8),%xmm0
  mov    0x18(%rsp),%eax
  mov    %r15d,(%rsp)
  movsd  %xmm0,0x98(%rsp)
  push   %rax
  mov    0x24(%rsp),%edi
  push   %rdi
  mov    0x30(%rsp),%r10d
  mov    %ebp,%edi
  push   %r10
  push   %r13
  mov    0x60(%rsp),%r11d
  push   %r11
  mov    0x60(%rsp),%r9d
  push   %r9
  mov    0xd8(%rsp),%r8d
  mov    %ebx,%r9d
  mov    0x74(%rsp),%ecx
  mov    0x60(%rsp),%edx
  mov    0x58(%rsp),%esi
  call   <Blocal_index@plt>
  mov    0xa0(%rsp),%rsi
  mov    %ebx,%edi
  mov    %r14d,%edx
  movsd  0xc8(%rsp),%xmm0
  mulsd  (%rsi,%rax,8),%xmm0
  mov    %r12d,%esi
  movsd  %xmm0,0xd0(%rsp)
  add    $0x40,%rsp
  call   <index_2d@plt>
  mov    0x40(%rsp),%r11
  movsd  (%r11,%rax,8),%xmm1
  movsd  %xmm1,0x88(%rsp)
  sub    $0x8,%rsp
  push   %r15
  mov    0x18(%rsp),%eax
  push   %rax
  mov    0x24(%rsp),%edi
  push   %rdi
  mov    0x30(%rsp),%r10d
  mov    %ebp,%edi
  push   %r10
  push   %r13
  mov    0x60(%rsp),%r11d
  push   %r11
  mov    0x60(%rsp),%r9d
  push   %r9
  mov    0x74(%rsp),%ecx
  mov    %ebx,%r9d
  add    $0x1,%ebx
  mov    0x60(%rsp),%edx
  mov    0x58(%rsp),%esi
  mov    0xd8(%rsp),%r8d
  call   <Blocal_index@plt>
  mov    %ebp,%ecx
  mov    %r12d,%edx
  mov    %r14d,%r9d
  mov    0x98(%rsp),%rdi
  mov    %r13d,%esi
  movsd  0xc8(%rsp),%xmm1
  movsd  0xd0(%rsp),%xmm0
  mulsd  (%rdi,%rax,8),%xmm1
  mov    $0x1,%edi
  subsd  %xmm1,%xmm0
  mulsd  0xc0(%rsp),%xmm0
  movsd  %xmm0,0xc0(%rsp)
  mov    0x54(%rsp),%r8d
  add    $0x38,%rsp
  push   %r8
  mov    %r15d,%r8d
  call   <index_4d@plt>
  mov    0x88(%rsp),%rcx
  movsd  0x90(%rsp),%xmm0
  lea    (%rcx,%rax,8),%rax
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  pop    %rax
  pop    %rdx
  cmp    %ebx,0x8(%rsp)
  jne    L164
  add    $0x1,%ebp
  cmp    %ebp,0x14(%rsp)
  jne    L70
  add    $0x1,%r12d
  cmp    %r12d,%r14d
  jne    L25
  add    $0x1,%r13d
  cmp    %r13d,%r15d
  jne    L189
L114:
  mov    0xa0(%rsp),%ebx
  addq   $0x8,0x68(%rsp)
  lea    0x1(%rbx),%eax
  cmp    %ebx,0x9c(%rsp)
  je     L194
  mov    %eax,0xa0(%rsp)
  mov    %eax,%ebx
  jmp    L93
```

assistant: ```c
void make_nucleon_2pt(double *C_re, double *C_im, const double *prop_re, const double *prop_im, const int *src_color_weights_r1, const int *src_spin_weights_r1, const double *src_weights_r1, const int *src_color_weights_r2, const int *src_spin_weights_r2, const double *src_weights_r2, const double *src_psi_re, const double *src_psi_im, const double *snk_psi_re, const double *snk_psi_im, const int Nc, const int Ns, const int Vsrc, const int Vsnk, const int Nt, const int Nw, const int Nq, const int Nsrc, const int Nsnk) {
  int n, m, t, x, iC, iS, jC, jS, kC, kS, wnum;
  double *Blocal_r1_re = malloc(Nt * Nc * Ns * Nc * Ns * Vsnk * Nc * Ns * Nsrc * sizeof(double));
  double *Blocal_r1_im = malloc(Nt * Nc * Ns * Nc * Ns * Vsnk * Nc * Ns * Nsrc * sizeof(double));
  double *Blocal_r2_re = malloc(Nt * Nc * Ns * Nc * Ns * Vsnk * Nc * Ns * Nsrc * sizeof(double));
  double *Blocal_r2_im = malloc(Nt * Nc * Ns * Nc * Ns * Vsnk * Nc * Ns * Nsrc * sizeof(double));
  make_local_block(Blocal_r1_re, Blocal_r1_im, prop_re, prop_im, src_color_weights_r1, src_spin_weights_r1, src_weights_r1, src_psi_re, src_psi_im, Nc, Ns, Vsrc, Vsnk, Nt, Nw, Nq, Nsrc);
  make_local_block(Blocal_r2_re, Blocal_r2_im, prop_re, prop_im, src_color_weights_r2, src_spin_weights_r2, src_weights_r2, src_psi_re, src_psi_im, Nc, Ns, Vsrc, Vsnk, Nt, Nw, Nq, Nsrc);
  for (wnum = 0; wnum < Nw; wnum++) {
    iC = src_color_weights_r1[index_2d(wnum, 0, Nq)];
    iS = src_spin_weights_r1[index_2d(wnum, 0, Nq)];
    jC = src_color_weights_r1[index_2d(wnum, 1, Nq)];
    jS = src_spin_weights_r1[index_2d(wnum, 1, Nq)];
    kC = src_color_weights_r1[index_2d(wnum, 2, Nq)];
    kS = src_spin_weights_r1[index_2d(wnum, 2, Nq)];
    for (m = 0; m < Nsrc; m++) {
      for (n = 0; n < Nsnk; n++) {
        for (t = 0; t < Nt; t++) {
          for (x = 0; x < Vsnk; x++) {
            C_re[index_4d(0, m, n, t, Nsrc, Nsnk, Nt)] += src_weights_r1[wnum] * (snk_psi_re[index_2d(x, n, Nsnk)] * Blocal_r1_re[Blocal_index(t, iC, iS, kC, kS, x, jC, jS, m, Nc, Ns, Vsnk, Nsrc)] - snk_psi_im[index_2d(x, n, Nsnk)] * Blocal_r1_im[Blocal_index(t, iC, iS, kC, kS, x, jC, jS, m, Nc, Ns, Vsnk, Nsrc)]);
            C_im[index_4d(0, m, n, t, Nsrc, Nsnk, Nt)] += src_weights_r1[wnum] * (snk_psi_re[index_2d(x, n, Nsnk)] * Blocal_r1_im[Blocal_index(t, iC, iS, kC, kS, x, jC, jS, m, Nc, Ns, Vsnk, Nsrc)] - snk_psi_im[index_2d(x, n, Nsnk)] * Blocal_r1_re[Blocal_index(t, iC, iS, kC, kS, x, jC, jS, m, Nc, Ns, Vsnk, Nsrc)]);
          }
        }
      }
    }
  }
  for (wnum = 0; wnum < Nw; wnum++) {
    iC = src_color_weights_r2[index_2d(wnum, 0, Nq)];
    iS = src_spin_weights_r2[index_2d(wnum, 0, Nq)];
    jC = src_color_weights_r2[index_2d(wnum, 1, Nq)];
    jS = src_spin_weights_r2[index_2d(wnum, 1, Nq)];
    kC = src_color_weights_r2[index_2d(wnum, 2, Nq)];
    kS = src_spin_weights_r2[index_2d(wnum, 2, Nq)];
    for (m = 0; m < Nsrc; m++) {
      for (n = 0; n < Nsnk; n++) {
        for (t = 0; t < Nt; t++) {
          for (x = 0; x < Vsnk; x++) {
            C_re[index_4d(1, m, n, t, Nsrc, Nsnk, Nt)] += src_weights_r2[wnum] * (snk_psi_re[index_2d(x, n, Nsnk)] * Blocal_r2_re[Blocal_index(t, iC, iS, kC, kS, x, jC, jS, m, Nc, Ns, Vsnk, Nsrc)] - snk_psi_im[index_2d(x, n, Nsnk)] * Blocal_r2_im[Blocal_index(t, iC, iS, kC, kS, x, jC, jS, m, Nc, Ns, Vsnk, Nsrc)]);
            C_im[index_4d(1, m, n, t, Nsrc, Nsnk, Nt)] += src_weights_r2[wnum] * (snk_psi_re[index_2d(x, n, Nsnk)] * Blocal_r2_im[Blocal_index(t, iC, iS, kC, kS, x, jC, jS, m, Nc, Ns, Vsnk, Nsrc)] - snk_psi_im[index_2d(x, n, Nsnk)] * Blocal_r2_re[Blocal_index(t, iC, iS, kC, kS, x, jC, jS, m, Nc, Ns, Vsnk, Nsrc)]);
          }
        }
      }
    }
  }
  free(Blocal_r1_re);
  free(Blocal_r1_im);
  free(Blocal_r2_re);
  free(Blocal_r2_im);
}
```