#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 */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bucketSort(float *, int /*<<< orphan*/, int);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ insertSorted(struct node **, float);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  int n, i;
  scanf("%d", &n);
  float *a = (float *)malloc(n * sizeof(float));
  struct node *list = NULL;
  for (i = 0; i < n; i++) {
    scanf("%f", &a[i]);
    insertSorted(&list, a[i]);
  }
  bucketSort(a, 0, n);
  for (i = 0; i < n; i++) {
    printf("%f ", a[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e72(%rip),%rax
mov    (%rax),%edx
lea    0xe81(%rip),%rdi
lea    0xe84(%rip),%rsi
call   1040 <freopen@plt>
mov    0x2e46(%rip),%rax
mov    (%rax),%edx
lea    0xe71(%rip),%rdi
lea    0xe75(%rip),%rsi
call   1040 <freopen@plt>
lea    0xe6b(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1228 <main+0xc8>
mov    -0x18(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
lea    -0x20(%rbp),%rdi
call   1050 <insertSorted@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11db <main+0x7b>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%edx
xor    %esi,%esi
call   1070 <bucketSort@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1276 <main+0x116>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdbe(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    123d <main+0xdd>
lea    0xda6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    0x2e64(%rip),%rax
mov    (%rax),%edx
lea    0xe73(%rip),%rdi
lea    0xe76(%rip),%rsi
call   1050 <freopen@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%edx
lea    0xe63(%rip),%rdi
lea    0xe67(%rip),%rsi
call   1050 <freopen@plt>
lea    0xe5d(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0x4(%rsp),%edi
shl    $0x2,%edi
call   1070 <malloc@plt>
mov    %rax,%r12
movq   $0x0,0x8(%rsp)
mov    0x4(%rsp),%edx
test   %edx,%edx
jle    122b <main+0xbb>
lea    0xe2d(%rip),%r14
lea    0x8(%rsp),%r15
mov    %r12,%rbx
xor    %r13d,%r13d
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
movss  (%rbx),%xmm0
mov    %r15,%rdi
call   1060 <insertSorted@plt>
add    $0x1,%r13
movslq 0x4(%rsp),%rdx
add    $0x4,%rbx
cmp    %rdx,%r13
jl     1200 <main+0x90>
mov    %r12,%rdi
xor    %esi,%esi
call   1080 <bucketSort@plt>
cmpl   $0x0,0x4(%rsp)
jle    1272 <main+0x102>
xor    %ebx,%ebx
lea    0xdda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
movss  (%r12,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
movslq 0x4(%rsp),%rax
cmp    %rax,%rbx
jl     1250 <main+0xe0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [11 x i8] c"output.txt\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [3 x i8] c"%f\00"
@.str.6 = [4 x i8] c"%f \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
%3 = load i32, i32* @stdin
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @freopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %5)
%7 = bitcast i32* %1 to i8*
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = shl i32 %9, 2
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to float*
%13 = bitcast %struct.node** %2 to i8*
store %struct.node* null, %struct.node** %2
%14 = load i32, i32* %1
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %26
16: ; preds = %0, %16
%17 = phi i64 [ %22, %16 ], [ 0, %0 ]
%18 = getelementptr inbounds float, float* %12, i64 %17
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %18)
%20 = load float, float* %18
%21 = call i32 @insertSorted(%struct.node** %2, float %20)
%22 = add nuw nsw i64 %17, 1
%23 = load i32, i32* %1
%24 = sext i32 %23 to i64
%25 = icmp slt i64 %22, %24
br i1 %25, label %16, label %26
26: ; preds = %16, %0
%27 = phi i32 [ %14, %0 ], [ %23, %16 ]
%28 = call i32 @bucketSort(float* %12, i32 0, i32 %27)
%29 = load i32, i32* %1
%30 = icmp sgt i32 %29, 0
br i1 %30, label %31, label %41
31: ; preds = %26, %31
%32 = phi i64 [ %37, %31 ], [ 0, %26 ]
%33 = getelementptr inbounds float, float* %12, i64 %32
%34 = load float, float* %33
%35 = fpext float %34 to double
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), double %35)
%37 = add nuw nsw i64 %32, 1
%38 = load i32, i32* %1
%39 = sext i32 %38 to i64
%40 = icmp slt i64 %37, %39
br i1 %40, label %31, label %41
41: ; preds = %31, %26
%42 = call i32 @putchar(i32 10)
ret i32 0
}