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

```asm
<inverse_pair>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  sub    %esi,%ebp
  sub    $0x8,%rsp
  cmp    $0x1,%ebp
  jg     L1
L37:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L1:
  sar    %ebp
  mov    %rdi,%r12
  mov    %edx,%ebx
  mov    %rcx,%r15
  add    %esi,%ebp
  mov    %r8,%r14
  mov    %esi,%r13d
  mov    %ebp,%edx
  call   <inverse_pair>
  mov    %r14,%r8
  mov    %r15,%rcx
  mov    %ebx,%edx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <inverse_pair>
  cmp    %ebp,%r13d
  jl     L52
  cmp    %ebp,%ebx
  jle    L28
L52:
  movslq %r13d,%rax
  lea    0x1(%r13),%edi
  mov    %ebp,%edx
  lea    (%r14,%rax,4),%rcx
  mov    %r13d,%eax
  nopl   0x0(%rax)
L169:
  cmp    %edx,%ebx
  jg     L38
  movslq %eax,%rdx
  add    $0x1,%eax
  mov    (%r12,%rdx,4),%edx
  mov    %edx,(%rcx)
  cmp    %eax,%ebp
  jg     L188
L28:
  cmp    %r13d,%ebx
  jle    L37
  movslq %r13d,%rax
  mov    %ebx,%edi
  lea    0x0(,%rax,4),%rdx
  sub    %r13d,%edi
  lea    (%r12,%rdx,1),%rsi
  lea    0x4(%r14,%rdx,1),%r8
  mov    %rsi,%rcx
  sub    %r8,%rcx
  cmp    $0x8,%rcx
  jbe    L99
  lea    -0x1(%rdi),%ecx
  cmp    $0x2,%ecx
  jbe    L99
  mov    %edi,%ecx
  add    %r14,%rdx
  xor    %eax,%eax
  shr    $0x2,%ecx
  shl    $0x4,%rcx
  nopl   0x0(%rax)
L60:
  movdqu (%rdx,%rax,1),%xmm0
  movups %xmm0,(%rsi,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rcx
  jne    L60
  mov    %edi,%eax
  and    $0xfffffffc,%eax
  add    %eax,%r13d
  cmp    %eax,%edi
  je     L37
  movslq %r13d,%rax
  mov    (%r14,%rax,4),%edx
  mov    %edx,(%r12,%rax,4)
  lea    0x1(%r13),%eax
  cmp    %ebx,%eax
  jge    L37
  cltq
  add    $0x2,%r13d
  mov    (%r14,%rax,4),%ecx
  lea    0x0(,%rax,4),%rdx
  mov    %ecx,(%r12,%rax,4)
  cmp    %r13d,%ebx
  jle    L37
  mov    0x4(%r14,%rdx,1),%eax
  mov    %eax,0x4(%r12,%rdx,1)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L99:
  mov    (%r14,%rax,4),%edx
  mov    %edx,(%r12,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jle    L37
  mov    (%r14,%rax,4),%edx
  mov    %edx,(%r12,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L99
  jmp    L37
  nopl   0x0(%rax)
L38:
  movslq %edx,%rsi
  mov    (%r12,%rsi,4),%esi
  cmp    %eax,%ebp
  jle    L178
  movslq %eax,%r8
  mov    (%r12,%r8,4),%r8d
  cmp    %esi,%r8d
  jg     L61
  mov    %r8d,(%rcx)
  add    $0x1,%eax
L77:
  add    $0x1,%edi
  add    $0x4,%rcx
  jmp    L169
  nopl   0x0(%rax)
L178:
  mov    %esi,(%rcx)
  add    $0x1,%edx
  mov    %ebp,%esi
  sub    %eax,%esi
  add    %esi,(%r15)
  cmp    %edx,%ebx
  jg     L77
  jmp    L28
  nopl   (%rax)
L188:
  jmp    1040 <inverse_pair.cold>
  nopl   (%rax)
L61:
  mov    %esi,(%rcx)
  mov    %ebp,%esi
  add    $0x1,%edx
  sub    %eax,%esi
  add    %esi,(%r15)
  jmp    L77
```

assistant: ```c
void inverse_pair(int *A, int x, int y, int *cnt, int *T) {
  if (y - x > 1) {
    int m = x + (y - x) / 2;
    int p = x, q = m, i = x;
    inverse_pair(A, x, m, cnt, T);
    inverse_pair(A, m, y, cnt, T);
    while (p < m || q < y) {
      if (q >= y || (p < m && A[p] <= A[q]))
        T[i++] = A[p++];
      else {
        T[i++] = A[q++];
        *cnt += m - p;
      }
    }
    for (i = x; i < y; i++)
      A[i] = T[i];
  }
}
```