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     L52
  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     L37
  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
L125:
  cmp    %rcx,%rsp
  je     L131
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L125
L37:
  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
L181:
  cmp    %rcx,%rsp
  je     L127
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L181
L127:
  mov    %rsi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L152
  orq    $0x0,-0x8(%rsp,%rdx,1)
L152:
  mov    %rsp,%r13
  cltq
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L140:
  cmp    %rdx,%rsp
  je     L116
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L140
L116:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L55
  orq    $0x0,-0x8(%rsp,%rax,1)
L55:
  mov    %rsp,%r14
  test   %r15d,%r15d
  jg     L47
L10:
  movslq %r15d,%rax
  mov    (%rbx,%r8,1),%edx
  mov    %edx,0x0(%r13,%rax,4)
  jmp    L123
L131:
  mov    %rsi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L188
  orq    $0x0,-0x8(%rsp,%rdx,1)
L188:
  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
L145:
  cmp    %rcx,%rsp
  je     L77
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L145
L77:
  mov    %rsi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L184
  orq    $0x0,-0x8(%rsp,%rdx,1)
L184:
  mov    %rsp,%r14
  mov    %eax,%r15d
  test   %eax,%eax
  jle    L123
L47:
  mov    %r15d,%esi
  lea    (%rbx,%r8,1),%rcx
  mov    $0x0,%eax
L18:
  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    L18
  cmp    $0x1,%edi
  je     L10
L123:
  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
L52:
  mov    -0x58(%rbp),%rbx
  mov    %rax,(%rbx)
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L43
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L43:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int split_and_count(int *students, int n, long *inv) {
  int i;
  if (n == 1) {
    *inv = 0;
    return 0;
  }
  int 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] = students[i];
    right_hand[i] = students[h + i];
  }
  if (n % 2 == 1) {
    left_hand[h] = students[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, students);
  *inv = x + y + z;
  return 0;
}
```