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

```asm
<main>:
  endbr64
  push   %rbp
  lea    D46(%rip),%rdi
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    -0x3c(%rbp),%rcx
  lea    -0x40(%rbp),%rdx
  xor    %eax,%eax
  lea    -0x44(%rbp),%rsi
  lea    D50(%rip),%rdi
  call   <scanf@plt>
  movslq -0x44(%rbp),%rax
  mov    %rsp,%rcx
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L83
L127:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L127
L83:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L117
L11:
  movslq -0x40(%rbp),%rax
  mov    %rsp,%rcx
  mov    %rsp,%r13
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  and    $0xfffffffffffffff0,%rdx
  sub    %rax,%rcx
L36:
  cmp    %rcx,%rsp
  je     L155
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L36
L117:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L11
L155:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L88
L106:
  movslq -0x3c(%rbp),%rax
  mov    %rsp,%rcx
  mov    %rsp,%r14
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  and    $0xfffffffffffffff0,%rdx
  sub    %rax,%rcx
L177:
  cmp    %rcx,%rsp
  je     L114
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L177
L88:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L106
L114:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L100
  orq    $0x0,-0x8(%rsp,%rdx,1)
L100:
  lea    D56(%rip),%rdi
  mov    %rsp,-0x58(%rbp)
  call   <puts@plt>
  cmpl   $0x0,-0x44(%rbp)
  jle    L164
  mov    %r13,%r15
  xor    %r12d,%r12d
  lea    D69(%rip),%rbx
  nopl   0x0(%rax,%rax,1)
L131:
  mov    %r15,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  add    $0x1,%r12d
  call   <scanf@plt>
  add    $0x4,%r15
  cmp    %r12d,-0x44(%rbp)
  jg     L131
L164:
  lea    D1(%rip),%rdi
  call   <puts@plt>
  mov    -0x40(%rbp),%edx
  test   %edx,%edx
  jle    L48
  mov    %r14,%r15
  xor    %r12d,%r12d
  lea    D69(%rip),%rbx
  nopl   0x0(%rax,%rax,1)
L21:
  mov    %r15,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  add    $0x1,%r12d
  call   <scanf@plt>
  add    $0x4,%r15
  cmp    %r12d,-0x40(%rbp)
  jg     L21
L48:
  lea    D21(%rip),%rdi
  call   <puts@plt>
  mov    -0x3c(%rbp),%eax
  test   %eax,%eax
  jle    L10
  mov    -0x58(%rbp),%r15
  xor    %r12d,%r12d
  lea    D69(%rip),%rbx
  nopl   0x0(%rax)
L152:
  mov    %r15,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  add    $0x1,%r12d
  call   <scanf@plt>
  add    $0x4,%r15
  cmp    %r12d,-0x3c(%rbp)
  jg     L152
L10:
  xor    %r12d,%r12d
  mov    -0x40(%rbp),%ecx
  mov    -0x44(%rbp),%edx
  mov    %r14,%rsi
  mov    %r12d,%r8d
  mov    %r13,%rdi
  call   <intersection@plt>
  mov    -0x3c(%rbp),%ecx
  mov    -0x58(%rbp),%rsi
  mov    %r12d,%r8d
  mov    %r12d,%edx
  mov    %rax,%rdi
  call   <intersection@plt>
  lea    D2(%rip),%rdi
  mov    %rax,%r12
  call   <puts@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L174
  lea    -0x28(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L174:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D46
type_guessed: string
name: parse_data
arguments: data_tag: D50
type_guessed: string
name: parse_data
arguments: data_tag: D56
type_guessed: string
name: parse_data
arguments: data_tag: D69
type_guessed: string
name: parse_data
arguments: data_tag: D1
type_guessed: string
name: parse_data
arguments: data_tag: D21
type_guessed: string
name: parse_data
arguments: data_tag: D2
type_guessed: string

tool: D46: Enter no. of elements in array 1, 2 and 3: 

tool: D50: %d %d %d

tool: D56: Enter the elements in array-1 in sorted order: 

tool: D69: %d

tool: D1: Enter the elements in array-2 in sorted order: 

tool: D21: Enter the elements in array-3 in sorted order: 

tool: D2: 
Common elements in all 3 arrays are: 

assistant: ```c
int main() {
  int n1, n2, n3, i;
  printf("Enter no. of elements in array 1, 2 and 3: ");
  scanf("%d %d %d", &n1, &n2, &n3);
  int arr1[n1], arr2[n2], arr3[n3];
  printf("Enter the elements in array-1 in sorted order: \n");
  for (i = 0; i < n1; i++)
    scanf("%d", &arr1[i]);
  printf("Enter the elements in array-2 in sorted order: \n");
  for (i = 0; i < n2; i++)
    scanf("%d", &arr2[i]);
  printf("Enter the elements in array-3 in sorted order: \n");
  for (i = 0; i < n3; i++)
    scanf("%d", &arr3[i]);
  int n;
  int *arr = intersection(arr1, arr2, n1, n2, n);
  arr = intersection(arr, arr3, n, n3, n);
  printf("\nCommon elements in all 3 arrays are: \n");
  for (i = 0; i < n; i++)
    printf("%d ", arr[i]);
  free(arr);
  return 0;
}
```