double opt_med7_double(double *p, int n) {
  {
    if ((p[0]) > (p[5])) {
      double temp = ((p[0]));
      ((p[0])) = ((p[5]));
      ((p[5])) = temp;
    };
  };
  {
    if ((p[0]) > (p[3])) {
      double temp = ((p[0]));
      ((p[0])) = ((p[3]));
      ((p[3])) = temp;
    };
  };
  {
    if ((p[1]) > (p[6])) {
      double temp = ((p[1]));
      ((p[1])) = ((p[6]));
      ((p[6])) = temp;
    };
  };
  {
    if ((p[2]) > (p[4])) {
      double temp = ((p[2]));
      ((p[2])) = ((p[4]));
      ((p[4])) = temp;
    };
  };
  {
    if ((p[0]) > (p[1])) {
      double temp = ((p[0]));
      ((p[0])) = ((p[1]));
      ((p[1])) = temp;
    };
  };
  {
    if ((p[3]) > (p[5])) {
      double temp = ((p[3]));
      ((p[3])) = ((p[5]));
      ((p[5])) = temp;
    };
  };
  {
    if ((p[2]) > (p[6])) {
      double temp = ((p[2]));
      ((p[2])) = ((p[6]));
      ((p[6])) = temp;
    };
  };
  {
    if ((p[2]) > (p[3])) {
      double temp = ((p[2]));
      ((p[2])) = ((p[3]));
      ((p[3])) = temp;
    };
  };
  {
    if ((p[3]) > (p[6])) {
      double temp = ((p[3]));
      ((p[3])) = ((p[6]));
      ((p[6])) = temp;
    };
  };
  {
    if ((p[4]) > (p[5])) {
      double temp = ((p[4]));
      ((p[4])) = ((p[5]));
      ((p[5])) = temp;
    };
  };
  {
    if ((p[1]) > (p[4])) {
      double temp = ((p[1]));
      ((p[1])) = ((p[4]));
      ((p[4])) = temp;
    };
  };
  {
    if ((p[1]) > (p[3])) {
      double temp = ((p[1]));
      ((p[1])) = ((p[3]));
      ((p[3])) = temp;
    };
  };
  {
    if ((p[3]) > (p[4])) {
      double temp = ((p[3]));
      ((p[3])) = ((p[4]));
      ((p[4])) = temp;
    };
  };
  return (p[3]);
}


