#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double count_sort_parallel(double *, int, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main(int argc, char *argv[]) {
  int i, n, nt;
  double *a, t_s;
  scanf("%d", &nt);
  scanf("%d", &n);
  a = (double *)malloc(n * sizeof(double));
  for (i = 0; i < n; i++)
    scanf("%lf", &a[i]);
  t_s = count_sort_parallel(a, n, nt);
  for (i = 0; i < n; i++)
    printf("%.2lf ", a[i]);
  printf("\n");
  printf("%lf\n", t_s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe91(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11cb <main+0x8b>
mov    -0x28(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1194 <main+0x54>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <count_sort_parallel@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    121b <main+0xdb>
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe01(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e6 <main+0xa6>
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xdd9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe9e(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0x8(%rsp),%edi
shl    $0x3,%edi
call   1060 <malloc@plt>
mov    %rax,%r15
mov    0x8(%rsp),%esi
test   %esi,%esi
jle    11cf <main+0x7f>
lea    0xe65(%rip),%r14
mov    %r15,%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rsi
add    $0x8,%r12
cmp    %rsi,%rbx
jl     11b0 <main+0x60>
mov    0xc(%rsp),%edx
mov    %r15,%rdi
call   1040 <count_sort_parallel@plt>
movsd  %xmm0,0x10(%rsp)
cmpl   $0x0,0x8(%rsp)
jle    121e <main+0xce>
xor    %ebx,%ebx
lea    0xe16(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
cmp    %rax,%rbx
jl     1200 <main+0xb0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xddf(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [7 x i8] c"%.2lf \00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [5 x i8] c"%lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double*
%10 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 8
%16 = trunc i64 %15 to i32
%17 = call i64 @malloc(i32 %16)
%18 = inttoptr i64 %17 to double*
store double* %18, double** %9
store i32 0, i32* %6
br label %19
19: ; preds = %29, %2
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %32
23: ; preds = %19
%24 = load double*, double** %9
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
%28 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %27)
br label %29
29: ; preds = %23
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %19
32: ; preds = %19
%33 = load double*, double** %9
%34 = load i32, i32* %7
%35 = load i32, i32* %8
%36 = call double @count_sort_parallel(double* %33, i32 %34, i32 %35)
store double %36, double* %10
store i32 0, i32* %6
br label %37
37: ; preds = %48, %32
%38 = load i32, i32* %6
%39 = load i32, i32* %7
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %51
41: ; preds = %37
%42 = load double*, double** %9
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %42, i64 %44
%46 = load double, double* %45
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %46)
br label %48
48: ; preds = %41
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
br label %37
51: ; preds = %37
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%53 = load double, double* %10
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %53)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [7 x i8] c"%.2lf \00"
@.str.4 = [5 x i8] c"%lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = shl i32 %9, 3
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to double*
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %2, %15
%16 = phi i64 [ %19, %15 ], [ 0, %2 ]
%17 = getelementptr inbounds double, double* %12, i64 %16
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %17)
%19 = add nuw nsw i64 %16, 1
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = icmp slt i64 %19, %21
br i1 %22, label %15, label %23
23: ; preds = %15, %2
%24 = phi i32 [ %13, %2 ], [ %20, %15 ]
%25 = load i32, i32* %4
%26 = call double @count_sort_parallel(double* %12, i32 %24, i32 %25)
%27 = load i32, i32* %3
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %38
29: ; preds = %23, %29
%30 = phi i64 [ %34, %29 ], [ 0, %23 ]
%31 = getelementptr inbounds double, double* %12, i64 %30
%32 = load double, double* %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %32)
%34 = add nuw nsw i64 %30, 1
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = icmp slt i64 %34, %36
br i1 %37, label %29, label %38
38: ; preds = %29, %23
%39 = call i32 @putchar(i32 10)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %26)
ret i32 0
}