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

```asm
<get_consensus_duplex>:
  endbr64
  push   %r15
  mov    %rsi,%r10
  mov    %r8d,%r15d
  mov    %rdx,%rsi
  push   %r14
  mov    %r9d,%r14d
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  push   %rbx
  movq   %xmm0,%rbx
  sub    $0x18,%rsp
  ucomisd D47(%rip),%xmm0
  mov    0x50(%rsp),%ebp
  mov    0x60(%rsp),%r8d
  jp     L4
  cmove  D45(%rip),%rbx
L4:
  test   %rsi,%rsi
  je     L22
  test   %r12,%r12
  je     L22
  movsbl %r8b,%r8d
  mov    %ebp,%ecx
  mov    %r15d,%edx
  mov    %r10,0x8(%rsp)
  mov    %r8d,(%rsp)
  call   <get_votes_qual@plt>
  mov    (%rsp),%r8d
  mov    0x8(%rsp),%rdi
  mov    %ebp,%ecx
  mov    %r12,%rsi
  mov    %r14d,%edx
  mov    %rax,%r13
  call   <get_votes_qual@plt>
  mov    %rax,%r12
L45:
  mov    0x70(%rsp),%rdi
  mov    $0x4,%edx
  lea    D11(%rip),%rsi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L61
  movq   %rbx,%xmm0
  mov    %ebp,%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <build_consensus_duplex@plt>
  mov    %rax,%r8
  mov    0x68(%rsp),%eax
  test   %eax,%eax
  je     L36
L86:
  mov    %ebp,%esi
  mov    %r13,%rdi
  mov    %r8,(%rsp)
  call   <free_votes@plt>
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <free_votes@plt>
  mov    (%rsp),%r8
L24:
  add    $0x18,%rsp
  mov    %r8,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L22:
  mov    %ebp,%edx
  mov    %r15d,%esi
  mov    %r10,(%rsp)
  call   <get_votes_simple@plt>
  mov    (%rsp),%rdi
  mov    %ebp,%edx
  mov    %r14d,%esi
  mov    %rax,%r13
  call   <get_votes_simple@plt>
  mov    %rax,%r12
  jmp    L45
  nop
L61:
  mov    0x70(%rsp),%rdi
  mov    $0x5,%edx
  lea    D34(%rip),%rsi
  call   <strncmp@plt>
  lea    D43(%rip),%r8
  test   %eax,%eax
  jne    L24
  mov    0x58(%rsp),%ecx
  mov    %r15d,%esi
  movq   %rbx,%xmm0
  mov    %ebp,%edx
  mov    %r13,%rdi
  call   <build_consensus@plt>
  mov    0x58(%rsp),%ecx
  movq   %rbx,%xmm0
  mov    %ebp,%edx
  mov    %r14d,%esi
  mov    %r12,%rdi
  mov    %rax,%r15
  call   <build_consensus@plt>
  mov    $0x1,%edx
  mov    %r15,%rdi
  mov    %rax,%rsi
  call   <build_consensus_duplex_simple@plt>
  mov    %rax,%r8
  mov    0x68(%rsp),%eax
  test   %eax,%eax
  jne    L86
L36:
  mov    %r8,%rdi
  mov    %ebp,%esi
  call   <rm_gaps@plt>
  mov    %rax,%r8
  jmp    L86
```

tool_calls: name: unpack_data
arguments: tag: D47
datatype: byte[8]
name: unpack_data
arguments: tag: D45
datatype: f64
name: unpack_data
arguments: tag: D11
datatype: string
name: unpack_data
arguments: tag: D34
datatype: string
name: unpack_data
arguments: tag: D43
datatype: string

tool: {"D47": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: D45: 0.5

tool: D11: freq

tool: D34: iupac

tool: 

assistant: ```c
char *get_consensus_duplex(char *align1[], char *align2[], char *quals1[], char *quals2[], int n_seqs1, int n_seqs2, int seq_len, double cons_thres, int min_reads, char qual_thres, int gapped, char *method) {
  if (cons_thres == -1.0) {
    cons_thres = 0.5;
  }
  int **votes1;
  int **votes2;
  if (quals1 == 0 || quals2 == 0) {
    votes1 = get_votes_simple(align1, n_seqs1, seq_len);
    votes2 = get_votes_simple(align2, n_seqs2, seq_len);
  } else {
    votes1 = get_votes_qual(align1, quals1, n_seqs1, seq_len, qual_thres);
    votes2 = get_votes_qual(align2, quals2, n_seqs2, seq_len, qual_thres);
  }
  char *consensus_gapped;
  if (!strncmp(method, "freq", 4)) {
    consensus_gapped = build_consensus_duplex(votes1, votes2, seq_len, cons_thres);
  } else if (!strncmp(method, "iupac", 5)) {
    char *cons1 = build_consensus(votes1, n_seqs1, seq_len, cons_thres, min_reads);
    char *cons2 = build_consensus(votes2, n_seqs2, seq_len, cons_thres, min_reads);
    consensus_gapped = build_consensus_duplex_simple(cons1, cons2, 1);
  } else {
    return "";
  }
  char *consensus;
  if (gapped) {
    consensus = consensus_gapped;
  } else {
    consensus = rm_gaps(consensus_gapped, seq_len);
  }
  free_votes(votes1, seq_len);
  free_votes(votes2, seq_len);
  return consensus;
}
```