user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<get_double_excitation>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    $0x10,%edi
  push   %rbx
  sub    $0x28,%rsp
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  movslq %r13d,%rax
  mov    %rax,0x10(%rsp)
  test   %rax,%rax
  je     L19
  lea    -0x8(,%rax,8),%rax
  movl   $0x0,0x1c(%rsp)
  xor    %ebx,%ebx
  xor    %r12d,%r12d
  movl   $0x2,0x18(%rsp)
  lea    0x0(%rbp,%rax,1),%r13
  add    %rax,%r15
  jmp    L26
  nopw   0x0(%rax,%rax,1)
L57:
  cmp    $0x2,%edx
  je     L97
L2:
  add    $0x1,%r12
  sub    $0x8,%r13
  sub    $0x8,%r15
  add    $0x40,%ebx
  cmp    0x10(%rsp),%r12
  je     L19
L26:
  mov    (%r15),%r14
  mov    0x0(%r13),%rax
  xor    (%r15),%rax
  and    %rax,%r14
  and    0x0(%r13),%rax
  mov    %rax,%rbp
  mov    %r14,%rdi
  call   <popcount@plt>
  mov    %rbp,%rdi
  mov    %eax,0x4(%rsp)
  call   <popcount@plt>
  mov    0x4(%rsp),%ecx
  mov    %eax,%edx
  cmp    $0x1,%ecx
  je     L35
  cmp    $0x2,%ecx
  je     L6
L96:
  cmp    $0x1,%edx
  jne    L57
  mov    %rbp,%rdi
  call   <trailz@plt>
  movslq 0x1c(%rsp),%rdx
  mov    0x8(%rsp),%rcx
  add    %ebx,%eax
  mov    %rdx,%rsi
  mov    %eax,(%rcx,%rdx,4)
  add    $0x1,%esi
  mov    %esi,0x1c(%rsp)
  jmp    L2
  nopl   0x0(%rax,%rax,1)
L35:
  mov    %r14,%rdi
  mov    %eax,0x4(%rsp)
  call   <trailz@plt>
  movslq 0x18(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  add    %ebx,%eax
  mov    %rcx,%rsi
  mov    %eax,(%rdx,%rcx,4)
  mov    0x4(%rsp),%edx
  add    $0x1,%esi
  mov    %esi,0x18(%rsp)
  jmp    L96
  nopl   0x0(%rax,%rax,1)
L6:
  mov    %r14,%rdi
  mov    %eax,0x4(%rsp)
  call   <trailz@plt>
  mov    0x8(%rsp),%rsi
  mov    $0x1,%edi
  mov    %eax,%ecx
  lea    (%rax,%rbx,1),%eax
  mov    %eax,0x8(%rsi)
  shl    %cl,%rdi
  not    %rdi
  and    %r14,%rdi
  call   <trailz@plt>
  mov    0x8(%rsp),%rsi
  mov    0x4(%rsp),%edx
  add    %ebx,%eax
  mov    %eax,0xc(%rsi)
  jmp    L96
  nop
L97:
  mov    %rbp,%rdi
  call   <trailz@plt>
  mov    0x8(%rsp),%r14
  mov    $0x1,%edi
  mov    %eax,%ecx
  lea    (%rax,%rbx,1),%eax
  shl    %cl,%rdi
  mov    %eax,(%r14)
  not    %rdi
  and    %rbp,%rdi
  call   <trailz@plt>
  add    %ebx,%eax
  mov    %eax,0x4(%r14)
  jmp    L2
  nopl   0x0(%rax,%rax,1)
L19:
  mov    0x8(%rsp),%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int *get_double_excitation(uint64_t *str1, uint64_t *str2, int nset) {
  size_t p;
  int *ijab = malloc(sizeof(int) * 4);
  int particle_ind = 2;
  int hole_ind = 0;
  for (p = 0; p < nset; ++p) {
    size_t pp = nset - p - 1;
    uint64_t str_tmp = str1[pp] ^ str2[pp];
    uint64_t str_particle = str_tmp & str2[pp];
    uint64_t str_hole = str_tmp & str1[pp];
    int n_particle = popcount(str_particle);
    int n_hole = popcount(str_hole);
    if (n_particle == 1) {
      ijab[particle_ind] = trailz(str_particle) + 64 * p;
      particle_ind++;
    } else if (n_particle == 2) {
      int a = trailz(str_particle);
      ijab[2] = a + 64 * p;
      str_particle &= ~(1ULL << a);
      int b = trailz(str_particle);
      ijab[3] = b + 64 * p;
    }
    if (n_hole == 1) {
      ijab[hole_ind] = trailz(str_hole) + 64 * p;
      hole_ind++;
    } else if (n_hole == 2) {
      int i = trailz(str_hole);
      ijab[0] = i + 64 * p;
      str_hole &= ~(1ULL << i);
      int j = trailz(str_hole);
      ijab[1] = j + 64 * p;
    }
  }
  return ijab;
}
```