user: 下面的汇编指令对应的C源代码是什么：

```asm
<ktau>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    %r8,-0x78(%rbp)
  mov    %r9,-0x80(%rbp)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    $0x8,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    $0x8,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x78(%rbp),%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x80(%rbp),%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    0x10(%rbp),%rax
  movl   $0x0,(%rax)
  mov    0x18(%rbp),%rax
  movl   $0x0,(%rax)
  mov    0x20(%rbp),%rax
  movl   $0x0,(%rax)
  movl   $0x1,-0x50(%rbp)
L159:
  movl   $0x0,-0x4c(%rbp)
L329:
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x48(%rbp),%ecx
  mov    -0x50(%rbp),%edx
  add    %ecx,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x44(%rbp),%ecx
  mov    -0x50(%rbp),%edx
  add    %ecx,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %eax,-0x2c(%rbp)
L69:
  mov    -0x48(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  setl   %al
  movzbl %al,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x44(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  setl   %al
  movzbl %al,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x28(%rbp),%eax
  and    -0x24(%rbp),%eax
  test   %eax,%eax
  je     L149
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  seta   %al
  movzbl %al,%edx
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x58(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rax),%xmm0
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x58(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rax),%xmm1
  ucomisd %xmm1,%xmm0
  setnp  %al
  mov    $0x0,%ecx
  ucomisd %xmm1,%xmm0
  cmove  %eax,%ecx
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rsi
  mov    -0x60(%rbp),%rax
  add    %rsi,%rax
  movsd  (%rax),%xmm0
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rsi
  mov    -0x60(%rbp),%rax
  add    %rsi,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  seta   %al
  and    %ecx,%eax
  movzbl %al,%eax
  or     %edx,%eax
  mov    %eax,-0x34(%rbp)
  jmp    L349
L149:
  movl   $0x0,-0x34(%rbp)
L349:
  cmpl   $0x0,-0x24(%rbp)
  sete   %al
  movzbl %al,%eax
  and    -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  and    -0x24(%rbp),%eax
  mov    %eax,%ecx
  cmpl   $0x0,-0x34(%rbp)
  sete   %al
  movzbl %al,%eax
  and    %ecx,%eax
  or     %edx,%eax
  test   %eax,%eax
  je     L124
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x48(%rbp)
  addl   $0x1,-0x4c(%rbp)
L124:
  cmpl   $0x0,-0x28(%rbp)
  jne    L377
  cmpl   $0x0,-0x24(%rbp)
  je     L377
  mov    $0x1,%eax
  jmp    L315
L377:
  mov    $0x0,%eax
L315:
  mov    %eax,%edx
  and    $0x1,%edx
  cmpl   $0x0,-0x28(%rbp)
  je     L311
  cmpl   $0x0,-0x24(%rbp)
  je     L311
  cmpl   $0x0,-0x34(%rbp)
  je     L311
  mov    $0x1,%eax
  jmp    L95
L311:
  mov    $0x0,%eax
L95:
  and    $0x1,%eax
  or     %edx,%eax
  test   %al,%al
  je     L376
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x44(%rbp)
  addl   $0x1,-0x4c(%rbp)
L376:
  mov    -0x28(%rbp),%eax
  or     -0x24(%rbp),%eax
  test   %eax,%eax
  jne    L69
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L329
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x60(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  shll   -0x50(%rbp)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x50(%rbp)
  jl     L159
  movl   $0x1,-0x3c(%rbp)
  movl   $0x1,-0x38(%rbp)
  movl   $0x1,-0x40(%rbp)
  jmp    L99
L342:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x40(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  ucomisd %xmm1,%xmm0
  jp     L129
  ucomisd %xmm1,%xmm0
  jne    L129
  addl   $0x1,-0x3c(%rbp)
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x40(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  ucomisd %xmm1,%xmm0
  jp     L43
  ucomisd %xmm1,%xmm0
  jne    L43
  addl   $0x1,-0x38(%rbp)
  jmp    L43
L129:
  cmpl   $0x1,-0x3c(%rbp)
  jle    L43
  mov    0x10(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  add    %eax,%edx
  mov    0x10(%rbp),%rax
  mov    %edx,(%rax)
  cmpl   $0x1,-0x38(%rbp)
  jle    L365
  mov    0x20(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x38(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  add    %eax,%edx
  mov    0x20(%rbp),%rax
  mov    %edx,(%rax)
L365:
  movl   $0x1,-0x3c(%rbp)
  movl   $0x1,-0x38(%rbp)
L43:
  addl   $0x1,-0x40(%rbp)
L99:
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x40(%rbp)
  jl     L342
  mov    0x10(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  add    %eax,%edx
  mov    0x10(%rbp),%rax
  mov    %edx,(%rax)
  mov    0x20(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x38(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  add    %eax,%edx
  mov    0x20(%rbp),%rax
  mov    %edx,(%rax)
  movl   $0x1,-0x50(%rbp)
L36:
  movl   $0x0,-0x4c(%rbp)
L117:
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x48(%rbp),%ecx
  mov    -0x50(%rbp),%edx
  add    %ecx,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x44(%rbp),%ecx
  mov    -0x50(%rbp),%edx
  add    %ecx,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %eax,-0x2c(%rbp)
L150:
  mov    -0x48(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  setl   %al
  movzbl %al,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x44(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  setl   %al
  movzbl %al,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x28(%rbp),%eax
  and    -0x24(%rbp),%eax
  test   %eax,%eax
  je     L68
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  seta   %al
  movzbl %al,%eax
  mov    %eax,-0x34(%rbp)
  jmp    L101
L68:
  movl   $0x0,-0x34(%rbp)
L101:
  cmpl   $0x0,-0x24(%rbp)
  sete   %al
  movzbl %al,%eax
  and    -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  and    -0x24(%rbp),%eax
  mov    %eax,%ecx
  cmpl   $0x0,-0x34(%rbp)
  sete   %al
  movzbl %al,%eax
  and    %ecx,%eax
  or     %edx,%eax
  test   %eax,%eax
  je     L154
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x48(%rbp)
  addl   $0x1,-0x4c(%rbp)
L154:
  cmpl   $0x0,-0x28(%rbp)
  jne    L383
  cmpl   $0x0,-0x24(%rbp)
  je     L383
  mov    $0x1,%eax
  jmp    L405
L383:
  mov    $0x0,%eax
L405:
  mov    %eax,%edx
  and    $0x1,%edx
  cmpl   $0x0,-0x28(%rbp)
  je     L119
  cmpl   $0x0,-0x24(%rbp)
  je     L119
  cmpl   $0x0,-0x34(%rbp)
  je     L119
  mov    $0x1,%eax
  jmp    L160
L119:
  mov    $0x0,%eax
L160:
  and    $0x1,%eax
  or     %edx,%eax
  test   %al,%al
  je     L200
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x78(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x30(%rbp),%eax
  sub    -0x48(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x78(%rbp),%rax
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x44(%rbp)
  addl   $0x1,-0x4c(%rbp)
L200:
  mov    -0x28(%rbp),%eax
  or     -0x24(%rbp),%eax
  test   %eax,%eax
  jne    L150
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L117
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x60(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  shll   -0x50(%rbp)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x50(%rbp)
  jl     L36
  movl   $0x1,-0x3c(%rbp)
  movl   $0x1,-0x40(%rbp)
  jmp    L398
L35:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x40(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  ucomisd %xmm1,%xmm0
  jp     L102
  ucomisd %xmm1,%xmm0
  jne    L102
  addl   $0x1,-0x3c(%rbp)
  jmp    L185
L102:
  cmpl   $0x1,-0x3c(%rbp)
  jle    L185
  mov    0x18(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  add    %eax,%edx
  mov    0x18(%rbp),%rax
  mov    %edx,(%rax)
  movl   $0x1,-0x3c(%rbp)
L185:
  addl   $0x1,-0x40(%rbp)
L398:
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x40(%rbp)
  jl     L35
  mov    0x18(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  add    %eax,%edx
  mov    0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D4(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x80(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x80(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x78(%rbp),%rax
  movsd  (%rax),%xmm0
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm2
  mov    0x10(%rbp),%rax
  mov    (%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm0,%xmm2
  mov    0x18(%rbp),%rax
  mov    (%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm2,%xmm0
  mov    0x20(%rbp),%rax
  mov    (%rax),%eax
  pxor   %xmm3,%xmm3
  cvtsi2sd %eax,%xmm3
  movapd %xmm0,%xmm2
  subsd  %xmm3,%xmm2
  subsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  mov    -0x78(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x80(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    0x10(%rbp),%rax
  mov    (%rax),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  mov    -0x80(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    0x18(%rbp),%rax
  mov    (%rax),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  subsd  %xmm2,%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    -0x80(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x78(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x80(%rbp),%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  mov    -0x70(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D4
data_type: f64

tool: D4: 0.5

assistant: ```c
void ktau(double *X, double *Y, int *N, double *tau, double *S, double *D, int *T, int *U, int *V) {
  int K, L, I, J, Iend, Jend;
  int i, j, m;
  double *Y2 = calloc(*N, sizeof(double));
  double *X2 = calloc(*N, sizeof(double));
  double *xptr, *yptr;
  bool Iflag, Jflag, Xflag;
  *S = 0.;
  *D = 0.;
  *T = 0;
  *U = 0;
  *V = 0;
  K = 1;
  do {
    L = 0;
    do {
      I = L;
      J = (I + K) < (*N) ? (I + K) : (*N);
      Iend = J;
      Jend = (J + K) < (*N) ? (J + K) : (*N);
      do {
        Iflag = (I < Iend);
        Jflag = (J < Jend);
        if (Iflag & Jflag) {
          Xflag = ((X[I] > X[J]) | ((X[I] == X[J]) & (Y[I] > Y[J])));
        } else {
          Xflag = false;
        }
        if ((Iflag & !Jflag) | (Iflag & Jflag & !Xflag)) {
          X2[L] = X[I];
          Y2[L] = Y[I];
          I++;
          L++;
        };
        if ((!Iflag && Jflag) | (Iflag && Jflag && Xflag)) {
          X2[L] = X[J];
          Y2[L] = Y[J];
          J++;
          L++;
        };
      } while (Iflag | Jflag);
    } while (L < *N);
    xptr = X;
    X = X2;
    X2 = xptr;
    yptr = Y;
    Y = Y2;
    Y2 = yptr;
    K *= 2;
  } while (K < *N);
  j = 1;
  m = 1;
  for (i = 1; i < *N; i++)
    if (X[i] == X[i - 1]) {
      j++;
      if (Y[i] == Y[i - 1])
        m++;
    } else if (j > 1) {
      *T += j * (j - 1) / 2;
      if (m > 1)
        *V += m * (m - 1) / 2;
      j = 1;
      m = 1;
    };
  *T += j * (j - 1) / 2;
  *V += m * (m - 1) / 2;
  K = 1;
  do {
    L = 0;
    do {
      I = L;
      J = (I + K) < (*N) ? (I + K) : (*N);
      Iend = J;
      Jend = (J + K) < (*N) ? (J + K) : (*N);
      do {
        Iflag = (I < Iend);
        Jflag = (J < Jend);
        if (Iflag & Jflag) {
          Xflag = (Y[I] > Y[J]);
        } else {
          Xflag = false;
        }
        if ((Iflag & !Jflag) | (Iflag & Jflag & !Xflag)) {
          X2[L] = X[I];
          Y2[L] = Y[I];
          I++;
          L++;
        };
        if ((!Iflag && Jflag) | (Iflag && Jflag && Xflag)) {
          X2[L] = X[J];
          Y2[L] = Y[J];
          *S += Iend - I;
          J++;
          L++;
        };
      } while ((Iflag | Jflag));
    } while (L < *N);
    xptr = X;
    X = X2;
    X2 = xptr;
    yptr = Y;
    Y = Y2;
    Y2 = yptr;
    K *= 2;
  } while (K < *N);
  j = 1;
  for (i = 1; i < *N; i++)
    if (Y[i] == Y[i - 1])
      j++;
    else if (j > 1) {
      *U += j * (j - 1) / 2;
      j = 1;
    };
  *U += j * (j - 1) / 2;
  *D = 0.5 * (*N) * (*N - 1);
  *S = *D - (2. * (*S) + *T + *U - *V);
  *D = sqrt((*D - *T) * (*D - *U));
  *tau = (*S) / (*D);
  free(Y2);
  free(X2);
}
```