double dmax1(double a, double b, double c, double e, double f) {
  double d;
  d = (((a) > (b)) ? (a) : (b));
  d = (((d) > (c)) ? (d) : (c));
  d = (((d) > (e)) ? (d) : (e));
  d = (((d) > (f)) ? (d) : (f));
  return d;
}


x86 assembly (clang, -O0):
<dmax1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113c <dmax1+0x3c>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1146 <dmax1+0x46>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    116f <dmax1+0x6f>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1179 <dmax1+0x79>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    11a2 <dmax1+0xa2>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    11ac <dmax1+0xac>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    11d5 <dmax1+0xd5>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    11df <dmax1+0xdf>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmax1>:
maxsd  %xmm1,%xmm0
maxsd  %xmm2,%xmm0
maxsd  %xmm3,%xmm0
maxsd  %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @dmax1(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fcmp ogt double %12, %13
br i1 %14, label %15, label %17
15: ; preds = %5
%16 = load double, double* %6
br label %19
17: ; preds = %5
%18 = load double, double* %7
br label %19
19: ; preds = %17, %15
%20 = phi double [ %16, %15 ], [ %18, %17 ]
store double %20, double* %11
%21 = load double, double* %11
%22 = load double, double* %8
%23 = fcmp ogt double %21, %22
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = load double, double* %11
br label %28
26: ; preds = %19
%27 = load double, double* %8
br label %28
28: ; preds = %26, %24
%29 = phi double [ %25, %24 ], [ %27, %26 ]
store double %29, double* %11
%30 = load double, double* %11
%31 = load double, double* %9
%32 = fcmp ogt double %30, %31
br i1 %32, label %33, label %35
33: ; preds = %28
%34 = load double, double* %11
br label %37
35: ; preds = %28
%36 = load double, double* %9
br label %37
37: ; preds = %35, %33
%38 = phi double [ %34, %33 ], [ %36, %35 ]
store double %38, double* %11
%39 = load double, double* %11
%40 = load double, double* %10
%41 = fcmp ogt double %39, %40
br i1 %41, label %42, label %44
42: ; preds = %37
%43 = load double, double* %11
br label %46
44: ; preds = %37
%45 = load double, double* %10
br label %46
46: ; preds = %44, %42
%47 = phi double [ %43, %42 ], [ %45, %44 ]
store double %47, double* %11
%48 = load double, double* %11
ret double %48
}

LLVM IR (-O2):
define double @dmax1(double %0, double %1, double %2, double %3, double %4) {
%6 = fcmp ogt double %0, %1
%7 = select i1 %6, double %0, double %1
%8 = fcmp ogt double %7, %2
%9 = select i1 %8, double %7, double %2
%10 = fcmp ogt double %9, %3
%11 = select i1 %10, double %9, double %3
%12 = fcmp ogt double %11, %4
%13 = select i1 %12, double %11, double %4
ret double %13
}