double DEVlimvds(vnew, vold)
double vnew;
double vold;
{
  if (vold >= 3.5) {
    if (vnew > vold) {
      vnew = ((vnew) < ((3 * vold) + 2) ? (vnew) : ((3 * vold) + 2));
    } else {
      if (vnew < 3.5) {
        vnew = ((vnew) > (2) ? (vnew) : (2));
      }
    }
  } else {
    if (vnew > vold) {
      vnew = ((vnew) < (4) ? (vnew) : (4));
    } else {
      vnew = ((vnew) > (-.5) ? (vnew) : (-.5));
    }
  }
  return (vnew);
}


x86 assembly (clang, -O0):
<DEVlimvds>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1200 <DEVlimvds+0x100>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11a1 <DEVlimvds+0xa1>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xed9(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xec5(%rip),%xmm2
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1170 <DEVlimvds+0x70>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1192 <DEVlimvds+0x92>
movsd  -0x10(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11fb <DEVlimvds+0xfb>
movsd  0xe57(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11f6 <DEVlimvds+0xf6>
movsd  -0x8(%rbp),%xmm0
movsd  0xe57(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11da <DEVlimvds+0xda>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11ec <DEVlimvds+0xec>
movsd  0xe36(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11ec <DEVlimvds+0xec>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11fb <DEVlimvds+0xfb>
jmp    129a <DEVlimvds+0x19a>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1253 <DEVlimvds+0x153>
movsd  0xdf8(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1232 <DEVlimvds+0x132>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1244 <DEVlimvds+0x144>
movsd  0xdd6(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1244 <DEVlimvds+0x144>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1295 <DEVlimvds+0x195>
movsd  -0x8(%rbp),%xmm0
movsd  0xda8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1279 <DEVlimvds+0x179>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    128b <DEVlimvds+0x18b>
movsd  0xd87(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    128b <DEVlimvds+0x18b>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    129a <DEVlimvds+0x19a>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DEVlimvds>:
ucomisd 0xef8(%rip),%xmm1
jae    1119 <DEVlimvds+0x19>
ucomisd %xmm1,%xmm0
jbe    1134 <DEVlimvds+0x34>
minsd  0xf08(%rip),%xmm0
ret
ucomisd %xmm1,%xmm0
jbe    113d <DEVlimvds+0x3d>
mulsd  0xee9(%rip),%xmm1
addsd  0xed9(%rip),%xmm1
minsd  %xmm1,%xmm0
ret
maxsd  0xedc(%rip),%xmm0
ret
movsd  0xebb(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    113c <DEVlimvds+0x3c>
maxsd  0xeb5(%rip),%xmm0
ret

LLVM IR (-O0):
define double @DEVlimvds(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp oge double %5, 3.500000e+00
br i1 %6, label %7, label %36
7: ; preds = %2
%8 = load double, double* %3
%9 = load double, double* %4
%10 = fcmp ogt double %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %13, double 2.000000e+00)
%15 = fcmp olt double %12, %14
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = load double, double* %3
br label %21
18: ; preds = %11
%19 = load double, double* %4
%20 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %19, double 2.000000e+00)
br label %21
21: ; preds = %18, %16
%22 = phi double [ %17, %16 ], [ %20, %18 ]
store double %22, double* %3
br label %35
23: ; preds = %7
%24 = load double, double* %3
%25 = fcmp olt double %24, 3.500000e+00
br i1 %25, label %26, label %34
26: ; preds = %23
%27 = load double, double* %3
%28 = fcmp ogt double %27, 2.000000e+00
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = load double, double* %3
br label %32
31: ; preds = %26
br label %32
32: ; preds = %31, %29
%33 = phi double [ %30, %29 ], [ 2.000000e+00, %31 ]
store double %33, double* %3
br label %34
34: ; preds = %32, %23
br label %35
35: ; preds = %34, %21
br label %57
36: ; preds = %2
%37 = load double, double* %3
%38 = load double, double* %4
%39 = fcmp ogt double %37, %38
br i1 %39, label %40, label %48
40: ; preds = %36
%41 = load double, double* %3
%42 = fcmp olt double %41, 4.000000e+00
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = load double, double* %3
br label %46
45: ; preds = %40
br label %46
46: ; preds = %45, %43
%47 = phi double [ %44, %43 ], [ 4.000000e+00, %45 ]
store double %47, double* %3
br label %56
48: ; preds = %36
%49 = load double, double* %3
%50 = fcmp ogt double %49, -5.000000e-01
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = load double, double* %3
br label %54
53: ; preds = %48
br label %54
54: ; preds = %53, %51
%55 = phi double [ %52, %51 ], [ -5.000000e-01, %53 ]
store double %55, double* %3
br label %56
56: ; preds = %54, %46
br label %57
57: ; preds = %56, %35
%58 = load double, double* %3
ret double %58
}

LLVM IR (-O2):
define double @DEVlimvds(double %0, double %1) {
%3 = fcmp ult double %1, 3.500000e+00
%4 = fcmp ogt double %0, %1
br i1 %3, label %15, label %5
5: ; preds = %2
br i1 %4, label %6, label %10
6: ; preds = %5
%7 = tail call double @llvm.fmuladd.f64(double %1, double 3.000000e+00, double 2.000000e+00)
%8 = fcmp ogt double %7, %0
%9 = select i1 %8, double %0, double %7
br label %22
10: ; preds = %5
%11 = fcmp olt double %0, 3.500000e+00
br i1 %11, label %12, label %22
12: ; preds = %10
%13 = fcmp ogt double %0, 2.000000e+00
%14 = select i1 %13, double %0, double 2.000000e+00
br label %22
15: ; preds = %2
br i1 %4, label %16, label %19
16: ; preds = %15
%17 = fcmp olt double %0, 4.000000e+00
%18 = select i1 %17, double %0, double 4.000000e+00
br label %22
19: ; preds = %15
%20 = fcmp ogt double %0, -5.000000e-01
%21 = select i1 %20, double %0, double -5.000000e-01
br label %22
22: ; preds = %16, %19, %6, %12, %10
%23 = phi double [ %9, %6 ], [ %14, %12 ], [ %0, %10 ], [ %18, %16 ], [ %21, %19 ]
ret double %23
}