x86 assembly (clang, -O0):
<opt_med7_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
ucomisd 0x28(%rax),%xmm0
jbe    114e <opt_med7_double+0x4e>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
ucomisd 0x18(%rax),%xmm0
jbe    1191 <opt_med7_double+0x91>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
ucomisd 0x30(%rax),%xmm0
jbe    11d7 <opt_med7_double+0xd7>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
ucomisd 0x20(%rax),%xmm0
jbe    121d <opt_med7_double+0x11d>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
ucomisd 0x8(%rax),%xmm0
jbe    1260 <opt_med7_double+0x160>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
ucomisd 0x28(%rax),%xmm0
jbe    12a6 <opt_med7_double+0x1a6>
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
ucomisd 0x30(%rax),%xmm0
jbe    12ec <opt_med7_double+0x1ec>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
ucomisd 0x18(%rax),%xmm0
jbe    1332 <opt_med7_double+0x232>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
ucomisd 0x30(%rax),%xmm0
jbe    1378 <opt_med7_double+0x278>
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x58(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
ucomisd 0x28(%rax),%xmm0
jbe    13be <opt_med7_double+0x2be>
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x60(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
ucomisd 0x20(%rax),%xmm0
jbe    1404 <opt_med7_double+0x304>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x68(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
ucomisd 0x18(%rax),%xmm0
jbe    144a <opt_med7_double+0x34a>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x70(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
ucomisd 0x20(%rax),%xmm0
jbe    1490 <opt_med7_double+0x390>
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x78(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_med7_double>:
movsd  (%rdi),%xmm1
movsd  0x28(%rdi),%xmm2
ucomisd %xmm2,%xmm1
jbe    111e <opt_med7_double+0x1e>
movsd  %xmm2,(%rdi)
movsd  %xmm1,0x28(%rdi)
movapd %xmm1,%xmm0
jmp    1126 <opt_med7_double+0x26>
movapd %xmm2,%xmm0
movapd %xmm1,%xmm2
movsd  0x18(%rdi),%xmm1
ucomisd %xmm1,%xmm2
jbe    1140 <opt_med7_double+0x40>
movsd  %xmm1,(%rdi)
movsd  %xmm2,0x18(%rdi)
movapd %xmm2,%xmm5
jmp    1148 <opt_med7_double+0x48>
movapd %xmm1,%xmm5
movapd %xmm2,%xmm1
movsd  0x8(%rdi),%xmm4
movsd  0x30(%rdi),%xmm2
ucomisd %xmm2,%xmm4
jbe    1168 <opt_med7_double+0x68>
movsd  %xmm2,0x8(%rdi)
movsd  %xmm4,0x30(%rdi)
movapd %xmm4,%xmm3
jmp    1170 <opt_med7_double+0x70>
movapd %xmm2,%xmm3
movapd %xmm4,%xmm2
movsd  0x10(%rdi),%xmm7
movsd  0x20(%rdi),%xmm6
ucomisd %xmm6,%xmm7
jbe    121d <opt_med7_double+0x11d>
movsd  %xmm6,0x10(%rdi)
movsd  %xmm7,0x20(%rdi)
movapd %xmm7,%xmm4
ucomisd %xmm2,%xmm1
ja     122f <opt_med7_double+0x12f>
movapd %xmm2,%xmm1
ucomisd %xmm0,%xmm5
ja     1242 <opt_med7_double+0x142>
movapd %xmm0,%xmm2
movapd %xmm5,%xmm0
ucomisd %xmm3,%xmm6
ja     125a <opt_med7_double+0x15a>
movapd %xmm3,%xmm5
movapd %xmm6,%xmm3
ucomisd %xmm0,%xmm3
ja     1272 <opt_med7_double+0x172>
movapd %xmm0,%xmm3
ucomisd %xmm5,%xmm3
ja     1286 <opt_med7_double+0x186>
movapd %xmm3,%xmm5
ucomisd %xmm2,%xmm4
ja     129a <opt_med7_double+0x19a>
movapd %xmm4,%xmm2
ucomisd %xmm2,%xmm1
ja     12ae <opt_med7_double+0x1ae>
movapd %xmm2,%xmm0
movapd %xmm1,%xmm2
ucomisd %xmm5,%xmm2
ja     12c6 <opt_med7_double+0x1c6>
movapd %xmm5,%xmm2
ucomisd %xmm0,%xmm2
ja     12da <opt_med7_double+0x1da>
movapd %xmm2,%xmm0
ret
movapd %xmm6,%xmm4
movapd %xmm7,%xmm6
ucomisd %xmm2,%xmm1
jbe    119c <opt_med7_double+0x9c>
movsd  %xmm2,(%rdi)
movsd  %xmm1,0x8(%rdi)
ucomisd %xmm0,%xmm5
jbe    11aa <opt_med7_double+0xaa>
movsd  %xmm0,0x18(%rdi)
movsd  %xmm5,0x28(%rdi)
movapd %xmm5,%xmm2
ucomisd %xmm3,%xmm6
jbe    11bc <opt_med7_double+0xbc>
movsd  %xmm3,0x10(%rdi)
movsd  %xmm6,0x30(%rdi)
movapd %xmm6,%xmm5
ucomisd %xmm0,%xmm3
jbe    11ce <opt_med7_double+0xce>
movsd  %xmm0,0x10(%rdi)
movsd  %xmm3,0x18(%rdi)
ucomisd %xmm5,%xmm3
jbe    11dc <opt_med7_double+0xdc>
movsd  %xmm5,0x18(%rdi)
movsd  %xmm3,0x30(%rdi)
ucomisd %xmm2,%xmm4
jbe    11ea <opt_med7_double+0xea>
movsd  %xmm2,0x20(%rdi)
movsd  %xmm4,0x28(%rdi)
ucomisd %xmm2,%xmm1
jbe    11f8 <opt_med7_double+0xf8>
movsd  %xmm2,0x8(%rdi)
movsd  %xmm1,0x20(%rdi)
movapd %xmm1,%xmm0
ucomisd %xmm5,%xmm2
jbe    120a <opt_med7_double+0x10a>
movsd  %xmm5,0x8(%rdi)
movsd  %xmm2,0x18(%rdi)
ucomisd %xmm0,%xmm2
jbe    1218 <opt_med7_double+0x118>
movsd  %xmm0,0x18(%rdi)
movsd  %xmm2,0x20(%rdi)
ret

LLVM IR (-O0):
define double @opt_med7_double(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%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
store double* %0, double** %3
store i32 %1, i32* %4
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = load double*, double** %3
%22 = getelementptr inbounds double, double* %21, i64 5
%23 = load double, double* %22
%24 = fcmp ogt double %20, %23
br i1 %24, label %25, label %37
25: ; preds = %2
%26 = load double*, double** %3
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
store double %28, double* %5
%29 = load double*, double** %3
%30 = getelementptr inbounds double, double* %29, i64 5
%31 = load double, double* %30
%32 = load double*, double** %3
%33 = getelementptr inbounds double, double* %32, i64 0
store double %31, double* %33
%34 = load double, double* %5
%35 = load double*, double** %3
%36 = getelementptr inbounds double, double* %35, i64 5
store double %34, double* %36
br label %37
37: ; preds = %25, %2
%38 = load double*, double** %3
%39 = getelementptr inbounds double, double* %38, i64 0
%40 = load double, double* %39
%41 = load double*, double** %3
%42 = getelementptr inbounds double, double* %41, i64 3
%43 = load double, double* %42
%44 = fcmp ogt double %40, %43
br i1 %44, label %45, label %57
45: ; preds = %37
%46 = load double*, double** %3
%47 = getelementptr inbounds double, double* %46, i64 0
%48 = load double, double* %47
store double %48, double* %6
%49 = load double*, double** %3
%50 = getelementptr inbounds double, double* %49, i64 3
%51 = load double, double* %50
%52 = load double*, double** %3
%53 = getelementptr inbounds double, double* %52, i64 0
store double %51, double* %53
%54 = load double, double* %6
%55 = load double*, double** %3
%56 = getelementptr inbounds double, double* %55, i64 3
store double %54, double* %56
br label %57
57: ; preds = %45, %37
%58 = load double*, double** %3
%59 = getelementptr inbounds double, double* %58, i64 1
%60 = load double, double* %59
%61 = load double*, double** %3
%62 = getelementptr inbounds double, double* %61, i64 6
%63 = load double, double* %62
%64 = fcmp ogt double %60, %63
br i1 %64, label %65, label %77
65: ; preds = %57
%66 = load double*, double** %3
%67 = getelementptr inbounds double, double* %66, i64 1
%68 = load double, double* %67
store double %68, double* %7
%69 = load double*, double** %3
%70 = getelementptr inbounds double, double* %69, i64 6
%71 = load double, double* %70
%72 = load double*, double** %3
%73 = getelementptr inbounds double, double* %72, i64 1
store double %71, double* %73
%74 = load double, double* %7
%75 = load double*, double** %3
%76 = getelementptr inbounds double, double* %75, i64 6
store double %74, double* %76
br label %77
77: ; preds = %65, %57
%78 = load double*, double** %3
%79 = getelementptr inbounds double, double* %78, i64 2
%80 = load double, double* %79
%81 = load double*, double** %3
%82 = getelementptr inbounds double, double* %81, i64 4
%83 = load double, double* %82
%84 = fcmp ogt double %80, %83
br i1 %84, label %85, label %97
85: ; preds = %77
%86 = load double*, double** %3
%87 = getelementptr inbounds double, double* %86, i64 2
%88 = load double, double* %87
store double %88, double* %8
%89 = load double*, double** %3
%90 = getelementptr inbounds double, double* %89, i64 4
%91 = load double, double* %90
%92 = load double*, double** %3
%93 = getelementptr inbounds double, double* %92, i64 2
store double %91, double* %93
%94 = load double, double* %8
%95 = load double*, double** %3
%96 = getelementptr inbounds double, double* %95, i64 4
store double %94, double* %96
br label %97
97: ; preds = %85, %77
%98 = load double*, double** %3
%99 = getelementptr inbounds double, double* %98, i64 0
%100 = load double, double* %99
%101 = load double*, double** %3
%102 = getelementptr inbounds double, double* %101, i64 1
%103 = load double, double* %102
%104 = fcmp ogt double %100, %103
br i1 %104, label %105, label %117
105: ; preds = %97
%106 = load double*, double** %3
%107 = getelementptr inbounds double, double* %106, i64 0
%108 = load double, double* %107
store double %108, double* %9
%109 = load double*, double** %3
%110 = getelementptr inbounds double, double* %109, i64 1
%111 = load double, double* %110
%112 = load double*, double** %3
%113 = getelementptr inbounds double, double* %112, i64 0
store double %111, double* %113
%114 = load double, double* %9
%115 = load double*, double** %3
%116 = getelementptr inbounds double, double* %115, i64 1
store double %114, double* %116
br label %117
117: ; preds = %105, %97
%118 = load double*, double** %3
%119 = getelementptr inbounds double, double* %118, i64 3
%120 = load double, double* %119
%121 = load double*, double** %3
%122 = getelementptr inbounds double, double* %121, i64 5
%123 = load double, double* %122
%124 = fcmp ogt double %120, %123
br i1 %124, label %125, label %137
125: ; preds = %117
%126 = load double*, double** %3
%127 = getelementptr inbounds double, double* %126, i64 3
%128 = load double, double* %127
store double %128, double* %10
%129 = load double*, double** %3
%130 = getelementptr inbounds double, double* %129, i64 5
%131 = load double, double* %130
%132 = load double*, double** %3
%133 = getelementptr inbounds double, double* %132, i64 3
store double %131, double* %133
%134 = load double, double* %10
%135 = load double*, double** %3
%136 = getelementptr inbounds double, double* %135, i64 5
store double %134, double* %136
br label %137
137: ; preds = %125, %117
%138 = load double*, double** %3
%139 = getelementptr inbounds double, double* %138, i64 2
%140 = load double, double* %139
%141 = load double*, double** %3
%142 = getelementptr inbounds double, double* %141, i64 6
%143 = load double, double* %142
%144 = fcmp ogt double %140, %143
br i1 %144, label %145, label %157
145: ; preds = %137
%146 = load double*, double** %3
%147 = getelementptr inbounds double, double* %146, i64 2
%148 = load double, double* %147
store double %148, double* %11
%149 = load double*, double** %3
%150 = getelementptr inbounds double, double* %149, i64 6
%151 = load double, double* %150
%152 = load double*, double** %3
%153 = getelementptr inbounds double, double* %152, i64 2
store double %151, double* %153
%154 = load double, double* %11
%155 = load double*, double** %3
%156 = getelementptr inbounds double, double* %155, i64 6
store double %154, double* %156
br label %157
157: ; preds = %145, %137
%158 = load double*, double** %3
%159 = getelementptr inbounds double, double* %158, i64 2
%160 = load double, double* %159
%161 = load double*, double** %3
%162 = getelementptr inbounds double, double* %161, i64 3
%163 = load double, double* %162
%164 = fcmp ogt double %160, %163
br i1 %164, label %165, label %177
165: ; preds = %157
%166 = load double*, double** %3
%167 = getelementptr inbounds double, double* %166, i64 2
%168 = load double, double* %167
store double %168, double* %12
%169 = load double*, double** %3
%170 = getelementptr inbounds double, double* %169, i64 3
%171 = load double, double* %170
%172 = load double*, double** %3
%173 = getelementptr inbounds double, double* %172, i64 2
store double %171, double* %173
%174 = load double, double* %12
%175 = load double*, double** %3
%176 = getelementptr inbounds double, double* %175, i64 3
store double %174, double* %176
br label %177
177: ; preds = %165, %157
%178 = load double*, double** %3
%179 = getelementptr inbounds double, double* %178, i64 3
%180 = load double, double* %179
%181 = load double*, double** %3
%182 = getelementptr inbounds double, double* %181, i64 6
%183 = load double, double* %182
%184 = fcmp ogt double %180, %183
br i1 %184, label %185, label %197
185: ; preds = %177
%186 = load double*, double** %3
%187 = getelementptr inbounds double, double* %186, i64 3
%188 = load double, double* %187
store double %188, double* %13
%189 = load double*, double** %3
%190 = getelementptr inbounds double, double* %189, i64 6
%191 = load double, double* %190
%192 = load double*, double** %3
%193 = getelementptr inbounds double, double* %192, i64 3
store double %191, double* %193
%194 = load double, double* %13
%195 = load double*, double** %3
%196 = getelementptr inbounds double, double* %195, i64 6
store double %194, double* %196
br label %197
197: ; preds = %185, %177
%198 = load double*, double** %3
%199 = getelementptr inbounds double, double* %198, i64 4
%200 = load double, double* %199
%201 = load double*, double** %3
%202 = getelementptr inbounds double, double* %201, i64 5
%203 = load double, double* %202
%204 = fcmp ogt double %200, %203
br i1 %204, label %205, label %217
205: ; preds = %197
%206 = load double*, double** %3
%207 = getelementptr inbounds double, double* %206, i64 4
%208 = load double, double* %207
store double %208, double* %14
%209 = load double*, double** %3
%210 = getelementptr inbounds double, double* %209, i64 5
%211 = load double, double* %210
%212 = load double*, double** %3
%213 = getelementptr inbounds double, double* %212, i64 4
store double %211, double* %213
%214 = load double, double* %14
%215 = load double*, double** %3
%216 = getelementptr inbounds double, double* %215, i64 5
store double %214, double* %216
br label %217
217: ; preds = %205, %197
%218 = load double*, double** %3
%219 = getelementptr inbounds double, double* %218, i64 1
%220 = load double, double* %219
%221 = load double*, double** %3
%222 = getelementptr inbounds double, double* %221, i64 4
%223 = load double, double* %222
%224 = fcmp ogt double %220, %223
br i1 %224, label %225, label %237
225: ; preds = %217
%226 = load double*, double** %3
%227 = getelementptr inbounds double, double* %226, i64 1
%228 = load double, double* %227
store double %228, double* %15
%229 = load double*, double** %3
%230 = getelementptr inbounds double, double* %229, i64 4
%231 = load double, double* %230
%232 = load double*, double** %3
%233 = getelementptr inbounds double, double* %232, i64 1
store double %231, double* %233
%234 = load double, double* %15
%235 = load double*, double** %3
%236 = getelementptr inbounds double, double* %235, i64 4
store double %234, double* %236
br label %237
237: ; preds = %225, %217
%238 = load double*, double** %3
%239 = getelementptr inbounds double, double* %238, i64 1
%240 = load double, double* %239
%241 = load double*, double** %3
%242 = getelementptr inbounds double, double* %241, i64 3
%243 = load double, double* %242
%244 = fcmp ogt double %240, %243
br i1 %244, label %245, label %257
245: ; preds = %237
%246 = load double*, double** %3
%247 = getelementptr inbounds double, double* %246, i64 1
%248 = load double, double* %247
store double %248, double* %16
%249 = load double*, double** %3
%250 = getelementptr inbounds double, double* %249, i64 3
%251 = load double, double* %250
%252 = load double*, double** %3
%253 = getelementptr inbounds double, double* %252, i64 1
store double %251, double* %253
%254 = load double, double* %16
%255 = load double*, double** %3
%256 = getelementptr inbounds double, double* %255, i64 3
store double %254, double* %256
br label %257
257: ; preds = %245, %237
%258 = load double*, double** %3
%259 = getelementptr inbounds double, double* %258, i64 3
%260 = load double, double* %259
%261 = load double*, double** %3
%262 = getelementptr inbounds double, double* %261, i64 4
%263 = load double, double* %262
%264 = fcmp ogt double %260, %263
br i1 %264, label %265, label %277
265: ; preds = %257
%266 = load double*, double** %3
%267 = getelementptr inbounds double, double* %266, i64 3
%268 = load double, double* %267
store double %268, double* %17
%269 = load double*, double** %3
%270 = getelementptr inbounds double, double* %269, i64 4
%271 = load double, double* %270
%272 = load double*, double** %3
%273 = getelementptr inbounds double, double* %272, i64 3
store double %271, double* %273
%274 = load double, double* %17
%275 = load double*, double** %3
%276 = getelementptr inbounds double, double* %275, i64 4
store double %274, double* %276
br label %277
277: ; preds = %265, %257
%278 = load double*, double** %3
%279 = getelementptr inbounds double, double* %278, i64 3
%280 = load double, double* %279
ret double %280
}

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