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

```asm
<split_and_count>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x98,%rsp
  mov    %rdi,-0x88(%rbp)
  mov    %esi,-0x8c(%rbp)
  mov    %rdx,-0x98(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  cmpl   $0x1,-0x8c(%rbp)
  jne    L12
  mov    -0x98(%rbp),%rax
  movq   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L38
L12:
  mov    -0x8c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edi
  call   <floor@plt>
  mov    %eax,-0x74(%rbp)
  mov    -0x74(%rbp),%eax
  mov    %eax,-0x78(%rbp)
  mov    -0x8c(%rbp),%eax
  cltd
  shr    $0x1f,%edx
  add    %edx,%eax
  and    $0x1,%eax
  sub    %edx,%eax
  cmp    $0x1,%eax
  jne    L17
  addl   $0x1,-0x78(%rbp)
L17:
  mov    -0x78(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x58(%rbp)
  movslq %eax,%rdx
  mov    %rdx,-0xb0(%rbp)
  movq   $0x0,-0xa8(%rbp)
  movslq %eax,%rdx
  mov    %rdx,-0xc0(%rbp)
  movq   $0x0,-0xb8(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L67:
  cmp    %rdx,%rsp
  je     L118
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L67
L118:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L114
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L114:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x50(%rbp)
  mov    -0x74(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x48(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L37:
  cmp    %rdx,%rsp
  je     L1
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L37
L1:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L44
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L44:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x40(%rbp)
  movl   $0x0,-0x7c(%rbp)
  jmp    L33
L91:
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x50(%rbp),%rax
  mov    -0x7c(%rbp),%edx
  movslq %edx,%rdx
  mov    %ecx,(%rax,%rdx,4)
  mov    -0x78(%rbp),%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x40(%rbp),%rax
  mov    -0x7c(%rbp),%edx
  movslq %edx,%rdx
  mov    %ecx,(%rax,%rdx,4)
  addl   $0x1,-0x7c(%rbp)
L33:
  mov    -0x7c(%rbp),%eax
  cmp    -0x78(%rbp),%eax
  jl     L91
  mov    -0x8c(%rbp),%eax
  cltd
  shr    $0x1f,%edx
  add    %edx,%eax
  and    $0x1,%eax
  sub    %edx,%eax
  cmp    $0x1,%eax
  jne    L116
  mov    -0x78(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x50(%rbp),%rax
  mov    -0x78(%rbp),%edx
  movslq %edx,%rdx
  mov    %ecx,(%rax,%rdx,4)
L116:
  movq   $0x0,-0x60(%rbp)
  lea    -0x70(%rbp),%rdx
  mov    -0x78(%rbp),%ecx
  mov    -0x50(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <split_and_count>
  lea    -0x68(%rbp),%rdx
  mov    -0x74(%rbp),%ecx
  mov    -0x40(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <split_and_count>
  lea    -0x60(%rbp),%r8
  mov    -0x8c(%rbp),%edi
  mov    -0x74(%rbp),%ecx
  mov    -0x40(%rbp),%rdx
  mov    -0x78(%rbp),%esi
  mov    -0x50(%rbp),%rax
  sub    $0x8,%rsp
  push   -0x88(%rbp)
  mov    %r8,%r9
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <merge@plt>
  add    $0x10,%rsp
  mov    -0x70(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  add    %rax,%rdx
  mov    -0x60(%rbp),%rax
  add    %rax,%rdx
  mov    -0x98(%rbp),%rax
  mov    %rdx,(%rax)
  mov    $0x0,%eax
L38:
  mov    %rbx,%rsp
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L93
  call   <__stack_chk_fail@plt>
L93:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
int split_and_count(int *items, int n, long *inv) {
  if (n == 1) {
    *inv = 0;
    return 0;
  }
  int i, g, h;
  g = (int)floor(n / 2);
  h = g;
  if (n % 2 == 1) {
    h = h + 1;
  }
  int left_hand[h];
  int right_hand[g];
  for (i = 0; i < h; i++) {
    left_hand[i] = items[i];
    right_hand[i] = items[h + i];
  }
  if (n % 2 == 1) {
    left_hand[h] = items[h];
  }
  long x, y, z;
  z = 0;
  split_and_count(left_hand, h, &x);
  split_and_count(right_hand, g, &y);
  merge(left_hand, h, right_hand, g, n, &z, items);
  *inv = x + y + z;
  return 0;
}
```