void order_args(double *pf0, double *pf1, double *pf2, double *px0, double *px1,
                double *px2) {
  if (*px0 > *px2) {
    {
      double _tmp;
      _tmp = (*px0);
      (*px0) = (*px2);
      (*px2) = _tmp;
    };
    {
      double _tmp;
      _tmp = (*pf0);
      (*pf0) = (*pf2);
      (*pf2) = _tmp;
    };
  }
  if (*px0 > *px1) {
    {
      double _tmp;
      _tmp = (*px0);
      (*px0) = (*px1);
      (*px1) = _tmp;
    };
    {
      double _tmp;
      _tmp = (*pf0);
      (*pf0) = (*pf1);
      (*pf1) = _tmp;
    };
  } else {
    if (*px1 > *px2) {
      {
        double _tmp;
        _tmp = (*px1);
        (*px1) = (*px2);
        (*px2) = _tmp;
      };
      {
        double _tmp;
        _tmp = (*pf1);
        (*pf1) = (*pf2);
        (*pf2) = _tmp;
      };
    }
  }
}


x86 assembly (clang, -O0):
<order_args>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1186 <order_args+0x86>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    11f5 <order_args+0xf5>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1264 <order_args+0x164>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    125f <order_args+0x15f>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x58(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1264 <order_args+0x164>
pop    %rbp
ret

x86 assembly (clang, -O2):
<order_args>:
movsd  (%rcx),%xmm0
movsd  (%r9),%xmm1
ucomisd %xmm1,%xmm0
jbe    112c <order_args+0x2c>
movsd  %xmm1,(%rcx)
movsd  %xmm0,(%r9)
movsd  (%rdi),%xmm0
movsd  (%rdx),%xmm1
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%rdx)
movsd  (%rcx),%xmm0
movsd  (%r8),%xmm1
ucomisd %xmm1,%xmm0
jbe    1142 <order_args+0x42>
movsd  %xmm1,(%rcx)
movsd  %xmm0,(%r8)
jmp    115d <order_args+0x5d>
movsd  (%r9),%xmm0
ucomisd %xmm0,%xmm1
jbe    116d <order_args+0x6d>
movsd  %xmm0,(%r8)
movsd  %xmm1,(%r9)
mov    %rsi,%rdi
mov    %rdx,%rsi
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @order_args(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
store double* %0, double** %7
store double* %1, double** %8
store double* %2, double** %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
%19 = load double*, double** %10
%20 = load double, double* %19
%21 = load double*, double** %12
%22 = load double, double* %21
%23 = fcmp ogt double %20, %22
br i1 %23, label %24, label %39
24: ; preds = %6
%25 = load double*, double** %10
%26 = load double, double* %25
store double %26, double* %13
%27 = load double*, double** %12
%28 = load double, double* %27
%29 = load double*, double** %10
store double %28, double* %29
%30 = load double, double* %13
%31 = load double*, double** %12
store double %30, double* %31
%32 = load double*, double** %7
%33 = load double, double* %32
store double %33, double* %14
%34 = load double*, double** %9
%35 = load double, double* %34
%36 = load double*, double** %7
store double %35, double* %36
%37 = load double, double* %14
%38 = load double*, double** %9
store double %37, double* %38
br label %39
39: ; preds = %24, %6
%40 = load double*, double** %10
%41 = load double, double* %40
%42 = load double*, double** %11
%43 = load double, double* %42
%44 = fcmp ogt double %41, %43
br i1 %44, label %45, label %60
45: ; preds = %39
%46 = load double*, double** %10
%47 = load double, double* %46
store double %47, double* %15
%48 = load double*, double** %11
%49 = load double, double* %48
%50 = load double*, double** %10
store double %49, double* %50
%51 = load double, double* %15
%52 = load double*, double** %11
store double %51, double* %52
%53 = load double*, double** %7
%54 = load double, double* %53
store double %54, double* %16
%55 = load double*, double** %8
%56 = load double, double* %55
%57 = load double*, double** %7
store double %56, double* %57
%58 = load double, double* %16
%59 = load double*, double** %8
store double %58, double* %59
br label %82
60: ; preds = %39
%61 = load double*, double** %11
%62 = load double, double* %61
%63 = load double*, double** %12
%64 = load double, double* %63
%65 = fcmp ogt double %62, %64
br i1 %65, label %66, label %81
66: ; preds = %60
%67 = load double*, double** %11
%68 = load double, double* %67
store double %68, double* %17
%69 = load double*, double** %12
%70 = load double, double* %69
%71 = load double*, double** %11
store double %70, double* %71
%72 = load double, double* %17
%73 = load double*, double** %12
store double %72, double* %73
%74 = load double*, double** %8
%75 = load double, double* %74
store double %75, double* %18
%76 = load double*, double** %9
%77 = load double, double* %76
%78 = load double*, double** %8
store double %77, double* %78
%79 = load double, double* %18
%80 = load double*, double** %9
store double %79, double* %80
br label %81
81: ; preds = %66, %60
br label %82
82: ; preds = %81, %45
ret void
}

LLVM IR (-O2):
define void @order_args(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, double* nocapture %5) {
%7 = load double, double* %3
%8 = load double, double* %5
%9 = fcmp ogt double %7, %8
br i1 %9, label %10, label %14
10: ; preds = %6
store double %8, double* %3
store double %7, double* %5
%11 = load double, double* %0
%12 = load double, double* %2
store double %12, double* %0
store double %11, double* %2
%13 = load double, double* %3
br label %14
14: ; preds = %10, %6
%15 = phi double [ %13, %10 ], [ %7, %6 ]
%16 = load double, double* %4
%17 = fcmp ogt double %15, %16
br i1 %17, label %18, label %19
18: ; preds = %14
store double %16, double* %3
store double %15, double* %4
br label %23
19: ; preds = %14
%20 = load double, double* %5
%21 = fcmp ogt double %16, %20
br i1 %21, label %22, label %28
22: ; preds = %19
store double %20, double* %4
store double %16, double* %5
br label %23
23: ; preds = %18, %22
%24 = phi double* [ %1, %22 ], [ %0, %18 ]
%25 = phi double* [ %2, %22 ], [ %1, %18 ]
%26 = load double, double* %24
%27 = load double, double* %25
store double %27, double* %24
store double %26, double* %25
br label %28
28: ; preds = %23, %19
ret void
}