int main(void) {
  {
    double data1[11] = {15, 20, 35, 40, 50, 34, 32, 43, 20, 1, 60};
    double ans[11] = {1, 15, 20, 20, 32, 34, 35, 40, 43, 50, 60};
    long i;
    CSPL_Sort_mergesort(data1, 11);
    for (i = 0; i < 11; i++) {
      printf("CSPL_Sort_mergesort[%ld]=%lf\n", i, data1[i]);
      {
        if ((fabs((ans[i]) - (data1[i])) < (1e-7)) == 0)
          return (1);
      };
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xed3(%rip),%rsi
mov    $0x58,%edx
call   1050 <memcpy@plt>
lea    -0xc0(%rbp),%rdi
lea    0xf1b(%rip),%rsi
mov    $0x58,%edx
call   1050 <memcpy@plt>
lea    -0x60(%rbp),%rdi
mov    $0xb,%esi
mov    $0x0,%al
call   1040 <CSPL_Sort_mergesort@plt>
movq   $0x0,-0xc8(%rbp)
cmpq   $0xb,-0xc8(%rbp)
0b
jge    1227 <main+0xf7>
mov    -0xc8(%rbp),%rsi
mov    -0xc8(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm0
lea    0xf25(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc8(%rbp),%rax
movsd  -0xc0(%rbp,%rax,8),%xmm1
ff ff
mov    -0xc8(%rbp),%rax
subsd  -0x60(%rbp,%rax,8),%xmm1
movaps 0xe32(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xe16(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
jne    120b <main+0xdb>
movl   $0x1,-0x4(%rbp)
jmp    122e <main+0xfe>
jmp    1210 <main+0xe0>
mov    -0xc8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xc8(%rbp)
jmp    118a <main+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
mov    0xf94(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xf78(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf5c(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xf40(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xf24(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xf08(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1040 <CSPL_Sort_mergesort@plt>
movsd  (%rsp),%xmm0
lea    0xf41(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe68(%rip),%xmm0
subsd  (%rsp),%xmm0
andpd  0xebb(%rip),%xmm0
mov    $0x1,%ebx
movsd  0xe56(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    143c <main+0x31c>
movsd  0x8(%rsp),%xmm0
lea    0xeff(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe33(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
andpd  0xe75(%rip),%xmm0
movsd  0xe15(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    143c <main+0x31c>
movsd  0x10(%rsp),%xmm0
lea    0xebe(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xdfa(%rip),%xmm0
subsd  0x10(%rsp),%xmm0
andpd  0xe34(%rip),%xmm0
movsd  0xdd4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    143c <main+0x31c>
movsd  0x18(%rsp),%xmm0
lea    0xe7d(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xdb9(%rip),%xmm1
subsd  0x18(%rsp),%xmm1
andpd  0xdf3(%rip),%xmm1
movsd  0xd93(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    143c <main+0x31c>
movsd  0x20(%rsp),%xmm0
lea    0xe3c(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xd80(%rip),%xmm0
subsd  0x20(%rsp),%xmm0
andpd  0xdb2(%rip),%xmm0
movsd  0xd52(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    143c <main+0x31c>
movsd  0x28(%rsp),%xmm0
lea    0xdfb(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xd47(%rip),%xmm0
subsd  0x28(%rsp),%xmm0
andpd  0xd71(%rip),%xmm0
movsd  0xd11(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    143c <main+0x31c>
movsd  0x30(%rsp),%xmm0
lea    0xdba(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xd0e(%rip),%xmm0
subsd  0x30(%rsp),%xmm0
andpd  0xd30(%rip),%xmm0
movsd  0xcd0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    143c <main+0x31c>
movsd  0x38(%rsp),%xmm0
lea    0xd79(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xcd5(%rip),%xmm0
subsd  0x38(%rsp),%xmm0
andpd  0xcef(%rip),%xmm0
movsd  0xc8f(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    143c <main+0x31c>
movsd  0x40(%rsp),%xmm0
lea    0xd38(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xc9c(%rip),%xmm0
subsd  0x40(%rsp),%xmm0
andpd  0xcae(%rip),%xmm0
movsd  0xc4e(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    143c <main+0x31c>
movsd  0x48(%rsp),%xmm0
lea    0xcfb(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xc27(%rip),%xmm1
movsd  0xc5f(%rip),%xmm0
subsd  0x48(%rsp),%xmm0
andpd  0xc69(%rip),%xmm0
ucomisd %xmm0,%xmm1
jbe    143c <main+0x31c>
movsd  0x50(%rsp),%xmm0
lea    0xcbe(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xc32(%rip),%xmm0
subsd  0x50(%rsp),%xmm0
andpd  0xc34(%rip),%xmm0
movsd  0xbd4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    143c <main+0x31c>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.data1 = [11 x double] [double 1.500000e+01, double 2.000000e+01, double 3.500000e+01, double 4.000000e+01, double 5.000000e+01, double 3.400000e+01, double 3.200000e+01, double 4.300000e+01, double 2.000000e+01, double 1.000000e+00, double 6.000000e+01]
@__const.main.ans = [11 x double] [double 1.000000e+00, double 1.500000e+01, double 2.000000e+01, double 2.000000e+01, double 3.200000e+01, double 3.400000e+01, double 3.500000e+01, double 4.000000e+01, double 4.300000e+01, double 5.000000e+01, double 6.000000e+01]
@.str = [30 x i8] c"CSPL_Sort_mergesort[%ld]=%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x double]
%3 = alloca [11 x double]
%4 = alloca i64
store i32 0, i32* %1
%5 = bitcast [11 x double]* %2 to i8*
%6 = bitcast [11 x double]* %3 to i8*
%7 = getelementptr inbounds [11 x double], [11 x double]* %2, i64 0, i64 0
%8 = call i32 (double*, i32, ...) bitcast (i32 (...)* @CSPL_Sort_mergesort to i32 (double*, i32, ...)*)(double* %7, i32 11)
store i64 0, i64* %4
br label %9
9: ; preds = %31, %0
%10 = load i64, i64* %4
%11 = icmp slt i64 %10, 11
br i1 %11, label %12, label %34
12: ; preds = %9
%13 = load i64, i64* %4
%14 = load i64, i64* %4
%15 = getelementptr inbounds [11 x double], [11 x double]* %2, i64 0, i64 %14
%16 = load double, double* %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %13, double %16)
%18 = load i64, i64* %4
%19 = getelementptr inbounds [11 x double], [11 x double]* %3, i64 0, i64 %18
%20 = load double, double* %19
%21 = load i64, i64* %4
%22 = getelementptr inbounds [11 x double], [11 x double]* %2, i64 0, i64 %21
%23 = load double, double* %22
%24 = fsub double %20, %23
%25 = call double @llvm.fabs.f64(double %24)
%26 = fcmp olt double %25, 0x3E7AD7F29ABCAF48
%27 = zext i1 %26 to i32
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %12
store i32 1, i32* %1
br label %35
30: ; preds = %12
br label %31
31: ; preds = %30
%32 = load i64, i64* %4
%33 = add nsw i64 %32, 1
store i64 %33, i64* %4
br label %9
34: ; preds = %9
store i32 0, i32* %1
br label %35
35: ; preds = %34, %29
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
@__const.main.data1 = [11 x double] [double 1.500000e+01, double 2.000000e+01, double 3.500000e+01, double 4.000000e+01, double 5.000000e+01, double 3.400000e+01, double 3.200000e+01, double 4.300000e+01, double 2.000000e+01, double 1.000000e+00, double 6.000000e+01]
@.str = [30 x i8] c"CSPL_Sort_mergesort[%ld]=%lf\0A\00"
define i32 @main() {
%1 = alloca [11 x double]
%2 = bitcast [11 x double]* %1 to i8*
%3 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 0
%4 = call i32 (double*, i32, ...) bitcast (i32 (...)* @CSPL_Sort_mergesort to i32 (double*, i32, ...)*)(double* %3, i32 11)
%5 = load double, double* %3
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 0, double %5)
%7 = load double, double* %3
%8 = fsub double 1.000000e+00, %7
%9 = call double @llvm.fabs.f64(double %8)
%10 = fcmp uge double %9, 0x3E7AD7F29ABCAF48
br i1 %10, label %92, label %11
11: ; preds = %0
%12 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 1
%13 = load double, double* %12
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 1, double %13)
%15 = load double, double* %12
%16 = fsub double 1.500000e+01, %15
%17 = call double @llvm.fabs.f64(double %16)
%18 = fcmp uge double %17, 0x3E7AD7F29ABCAF48
br i1 %18, label %92, label %19
19: ; preds = %11
%20 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 2
%21 = load double, double* %20
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 2, double %21)
%23 = load double, double* %20
%24 = fsub double 2.000000e+01, %23
%25 = call double @llvm.fabs.f64(double %24)
%26 = fcmp uge double %25, 0x3E7AD7F29ABCAF48
br i1 %26, label %92, label %27
27: ; preds = %19
%28 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 3
%29 = load double, double* %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 3, double %29)
%31 = load double, double* %28
%32 = fsub double 2.000000e+01, %31
%33 = call double @llvm.fabs.f64(double %32)
%34 = fcmp uge double %33, 0x3E7AD7F29ABCAF48
br i1 %34, label %92, label %35
35: ; preds = %27
%36 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 4
%37 = load double, double* %36
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 4, double %37)
%39 = load double, double* %36
%40 = fsub double 3.200000e+01, %39
%41 = call double @llvm.fabs.f64(double %40)
%42 = fcmp uge double %41, 0x3E7AD7F29ABCAF48
br i1 %42, label %92, label %43
43: ; preds = %35
%44 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 5
%45 = load double, double* %44
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 5, double %45)
%47 = load double, double* %44
%48 = fsub double 3.400000e+01, %47
%49 = call double @llvm.fabs.f64(double %48)
%50 = fcmp uge double %49, 0x3E7AD7F29ABCAF48
br i1 %50, label %92, label %51
51: ; preds = %43
%52 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 6
%53 = load double, double* %52
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 6, double %53)
%55 = load double, double* %52
%56 = fsub double 3.500000e+01, %55
%57 = call double @llvm.fabs.f64(double %56)
%58 = fcmp uge double %57, 0x3E7AD7F29ABCAF48
br i1 %58, label %92, label %59
59: ; preds = %51
%60 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 7
%61 = load double, double* %60
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 7, double %61)
%63 = load double, double* %60
%64 = fsub double 4.000000e+01, %63
%65 = call double @llvm.fabs.f64(double %64)
%66 = fcmp uge double %65, 0x3E7AD7F29ABCAF48
br i1 %66, label %92, label %67
67: ; preds = %59
%68 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 8
%69 = load double, double* %68
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 8, double %69)
%71 = load double, double* %68
%72 = fsub double 4.300000e+01, %71
%73 = call double @llvm.fabs.f64(double %72)
%74 = fcmp uge double %73, 0x3E7AD7F29ABCAF48
br i1 %74, label %92, label %75
75: ; preds = %67
%76 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 9
%77 = load double, double* %76
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 9, double %77)
%79 = load double, double* %76
%80 = fsub double 5.000000e+01, %79
%81 = call double @llvm.fabs.f64(double %80)
%82 = fcmp uge double %81, 0x3E7AD7F29ABCAF48
br i1 %82, label %92, label %83
83: ; preds = %75
%84 = getelementptr inbounds [11 x double], [11 x double]* %1, i64 0, i64 10
%85 = load double, double* %84
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 10, double %85)
%87 = load double, double* %84
%88 = fsub double 6.000000e+01, %87
%89 = call double @llvm.fabs.f64(double %88)
%90 = fcmp uge double %89, 0x3E7AD7F29ABCAF48
br i1 %90, label %92, label %91
91: ; preds = %83
br label %92
92: ; preds = %91, %83, %75, %67, %59, %51, %43, %35, %27, %19, %11, %0
%93 = phi i32 [ 1, %0 ], [ 1, %11 ], [ 1, %19 ], [ 1, %27 ], [ 1, %35 ], [ 1, %43 ], [ 1, %51 ], [ 1, %59 ], [ 1, %67 ], [ 1, %75 ], [ 1, %83 ], [ 0, %91 ]
ret i32 %93
}