user: Translate the below assembly code into C programming language:

```asm
<split_and_count>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  cmp    $0x1,%esi
  je     L135
  mov    %rdi,%rbx
  mov    %esi,%r12d
  mov    %esi,%edi
  shr    $0x1f,%edi
  add    %esi,%edi
  sar    %edi
  call   <floor@plt>
  mov    %eax,-0x5c(%rbp)
  mov    %r12d,%edx
  shr    $0x1f,%edx
  lea    (%r12,%rdx,1),%edi
  and    $0x1,%edi
  sub    %edx,%edi
  cmp    $0x1,%edi
  je     L21
  movslq %eax,%r8
  shl    $0x2,%r8
  lea    0xf(%r8),%rdx
  mov    %rdx,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rcx
  sub    %rdx,%rcx
L136:
  cmp    %rcx,%rsp
  je     L150
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L136
L21:
  lea    0x1(%rax),%r15d
  movslq %r15d,%r8
  shl    $0x2,%r8
  lea    0xf(%r8),%rdx
  mov    %rdx,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rcx
  sub    %rdx,%rcx
L60:
  cmp    %rcx,%rsp
  je     L111
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L60
L111:
  mov    %rsi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L31
  orq    $0x0,-0x8(%rsp,%rdx,1)
L31:
  mov    %rsp,%r13
  cltq
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L129:
  cmp    %rdx,%rsp
  je     L5
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L129
L5:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L58
  orq    $0x0,-0x8(%rsp,%rax,1)
L58:
  mov    %rsp,%r14
  test   %r15d,%r15d
  jg     L187
L34:
  movslq %r15d,%rax
  mov    (%rbx,%r8,1),%edx
  mov    %edx,0x0(%r13,%rax,4)
  jmp    L93
L150:
  mov    %rsi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L81
  orq    $0x0,-0x8(%rsp,%rdx,1)
L81:
  mov    %rsp,%r13
  movslq %eax,%rdx
  lea    0xf(,%rdx,4),%rdx
  mov    %rdx,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rcx
  sub    %rdx,%rcx
L154:
  cmp    %rcx,%rsp
  je     L131
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L154
L131:
  mov    %rsi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L13
  orq    $0x0,-0x8(%rsp,%rdx,1)
L13:
  mov    %rsp,%r14
  mov    %eax,%r15d
  test   %eax,%eax
  jle    L93
L187:
  mov    %r15d,%esi
  lea    (%rbx,%r8,1),%rcx
  mov    $0x0,%eax
L92:
  mov    (%rbx,%rax,4),%edx
  mov    %edx,0x0(%r13,%rax,4)
  mov    (%rcx,%rax,4),%edx
  mov    %edx,(%r14,%rax,4)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L92
  cmp    $0x1,%edi
  je     L34
L93:
  movq   $0x0,-0x40(%rbp)
  lea    -0x50(%rbp),%rdx
  mov    %r15d,%esi
  mov    %r13,%rdi
  call   <split_and_count>
  lea    -0x48(%rbp),%rdx
  mov    -0x5c(%rbp),%esi
  mov    %r14,%rdi
  call   <split_and_count>
  sub    $0x8,%rsp
  push   %rbx
  lea    -0x40(%rbp),%r9
  mov    %r12d,%r8d
  mov    -0x5c(%rbp),%ecx
  mov    %r14,%rdx
  mov    %r15d,%esi
  mov    %r13,%rdi
  call   <merge@plt>
  mov    -0x48(%rbp),%rax
  add    -0x50(%rbp),%rax
  add    -0x40(%rbp),%rax
  add    $0x10,%rsp
L135:
  mov    -0x58(%rbp),%rbx
  mov    %rax,(%rbx)
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L114
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L114:
  call   <__stack_chk_fail@plt>
```

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;
}
```