user: Demonstrate the C code that generates the assembly output below:

```asm
<count_sort_parallel>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %edx,-0x40(%rbp)
  mov    -0x3c(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    $0x0,%eax
  call   <omp_get_wtime@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L10
L13:
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L89
L18:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  comisd %xmm1,%xmm0
  jbe    L34
  addl   $0x1,-0x24(%rbp)
  jmp    L68
L34:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  ucomisd %xmm1,%xmm0
  jp     L68
  ucomisd %xmm1,%xmm0
  jne    L68
  mov    -0x28(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jge    L68
  addl   $0x1,-0x24(%rbp)
L68:
  addl   $0x1,-0x28(%rbp)
L89:
  mov    -0x28(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L18
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L10:
  mov    -0x2c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L13
  mov    $0x0,%eax
  call   <omp_get_wtime@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  subsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x3c(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movl   $0x0,-0x2c(%rbp)
  jmp    L55
L20:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movq   %rax,%xmm0
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  addl   $0x1,-0x2c(%rbp)
L55:
  mov    -0x2c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L20
  mov    $0xa,%edi
  call   <putchar@plt>
  movsd  -0x8(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D1
data_type: string

tool: D1: %.2f 

assistant: ```c
double count_sort_parallel(double a[], int n, int nthreads) {
  int i, j, count;
  double *temp;
  double start, end, duracao;
  temp = (double *)malloc(n * sizeof(double));
  start = omp_get_wtime();
#pragma omp parallel for num_threads(nthreads) default(none) private(i, j, count) shared(a, temp, n)
  for (i = 0; i < n; i++) {
    count = 0;
    for (j = 0; j < n; j++)
      if (a[j] < a[i])
        count++;
      else if (a[j] == a[i] && j < i)
        count++;
    temp[count] = a[i];
  }
  end = omp_get_wtime();
  duracao = end - start;
  memcpy(a, temp, n * sizeof(double));
  free(temp);
  for (i = 0; i < n; i++) {
    printf("%.2f ", a[i]);
  }
  printf("\n");
  return duracao;
}
```