short betterFitness(double objective_value_x, double constraint_value_x,
                    double objective_value_y, double constraint_value_y) {
  short result;
  result = 0;
  if (constraint_value_x > 0) {
    if (constraint_value_y > 0) {
      if (constraint_value_x < constraint_value_y)
        result = 1;
    }
  } else {
    if (constraint_value_y > 0)
      result = 1;
    else {
      if (objective_value_x < objective_value_y)
        result = 1;
    }
  }
  return (result);
}


x86 assembly (clang, -O0):
<betterFitness>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movw   $0x0,-0x22(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1166 <betterFitness+0x66>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1161 <betterFitness+0x61>
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115c <betterFitness+0x5c>
movw   $0x1,-0x22(%rbp)
jmp    1161 <betterFitness+0x61>
jmp    11a7 <betterFitness+0xa7>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1183 <betterFitness+0x83>
movw   $0x1,-0x22(%rbp)
jmp    11a2 <betterFitness+0xa2>
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    119d <betterFitness+0x9d>
movw   $0x1,-0x22(%rbp)
jmp    11a2 <betterFitness+0xa2>
jmp    11a7 <betterFitness+0xa7>
movswl -0x22(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<betterFitness>:
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm1
jbe    111e <betterFitness+0x1e>
ucomisd %xmm4,%xmm3
seta   %al
ucomisd %xmm1,%xmm3
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret
mov    $0x1,%ax
ucomisd %xmm4,%xmm3
ja     1130 <betterFitness+0x30>
ucomisd %xmm0,%xmm2
ja     1130 <betterFitness+0x30>
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i16 @betterFitness(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i16
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
store i16 0, i16* %9
%10 = load double, double* %6
%11 = fcmp ogt double %10, 0.000000e+00
br i1 %11, label %12, label %22
12: ; preds = %4
%13 = load double, double* %8
%14 = fcmp ogt double %13, 0.000000e+00
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load double, double* %6
%17 = load double, double* %8
%18 = fcmp olt double %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15
store i16 1, i16* %9
br label %20
20: ; preds = %19, %15
br label %21
21: ; preds = %20, %12
br label %33
22: ; preds = %4
%23 = load double, double* %8
%24 = fcmp ogt double %23, 0.000000e+00
br i1 %24, label %25, label %26
25: ; preds = %22
store i16 1, i16* %9
br label %32
26: ; preds = %22
%27 = load double, double* %5
%28 = load double, double* %7
%29 = fcmp olt double %27, %28
br i1 %29, label %30, label %31
30: ; preds = %26
store i16 1, i16* %9
br label %31
31: ; preds = %30, %26
br label %32
32: ; preds = %31, %25
br label %33
33: ; preds = %32, %21
%34 = load i16, i16* %9
ret i16 %34
}

LLVM IR (-O2):
define signext i16 @betterFitness(double %0, double %1, double %2, double %3) {
%5 = fcmp ogt double %1, 0.000000e+00
%6 = fcmp ogt double %3, 0.000000e+00
br i1 %5, label %7, label %11
7: ; preds = %4
%8 = fcmp olt double %1, %3
%9 = and i1 %6, %8
%10 = zext i1 %9 to i16
br label %15
11: ; preds = %4
br i1 %6, label %15, label %12
12: ; preds = %11
%13 = fcmp olt double %0, %2
br i1 %13, label %14, label %15
14: ; preds = %12
br label %15
15: ; preds = %7, %11, %14, %12
%16 = phi i16 [ 1, %14 ], [ 0, %12 ], [ 1, %11 ], [ %10, %7 ]
ret i16 %16
}