user: Please show me the C implementation that matches the assembly code listed below:

```asm
<kendallSmallN>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  movl   $0x0,-0x40(%rbp)
  movl   $0x0,-0x3c(%rbp)
  movl   $0x0,-0x38(%rbp)
  movq   $0x0,-0x30(%rbp)
  jmp    L71
L108:
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x28(%rbp)
  jmp    L147
L170:
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  jbe    L52
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  jbe    L76
  addl   $0x1,-0x38(%rbp)
  jmp    L42
L76:
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  comisd %xmm1,%xmm0
  jbe    L119
  subl   $0x1,-0x38(%rbp)
  jmp    L42
L119:
  addl   $0x1,-0x40(%rbp)
  jmp    L42
L52:
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  comisd %xmm1,%xmm0
  jbe    L22
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  jbe    L128
  subl   $0x1,-0x38(%rbp)
  jmp    L42
L128:
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  comisd %xmm1,%xmm0
  jbe    L103
  addl   $0x1,-0x38(%rbp)
  jmp    L42
L103:
  addl   $0x1,-0x40(%rbp)
  jmp    L42
L22:
  addl   $0x1,-0x3c(%rbp)
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  ucomisd %xmm1,%xmm0
  jp     L42
  ucomisd %xmm1,%xmm0
  jne    L42
  addl   $0x1,-0x40(%rbp)
L42:
  addq   $0x1,-0x28(%rbp)
L147:
  mov    -0x28(%rbp),%rax
  cmp    -0x58(%rbp),%rax
  jb     L170
  addq   $0x1,-0x30(%rbp)
L71:
  mov    -0x30(%rbp),%rax
  cmp    -0x58(%rbp),%rax
  jb     L108
  mov    -0x58(%rbp),%rax
  sub    $0x1,%rax
  imul   -0x58(%rbp),%rax
  shr    %rax
  mov    %eax,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  sub    -0x40(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x34(%rbp),%eax
  sub    -0x3c(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x20(%rbp),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  mov    %eax,%ecx
  mov    -0x38(%rbp),%eax
  cltd
  idiv   %ecx
  mov    %eax,%ebx
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  mov    %eax,%esi
  mov    %ebx,%eax
  cltd
  idiv   %esi
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
double kendallSmallN(double *arr1, double *arr2, size_t len) {
  int m1 = 0, m2 = 0, s = 0, nPair;
  size_t i, j;
  double denominator1, denominator2;
  for (i = 0; i < len; i++) {
    for (j = i + 1; j < len; j++) {
      if (arr2[i] > arr2[j]) {
        if (arr1[i] > arr1[j]) {
          s++;
        } else if (arr1[i] < arr1[j]) {
          s--;
        } else {
          m1++;
        }
      } else if (arr2[i] < arr2[j]) {
        if (arr1[i] > arr1[j]) {
          s--;
        } else if (arr1[i] < arr1[j]) {
          s++;
        } else {
          m1++;
        }
      } else {
        m2++;
        if (arr1[i] == arr1[j]) {
          m1++;
        }
      }
    }
  }
  nPair = len * (len - 1) / 2;
  denominator1 = nPair - m1;
  denominator2 = nPair - m2;
  return s / sqrt(denominator1) / sqrt(denominator2);
}
```