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

```asm
<contract_ss_c>:
  endbr64
  push   %r15
  push   %r14
  mov    %edi,%r14d
  push   %r13
  lea    0x7e(%r14),%r13d
  push   %r12
  movslq %r9d,%r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x98,%rsp
  mov    0xd0(%rsp),%rax
  mov    %edi,0x40(%rsp)
  lea    0x0(,%r9,4),%edi
  mov    %esi,0x44(%rsp)
  mov    %edx,0x3c(%rsp)
  mov    %rcx,0x30(%rsp)
  mov    %r8,0x48(%rsp)
  mov    %rax,0x50(%rsp)
  call   <malloc@plt>
  add    $0x3f,%r14d
  cmovns %r14d,%r13d
  movl   $0x0,(%rax)
  mov    %rax,%r15
  sar    $0x6,%r13d
  movslq %r13d,%rax
  mov    %rax,0x10(%rsp)
  shl    $0x2,%rax
  mov    %rax,0x20(%rsp)
  add    %rax,%rbx
  cmp    $0x1,%r12
  jbe    L187
  mov    $0x1,%r14d
  mov    %rbx,%rdi
  mov    %r12,(%rsp)
  mov    %rax,%r12
  mov    %r15,0x8(%rsp)
  add    %rax,%rdi
  mov    %r14,%r15
  mov    %rbx,%r14
  nopl   0x0(%rax,%rax,1)
L208:
  mov    0x30(%rsp),%rsi
  lea    (%r12,%rdi,1),%rbp
  mov    %r13d,%edx
  call   <n_excitations@plt>
  mov    %rbp,%rdi
  mov    %r13d,%edx
  mov    %r14,%rsi
  mov    %eax,%ebx
  call   <n_excitations@plt>
  lea    (%r12,%rbp,1),%rdi
  add    %eax,%ebx
  mov    0x8(%rsp),%rax
  mov    %ebx,(%rax,%r15,4)
  add    $0x1,%r15
  cmp    %r15,(%rsp)
  jne    L208
  mov    (%rsp),%r12
  mov    %rax,%r15
L59:
  movslq 0x44(%rsp),%rax
  movslq 0x3c(%rsp),%rsi
  xor    %r14d,%r14d
  mov    0x30(%rsp),%r8
  mov    0x10(%rsp),%r11
  mov    %rax,0x58(%rsp)
  shl    $0x2,%rax
  mov    %rax,0x68(%rsp)
  lea    0x0(,%rsi,4),%rax
  mov    %r8,%r10
  shl    $0x3,%r11
  mov    %rsi,0x60(%rsp)
  mov    %r12,%r8
  mov    %rax,0x70(%rsp)
  nopw   0x0(%rax,%rax,1)
L121:
  mov    0x20(%rsp),%rax
  mov    %r14,%r9
  mov    %r10,0x28(%rsp)
  xor    %ebx,%ebx
  mov    0x30(%rsp),%rbp
  mov    %r8,%r14
  add    %r10,%rax
  mov    %rax,0x18(%rsp)
  jmp    L209
  nopl   0x0(%rax)
L107:
  add    $0x1,%rbx
  add    %r11,%rbp
  cmp    %rbx,%r14
  jbe    L154
L209:
  mov    (%r15,%r9,4),%eax
  sub    (%r15,%rbx,4),%eax
  add    $0x2,%eax
  cmp    $0x4,%eax
  ja     L107
  mov    0x20(%rsp),%rax
  mov    0x28(%rsp),%rdi
  mov    %r13d,%edx
  mov    %rbp,%rsi
  mov    %r11,0x10(%rsp)
  mov    %r9,0x8(%rsp)
  lea    (%rax,%rbp,1),%r12
  call   <n_excitations@plt>
  mov    0x18(%rsp),%rdi
  mov    %r13d,%edx
  mov    %r12,%rsi
  mov    %eax,(%rsp)
  call   <n_excitations@plt>
  mov    0x8(%rsp),%r9
  mov    (%rsp),%ecx
  mov    0x10(%rsp),%r11
  cmp    %r9,%rbx
  je     L185
  lea    (%rcx,%rax,1),%edx
  cmp    $0x2,%edx
  jne    L107
  cmp    %eax,%ecx
  jne    L107
  mov    0x28(%rsp),%rdi
  mov    %r13d,%edx
  mov    %rbp,%rsi
  mov    %r11,0x10(%rsp)
  mov    %r9,0x8(%rsp)
  call   <get_single_excitation@plt>
  mov    0x18(%rsp),%rdi
  mov    %r12,%rsi
  mov    %r13d,%edx
  mov    %rax,(%rsp)
  call   <get_single_excitation@plt>
  mov    (%rsp),%r10
  mov    0x8(%rsp),%r9
  mov    %rax,%r12
  mov    0x10(%rsp),%r11
  mov    (%rax),%eax
  mov    0x4(%r12),%r8d
  mov    (%r10),%esi
  mov    0x4(%r10),%edi
  cmp    %r8d,%esi
  mov    %r8d,(%rsp)
  jne    L165
  cmp    %eax,%edi
  mov    %eax,0x8(%rsp)
  je     L35
L165:
  mov    %r10,%rdi
  mov    %r11,0x8(%rsp)
  add    $0x1,%rbx
  mov    %r9,(%rsp)
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%r11
  mov    (%rsp),%r9
  add    %r11,%rbp
  cmp    %rbx,%r14
  ja     L209
  nopl   0x0(%rax)
L154:
  mov    %r14,%r8
  mov    %r9,%r14
  mov    0x18(%rsp),%r10
  add    0x20(%rsp),%r10
  add    $0x1,%r14
  cmp    %r14,%r8
  ja     L121
L20:
  add    $0x98,%rsp
  mov    %r15,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10a0 <free@plt>
  xchg   %ax,%ax
L185:
  mov    0x44(%rsp),%esi
  mov    0x3c(%rsp),%edi
  pxor   %xmm1,%xmm1
  pxor   %xmm0,%xmm0
  mov    0x40(%rsp),%edx
  mov    %esi,%eax
  mov    %esi,%ecx
  sub    %edi,%eax
  cvtsi2sd %eax,%xmm1
  mov    %esi,%eax
  mov    %r13d,%esi
  add    %edi,%eax
  mov    0x28(%rsp),%rdi
  cvtsi2sd %eax,%xmm0
  mulsd  D22(%rip),%xmm0
  mulsd  %xmm1,%xmm1
  mulsd  D21(%rip),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rsp)
  call   <compute_occ_list@plt>
  mov    0x3c(%rsp),%ecx
  mov    0x40(%rsp),%edx
  mov    %r13d,%esi
  mov    0x18(%rsp),%rdi
  mov    %rax,%r12
  call   <compute_occ_list@plt>
  cmpq   $0x0,0x58(%rsp)
  movsd  (%rsp),%xmm0
  mov    0x8(%rsp),%r9
  mov    0x10(%rsp),%r11
  mov    %rax,%r10
  je     L30
  mov    0x68(%rsp),%rax
  mov    0x60(%rsp),%r8
  mov    %r12,%rsi
  lea    (%rax,%r12,1),%rdi
  mov    0x70(%rsp),%rax
  lea    (%r10,%rax,1),%rcx
  nopl   0x0(%rax)
L81:
  mov    (%rsi),%edx
  test   %r8,%r8
  je     L149
  mov    %r10,%rax
  nopw   0x0(%rax,%rax,1)
L118:
  cmp    (%rax),%edx
  jne    L205
  subsd  D5(%rip),%xmm0
L205:
  add    $0x4,%rax
  cmp    %rax,%rcx
  jne    L118
L149:
  add    $0x4,%rsi
  cmp    %rsi,%rdi
  jne    L81
L30:
  mov    0x48(%rsp),%rax
  mov    %r12,%rdi
  mov    %r11,0x10(%rsp)
  mov    %r9,(%rsp)
  mulsd  (%rax,%r9,8),%xmm0
  mov    0x50(%rsp),%rax
  mov    %r10,0x8(%rsp)
  addsd  (%rax,%r9,8),%xmm0
  movsd  %xmm0,(%rax,%r9,8)
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    (%rsp),%r9
  mov    0x10(%rsp),%r11
  jmp    L107
L35:
  mov    0x28(%rsp),%rdx
  mov    %r13d,%ecx
  mov    %r11,0x88(%rsp)
  mov    %r9,0x80(%rsp)
  mov    %r10,0x78(%rsp)
  call   <compute_cre_des_sign@plt>
  mov    0x18(%rsp),%rdx
  mov    (%rsp),%edi
  mov    %r13d,%ecx
  mov    0x8(%rsp),%esi
  movsd  %xmm0,0x10(%rsp)
  call   <compute_cre_des_sign@plt>
  mov    0x48(%rsp),%rax
  mulsd  0x10(%rsp),%xmm0
  mov    0x80(%rsp),%r9
  mov    0x88(%rsp),%r11
  mulsd  (%rax,%rbx,8),%xmm0
  mov    0x50(%rsp),%rax
  mov    0x78(%rsp),%r10
  movsd  (%rax,%r9,8),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax,%r9,8)
  jmp    L165
L187:
  test   %r12,%r12
  je     L20
  jmp    L59
```

