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

```asm
<multiplets>:
  endbr64
  push   %r15
  mov    %r8,%r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x7a8,%rsp
  mov    0x7f0(%rsp),%rax
  mov    %r9,0xb0(%rsp)
  mov    %rdi,0xd8(%rsp)
  mov    0x808(%rsp),%rbp
  mov    %rax,0x68(%rsp)
  mov    0x7f8(%rsp),%rax
  mov    %rsi,0xe0(%rsp)
  mov    %rax,0x70(%rsp)
  mov    0x810(%rsp),%rax
  mov    %rdx,0x50(%rsp)
  xor    %edx,%edx
  mov    %rax,0x20(%rsp)
  mov    0x818(%rsp),%rax
  mov    %rcx,0x58(%rsp)
  mov    %rsi,%rcx
  mov    %rdi,%rsi
  mov    $0x1,%edi
  mov    %rax,0x78(%rsp)
  mov    0x820(%rsp),%rax
  mov    %rax,0x38(%rsp)
  mov    0x828(%rsp),%rax
  mov    %rax,0x80(%rsp)
  mov    0x830(%rsp),%rax
  mov    %rax,0xe8(%rsp)
  mov    0x838(%rsp),%rax
  mov    %rax,0xf0(%rsp)
  mov    0x840(%rsp),%rax
  mov    %rax,0xf8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x798(%rsp)
  xor    %eax,%eax
  mov    D12(%rip),%rax
  movq   $0x0,0x118(%rsp)
  movq   $0x0,0x120(%rsp)
  mov    %rax,0x110(%rsp)
  mov    D63(%rip),%rax
  mov    %rax,0x128(%rsp)
  call   <lmatrix@plt>
  mov    $0x3,%ecx
  mov    $0x1,%edx
  mov    %ebx,%esi
  mov    $0x1,%edi
  mov    %rax,0xa8(%rsp)
  mov    %ebx,0xd4(%rsp)
  call   <dmatrix@plt>
  mov    $0x3,%ecx
  mov    $0x1,%edx
  mov    %ebx,%esi
  mov    $0x1,%edi
  mov    %rax,0xb8(%rsp)
  call   <dmatrix@plt>
  mov    $0x3,%ecx
  mov    $0x1,%edx
  mov    $0x3,%esi
  mov    $0x1,%edi
  mov    %rax,0xc0(%rsp)
  call   <dmatrix@plt>
  mov    $0x3,%ecx
  mov    $0x1,%edx
  mov    $0x64,%esi
  mov    $0x1,%edi
  mov    %rax,%r12
  call   <dmatrix@plt>
  movq   $0x0,0x48(%rsp)
  mov    %rax,0xc8(%rsp)
  test   %r14,%r14
  jle    L71
  movq   $0x1,0x8(%rsp)
  jmp    L232
  nopl   0x0(%rax)
L103:
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  cmp    %rax,0x50(%rsp)
  jl     L71
L232:
  mov    0x58(%rsp),%rax
  mov    0x8(%rsp),%rbx
  mov    (%rax,%rbx,8),%rdx
  mov    0x328(%rdx),%rax
  mov    %rax,0x28(%rsp)
  cmp    $0x1,%rax
  jle    L103
  add    $0x1,%rax
  mov    %rbx,0x8(%r15)
  cmpq   $0x0,0x328(%rdx)
  mov    %rax,0x30(%rsp)
  mov    $0x1,%eax
  jle    L37
  nopw   0x0(%rax,%rax,1)
L50:
  mov    (%rdx,%rax,8),%rcx
  mov    %rcx,0x8(%r15,%rax,8)
  add    $0x1,%rax
  cmp    %rax,0x328(%rdx)
  jge    L50
L37:
  mov    0xb0(%rsp),%rdx
  mov    0x30(%rsp),%rdi
  mov    %r15,%rsi
  call   <lsort@plt>
  cmpq   $0x0,0x48(%rsp)
  mov    $0x1,%edx
  je     L269
  mov    0x48(%rsp),%r8
  mov    0xa8(%rsp),%r9
  mov    0x30(%rsp),%r10
  jmp    L116
  nopl   0x0(%rax)
L72:
  add    $0x1,%rdx
  cmp    %r8,%rdx
  jg     L2
L220:
  test   %al,%al
  je     L2
L116:
  mov    (%r9,%rdx,8),%rsi
  mov    $0x1,%eax
  xor    %edi,%edi
  mov    (%rsi),%rcx
  cmp    %r10,%rcx
  jne    L72
  mov    $0x1,%eax
  nopl   (%rax)
L7:
  mov    (%rsi,%rax,8),%rdi
  cmp    %rdi,(%r15,%rax,8)
  jne    L73
  add    $0x1,%rax
  cmp    %rax,%rcx
  jge    L7
L73:
  xor    %edi,%edi
  cmp    %rcx,%rax
  setg   %dil
  setle  %al
  add    $0x1,%rdx
  cmp    %r8,%rdx
  jle    L220
  nopl   0x0(%rax,%rax,1)
L2:
  test   %rdi,%rdi
  jne    L103
L269:
  addq   $0x1,0x48(%rsp)
  mov    0x48(%rsp),%rsi
  lea    0x590(%rsp),%r13
  mov    0xa8(%rsp),%rcx
  mov    %r12,0x100(%rsp)
  lea    0x0(,%rsi,8),%rax
  mov    %rbp,0x108(%rsp)
  mov    0xc0(%rsp),%r14
  lea    (%rcx,%rax,1),%rbx
  mov    0x30(%rsp),%rcx
  mov    %r15,0x60(%rsp)
  add    0xf8(%rsp),%rax
  mov    (%rbx),%rdx
  mov    %rbx,0x88(%rsp)
  mov    %rax,0x90(%rsp)
  lea    0x190(%rsp),%rax
  mov    0xf0(%rsp),%rbx
  mov    %rax,0x98(%rsp)
  lea    0x390(%rsp),%rax
  mov    0xb8(%rsp),%r15
  mov    %rcx,(%rdx)
  mov    %rax,0xa0(%rsp)
  movb   $0x0,0x190(%rsp)
  movb   $0x0,0x390(%rsp)
  mov    %rcx,(%rbx,%rsi,8)
  mov    $0x1,%ebx
  nopl   0x0(%rax)
L176:
  mov    0x60(%rsp),%rax
  mov    0x70(%rsp),%rdi
  lea    D48(%rip),%r9
  mov    0x68(%rsp),%rsi
  cmp    %rbx,0x30(%rsp)
  mov    (%rax,%rbx,8),%r12
  mov    0x90(%rsp),%rax
  mov    (%rax),%rax
  lea    0x0(,%r12,8),%rbp
  mov    %r12,(%rax,%rbx,8)
  mov    0x88(%rsp),%rax
  mov    (%rax),%rax
  mov    %r12,(%rax,%rbx,8)
  mov    0x38(%rsp),%rax
  mov    (%rax,%r12,8),%rax
  mov    0x8(%rax),%rax
  mov    (%rdi,%rax,8),%rcx
  movsbq (%rsi,%rax,1),%rdx
  lea    D44(%rip),%rax
  mov    %r13,%rdi
  cmove  %rax,%r9
  mov    0x80(%rsp),%rax
  lea    D67(%rip),%rsi
  movsbl (%rax,%r12,1),%r8d
  xor    %eax,%eax
  call   <sprintf@plt>
  mov    0x98(%rsp),%rdi
  mov    %r13,%rsi
  call   <strcat@plt>
  mov    %r12,%rdx
  mov    %r13,%rdi
  xor    %eax,%eax
  lea    D31(%rip),%rsi
  mov    $0x8,%r12d
  call   <sprintf@plt>
  mov    0xa0(%rsp),%rdi
  mov    %r13,%rsi
  call   <strcat@plt>
  mov    0x78(%rsp),%rax
  mov    %r13,0x40(%rsp)
  mov    %rbp,%r13
  lea    (%rax,%rbp,1),%rdx
  mov    0x20(%rsp),%rax
  lea    (%rax,%rbp,1),%rcx
  mov    %rdx,%rbp
L26:
  lea    0x30(%r12),%rax
  cmp    $0x1,%rbx
  je     L100
  mov    %rax,0x18(%rsp)
  mov    (%rcx),%rax
  mov    0x8(%r15),%rdi
  mov    %rcx,0x10(%rsp)
  lea    0x30(%rax),%rsi
  call   <dot@plt>
  pxor   %xmm1,%xmm1
  mov    0x10(%rsp),%rcx
  mov    0x18(%rsp),%rax
  comisd %xmm0,%xmm1
  ja     L214
L100:
  mov    0x20(%rsp),%rdi
  mov    (%rdi,%r13,1),%rsi
  movsd  (%rsi,%rax,1),%xmm0
  mov    (%r15,%rbx,8),%rax
  movsd  %xmm0,(%rax,%r12,1)
L257:
  mov    0x0(%rbp),%rax
  movsd  (%rax,%r12,1),%xmm0
  mov    (%r14,%rbx,8),%rax
  movsd  %xmm0,(%rax,%r12,1)
  add    $0x8,%r12
  cmp    $0x20,%r12
  jne    L26
  mov    0x40(%rsp),%r13
  lea    0x1(%rbx),%rax
  cmp    %rbx,0x28(%rsp)
  jl     L94
  mov    %rax,%rbx
  jmp    L176
  cs nopw 0x0(%rax,%rax,1)
L214:
  mov    (%rcx),%rdi
  mov    (%r15,%rbx,8),%rsi
  movsd  (%rdi,%rax,1),%xmm0
  xorpd  D20(%rip),%xmm0
  movsd  %xmm0,(%rsi,%r12,1)
  jmp    L257
L71:
  mov    0x48(%rsp),%rcx
  mov    0xe8(%rsp),%rax
  mov    $0x1,%esi
  mov    0xe0(%rsp),%r8
  mov    0xd8(%rsp),%rdx
  mov    %rcx,(%rax)
  mov    0xa8(%rsp),%rdi
  xor    %ecx,%ecx
  call   <free_lmatrix@plt>
  mov    $0x3,%r8d
  mov    $0x1,%ecx
  mov    0xd4(%rsp),%ebx
  mov    0xb8(%rsp),%rdi
  mov    $0x1,%esi
  mov    %ebx,%edx
  call   <free_dmatrix@plt>
  mov    0xc0(%rsp),%rdi
  mov    $0x3,%r8d
  mov    %ebx,%edx
  mov    $0x1,%ecx
  mov    $0x1,%esi
  call   <free_dmatrix@plt>
  mov    $0x3,%r8d
  mov    $0x1,%ecx
  mov    %r12,%rdi
  mov    $0x3,%edx
  mov    $0x1,%esi
  call   <free_dmatrix@plt>
  mov    $0x3,%r8d
  mov    $0x1,%ecx
  mov    0xc8(%rsp),%rdi
  mov    $0x64,%edx
  mov    $0x1,%esi
  call   <free_dmatrix@plt>
  mov    0x798(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L267
  add    $0x7a8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L94:
  mov    0x30(%rsp),%rbx
  mov    $0x3,%edx
  mov    0x60(%rsp),%r15
  lea    0x170(%rsp),%rcx
  mov    0xc0(%rsp),%rdi
  lea    0x150(%rsp),%r13
  mov    0x100(%rsp),%r12
  lea    0x130(%rsp),%r14
  mov    %rbx,%rsi
  mov    0x108(%rsp),%rbp
  call   <ave_dmatrix@plt>
  mov    %r13,%rcx
  mov    %rbx,%rsi
  mov    $0x3,%edx
  mov    0xb8(%rsp),%rdi
  lea    0x110(%rsp),%rbx
  call   <ave_dmatrix@plt>
  mov    %r14,%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <cross@plt>
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <magang@plt>
  mov    %r14,%rdi
  mov    %r12,%rdx
  mov    %eax,%esi
  call   <arb_rotation@plt>
  mov    0x28(%rsp),%rax
  mov    %r15,0x18(%rsp)
  mov    %rbp,%r15
  movq   $0x1,0x10(%rsp)
  mov    0xc8(%rsp),%r14
  add    $0x2,%rax
  mov    %rax,0x28(%rsp)
  nopl   0x0(%rax)
L245:
  mov    0x10(%rsp),%rbx
  mov    0x18(%rsp),%rax
  mov    (%rax,%rbx,8),%rax
  mov    0x38(%rsp),%rbx
  lea    (%rbx,%rax,8),%rbx
  mov    (%rbx),%rax
  mov    0x8(%rax),%rbp
  cmp    %rbp,0x10(%rax)
  jl     L188
  mov    %rbp,%rdx
  jmp    L38
  nopl   (%rax)
L28:
  mov    0x8(%rax),%rdx
L38:
  mov    (%r15,%rbp,8),%rax
  mov    $0x3,%r8d
  mov    $0x3,%ecx
  mov    %r13,%rdi
  mov    $0x3,%esi
  movsd  0x8(%rax),%xmm0
  subsd  0x178(%rsp),%xmm0
  movsd  %xmm0,0x158(%rsp)
  movsd  0x10(%rax),%xmm0
  subsd  0x180(%rsp),%xmm0
  movsd  %xmm0,0x160(%rsp)
  movsd  0x18(%rax),%xmm0
  mov    %rbp,%rax
  subsd  0x188(%rsp),%xmm0
  sub    %rdx,%rax
  mov    %r12,%rdx
  add    $0x1,%rbp
  mov    0x8(%r14,%rax,8),%r9
  movsd  %xmm0,0x168(%rsp)
  call   <multi_vec_Tmatrix@plt>
  mov    (%rbx),%rax
  cmp    %rbp,0x10(%rax)
  jge    L28
L188:
  addq   $0x1,0x10(%rsp)
  mov    0x10(%rsp),%rax
  cmp    0x28(%rsp),%rax
  jne    L245
  mov    %r15,%rbp
  mov    0x18(%rsp),%r15
  jmp    L103
L267:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D12
datatype: byte[8]
name: read_data
arguments: data_tag: D63
datatype: f64
name: read_data
arguments: data_tag: D48
datatype: string
name: read_data
arguments: data_tag: D44
datatype: string
name: read_data
arguments: data_tag: D67
datatype: string
name: read_data
arguments: data_tag: D31
datatype: string
name: read_data
arguments: data_tag: D20
datatype: f32[4]

tool: {"D12": [0x85,0xeb,0x51,0xb8,0xfe,0x87,0xc3,0xc0]}

tool: D63: 1

tool: D48:   +  

tool: 

tool: D67: %c: %d %c%s

tool: D31: %d_

tool: {"D20": [0.0,-0.0,0.0,0.0]}

assistant: ```c
void multiplets(long num_ple, long max_ple, long num_residue, long **pair_info, long *ivec, long *idx1, char **AtomName, char **ResName, char *ChainID, long *ResSeq, char **Miscs, double **xyz, double **orien, double **org, long **seidx, char *bseq, long *num_multi, long *multi_idx, long **multi) {
  char pairstr[512], pairnum[512], tmp[512];
  double z[4] = {-9999.99, 0.0, 0.0, 1.0};
  double hinge[4], zave[4], pave[4], **ztot, **ptot, **rotmat, **xyz_residue;
  long i, inum_base, inum, is_exist, j, jr, k, m, n_unique = 0, **mtxple;
  mtxple = lmatrix(1, num_ple, 0, max_ple);
  ztot = dmatrix(1, max_ple, 1, 3);
  ptot = dmatrix(1, max_ple, 1, 3);
  rotmat = dmatrix(1, 3, 1, 3);
  xyz_residue = dmatrix(1, 100, 1, 3);
  for (i = 1; i <= num_residue; i++) {
    if (pair_info[i][101L] > 1) {
      inum_base = pair_info[i][101L] + 1;
      ivec[1] = i;
      for (j = 1; j <= pair_info[i][101L]; j++)
        ivec[j + 1] = pair_info[i][j];
      lsort(inum_base, ivec, idx1);
      is_exist = 0;
      for (j = 1; j <= n_unique && !is_exist; j++)
        if (inum_base == mtxple[j][0]) {
          for (k = 1; k <= mtxple[j][0]; k++)
            if (ivec[k] != mtxple[j][k])
              break;
          if (k > mtxple[j][0])
            is_exist = 1;
        }
      if (!is_exist) {
        mtxple[++n_unique][0] = inum_base;
        pairstr[0] = '\0';
        pairnum[0] = '\0';
        multi_idx[n_unique] = inum_base;
        for (j = 1; j <= inum_base; j++) {
          jr = ivec[j];
          multi[n_unique][j] = jr;
          mtxple[n_unique][j] = jr;
          k = seidx[jr][1];
          sprintf(tmp, "%c: %d %c%s", ChainID[k], ResSeq[k], bseq[jr], (j == inum_base) ? "" : "  +  ");
          strcat(pairstr, tmp);
          sprintf(tmp, "%d_", jr);
          strcat(pairnum, tmp);
          for (k = 1; k <= 3; k++) {
            if (j > 1 && dot(ztot[1], &orien[jr][6]) < 0.0)
              ztot[j][k] = -orien[jr][6 + k];
            else
              ztot[j][k] = orien[jr][6 + k];
            ptot[j][k] = org[jr][k];
          }
        }
        ave_dmatrix(ptot, inum_base, 3, pave);
        ave_dmatrix(ztot, inum_base, 3, zave);
        cross(zave, z, hinge);
        arb_rotation(hinge, magang(zave, z), rotmat);
        inum = 0;
        for (j = 1; j <= inum_base; j++) {
          jr = ivec[j];
          for (k = seidx[jr][1]; k <= seidx[jr][2]; k++) {
            for (m = 1; m <= 3; m++)
              zave[m] = xyz[k][m] - pave[m];
            multi_vec_Tmatrix(zave, 3, rotmat, 3, 3, xyz_residue[k - seidx[jr][1] + 1]);
          }
        }
      }
    }
  }
  *num_multi = n_unique;
  free_lmatrix(mtxple, 1, num_ple, 0, max_ple);
  free_dmatrix(ztot, 1, max_ple, 1, 3);
  free_dmatrix(ptot, 1, max_ple, 1, 3);
  free_dmatrix(rotmat, 1, 3, 1, 3);
  free_dmatrix(xyz_residue, 1, 100, 1, 3);
}
```