user: 请将以下的汇编代码转换成C语言代码：

```asm
<related>:
  endbr64
  push   %r15
  push   %r14
  mov    %r9,%r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x28,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %r9,%rsi
  call   <aaf@plt>
  pxor   %xmm9,%xmm9
  pxor   %xmm7,%xmm7
  movsd  D0(%rip),%xmm8
  cvtss2sd %xmm0,%xmm9
  movapd %xmm9,%xmm4
  movapd %xmm8,%xmm6
  addsd  %xmm9,%xmm4
  subsd  %xmm9,%xmm6
  mulsd  %xmm4,%xmm6
  cvtsd2ss %xmm6,%xmm6
  ucomiss %xmm7,%xmm6
  jp     L65
  movl   $0x0,0x1c(%rsp)
  je     L44
L65:
  test   %r14,%r14
  je     L86
  lea    0x1(%r14),%eax
  mov    %r14d,%r9d
  xor    %r8d,%r8d
  xor    %r11d,%r11d
  mov    %eax,0x18(%rsp)
  movss  D22(%rip),%xmm5
  mov    $0x1,%esi
  movl   $0x0,0x14(%rsp)
  movl   $0x0,0x1c(%rsp)
  nopl   0x0(%rax,%rax,1)
L27:
  mov    0x0(%rbp,%r11,4),%eax
  cmp    $0x3,%eax
  je     L142
  pxor   %xmm2,%xmm2
  addl   $0x1,0x1c(%rsp)
  mov    0x14(%rsp),%r10d
  mov    %r11,%rcx
  cvtsi2ss %eax,%xmm2
  jmp    L134
  nopl   (%rax)
L32:
  comiss D18(%rip),%xmm0
  jbe    L148
  movslq %r10d,%rdx
  addq   $0x1,0x0(%r13,%rdx,8)
L156:
  cvtss2sd %xmm0,%xmm0
  addsd  %xmm10,%xmm0
  movsd  %xmm0,(%r15)
  addq   $0x1,(%rbx,%rax,1)
L58:
  add    $0x1,%rcx
  add    %r9d,%r10d
  cmp    %rcx,%r14
  jbe    L142
  mov    0x0(%rbp,%rcx,4),%eax
L134:
  cmp    $0x3,%eax
  je     L58
  pxor   %xmm3,%xmm3
  mov    0x8(%rsp),%rdi
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm3
  lea    (%r8,%rcx,1),%eax
  cvtss2sd %xmm2,%xmm1
  cltq
  shl    $0x3,%rax
  lea    (%rdi,%rax,1),%r15
  movsd  (%r15),%xmm10
  cmp    %rcx,%r11
  je     L125
  ucomiss %xmm5,%xmm3
  pxor   %xmm0,%xmm0
  subsd  %xmm4,%xmm1
  cvtss2sd %xmm3,%xmm0
  subsd  %xmm4,%xmm0
  setp   %dil
  mulsd  %xmm1,%xmm0
  cmovne %esi,%edi
  ucomiss %xmm3,%xmm2
  setp   %dl
  cmovne %esi,%edx
  cvtsd2ss %xmm0,%xmm0
  and    %edx,%edi
  ucomiss %xmm5,%xmm2
  setp   %dl
  cmovne %esi,%edx
  and    %edi,%edx
  movzbl %dl,%edx
  add    %rdx,(%r12,%rax,1)
L24:
  divss  %xmm6,%xmm0
  ucomiss %xmm3,%xmm2
  mov    $0x0,%edi
  setnp  %dl
  cmovne %edi,%edx
  ucomiss %xmm7,%xmm2
  setp   %dil
  cmovne %esi,%edi
  test   %dil,%dil
  je     L148
  test   %dl,%dl
  jne    L32
L148:
  comiss D18(%rip),%xmm0
  jbe    L156
  ucomiss %xmm5,%xmm3
  setp   %dil
  cmovne %esi,%edi
  and    %edx,%edi
  movzbl %dil,%edi
  add    %rdi,0x0(%r13,%rax,1)
  jmp    L156
  nopw   0x0(%rax,%rax,1)
L142:
  add    $0x1,%r11
  mov    0x18(%rsp),%ecx
  add    %r9d,%r8d
  add    %ecx,0x14(%rsp)
  cmp    %r11,%r14
  jne    L27
L44:
  mov    0x1c(%rsp),%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L125:
  movapd %xmm4,%xmm11
  movaps %xmm2,%xmm0
  addsd  %xmm8,%xmm10
  addsd  %xmm8,%xmm11
  mulss  %xmm2,%xmm0
  mulsd  %xmm11,%xmm1
  cvtss2sd %xmm0,%xmm0
  subsd  %xmm1,%xmm0
  movapd %xmm9,%xmm1
  mulsd  %xmm4,%xmm1
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  jmp    L24
L86:
  movl   $0x0,0x1c(%rsp)
  jmp    L44
```

tool_calls: name: parse_data
arguments: data_label: D0
type_infered: f64
name: parse_data
arguments: data_label: D22
type_infered: byte[4]
name: parse_data
arguments: data_label: D18
type_infered: f32

tool: D0: 1

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

tool: D18: 2.5

assistant: ```c
int related(int *gt_types, double *asum, int32_t *N, int32_t *ibs0, int32_t *ibs2, int32_t n_samples) {
  int idx, uidx, n_used = 0;
  int32_t j, k;
  float pi = aaf(gt_types, n_samples);
  float numer, val;
  float gtj, gtk;
  float denom = 2.0 * pi * (1.0 - pi);
  if (denom == 0) {
    return 0;
  }
  for (j = 0; j < n_samples; j++) {
    if (gt_types[j] == 3) {
      continue;
    }
    gtj = gt_types[j];
    n_used++;
    for (k = j; k < n_samples; k++) {
      if (gt_types[k] == 3) {
        continue;
      }
      uidx = j + k * n_samples;
      idx = j * n_samples + k;
      gtk = gt_types[k];
      if (j != k) {
        numer = (gtj - 2.0 * pi) * (gtk - 2.0 * pi);
        ibs0[idx] += (gtj != 1 && gtk != 1 && gtj != gtk);
      } else {
        numer = (gtj * gtj) - (1.0 + 2.0 * pi) * gtj + 2.0 * pi * pi;
        asum[idx] += 1;
      }
      val = numer / denom;
      if (gtj == gtk && gtj != 0 && val > 2.5) {
        ibs2[uidx] += 1;
      } else if (val > 2.5) {
        ibs2[idx] += (gtj == gtk && gtk != 1);
      }
      asum[idx] += val;
      N[idx] += 1;
    }
  }
  return n_used;
}
```