char betterFitness(double objective_value_x, double constraint_value_x,
                   double objective_value_y, double constraint_value_y) {
  char 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)
movb   $0x0,-0x21(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1162 <betterFitness+0x62>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    115d <betterFitness+0x5d>
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1158 <betterFitness+0x58>
movb   $0x1,-0x21(%rbp)
jmp    115d <betterFitness+0x5d>
jmp    119b <betterFitness+0x9b>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    117d <betterFitness+0x7d>
movb   $0x1,-0x21(%rbp)
jmp    1196 <betterFitness+0x96>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1191 <betterFitness+0x91>
movb   $0x1,-0x21(%rbp)
jmp    1196 <betterFitness+0x96>
jmp    119b <betterFitness+0x9b>
movsbl -0x21(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<betterFitness>:
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm1
jbe    111b <betterFitness+0x1b>
ucomisd %xmm4,%xmm3
seta   %cl
ucomisd %xmm1,%xmm3
seta   %al
and    %cl,%al
ret
mov    $0x1,%al
ucomisd %xmm4,%xmm3
ja     112b <betterFitness+0x2b>
ucomisd %xmm2,%xmm0
ja     112b <betterFitness+0x2b>
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @betterFitness(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i8
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
store i8 0, i8* %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 i8 1, i8* %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 i8 1, i8* %9
br label %32
26: ; preds = %22
%27 = load double, double* %5
%28 = load double, double* %7
%29 = fcmp ogt double %27, %28
br i1 %29, label %30, label %31
30: ; preds = %26
store i8 1, i8* %9
br label %31
31: ; preds = %30, %26
br label %32
32: ; preds = %31, %25
br label %33
33: ; preds = %32, %21
%34 = load i8, i8* %9
ret i8 %34
}

LLVM IR (-O2):
define signext i8 @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 i8
br label %15
11: ; preds = %4
br i1 %6, label %15, label %12
12: ; preds = %11
%13 = fcmp ogt double %0, %2
br i1 %13, label %14, label %15
14: ; preds = %12
br label %15
15: ; preds = %7, %11, %14, %12
%16 = phi i8 [ 1, %14 ], [ 0, %12 ], [ 1, %11 ], [ %10, %7 ]
ret i8 %16
}