// File: canzarlab[P]Trajan/geno/augmentedLagrangian.cpp
// Function: AugmentedNLP::computeConstraintError()
void computeConstraintError()
  {
    _constraintError = _constraintValues;

    // for equality constraints
    _constraintError.head(_mEqualities) -= _cl.head(_mEqualities);

    for (size_t i = 0; i < _mInequalities; ++i)
    {
      if (_cType[i+_mEqualities] == 2)
      {
	// lower bound not -INF
	_constraintError(i+_mEqualities) -= _cl(i+_mEqualities);
      }
      if (_cType[i+_mEqualities] == 3)
      {
	// lower bound not -INF and upper not INF
	double err = std::max(_constraintError(i+_mEqualities) - _cu(i + _mEqualities), 0.0);
	err = std::min(_constraintError(i+_mEqualities) - _cl(i+_mEqualities), err);
	_constraintError(i+_mEqualities) = err;
	//	std::cout << "c = " << _constraintError(i+_mEqualities) << std::endl;
	//	std::cout << "e = " << err << std::endl;
	//	std::cout << "lb= " << _cl(i+_mEqualities) << std::endl;
	//	std::cout << "ub= " << _cu(i+_mEqualities) << std::endl;
      }
      if (_cType[i+_mEqualities] == 4)
      {
	// upper bound not INF
	_constraintError(i+_mEqualities) -= _cu(i+_mEqualities);
      }
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
movq %rdi, %rsi
addq $0x30, %rsi
addq $0x90, %rdi
callq 0x145a0
movq -0xa8(%rbp), %rax
movq %rax, %rsi
addq $0x58, %rsi
movq 0x20(%rax), %rdx
leaq -0x40(%rbp), %rdi
callq 0x14810
movq -0xa8(%rbp), %rax
movq %rax, %rsi
addq $0x90, %rsi
movq 0x20(%rax), %rdx
leaq -0x78(%rbp), %rdi
callq 0x14810
leaq -0x78(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x16320
movq $0x0, -0x80(%rbp)
movq -0xa8(%rbp), %rcx
movq -0x80(%rbp), %rax
cmpq 0x28(%rcx), %rax
jae 0x15f20
movq -0xa8(%rbp), %rax
movq %rax, %rdi
addq $0x78, %rdi
movq -0x80(%rbp), %rsi
addq 0x20(%rax), %rsi
callq 0x145d0
cmpl $0x2, (%rax)
jne 0x15d2c
movq -0xa8(%rbp), %rax
movq %rax, %rdi
addq $0x58, %rdi
movq -0x80(%rbp), %rsi
addq 0x20(%rax), %rsi
callq 0x145f0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0xb0(%rbp)
movq %rax, %rdi
addq $0x90, %rdi
movq -0x80(%rbp), %rsi
addq 0x20(%rax), %rsi
callq 0x145f0
movsd -0xb0(%rbp), %xmm1
movsd (%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movq -0xa8(%rbp), %rax
movq %rax, %rdi
addq $0x78, %rdi
movq -0x80(%rbp), %rsi
addq 0x20(%rax), %rsi
callq 0x145d0
cmpl $0x3, (%rax)
jne 0x15e91
movq -0xa8(%rbp), %rax
movq %rax, %rdi
addq $0x90, %rdi
movq -0x80(%rbp), %rsi
addq 0x20(%rax), %rsi
callq 0x145f0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0xc8(%rbp)
movq %rax, %rdi
addq $0x68, %rdi
movq -0x80(%rbp), %rsi
addq 0x20(%rax), %rsi
callq 0x145f0
movsd -0xc8(%rbp), %xmm0
subsd (%rax), %xmm0
movsd %xmm0, -0x90(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x14920
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0x88(%rbp)
movq %rax, %rdi
addq $0x90, %rdi
movq -0x80(%rbp), %rsi
addq 0x20(%rax), %rsi
callq 0x145f0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0xc0(%rbp)
movq %rax, %rdi
addq $0x58, %rdi
movq -0x80(%rbp), %rsi
addq 0x20(%rax), %rsi
callq 0x145f0
movsd -0xc0(%rbp), %xmm0
subsd (%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x148e0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x88(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
movq %rax, %rdi
addq $0x90, %rdi
movq -0x80(%rbp), %rsi
addq 0x20(%rax), %rsi
callq 0x145f0
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0xa8(%rbp), %rax
movq %rax, %rdi
addq $0x78, %rdi
movq -0x80(%rbp), %rsi
addq 0x20(%rax), %rsi
callq 0x145d0
cmpl $0x4, (%rax)
jne 0x15f0d
movq -0xa8(%rbp), %rax
movq %rax, %rdi
addq $0x68, %rdi
movq -0x80(%rbp), %rsi
addq 0x20(%rax), %rsi
callq 0x145f0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0xd0(%rbp)
movq %rax, %rdi
addq $0x90, %rdi
movq -0x80(%rbp), %rsi
addq 0x20(%rax), %rsi
callq 0x145f0
movsd -0xd0(%rbp), %xmm1
movsd (%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rax)
jmp 0x15f0f
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x15c9b
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax)