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

```asm
<ej6>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    D25(%rip),%rdi
  call   <puts@plt>
  lea    0x1c(%rsp),%rsi
  lea    D41(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x1c(%rsp),%esi
  lea    D96(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D54(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x1c(%rsp),%edi
  call   <ej1@plt>
  mov    %rax,%rbp
  mov    0x1c(%rsp),%esi
  mov    %rax,%rdi
  call   <ej4@plt>
  mov    0x1c(%rsp),%edi
  call   <ej1@plt>
  mov    %rax,%rbx
  mov    0x1c(%rsp),%esi
  mov    %rax,%rdi
  call   <ej4@plt>
  mov    0x1c(%rsp),%edi
  call   <ej1@plt>
  mov    %rax,%r13
  mov    0x1c(%rsp),%esi
  mov    %rax,%rdi
  call   <ej4@plt>
  mov    0x1c(%rsp),%edi
  call   <ej1@plt>
  mov    %rax,%r12
  mov    0x1c(%rsp),%esi
  mov    %rax,%rdi
  call   <ej4@plt>
  lea    D87(%rip),%rdi
  call   <puts@plt>
  lea    0x20(%rsp),%rsi
  lea    D36(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x1c(%rsp),%esi
  movsd  0x20(%rsp),%xmm0
  mov    %rbp,%rdi
  call   <ej3@plt>
  mov    0x1c(%rsp),%esi
  movsd  0x20(%rsp),%xmm0
  mov    %rbx,%rdi
  call   <ej3@plt>
  mov    0x1c(%rsp),%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <ej2@plt>
  mov    %rax,%r15
  mov    0x1c(%rsp),%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <ej2@plt>
  mov    %rax,%r14
  mov    0x1c(%rsp),%edx
  mov    %rax,%rsi
  mov    %r15,%rdi
  call   <ej2@plt>
  mov    %rax,0x8(%rsp)
  movsd  0x20(%rsp),%xmm0
  lea    D47(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  lea    D58(%rip),%rdi
  call   <puts@plt>
  mov    0x1c(%rsp),%esi
  mov    %rbp,%rdi
  call   <ej5@plt>
  lea    D64(%rip),%rdi
  call   <puts@plt>
  mov    0x1c(%rsp),%esi
  mov    %rbx,%rdi
  call   <ej5@plt>
  lea    D107(%rip),%rdi
  call   <puts@plt>
  mov    0x1c(%rsp),%esi
  mov    %r15,%rdi
  call   <ej5@plt>
  lea    D12(%rip),%rdi
  call   <puts@plt>
  mov    0x1c(%rsp),%esi
  mov    %r14,%rdi
  call   <ej5@plt>
  lea    D74(%rip),%rdi
  call   <puts@plt>
  mov    0x1c(%rsp),%esi
  mov    0x8(%rsp),%rdi
  call   <ej5@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D25
type: string
name: read_data
arguments: data_label: D41
type: string
name: read_data
arguments: data_label: D96
type: string
name: read_data
arguments: data_label: D54
type: string
name: read_data
arguments: data_label: D87
type: string
name: read_data
arguments: data_label: D36
type: string
name: read_data
arguments: data_label: D47
type: string
name: read_data
arguments: data_label: D58
type: string
name: read_data
arguments: data_label: D64
type: string
name: read_data
arguments: data_label: D107
type: string
name: read_data
arguments: data_label: D12
type: string
name: read_data
arguments: data_label: D74
type: string

tool: D25: Introduzca un entero N:

tool: D41: %d

tool: D96: a) Entero introducido: %d


tool: D54: b) 

tool: D87: Factor de escalamiento:

tool: D36: %lf

tool: D47: c) Factor de escalamiento: %lf


tool: D58: d) Primer vector escalado:

tool: D64:    Segundo vector escalado:

tool: D107: e) Vector u:

tool: D12:    Vector v:

tool: D74: f) Producto vectorial u x v:

assistant: ```c
void ej6() {
  int N;
  printf("Introduzca un entero N:\n");
  scanf("%d", &N);
  printf("a) Entero introducido: %d\n", N);
  printf("b) ");
  double *vec1, *vec2, *vec3, *vec4;
  vec1 = ej1(N);
  ej4(vec1, N);
  vec2 = ej1(N);
  ej4(vec2, N);
  vec3 = ej1(N);
  ej4(vec3, N);
  vec4 = ej1(N);
  ej4(vec4, N);
  double s;
  printf("Factor de escalamiento:\n");
  scanf("%lf", &s);
  ej3(vec1, s, N);
  ej3(vec2, s, N);
  double *u, *v;
  u = ej2(vec1, vec2, N);
  v = ej2(vec3, vec4, N);
  double *ans;
  ans = ej2(u, v, N);
  printf("c) Factor de escalamiento: %lf\n", s);
  printf("d) Primer vector escalado:\n");
  ej5(vec1, N);
  printf("   Segundo vector escalado:\n");
  ej5(vec2, N);
  printf("e) Vector u:\n");
  ej5(u, N);
  printf("   Vector v:\n");
  ej5(v, N);
  printf("f) Producto vectorial u x v:\n");
  ej5(ans, N);
  free(vec1);
  free(vec2);
  free(vec3);
  free(vec4);
}
```