void mysort1_rev(int N, double *data1) {
  int i, j;
  double v, t1;
  if (N <= 1)
    return;
  v = data1[0];
  i = 0;
  j = N;
  for (;;) {
    while (++i < N ? data1[i] > v : 0) {
    }
    while (data1[--j] < v) {
    }
    if (i >= j)
      break;
    t1 = data1[i];
    data1[i] = data1[j];
    data1[j] = t1;
  }
  t1 = data1[i - 1];
  data1[i - 1] = data1[0];
  data1[0] = t1;
  mysort1_rev(i - 1, data1);
  mysort1_rev(N - i, data1 + i);
}


x86 assembly (clang, -O0):
<mysort1_rev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jg     112e <mysort1_rev+0x1e>
jmp    1285 <mysort1_rev+0x175>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    114d <mysort1_rev+0x3d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmp    -0x4(%rbp),%eax
jge    1181 <mysort1_rev+0x71>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x20(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x2c(%rbp)
jmp    118b <mysort1_rev+0x7b>
xor    %eax,%eax
mov    %eax,-0x2c(%rbp)
jmp    118b <mysort1_rev+0x7b>
mov    -0x2c(%rbp),%eax
cmp    $0x0,%eax
je     119c <mysort1_rev+0x8c>
jmp    114d <mysort1_rev+0x3d>
jmp    11a1 <mysort1_rev+0x91>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11ca <mysort1_rev+0xba>
jmp    11a1 <mysort1_rev+0x91>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     11db <mysort1_rev+0xcb>
jmp    121e <mysort1_rev+0x10e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1148 <mysort1_rev+0x38>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x14(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <mysort1_rev@plt>
mov    -0x4(%rbp),%edi
sub    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
call   1030 <mysort1_rev@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysort1_rev>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jge    112f <mysort1_rev+0x1f>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movabs $0xffffffff00000000,%r15
ff ff ff
movabs $0x100000000,%r10
jmp    11a8 <mysort1_rev+0x98>
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%r12,%r13,1),%edi
mov    %r14,%rax
neg    %rax
sar    $0x1d,%rax
movsd  (%rsi,%rax,1),%xmm0
movsd  (%rsi),%xmm1
movsd  %xmm1,(%rsi,%rax,1)
movsd  %xmm0,(%rsi)
mov    %rsi,%rbx
mov    %r10,%rbp
call   1030 <mysort1_rev@plt>
mov    %rbp,%r10
mov    %rbx,%rsi
mov    0x4(%rsp),%eax
sub    %r13d,%eax
not    %r12d
add    %eax,%r12d
mov    %rbp,%rax
sub    %r14,%rax
sar    $0x1d,%rax
add    %rax,%rsi
mov    %r12d,%edi
cmp    $0x1,%r12d
jle    1120 <mysort1_rev+0x10>
movsd  (%rsi),%xmm0
mov    %edi,%eax
lea    0x8(%rsi),%r8
mov    %edi,0x4(%rsp)
mov    %edi,%edx
xor    %r13d,%r13d
nopl   0x0(%rax,%rax,1)
movslq %r13d,%r9
mov    %r9,%rbp
imul   %r15,%rbp
lea    0x1(%r9),%rdi
lea    (%r8,%r9,8),%rcx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%r14
mov    %rbx,%r12
lea    (%rdi,%rbx,1),%rbp
cmp    %rax,%rbp
jge    1204 <mysort1_rev+0xf4>
movsd  (%rcx,%r12,8),%xmm1
lea    (%r14,%r15,1),%rbp
lea    0x1(%r12),%rbx
ucomisd %xmm0,%xmm1
ja     11e0 <mysort1_rev+0xd0>
movslq %edx,%rcx
lea    (%r9,%r12,1),%rbp
add    $0x1,%rbp
lea    (%rsi,%rcx,8),%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  -0x8(%rdi),%xmm1
add    $0xfffffffffffffff8,%rdi
add    $0xffffffff,%edx
ucomisd %xmm1,%xmm0
ja     1220 <mysort1_rev+0x110>
lea    (%r12,%r13,1),%ecx
add    $0x1,%ecx
cmp    %edx,%ecx
jge    1150 <mysort1_rev+0x40>
mov    %r10,%rcx
sub    %r14,%rcx
sar    $0x1d,%rcx
movsd  (%rsi,%rcx,1),%xmm2
movsd  %xmm1,(%rsi,%rcx,1)
movsd  %xmm2,(%rdi)
mov    %rbp,%r13
jmp    11c0 <mysort1_rev+0xb0>

LLVM IR (-O0):
define void @mysort1_rev(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
store i32 %0, i32* %3
store double* %1, double** %4
%9 = load i32, i32* %3
%10 = icmp sle i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %2
br label %101
12: ; preds = %2
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
store double %15, double* %7
store i32 0, i32* %5
%16 = load i32, i32* %3
store i32 %16, i32* %6
br label %17
17: ; preds = %53, %12
br label %18
18: ; preds = %36, %17
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
%21 = load i32, i32* %3
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %32
23: ; preds = %18
%24 = load double*, double** %4
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
%28 = load double, double* %27
%29 = load double, double* %7
%30 = fcmp ogt double %28, %29
%31 = zext i1 %30 to i32
br label %33
32: ; preds = %18
br label %33
33: ; preds = %32, %23
%34 = phi i32 [ %31, %23 ], [ 0, %32 ]
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %33
br label %18
37: ; preds = %33
br label %38
38: ; preds = %47, %37
%39 = load double*, double** %4
%40 = load i32, i32* %6
%41 = add nsw i32 %40, -1
store i32 %41, i32* %6
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %39, i64 %42
%44 = load double, double* %43
%45 = load double, double* %7
%46 = fcmp olt double %44, %45
br i1 %46, label %47, label %48
47: ; preds = %38
br label %38
48: ; preds = %38
%49 = load i32, i32* %5
%50 = load i32, i32* %6
%51 = icmp sge i32 %49, %50
br i1 %51, label %52, label %53
52: ; preds = %48
br label %73
53: ; preds = %48
%54 = load double*, double** %4
%55 = load i32, i32* %5
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
%58 = load double, double* %57
store double %58, double* %8
%59 = load double*, double** %4
%60 = load i32, i32* %6
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %59, i64 %61
%63 = load double, double* %62
%64 = load double*, double** %4
%65 = load i32, i32* %5
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %64, i64 %66
store double %63, double* %67
%68 = load double, double* %8
%69 = load double*, double** %4
%70 = load i32, i32* %6
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
store double %68, double* %72
br label %17
73: ; preds = %52
%74 = load double*, double** %4
%75 = load i32, i32* %5
%76 = sub nsw i32 %75, 1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %74, i64 %77
%79 = load double, double* %78
store double %79, double* %8
%80 = load double*, double** %4
%81 = getelementptr inbounds double, double* %80, i64 0
%82 = load double, double* %81
%83 = load double*, double** %4
%84 = load i32, i32* %5
%85 = sub nsw i32 %84, 1
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %83, i64 %86
store double %82, double* %87
%88 = load double, double* %8
%89 = load double*, double** %4
%90 = getelementptr inbounds double, double* %89, i64 0
store double %88, double* %90
%91 = load i32, i32* %5
%92 = sub nsw i32 %91, 1
%93 = load double*, double** %4
%94 = load i32, i32* %3
%95 = load i32, i32* %5
%96 = sub nsw i32 %94, %95
%97 = load double*, double** %4
%98 = load i32, i32* %5
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double, double* %97, i64 %99
br label %101
101: ; preds = %73, %11
ret void
}

LLVM IR (-O2):
define void @mysort1_rev(i32 %0, double* %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %53, label %4
4: ; preds = %2, %40
%5 = phi double* [ %51, %40 ], [ %1, %2 ]
%6 = phi i32 [ %48, %40 ], [ %0, %2 ]
%7 = load double, double* %5
%8 = zext i32 %6 to i64
br label %9
9: ; preds = %34, %4
%10 = phi i32 [ %6, %4 ], [ %32, %34 ]
%11 = phi i64 [ 0, %4 ], [ %16, %34 ]
%12 = shl i64 %11, 32
%13 = ashr exact i64 %12, 32
br label %14
14: ; preds = %18, %9
%15 = phi i64 [ %16, %18 ], [ %13, %9 ]
%16 = add nsw i64 %15, 1
%17 = icmp slt i64 %16, %8
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = getelementptr inbounds double, double* %5, i64 %16
%20 = load double, double* %19
%21 = fcmp ule double %20, %7
br i1 %21, label %22, label %14
22: ; preds = %14, %18
%23 = sext i32 %10 to i64
br label %24
24: ; preds = %22, %24
%25 = phi i64 [ %23, %22 ], [ %26, %24 ]
%26 = add i64 %25, -1
%27 = getelementptr inbounds double, double* %5, i64 %26
%28 = load double, double* %27
%29 = fcmp olt double %28, %7
br i1 %29, label %24, label %30
30: ; preds = %24
%31 = trunc i64 %16 to i32
%32 = trunc i64 %26 to i32
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %40
34: ; preds = %30
%35 = getelementptr inbounds double, double* %5, i64 %26
%36 = shl i64 %16, 32
%37 = ashr exact i64 %36, 32
%38 = getelementptr inbounds double, double* %5, i64 %37
%39 = load double, double* %38
store double %28, double* %38
store double %39, double* %35
br label %9
40: ; preds = %30
%41 = trunc i64 %15 to i32
%42 = trunc i64 %16 to i32
%43 = shl i64 %15, 32
%44 = ashr exact i64 %43, 32
%45 = getelementptr inbounds double, double* %5, i64 %44
%46 = load double, double* %45
%47 = load double, double* %5
store double %47, double* %45
store double %46, double* %5
tail call void @mysort1_rev(i32 %41, double* %5)
%48 = sub nsw i32 %6, %42
%49 = shl i64 %16, 32
%50 = ashr exact i64 %49, 32
%51 = getelementptr inbounds double, double* %5, i64 %50
%52 = icmp slt i32 %48, 2
br i1 %52, label %53, label %4
53: ; preds = %40, %2
ret void
}