#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ Swap(double **, int, int);
int ReduceNondominatedSet(double *front[], int noPoints, int objective,
                          double threshold) {
  int n;
  int i;
  n = noPoints;
  for (i = 0; i < n; i++)
    if (front[i][objective] <= threshold) {
      n--;
      Swap(front, i, n);
    }
  return n;
}


x86 assembly (clang, -O0):
<ReduceNondominatedSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    118f <ReduceNondominatedSet+0x7f>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     117c <ReduceNondominatedSet+0x6c>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <Swap@plt>
jmp    1181 <ReduceNondominatedSet+0x71>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1134 <ReduceNondominatedSet+0x24>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReduceNondominatedSet>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
test   %esi,%esi
jle    115e <ReduceNondominatedSet+0x4e>
mov    %rdi,%r14
movslq %edx,%r15
xor    %ebx,%ebx
movsd  %xmm0,(%rsp)
jmp    113c <ReduceNondominatedSet+0x2c>
nopl   0x0(%rax)
add    $0x1,%rbx
movslq %ebp,%rax
cmp    %rax,%rbx
jge    115e <ReduceNondominatedSet+0x4e>
mov    (%r14,%rbx,8),%rax
ucomisd (%rax,%r15,8),%xmm0
jb     1130 <ReduceNondominatedSet+0x20>
add    $0xffffffff,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <Swap@plt>
movsd  (%rsp),%xmm0
jmp    1130 <ReduceNondominatedSet+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ReduceNondominatedSet(double** %0, i32 %1, i32 %2, double %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %25
6: ; preds = %4
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %6, %20
%9 = phi i64 [ 0, %6 ], [ %22, %20 ]
%10 = phi i32 [ %1, %6 ], [ %21, %20 ]
%11 = getelementptr inbounds double*, double** %0, i64 %9
%12 = load double*, double** %11
%13 = getelementptr inbounds double, double* %12, i64 %7
%14 = load double, double* %13
%15 = fcmp ugt double %14, %3
br i1 %15, label %20, label %16
16: ; preds = %8
%17 = add nsw i32 %10, -1
%18 = trunc i64 %9 to i32
%19 = tail call i32 @Swap(double** %0, i32 %18, i32 %17)
br label %20
20: ; preds = %8, %16
%21 = phi i32 [ %17, %16 ], [ %10, %8 ]
%22 = add nuw nsw i64 %9, 1
%23 = sext i32 %21 to i64
%24 = icmp slt i64 %22, %23
br i1 %24, label %8, label %25
25: ; preds = %20, %4
%26 = phi i32 [ %1, %4 ], [ %21, %20 ]
ret i32 %26
}