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

```asm
<read_slap>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rdx
  lea    0x8(%rsp),%rsi
  movq   $0x0,0x8(%rsp)
  movq   $0x0,0x10(%rsp)
  call   <read_ij@plt>
  mov    0x8(%rsp),%rdi
  lea    (%rax,%rax,1),%r12d
  mov    %eax,%ebp
  mov    %r12d,(%r15)
  lea    0x0(,%rax,8),%r15d
  mov    %r15d,%esi
  call   <realloc@plt>
  mov    0x10(%rsp),%rdi
  mov    %r15d,%esi
  mov    %rax,0x8(%rsp)
  call   <realloc@plt>
  mov    0x8(%rsp),%rdi
  mov    %rax,0x10(%rsp)
  mov    %rax,%rsi
  cmp    %ebp,%r12d
  jbe    L73
  mov    %ebp,%r9d
  lea    0x4(%rdi),%r11
  lea    0x4(%rsi),%r15
  mov    %r12d,%edx
  lea    0x0(,%r9,4),%r10
  sub    %ebp,%edx
  lea    (%rax,%r10,1),%r8
  lea    (%rdi,%r10,1),%rcx
  mov    %r8,%rax
  sub    %r11,%rax
  lea    -0x4(%r10),%r11
  cmp    $0x8,%rax
  seta   %al
  cmp    $0x8,%r11
  seta   %r11b
  and    %r11d,%eax
  cmp    $0x1,%edx
  setne  %r11b
  and    %r11d,%eax
  mov    %rcx,%r11
  sub    %r15,%r11
  cmp    $0x8,%r11
  seta   %r11b
  and    %r11d,%eax
  lea    0x10(%rdi),%r11
  cmp    %r11,%rcx
  setae  %r11b
  test   %r11b,%al
  je     L57
  lea    0x4(%rdi,%r10,1),%r10
  mov    %r8,%rax
  sub    %r10,%rax
  cmp    $0x8,%rax
  jbe    L57
  lea    -0x1(%rdx),%eax
  cmp    $0x2,%eax
  jbe    L68
  mov    %edx,%r10d
  xor    %eax,%eax
  shr    $0x2,%r10d
  shl    $0x4,%r10
  xchg   %ax,%ax
L66:
  movdqu (%rsi,%rax,1),%xmm0
  movups %xmm0,(%rcx,%rax,1)
  movdqu (%rdi,%rax,1),%xmm1
  movups %xmm1,(%r8,%rax,1)
  add    $0x10,%rax
  cmp    %r10,%rax
  jne    L66
  mov    %edx,%ecx
  and    $0xfffffffc,%ecx
  lea    0x0(%rbp,%rcx,1),%eax
  cmp    %ecx,%edx
  je     L73
  sub    %ecx,%edx
  cmp    $0x1,%edx
  je     L26
L70:
  mov    (%rsi,%rcx,4),%r8
  add    %rcx,%r9
  mov    %r8,(%rdi,%r9,4)
  mov    (%rdi,%rcx,4),%rcx
  mov    %rcx,(%rsi,%r9,4)
  mov    %edx,%ecx
  and    $0xfffffffe,%ecx
  add    %ecx,%eax
  cmp    %ecx,%edx
  je     L73
L26:
  mov    %eax,%edx
  sub    %ebp,%edx
  mov    (%rsi,%rdx,4),%ecx
  mov    %ecx,(%rdi,%rax,4)
  mov    (%rdi,%rdx,4),%edx
  mov    %edx,(%rsi,%rax,4)
L73:
  mov    %r14,%r8
  mov    %r13,%rcx
  mov    %r12d,%edx
  call   <convert_ij2slap@plt>
  mov    0x8(%rsp),%rdi
  mov    %eax,(%rbx)
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L82
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L57:
  shl    $0x2,%rdx
  xor    %eax,%eax
  xchg   %ax,%ax
L78:
  mov    (%rsi,%rax,1),%r9d
  mov    %r9d,(%rcx,%rax,1)
  mov    (%rdi,%rax,1),%r9d
  mov    %r9d,(%r8,%rax,1)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L78
  jmp    L73
L68:
  mov    %ebp,%eax
  xor    %ecx,%ecx
  jmp    L70
L82:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void read_slap(FILE *filein, unsigned int *K, unsigned int *N, unsigned int **J_slap, unsigned int **r_slap) {
  unsigned int *I = NULL, *J = NULL;
  unsigned int i, k;
  k = read_ij(filein, &I, &J);
  *K = 2 * k;
  I = realloc(I, 2 * k * sizeof(unsigned int));
  J = realloc(J, 2 * k * sizeof(unsigned int));
  for (i = k; i < 2 * k; i++) {
    I[i] = J[i - k];
    J[i] = I[i - k];
  }
  *N = convert_ij2slap(I, J, 2 * k, r_slap, J_slap);
  free(I);
  free(J);
  return;
}
```