int weaklyDominates(double *point1, double *point2, int no_objectives) {
  int i;
  int better;
  i = 0;
  better = 1;
  while (i < no_objectives && better) {
    better = point1[i] <= point2[i];
    i++;
  }
  return better;
}


x86 assembly (clang, -O0):
<weaklyDominates>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
cmp    -0x14(%rbp),%ecx
mov    %al,-0x1d(%rbp)
jge    1138 <weaklyDominates+0x38>
cmpl   $0x0,-0x1c(%rbp)
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1148 <weaklyDominates+0x48>
jmp    117f <weaklyDominates+0x7f>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111d <weaklyDominates+0x1d>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<weaklyDominates>:
test   %edx,%edx
jle    1135 <weaklyDominates+0x35>
mov    %edx,%eax
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
movsd  -0x8(%rdi,%rcx,8),%xmm0
movsd  -0x8(%rsi,%rcx,8),%xmm1
cmp    %rax,%rcx
jae    112b <weaklyDominates+0x2b>
add    $0x1,%rcx
ucomisd %xmm0,%xmm1
jae    1110 <weaklyDominates+0x10>
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @weaklyDominates(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
store i32 0, i32* %7
store i32 1, i32* %8
br label %9
9: ; preds = %18, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %8
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %13, %9
%17 = phi i1 [ false, %9 ], [ %15, %13 ]
br i1 %17, label %18, label %33
18: ; preds = %16
%19 = load double*, double** %4
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = load double, double* %22
%24 = load double*, double** %5
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
%28 = load double, double* %27
%29 = fcmp ole double %23, %28
%30 = zext i1 %29 to i32
store i32 %30, i32* %8
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %9
33: ; preds = %16
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @weaklyDominates(double* nocapture %0, double* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %14, %7 ]
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %1, i64 %8
%12 = load double, double* %11
%13 = fcmp ole double %10, %12
%14 = add nuw nsw i64 %8, 1
%15 = icmp ult i64 %14, %6
%16 = select i1 %15, i1 %13, i1 false
br i1 %16, label %7, label %17
17: ; preds = %7
%18 = zext i1 %13 to i32
br label %19
19: ; preds = %17, %3
%20 = phi i32 [ 1, %3 ], [ %18, %17 ]
ret i32 %20
}