tool_calls: name: retrieve_data
arguments: data_label: D22
type: byte[8]
name: retrieve_data
arguments: data_label: D21
type: byte[8]
name: retrieve_data
arguments: data_label: D5
type: f64

tool: {"D22": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: {"D21": [0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x3f]}

tool: D5: 1

assistant: ```c
void contract_ss_c(int norb, int neleca, int nelecb, uint64_t *strs, double *civec, uint64_t ndet, double *ci1) {
  int *ts = malloc(sizeof(int) * ndet);
#pragma omp parallel
  {
    size_t ip, jp, p, q;
    int nset = (norb + 63) / 64;
    ts[0] = 0;
    uint64_t *str1a = strs;
    uint64_t *str1b = strs + nset;
#pragma omp for schedule(static)
    for (ip = 1; ip < ndet; ++ip) {
      uint64_t *stria = strs + ip * 2 * nset;
      uint64_t *strib = strs + ip * 2 * nset + nset;
      ts[ip] = (n_excitations(stria, str1a, nset) + n_excitations(strib, str1b, nset));
    }
#pragma omp for schedule(static)
    for (ip = 0; ip < ndet; ++ip) {
      for (jp = 0; jp < ndet; ++jp) {
        if (abs(ts[ip] - ts[jp]) < 3) {
          uint64_t *stria = strs + ip * 2 * nset;
          uint64_t *strib = strs + ip * 2 * nset + nset;
          uint64_t *strja = strs + jp * 2 * nset;
          uint64_t *strjb = strs + jp * 2 * nset + nset;
          int n_excit_a = n_excitations(stria, strja, nset);
          int n_excit_b = n_excitations(strib, strjb, nset);
          if (ip == jp) {
            double apb = (double)(neleca + nelecb);
            double amb = (double)(neleca - nelecb);
            double prefactor = apb / 2.0 + amb * amb / 4.0;
            int *occsa = compute_occ_list(stria, nset, norb, neleca);
            int *occsb = compute_occ_list(strib, nset, norb, nelecb);
            for (p = 0; p < neleca; ++p) {
              int pa = occsa[p];
              for (q = 0; q < nelecb; ++q) {
                int qb = occsb[q];
                if (pa == qb)
                  prefactor -= 1.0;
              }
            }
            ci1[ip] += prefactor * civec[ip];
            free(occsa);
            free(occsb);
          } else if ((n_excit_a + n_excit_b) == 2) {
            int i, j, a, b;
            if (n_excit_a == n_excit_b) {
              int *ia = get_single_excitation(stria, strja, nset);
              int *jb = get_single_excitation(strib, strjb, nset);
              i = ia[0];
              a = ia[1];
              j = jb[0];
              b = jb[1];
              if (i == b && j == a) {
                double sign = compute_cre_des_sign(a, i, stria, nset);
                sign *= compute_cre_des_sign(b, j, strib, nset);
                ci1[ip] -= sign * civec[jp];
              }
              free(ia);
              free(jb);
            }
          }
        }
      }
    }
  }
  free(ts);
}
```