user: Converte this assembly snippet into its equivalent C code:

```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    L97
  mov    -0x98(%rbp),%rax
  movq   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L75
L97:
  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    L54
  addl   $0x1,-0x78(%rbp)
L54:
  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
L13:
  cmp    %rdx,%rsp
  je     L49
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L13
L49:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L72
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L72:
  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
L36:
  cmp    %rdx,%rsp
  je     L126
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L36
L126:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L95
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L95:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x40(%rbp)
  movl   $0x0,-0x7c(%rbp)
  jmp    L105
L129:
  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)
L105:
  mov    -0x7c(%rbp),%eax
  cmp    -0x78(%rbp),%eax
  jl     L129
  mov    -0x8c(%rbp),%eax
  cltd
  shr    $0x1f,%edx
  add    %edx,%eax
  and    $0x1,%eax
  sub    %edx,%eax
  cmp    $0x1,%eax
  jne    L125
  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)
L125:
  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
L75:
  mov    %rbx,%rsp
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L39
  call   <__stack_chk_fail@plt>
L39:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

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