// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNSystemOfEquations.cpp
// Function: gaps::RNSystemOfEquations::RNSystemOfEquations(gaps::RNSystemOfEquations const&)
RNSystemOfEquations::
RNSystemOfEquations(const RNSystemOfEquations& system)
  : lower_bounds(NULL),
    upper_bounds(NULL),
    nvariables(system.nvariables),
    equations()
{
  // Allocate memory for variable counting
  index_to_variable = new int [ nvariables ];
  variable_to_index = new int [ nvariables ];
  variable_marks = new int [ nvariables ];
  for (int i = 0; i < nvariables; i++) variable_marks[i] = 0;
  current_mark = 1;

  // Copy equations
  equations.Resize(system.NEquations());
  for (int i = 0; i < system.NEquations(); i++) {
    RNEquation *equation = system.Equation(i);
    InsertEquation(new RNEquation(*equation));
  }

  // Copy lower bounds
  if (system.lower_bounds) {
    lower_bounds = new RNScalar [ nvariables ];
    for (int i = 0; i < nvariables; i++) {
      lower_bounds[i] = system.lower_bounds[i];
    }
  }
  
  // Copy upper bounds
  if (system.upper_bounds) {
    upper_bounds = new RNScalar [ nvariables ];
    for (int i = 0; i < nvariables; i++) {
      upper_bounds[i] = system.upper_bounds[i];
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movl 0x30(%rsi), %eax
movl %eax, 0x30(%rdi)
addq $0x38, %rdi
movq %rdi, 0x8(%rsp)
callq 0x2477e
movslq 0x30(%r15), %r13
leaq (,%r13,4), %r12
testq %r13, %r13
pushq $-0x1
popq %rax
cmovsq %rax, %r12
movq %r12, %rdi
callq 0x4030
movq %rax, (%r15)
movq %r12, %rdi
callq 0x4030
movq %rax, 0x8(%r15)
movq %r12, %rdi
callq 0x4030
leaq 0x20(%r15), %rcx
movq %rcx, 0x10(%rsp)
movq %rax, 0x10(%r15)
xorl %ecx, %ecx
testl %r13d, %r13d
cmovlel %ecx, %r13d
cmpq %rcx, %r13
je 0x239f6
andl $0x0, (%rax,%rcx,4)
incq %rcx
jmp 0x239e8
movl $0x1, 0x18(%r15)
movl 0x44(%r14), %esi
movq 0x8(%rsp), %rdi
callq 0x24864
xorl %ebx, %ebx
pushq $0x40
popq %r12
movslq 0x44(%r14), %rax
cmpq %rax, %rbx
jge 0x23a49
movq 0x38(%r14), %rax
movq (%rax,%rbx,8), %rbp
movq %r12, %rdi
callq 0x4280
movq %rax, %r13
movq %rax, %rdi
movq %rbp, %rsi
callq 0x24494
movq %r15, %rdi
movq %r13, %rsi
callq 0x23b0e
incq %rbx
jmp 0x23a12
cmpq $0x0, 0x20(%r14)
je 0x23a92
movslq 0x30(%r15), %rbx
leaq (,%rbx,8), %rdi
testq %rbx, %rbx
pushq $-0x1
popq %rax
cmovsq %rax, %rdi
callq 0x4030
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movq 0x20(%r14), %rcx
xorl %edx, %edx
testl %ebx, %ebx
cmovlel %edx, %ebx
cmpq %rdx, %rbx
je 0x23a92
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, (%rax,%rdx,8)
incq %rdx
jmp 0x23a7e
cmpq $0x0, 0x28(%r14)
je 0x23ad7
movslq 0x30(%r15), %rbx
leaq (,%rbx,8), %rdi
testq %rbx, %rbx
pushq $-0x1
popq %rax
cmovsq %rax, %rdi
callq 0x4030
movq %rax, 0x28(%r15)
movq 0x28(%r14), %rcx
xorl %edx, %edx
testl %ebx, %ebx
cmovlel %edx, %ebx
cmpq %rdx, %rbx
je 0x23ad7
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, (%rax,%rdx,8)
incq %rdx
jmp 0x23ac3
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x23af8
movq %rax, %r14
pushq $0x40
popq %rsi
movq %r13, %rdi
callq 0x4290
jmp 0x23afb
movq %rax, %r14
movq 0x8(%rsp), %rdi
callq 0x247ec
movq %r14, %rdi
callq 0x44d0
nop