LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Subtract(double)
void RNAlgebraic::
Subtract(RNScalar value)
{
  // Just checking
  assert(IsValid());

  // Check value
  if (value == 0.0) return;

  // Subtract scalar
  switch(operation) {
  case RN_ZERO_OPERATION: 
    operation = RN_POLYNOMIAL_OPERATION;
    polynomial = new RNPolynomial(-value, 0);
    return;
    
  case RN_POLYNOMIAL_OPERATION:
    polynomial->Subtract(value);
    return;
    
  default: {
    RNAlgebraic *e = new RNAlgebraic(operation, operands[0], operands[1]);
    operation = RN_SUBTRACT_OPERATION;
    operands[0] = e;
    operands[1] = new RNAlgebraic(value, 0);
    return; }
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x222b1
jp 0x222b1
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rdi, %rbx
movl 0x8(%rdi), %ebp
cmpl $0x1, %ebp
je 0x222fb
movapd %xmm0, (%rsp)
testl %ebp, %ebp
jne 0x2230c
movl $0x1, 0x8(%rbx)
pushq $0x10
popq %rdi
callq 0x4280
movq %rax, %r14
movapd (%rsp), %xmm0
xorpd 0x2ed7c(%rip), %xmm0    # 0x51060
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1e996
movq %r14, 0x20(%rbx)
jmp 0x222a8
movq 0x20(%rbx), %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x7966
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r14
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
movq %rax, %rdi
movl %ebp, %esi
callq 0x215b4
movl $0x3, 0x8(%rbx)
movq %r14, 0x10(%rbx)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r14
movq %rax, %rdi
movapd (%rsp), %xmm0
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x20266
movq %r14, 0x18(%rbx)
jmp 0x222a8
jmp 0x22360
movq %rax, %rbx
pushq $0x28
jmp 0x2236c
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Divide(double)
void RNAlgebraic::
Divide(RNScalar value)
{
  // Just checking
  assert(IsValid());

  // Check value
  if (value == 0.0) {
    if (IsZero()) {
      Empty();
    }
    else {
      Empty();
      operation = RN_POLYNOMIAL_OPERATION;
      polynomial = new RNPolynomial(RN_INFINITY, 0);
    }
  }
  else if (value != 1.0) {
    switch(operation) {
    case RN_ZERO_OPERATION: 
      return;
      
    case RN_POLYNOMIAL_OPERATION:
      polynomial->Divide(value);
      return;
    
    default: {
      RNAlgebraic *e = new RNAlgebraic(operation, operands[0], operands[1]);
      operation = RN_DIVIDE_OPERATION;
      operands[0] = new RNAlgebraic(value, 0);
      operands[1] = e;
      return; }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x223e2
jp 0x223e2
movq %rbx, %rdi
callq 0x20144
movl %eax, %ebp
movq %rbx, %rdi
callq 0x22022
testl %ebp, %ebp
jne 0x2245f
movl $0x1, 0x8(%rbx)
pushq $0x10
popq %rdi
callq 0x4280
movq %rax, %r14
leaq 0x54ff1(%rip), %rax     # 0x773b8
movsd (%rax), %xmm0
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1e996
movq %r14, 0x20(%rbx)
jmp 0x2245f
ucomisd 0x2ec26(%rip), %xmm0    # 0x51010
jne 0x223ee
jnp 0x2245f
movl 0x8(%rbx), %ebp
testl %ebp, %ebp
je 0x2245f
cmpl $0x1, %ebp
jne 0x2240d
movq 0x20(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1f096
movsd %xmm0, (%rsp)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r14
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
movq %rax, %rdi
movl %ebp, %esi
callq 0x215b4
movl $0x5, 0x8(%rbx)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r15
movq %rax, %rdi
movsd (%rsp), %xmm0
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x20266
movq %r15, 0x10(%rbx)
movq %r14, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r15, %rdi
jmp 0x22485
movq %rax, %rbx
pushq $0x28
jmp 0x22481
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Add(gaps::RNPolynomial const&)
void RNAlgebraic::
Add(const RNPolynomial& value)
{
  // Just checking
  assert(IsValid());

  // Check value
  if (value.IsZero()) return;

  // Add scalar
  switch(operation) {
  case RN_ZERO_OPERATION: 
    operation = RN_POLYNOMIAL_OPERATION;
    polynomial = new RNPolynomial(value);
    return;

  case RN_POLYNOMIAL_OPERATION:
    polynomial->Add(value);
    return;

  default: {
    RNAlgebraic *e = new RNAlgebraic(operation, operands[0], operands[1]);
    operation = RN_ADD_OPERATION;
    operands[0] = new RNAlgebraic(value, 0);
    operands[1] = e;
    return; }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1ee0e
testl %eax, %eax
je 0x224b5
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbx), %ebp
cmpl $0x1, %ebp
je 0x224e4
testl %ebp, %ebp
jne 0x224f8
movl $0x1, 0x8(%rbx)
pushq $0x10
popq %rdi
callq 0x4280
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x1e8ae
movq %r15, 0x20(%rbx)
jmp 0x224ac
movq 0x20(%rbx), %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1f0d0
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r15
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
movq %rax, %rdi
movl %ebp, %esi
callq 0x215b4
movl $0x2, 0x8(%rbx)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x20302
movq %r12, 0x10(%rbx)
movq %r15, 0x18(%rbx)
jmp 0x224ac
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r12, %rdi
jmp 0x2255a
movq %rax, %rbx
pushq $0x28
jmp 0x22556
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r15, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Subtract(gaps::RNPolynomial const&)
void RNAlgebraic::
Subtract(const RNPolynomial& value)
{
  // Just checking
  assert(IsValid());

  // Check value
  if (value.IsZero()) return;

  // Subtract scalar
  switch(operation) {
  case RN_ZERO_OPERATION: 
    operation = RN_POLYNOMIAL_OPERATION;
    polynomial = new RNPolynomial(value);
    polynomial->Negate();
    return;
    
  case RN_POLYNOMIAL_OPERATION:
    polynomial->Subtract(value);
    return;
    
  default: {
    RNAlgebraic *e = new RNAlgebraic(operation, operands[0], operands[1]);
    operation = RN_SUBTRACT_OPERATION;
    operands[0] = e;
    operands[1] = new RNAlgebraic(value, 0);
    return; }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1ee0e
testl %eax, %eax
je 0x2258c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbx), %ebp
cmpl $0x1, %ebp
je 0x225cb
testl %ebp, %ebp
jne 0x225e1
movl $0x1, 0x8(%rbx)
pushq $0x10
popq %rdi
callq 0x4280
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x1e8ae
movq %r15, 0x20(%rbx)
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1f02e
movq 0x20(%rbx), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1f122
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r15
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
movq %rax, %rdi
movl %ebp, %esi
callq 0x215b4
movl $0x3, 0x8(%rbx)
movq %r15, 0x10(%rbx)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x20302
movq %r15, 0x18(%rbx)
jmp 0x22581
jmp 0x2262a
movq %rax, %rbx
pushq $0x28
jmp 0x22636
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r15, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Multiply(gaps::RNPolynomial const&)
void RNAlgebraic::
Multiply(const RNPolynomial& value)
{
  // Just checking
  assert(IsValid());

  // Check value 
  if (value.IsZero()) {
    Empty();
  }
  else if (!value.IsOne()) {
    switch(operation) {
    case RN_ZERO_OPERATION: 
      return;
    
    case RN_POLYNOMIAL_OPERATION:
      assert(polynomial);
      if (TRUE || (value.NTerms() == 1) || (polynomial->NTerms() == 1)) {
        polynomial->Multiply(value);
      }
      else {
        operation = RN_MULTIPLY_OPERATION;
        operands[0] = new RNAlgebraic(polynomial);
        operands[1] = new RNAlgebraic(value, 0);
        polynomial = NULL;
      }
      return;
    
    default: {
      RNAlgebraic *e = new RNAlgebraic(operation, operands[0], operands[1]);
      operation = RN_MULTIPLY_OPERATION;
      operands[0] = new RNAlgebraic(value, 0);
      operands[1] = e;
      return; }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1ee0e
testl %eax, %eax
je 0x22672
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x22022
movq %r14, %rdi
callq 0x1ee18
testl %eax, %eax
je 0x22687
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbx), %ebp
testl %ebp, %ebp
je 0x2267e
cmpl $0x1, %ebp
jne 0x226a7
movq 0x20(%rbx), %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1f17a
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r15
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
movq %rax, %rdi
movl %ebp, %esi
callq 0x215b4
movl $0x4, 0x8(%rbx)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x20302
movq %r12, 0x10(%rbx)
movq %r15, 0x18(%rbx)
jmp 0x2267e
movq %rax, %rbx
movq %r12, %r15
jmp 0x226f6
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r15, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Divide(gaps::RNPolynomial const&)
void RNAlgebraic::
Divide(const RNPolynomial& value)
{
  // Just checking
  assert(IsValid());

  // Check value
  if (value.IsZero()) {
    if (IsZero()) {
      Empty();
    }
    else {
      Empty();
      operation = RN_POLYNOMIAL_OPERATION;
      polynomial = new RNPolynomial(RN_INFINITY, 0);
    }
  }
  else if (!value.IsOne()){
    switch(operation) {
    case RN_ZERO_OPERATION: 
      return;
      
    case RN_POLYNOMIAL_OPERATION:
      operation = RN_DIVIDE_OPERATION;
      operands[0] = new RNAlgebraic(polynomial);
      operands[1] = new RNAlgebraic(value, 0);
      polynomial = NULL;
      return;
    
    default: {
      RNAlgebraic *e = new RNAlgebraic(operation, operands[0], operands[1]);
      operation = RN_DIVIDE_OPERATION;
      operands[0] = new RNAlgebraic(value, 0);
      operands[1] = e;
      return; }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1ee0e
testl %eax, %eax
je 0x2276e
movq %rbx, %rdi
callq 0x20144
movl %eax, %ebp
movq %rbx, %rdi
callq 0x22022
testl %ebp, %ebp
jne 0x2277a
movl $0x1, 0x8(%rbx)
pushq $0x10
popq %rdi
callq 0x4280
movq %rax, %r14
leaq 0x54c65(%rip), %rax     # 0x773b8
movsd (%rax), %xmm0
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1e996
movq %r14, 0x20(%rbx)
jmp 0x2277a
movq %r14, %rdi
callq 0x1ee18
testl %eax, %eax
je 0x22783
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbx), %ebp
testl %ebp, %ebp
je 0x2277a
cmpl $0x1, %ebp
jne 0x227d2
movl $0x5, 0x8(%rbx)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r15
movq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x20064
movq %r15, 0x10(%rbx)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x20302
movq %r15, 0x18(%rbx)
andq $0x0, 0x20(%rbx)
jmp 0x2277a
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r15
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
movq %rax, %rdi
movl %ebp, %esi
callq 0x215b4
movl $0x5, 0x8(%rbx)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x20302
movq %r12, 0x10(%rbx)
movq %r15, 0x18(%rbx)
jmp 0x2277a
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r12, %rdi
jmp 0x2283c
jmp 0x22828
jmp 0x22828
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r15, %rdi
jmp 0x2283c
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Add(gaps::RNAlgebraic const&)
void RNAlgebraic::
Add(const RNAlgebraic& value)
{
  // Just checking
  assert(IsValid());
  assert(value.IsValid());

  // Check value
  if (value.IsZero()) return;

  // Add value
  switch(operation) {
  case RN_ZERO_OPERATION: 
    *this = value;
    return;

  case RN_POLYNOMIAL_OPERATION:
    if (value.operation == RN_POLYNOMIAL_OPERATION) {
      polynomial->Add(*(value.polynomial));
    }
    else {
      operands[0] = new RNAlgebraic(value);
      operands[1] = new RNAlgebraic(polynomial);
      operation = RN_ADD_OPERATION;
      polynomial = NULL;
    }
    return;

  default: {
    RNAlgebraic *e = new RNAlgebraic(operation, operands[0], operands[1]);
    operands[0] = new RNAlgebraic(value);
    operands[1] = e;
    operation = RN_ADD_OPERATION;
    return; }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x20144
testl %eax, %eax
je 0x2286d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbx), %ebp
cmpl $0x1, %ebp
je 0x2288c
testl %ebp, %ebp
jne 0x228a8
movq %rbx, %rdi
movq %r15, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x22958
cmpl $0x1, 0x8(%r15)
jne 0x228ef
movq 0x20(%rbx), %rdi
movq 0x20(%r15), %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1f0d0
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r14
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
movq %rax, %rdi
movl %ebp, %esi
callq 0x215b4
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x20370
movq %r12, 0x10(%rbx)
movq %r14, 0x18(%rbx)
movl $0x2, 0x8(%rbx)
jmp 0x22864
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x20370
movq %r14, 0x10(%rbx)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r14
movq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x20064
movq %r14, 0x18(%rbx)
movl $0x2, 0x8(%rbx)
andq $0x0, 0x20(%rbx)
jmp 0x22864
jmp 0x22941
jmp 0x22941
movq %rax, %rbx
movq %r12, %r14
jmp 0x22944
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::operator=(gaps::RNAlgebraic const&)
RNAlgebraic& RNAlgebraic::
operator=(const RNAlgebraic& value)
{
  // Just checking
  assert(value.IsValid());

  // Empty this value
  Empty();

  // Copy operation
  this->operation = value.operation;

  // Copy operands
  switch(operation) {
  case RN_ZERO_OPERATION:
    break;

  case RN_POLYNOMIAL_OPERATION:
    polynomial = new RNPolynomial(*(value.polynomial));
    break;

  default:
    operands[0] = new RNAlgebraic(*(value.operands[0]));
    operands[1] = new RNAlgebraic(*(value.operands[1]));
    break;
  }

  // Return this
  return *this;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x22022
movl 0x8(%r14), %eax
movl %eax, 0x8(%rbx)
testl %eax, %eax
je 0x229cc
cmpl $0x1, %eax
jne 0x22993
pushq $0x10
popq %rdi
callq 0x4280
movq %rax, %r15
movq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x1e8ae
pushq $0x20
jmp 0x229c7
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r15
movq 0x10(%r14), %rsi
movq %rax, %rdi
callq 0x20370
movq %r15, 0x10(%rbx)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r15
movq 0x18(%r14), %rsi
movq %rax, %rdi
callq 0x20370
pushq $0x18
popq %rax
movq %r15, (%rbx,%rax)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
jmp 0x229d7
movq %rax, %rbx
pushq $0x28
jmp 0x229e3
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r15, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Subtract(gaps::RNAlgebraic const&)
void RNAlgebraic::
Subtract(const RNAlgebraic& value)
{
  // Just checking
  assert(IsValid());
  assert(value.IsValid());

  // Check value
  if (value.IsZero()) return;

  // Subtract value
  switch(operation) {
  case RN_ZERO_OPERATION: 
    *this = value;
    Negate();
    return;

  case RN_POLYNOMIAL_OPERATION:
    if (value.operation == RN_POLYNOMIAL_OPERATION) {
      polynomial->Subtract(*(value.polynomial));
    }
    else {
      operands[1] = new RNAlgebraic(value);
      operands[0] = new RNAlgebraic(polynomial);
      operation = RN_SUBTRACT_OPERATION;
      polynomial = NULL;
    }
    return;

  default: {
    RNAlgebraic *e = new RNAlgebraic(operation, operands[0], operands[1]);
    operands[1] = new RNAlgebraic(value);
    operands[0] = e;
    operation = RN_SUBTRACT_OPERATION;
    return; }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x20144
testl %eax, %eax
je 0x22a17
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbx), %ebp
cmpl $0x1, %ebp
je 0x22a3e
testl %ebp, %ebp
jne 0x22a5a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x22958
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x219ae
cmpl $0x1, 0x8(%r15)
jne 0x22aa1
movq 0x20(%rbx), %rdi
movq 0x20(%r15), %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1f122
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r14
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
movq %rax, %rdi
movl %ebp, %esi
callq 0x215b4
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x20370
movq %r12, 0x18(%rbx)
movq %r14, 0x10(%rbx)
movl $0x3, 0x8(%rbx)
jmp 0x22a0e
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x20370
movq %r14, 0x18(%rbx)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r14
movq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x20064
movq %r14, 0x10(%rbx)
movl $0x3, 0x8(%rbx)
andq $0x0, 0x20(%rbx)
jmp 0x22a0e
jmp 0x22af3
jmp 0x22af3
movq %rax, %rbx
movq %r12, %r14
jmp 0x22af6
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Multiply(gaps::RNAlgebraic const&)
void RNAlgebraic::
Multiply(const RNAlgebraic& value)
{
  // Just checking
  assert(IsValid());
  assert(value.IsValid());

  // Check factor 
  if (value.IsZero()) {
    Empty();
  }
  else if (!value.IsOne()) {
    switch(operation) {
    case RN_ZERO_OPERATION: 
      return;
      
    case RN_POLYNOMIAL_OPERATION:
      if (value.operation == RN_POLYNOMIAL_OPERATION) {
        if (TRUE || (polynomial->NTerms() == 1) || (value.polynomial->NTerms() == 1)) {
          polynomial->Multiply(*(value.polynomial));
        }
        else {
          operands[1] = new RNAlgebraic(value);
          operands[0] = new RNAlgebraic(polynomial);
          operation = RN_MULTIPLY_OPERATION;
          polynomial = NULL;
        }
      }
      else {
        operands[1] = new RNAlgebraic(value);
        operands[0] = new RNAlgebraic(polynomial);
        operation = RN_MULTIPLY_OPERATION;
        polynomial = NULL;
      }
      return;
    
    default: {
      RNAlgebraic *e = new RNAlgebraic(operation, operands[0], operands[1]);
      operands[0] = new RNAlgebraic(value);
      operands[1] = e;
      operation = RN_MULTIPLY_OPERATION;
      return; }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x20144
testl %eax, %eax
je 0x22b34
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x22022
movq %r15, %rdi
callq 0x21a52
testl %eax, %eax
je 0x22b49
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbx), %ebp
testl %ebp, %ebp
je 0x22b40
cmpl $0x1, %ebp
jne 0x22b71
cmpl $0x1, 0x8(%r15)
jne 0x22bb5
movq 0x20(%rbx), %rdi
movq 0x20(%r15), %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1f17a
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r14
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
movq %rax, %rdi
movl %ebp, %esi
callq 0x215b4
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x20370
movq %r12, 0x10(%rbx)
movq %r14, 0x18(%rbx)
movl $0x4, 0x8(%rbx)
jmp 0x22b40
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x20370
movq %r14, 0x18(%rbx)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r14
movq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x20064
movq %r14, 0x10(%rbx)
movl $0x4, 0x8(%rbx)
andq $0x0, 0x20(%rbx)
jmp 0x22b40
jmp 0x22c07
jmp 0x22c07
movq %rax, %rbx
movq %r12, %r14
jmp 0x22c0a
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Divide(gaps::RNAlgebraic const&)
void RNAlgebraic::
Divide(const RNAlgebraic& value)
{
  // Just checking
  assert(IsValid());
  assert(value.IsValid());

  // Check factor
  if (value.IsZero()) {
    if (IsZero()) {
      Empty();
    }
    else {
      Empty();
      operation = RN_POLYNOMIAL_OPERATION;
      polynomial = new RNPolynomial(RN_INFINITY, 0);
    }
  }
  else if (!value.IsOne()) {
    switch(operation) {
    case RN_ZERO_OPERATION: 
      return;
      
    case RN_POLYNOMIAL_OPERATION:
      operands[1] = new RNAlgebraic(value);
      operands[0] = new RNAlgebraic(polynomial);
      operation = RN_DIVIDE_OPERATION;
      polynomial = NULL;
      return;
    
    default: {
      RNAlgebraic *e = new RNAlgebraic(operation, operands[0], operands[1]);
      operands[0] = new RNAlgebraic(value);
      operands[1] = e;
      operation = RN_DIVIDE_OPERATION;
      return; }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x20144
testl %eax, %eax
je 0x22c82
movq %rbx, %rdi
callq 0x20144
movl %eax, %ebp
movq %rbx, %rdi
callq 0x22022
testl %ebp, %ebp
jne 0x22c8e
movl $0x1, 0x8(%rbx)
pushq $0x10
popq %rdi
callq 0x4280
movq %rax, %r14
leaq 0x54751(%rip), %rax     # 0x773b8
movsd (%rax), %xmm0
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1e996
movq %r14, 0x20(%rbx)
jmp 0x22c8e
movq %r14, %rdi
callq 0x21a52
testl %eax, %eax
je 0x22c97
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbx), %ebp
testl %ebp, %ebp
je 0x22c8e
pushq $0x28
popq %rdi
cmpl $0x1, %ebp
jne 0x22ce6
callq 0x4280
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x20370
movq %r15, 0x18(%rbx)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r14
movq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x20064
movq %r14, 0x10(%rbx)
movl $0x5, 0x8(%rbx)
andq $0x0, 0x20(%rbx)
jmp 0x22c8e
callq 0x4280
movq %rax, %r15
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
movq %rax, %rdi
movl %ebp, %esi
callq 0x215b4
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x20370
movq %r12, 0x10(%rbx)
movq %r15, 0x18(%rbx)
movl $0x5, 0x8(%rbx)
jmp 0x22c8e
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r12, %rdi
jmp 0x22d52
movq %rax, %rbx
pushq $0x28
jmp 0x22d4e
jmp 0x22d3e
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r15, %rdi
jmp 0x22d52
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::operator=(double)
RNAlgebraic& RNAlgebraic::
operator=(RNScalar value)
{
  // Empty this algebraic
  Empty();

  // Assign constant
  operation = RN_POLYNOMIAL_OPERATION;
  polynomial = new RNPolynomial(value, 0);

  // Return this
  return *this;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
movq %rdi, %rbx
callq 0x22022
movl $0x1, 0x8(%rbx)
pushq $0x10
popq %rdi
callq 0x4280
movq %rax, %r14
movq %rax, %rdi
movsd (%rsp), %xmm0
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1e996
movq %r14, 0x20(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::operator=(gaps::RNPolynomial const&)
RNAlgebraic& RNAlgebraic::
operator=(const RNPolynomial& value)
{
  // Empty this algebraic
  Empty();

  // Assign polynomial
  operation = RN_POLYNOMIAL_OPERATION;
  polynomial = new RNPolynomial(value);

  // Return this
  return *this;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
callq 0x22022
movl $0x1, 0x8(%rbx)
pushq $0x10
popq %rdi
callq 0x4280
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x1e8ae
movq %r14, 0x20(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Evaluate(double const*) const
RNScalar RNAlgebraic::
Evaluate(const RNScalar *x) const
{
  // Return value of algebraic
  switch(operation) {
  case RN_ZERO_OPERATION:
    return 0;
  
  case RN_POLYNOMIAL_OPERATION: 
    return polynomial->Evaluate(x);

  case RN_ADD_OPERATION: 
    return operands[0]->Evaluate(x) + operands[1]->Evaluate(x);
  
  case RN_SUBTRACT_OPERATION: 
    return operands[0]->Evaluate(x) - operands[1]->Evaluate(x);
  
  case RN_MULTIPLY_OPERATION: 
    return operands[0]->Evaluate(x) * operands[1]->Evaluate(x);

  case RN_DIVIDE_OPERATION: {
    RNScalar v1 = operands[1]->Evaluate(x);
    if (RNIsZero(v1, RN_SMALL_EPSILON)) return RN_INFINITY;
    RNScalar v0 = operands[0]->Evaluate(x);
    return v0 / v1; }
  
  case RN_POW_OPERATION: {
    RNScalar v0 = operands[0]->Evaluate(x);
    if (v0 == 0) return 0;
    RNScalar v1 = operands[1]->Evaluate(x);
    if (v1 == 0) return 1;
    return pow(v0, v1); }
  }

  // Should never get here
  RNAbort("Invalid algebraic operation: %d", operation);
  return 0.0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x8(%rdi), %esi
xorpd %xmm0, %xmm0
cmpq $0x6, %rsi
ja 0x22ec9
movq %rdi, %r14
leaq 0x2fba8(%rip), %rax     # 0x529d8
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x20(%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1f436
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x22e0e
movsd %xmm0, (%rsp)
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x22e0e
mulsd (%rsp), %xmm0
jmp 0x22f79
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x22e0e
movsd %xmm0, (%rsp)
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x22e0e
addsd (%rsp), %xmm0
jmp 0x22f79
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x22e0e
movsd %xmm0, (%rsp)
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x22e0e
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0x22f79
leaq 0x2fbca(%rip), %rdi     # 0x52a9a
xorl %eax, %eax
callq 0x264a8
xorpd %xmm0, %xmm0
jmp 0x22f79
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x22e0e
leaq 0x544ad(%rip), %rax     # 0x773a0
movsd (%rax), %xmm2
movapd 0x2e161(%rip), %xmm1    # 0x51060
xorpd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x22f63
ucomisd %xmm0, %xmm2
jb 0x22f63
leaq 0x544a2(%rip), %rax     # 0x773b8
movsd (%rax), %xmm0
jmp 0x22f79
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x22e0e
movapd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x22f38
jnp 0x22f79
movsd %xmm1, (%rsp)
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x22e0e
movapd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x22f81
jp 0x22f81
movsd 0x2e0af(%rip), %xmm0    # 0x51010
jmp 0x22f79
movq 0x10(%r14), %rdi
movq %rbx, %rsi
movsd %xmm0, (%rsp)
callq 0x22e0e
divsd (%rsp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movsd (%rsp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x44c0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Evaluate(double const* const*) const
RNScalar RNAlgebraic::
Evaluate(double const* const* x) const
{
  // Return value of algebraic
  switch(operation) {
  case RN_ZERO_OPERATION: 
    return 0;
  
  case RN_POLYNOMIAL_OPERATION: 
    return polynomial->Evaluate(x);

  case RN_ADD_OPERATION: 
    return operands[0]->Evaluate(x) + operands[1]->Evaluate(x);
  
  case RN_SUBTRACT_OPERATION: 
    return operands[0]->Evaluate(x) - operands[1]->Evaluate(x);
  
  case RN_MULTIPLY_OPERATION: 
    return operands[0]->Evaluate(x) * operands[1]->Evaluate(x);

  case RN_DIVIDE_OPERATION: {
    RNScalar v1 = operands[1]->Evaluate(x);
    if (RNIsZero(v1, RN_SMALL_EPSILON)) return RN_INFINITY;
    RNScalar v0 = operands[0]->Evaluate(x);
    return v0 / v1; }
  
  case RN_POW_OPERATION: {
    RNScalar v0 = operands[0]->Evaluate(x);
    if (v0 == 0) return 0;
    RNScalar v1 = operands[1]->Evaluate(x);
    if (v1 == 0) return 1;
    return pow(v0, v1); }
  }

  // Should never get here
  RNAbort("Invalid algebraic operation: %d", operation);
  return 0.0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x8(%rdi), %esi
xorpd %xmm0, %xmm0
cmpq $0x6, %rsi
ja 0x2304d
movq %rdi, %r14
leaq 0x2fa40(%rip), %rax     # 0x529f4
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x20(%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1f57e
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x22f92
movsd %xmm0, (%rsp)
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x22f92
mulsd (%rsp), %xmm0
jmp 0x230fd
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x22f92
movsd %xmm0, (%rsp)
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x22f92
addsd (%rsp), %xmm0
jmp 0x230fd
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x22f92
movsd %xmm0, (%rsp)
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x22f92
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0x230fd
leaq 0x2fa46(%rip), %rdi     # 0x52a9a
xorl %eax, %eax
callq 0x264a8
xorpd %xmm0, %xmm0
jmp 0x230fd
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x22f92
leaq 0x54329(%rip), %rax     # 0x773a0
movsd (%rax), %xmm2
movapd 0x2dfdd(%rip), %xmm1    # 0x51060
xorpd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x230e7
ucomisd %xmm0, %xmm2
jb 0x230e7
leaq 0x5431e(%rip), %rax     # 0x773b8
movsd (%rax), %xmm0
jmp 0x230fd
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x22f92
movapd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x230bc
jnp 0x230fd
movsd %xmm1, (%rsp)
movq 0x18(%r14), %rdi
movq %rbx, %rsi
callq 0x22f92
movapd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x23105
jp 0x23105
movsd 0x2df2b(%rip), %xmm0    # 0x51010
jmp 0x230fd
movq 0x10(%r14), %rdi
movq %rbx, %rsi
movsd %xmm0, (%rsp)
callq 0x22f92
divsd (%rsp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movsd (%rsp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x44c0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Print(_IO_FILE*, int) const
void RNAlgebraic::
Print(FILE *fp, int indent) const
{
  // Print algebraic
  switch(operation) {
  case RN_ZERO_OPERATION:
    for (int i = 0; i < indent; i++) fprintf(fp, " ");
    fprintf(fp, "0\n");
    return;
    
  case RN_POLYNOMIAL_OPERATION: 
    for (int i = 0; i < indent; i++) fprintf(fp, " ");
    polynomial->Print(fp);
    return;

  default:
    for (int i = 0; i < indent; i++) fprintf(fp, " ");
    fprintf(fp, "[ %d\n", operation);
    operands[0]->Print(fp, indent+2);
    operands[1]->Print(fp, indent+2);
    for (int i = 0; i < indent; i++) fprintf(fp, " ");
    fprintf(fp, "]\n");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x8(%rdi), %eax
xorl %r12d, %r12d
testl %edx, %edx
cmovgl %edx, %r12d
testl %eax, %eax
je 0x2377b
movq %rdi, %r14
cmpl $0x1, %eax
jne 0x2379c
pushq $0x20
popq %rbp
subl $0x1, %r12d
jb 0x23761
movl %ebp, %edi
movq %rbx, %rsi
callq 0x4360
jmp 0x2374f
movq 0x20(%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1fae4
subl %eax, %r12d
pushq $0x20
popq %rbp
subl $0x1, %r12d
jb 0x23793
movl %ebp, %edi
movq %rbx, %rsi
callq 0x4360
jmp 0x23781
leaq 0x2e671(%rip), %rdi     # 0x51e0b
jmp 0x23808
movl %edx, %ebp
pushq $0x20
popq %r15
movl %r12d, %r13d
subl $0x1, %r13d
jb 0x237b8
movl %r15d, %edi
movq %rbx, %rsi
callq 0x4360
jmp 0x237a5
movl 0x8(%r14), %edx
leaq 0x2f2f7(%rip), %rsi     # 0x52aba
movq %rbx, %rdi
xorl %eax, %eax
callq 0x43f0
movq 0x10(%r14), %rdi
addl $0x2, %ebp
movq %rbx, %rsi
movl %ebp, %edx
callq 0x23726
movq 0x18(%r14), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x23726
pushq $0x20
popq %rbp
subl $0x1, %r12d
jb 0x23801
movl %ebp, %edi
movq %rbx, %rsi
callq 0x4360
jmp 0x237ef
leaq 0x2f2b8(%rip), %rdi     # 0x52ac0
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4570
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::IsValid() const
RNBoolean RNAlgebraic::
IsValid(void) const
{
  // Check operation
  if ((operation < 0) || (operation >= RN_NUM_ALGEBRAIC_OPERATIONS)) return FALSE; 

  // Check invariants
  switch(operation) {
  case RN_ZERO_OPERATION: 
    if (polynomial) { printf("E1\n"); return FALSE; }
    if (operands[0]) { printf("E2\n"); return FALSE; }
    if (operands[1]) { printf("E3\n"); return FALSE; }
    break;
    
  case RN_POLYNOMIAL_OPERATION: 
    if (!polynomial) { printf("E4\n"); return FALSE; }
    if (operands[0]) { printf("E5\n"); return FALSE; }
    if (operands[1]) { printf("E6\n"); return FALSE; }
    break;

  default:
    if (polynomial) { printf("E7\n"); return FALSE; }
    if (!operands[0]) { printf("E8\n"); return FALSE; }
    if (!operands[1]) { printf("E9\n"); return FALSE; }
    break;
  }

  // Passed all tests
  return TRUE;
}

// Assembly:
pushq %rbx
movl 0x8(%rdi), %ecx
xorl %ebx, %ebx
cmpl $0x6, %ecx
ja 0x238d2
movq 0x20(%rdi), %rax
cmpl $0x1, %ecx
je 0x2384e
testl %ecx, %ecx
jne 0x23863
testq %rax, %rax
je 0x23871
leaq 0x2f286(%rip), %rdi     # 0x52ad2
jmp 0x238cd
testq %rax, %rax
je 0x23881
cmpq $0x0, 0x10(%rdi)
je 0x238a1
leaq 0x2f268(%rip), %rdi     # 0x52ac9
jmp 0x238cd
testq %rax, %rax
je 0x2388a
leaq 0x2f26c(%rip), %rdi     # 0x52adb
jmp 0x238cd
cmpq $0x0, 0x10(%rdi)
je 0x238b1
leaq 0x2f250(%rip), %rdi     # 0x52acf
jmp 0x238cd
leaq 0x2f23b(%rip), %rdi     # 0x52ac3
jmp 0x238cd
cmpq $0x0, 0x10(%rdi)
je 0x238c6
cmpq $0x0, 0x18(%rdi)
jne 0x238c1
leaq 0x2f239(%rip), %rdi     # 0x52ad8
jmp 0x238cd
cmpq $0x0, 0x18(%rdi)
je 0x238c1
leaq 0x2f217(%rip), %rdi     # 0x52ac6
jmp 0x238cd
cmpq $0x0, 0x18(%rdi)
je 0x238c1
leaq 0x2f20d(%rip), %rdi     # 0x52acc
jmp 0x238cd
pushq $0x1
popq %rbx
jmp 0x238d2
leaq 0x2f208(%rip), %rdi     # 0x52ad5
callq 0x4440
movl %ebx, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNSystemOfEquations.cpp
// Function: gaps::RNSystemOfEquations::RNSystemOfEquations(int)
RNSystemOfEquations::
RNSystemOfEquations(int nvariables)
  : lower_bounds(NULL),
    upper_bounds(NULL),
    nvariables(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;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movl %esi, 0x30(%rdi)
leaq 0x38(%rdi), %r15
movq %r15, %rdi
callq 0x2477e
movl %r14d, %eax
shlq $0x2, %rax
testl %r14d, %r14d
pushq $-0x1
popq %r12
cmovnsq %rax, %r12
movq %r12, %rdi
callq 0x4030
movq %rax, (%rbx)
movq %r12, %rdi
callq 0x4030
movq %rax, 0x8(%rbx)
movq %r12, %rdi
callq 0x4030
movq %rax, 0x10(%rbx)
xorl %ecx, %ecx
testl %r14d, %r14d
cmovlel %ecx, %r14d
cmpq %rcx, %r14
je 0x23948
andl $0x0, (%rax,%rcx,4)
incq %rcx
jmp 0x2393a
movl $0x1, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x247ec
movq %rbx, %rdi
callq 0x44d0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNSystemOfEquations.cpp
// Function: gaps::RNSystemOfEquations::InsertEquation(gaps::RNEquation*)
void RNSystemOfEquations::
InsertEquation(RNEquation *equation)
{
  // Check equation
  if (equation->IsConstant()) { delete equation; return; }

  // Just checking
  assert(!equation->system);
  assert(equation->system_index == -1);
  // assert(!equations.FindEntry(equation));

  // Insert equation
  equation->system = this;
  equation->system_index = equations.NEntries();
  equations.Insert(equation);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x21b1e
testl %eax, %eax
je 0x23b34
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0x8(%rax)
movq %r14, 0x28(%rbx)
movl 0x44(%r14), %eax
addq $0x38, %r14
movl %eax, 0x30(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11a32
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNSystemOfEquations.cpp
// Function: gaps::RNSystemOfEquations::~RNSystemOfEquations()
RNSystemOfEquations::
~RNSystemOfEquations(void)
{
  // Delete memory for variable counting
  if (index_to_variable) delete [] index_to_variable;
  if (variable_to_index) delete [] variable_to_index;
  if (variable_marks) delete [] variable_marks;

  // Delete all equations
  while (NEquations() > 0) {
    RNEquation *equation = equations.Tail();
    RemoveEquation(equation);
    delete equation;
  }

  // Delete all bounds
  if (lower_bounds) delete [] lower_bounds;
  if (upper_bounds) delete [] upper_bounds;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x23b6b
callq 0x4370
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x23b79
callq 0x4370
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x23b87
callq 0x4370
leaq 0x38(%rbx), %r14
movslq 0x44(%rbx), %rax
testq %rax, %rax
jle 0x23bb8
movq 0x38(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x23bea
testq %r15, %r15
je 0x23b8b
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
jmp 0x23b8b
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x23bc6
callq 0x4370
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x23bd4
callq 0x4370
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x247ec
movq %rax, %rdi
callq 0x20013
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNSystemOfEquations.cpp
// Function: gaps::RNSystemOfEquations::NPartialDerivatives() const
int RNSystemOfEquations::
NPartialDerivatives(void) const
{
  // Return number of partial derivatives
  int count = 0;
  for (int i = 0; i < NEquations(); i++) {
    RNEquation *equation = Equation(i);
    equation->UpdateVariableIndex(nvariables, count, variable_marks, current_mark);
    ((RNSystemOfEquations *) this)->current_mark++;
  }
  return count;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xc(%rsp), %r14
andl $0x0, (%r14)
xorl %r15d, %r15d
movslq 0x44(%rbx), %rax
cmpq %rax, %r15
jge 0x23c6b
movq 0x38(%rbx), %rax
movq (%rax,%r15,8), %rdi
movl 0x30(%rbx), %esi
movq 0x10(%rbx), %rcx
movl 0x18(%rbx), %r8d
movq %r14, %rdx
xorl %r9d, %r9d
pushq $0x0
pushq $0x0
callq 0x21f88
popq %rax
popq %rcx
incl 0x18(%rbx)
incq %r15
jmp 0x23c36
movl 0xc(%rsp), %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNSystemOfEquations.cpp
// Function: gaps::RNSystemOfEquations::IsLinear() const
RNBoolean RNSystemOfEquations::
IsLinear(void) const
{
  // Check whether all equations are linear
  for (int i = 0; i < NEquations(); i++) {
    RNEquation *equation = Equation(i);
    if (!equation->IsLinear()) return FALSE;
  }

  // Passed all tests
  return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %ecx, %ecx
movq %rcx, %r14
movslq 0x44(%rbx), %r15
cmpq %r15, %rcx
jge 0x23ca5
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x21bb6
leaq 0x1(%r14), %rcx
testl %eax, %eax
jne 0x23c84
xorl %eax, %eax
cmpq %r15, %r14
setge %al
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNSystemOfEquations.cpp
// Function: gaps::RNSystemOfEquations::IsQuadratic() const
RNBoolean RNSystemOfEquations::
IsQuadratic(void) const
{
  // Check whether all equations are quadratic
  for (int i = 0; i < NEquations(); i++) {
    RNEquation *equation = Equation(i);
    if (!equation->IsQuadratic()) return FALSE;
  }

  // Passed all tests
  return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %ecx, %ecx
movq %rcx, %r14
movslq 0x44(%rbx), %r15
cmpq %r15, %rcx
jge 0x23cdf
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x21c86
leaq 0x1(%r14), %rcx
testl %eax, %eax
jne 0x23cbe
xorl %eax, %eax
cmpq %r15, %r14
setge %al
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNSystemOfEquations.cpp
// Function: gaps::RNSystemOfEquations::IsPolynomial() const
RNBoolean RNSystemOfEquations::
IsPolynomial(void) const
{
  // Check whether all equations are polynomial
  for (int i = 0; i < NEquations(); i++) {
    RNEquation *equation = Equation(i);
    if (!equation->IsPolynomial()) return FALSE;
  }

  // Passed all tests
  return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %ecx, %ecx
movq %rcx, %r14
movslq 0x44(%rbx), %r15
cmpq %r15, %rcx
jge 0x23d19
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x21d74
leaq 0x1(%r14), %rcx
testl %eax, %eax
jne 0x23cf8
xorl %eax, %eax
cmpq %r15, %r14
setge %al
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNSystemOfEquations.cpp
// Function: gaps::RNSystemOfEquations::HasVariable(int) const
RNBoolean RNSystemOfEquations::
HasVariable(int v) const
{
  // Check whether any equation has variable v
  for (int i = 0; i < NEquations(); i++) {
    RNEquation *equation = Equation(i);
    if (equation->HasVariable(v)) return TRUE;
  }

  // No equation has variable v
  return FALSE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %ecx, %ecx
movq %rcx, %r15
movslq 0x44(%r14), %r12
cmpq %r12, %rcx
jge 0x23d5e
movq 0x38(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
callq 0x21df0
leaq 0x1(%r15), %rcx
testl %eax, %eax
je 0x23d3b
xorl %eax, %eax
cmpq %r12, %r15
setl %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNSystemOfEquations.cpp
// Function: gaps::RNSystemOfEquations::InsertEquation(gaps::RNPolynomial*)
void RNSystemOfEquations::
InsertEquation(RNPolynomial *polynomial)
{
  // Check polynomial
  if (polynomial->IsConstant()) { delete polynomial; return; }

  // Insert equation
  RNEquation *equation = new RNEquation(polynomial);
  InsertEquation(equation);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1ee6a
testl %eax, %eax
je 0x23da1
movq %rbx, %rdi
callq 0x1ebc0
pushq $0x10
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4290
pushq $0x40
popq %rdi
callq 0x4280
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x243bc
movq %r14, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x23b0e
movq %rax, %rbx
pushq $0x40
popq %rsi
movq %r15, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNSystemOfEquations.cpp
// Function: gaps::RNSystemOfEquations::InsertEquation(gaps::RNAlgebraic*)
void RNSystemOfEquations::
InsertEquation(RNAlgebraic *algebraic)
{
  // Check algebraic
  if (algebraic->IsConstant()) { delete algebraic; return; }

  // Insert equation
  RNEquation *equation = new RNEquation(algebraic);
  InsertEquation(equation);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x21b1e
testl %eax, %eax
je 0x23e03
movq (%r14), %rax
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmpq *0x8(%rax)
pushq $0x40
popq %rdi
callq 0x4280
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x243e0
movq %rbx, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x23b0e
movq %rax, %rbx
pushq $0x40
popq %rsi
movq %r15, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNSystemOfEquations.cpp
// Function: gaps::RNSystemOfEquations::InsertEquation(gaps::RNPolynomial*, double)
void RNSystemOfEquations::
InsertEquation(RNPolynomial *polynomial, RNScalar residual_threshold)
{
  // Check polynomial
  if (polynomial->IsConstant()) { delete polynomial; return; }

  // Insert equation
  RNEquation *equation = new RNEquation(polynomial);
  equation->SetResidualThreshold(residual_threshold);
  InsertEquation(equation);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x1ee6a
testl %eax, %eax
je 0x23e7d
movq %rbx, %rdi
callq 0x1ebc0
pushq $0x10
popq %rsi
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x4290
pushq $0x40
popq %rdi
callq 0x4280
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x243bc
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x38(%r15)
movq %r14, %rdi
movq %r15, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x23b0e
movq %rax, %rbx
pushq $0x40
popq %rsi
movq %r15, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNSystemOfEquations.cpp
// Function: gaps::RNSystemOfEquations::InsertEquation(gaps::RNAlgebraic*, double)
void RNSystemOfEquations::
InsertEquation(RNAlgebraic *algebraic, RNScalar residual_threshold)
{
  // Check algebraic
  if (algebraic->IsConstant()) { delete algebraic; return; }

  // Insert equation
  RNEquation *equation = new RNEquation(algebraic);
  equation->SetResidualThreshold(residual_threshold);
  InsertEquation(equation);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x21b1e
testl %eax, %eax
je 0x23efd
movq (%r14), %rax
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *0x8(%rax)
pushq $0x40
popq %rdi
callq 0x4280
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x243e0
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x38(%r15)
movq %rbx, %rdi
movq %r15, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x23b0e
movq %rax, %rbx
pushq $0x40
popq %rsi
movq %r15, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNSystemOfEquations.cpp
// Function: gaps::RNSystemOfEquations::SetLowerBound(int, double)
void RNSystemOfEquations::
SetLowerBound(int variable, RNScalar bound)
{
  // Just checking
  assert((variable >= 0) && (variable < nvariables));
  
  // Allocate lower bounds
  if (!lower_bounds) {
    lower_bounds = new RNScalar [ nvariables ];
    for (int i = 0; i < nvariables; i++) {
      lower_bounds[i] = -FLT_MAX;
    }
  }

  // Set lower bound
  lower_bounds[variable] = bound;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movq 0x20(%rdi), %rax
testq %rax, %rax
jne 0x23fb2
movq %rdi, %r14
movsd %xmm0, 0x8(%rsp)
movslq 0x30(%rdi), %r15
leaq (,%r15,8), %rax
testq %r15, %r15
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x4030
movq %rax, 0x20(%r14)
xorl %ecx, %ecx
testl %r15d, %r15d
movl $0x0, %edx
cmovgl %r15d, %edx
movabsq $-0x3810000020000000, %rsi # imm = 0xC7EFFFFFE0000000
cmpq %rcx, %rdx
je 0x23fac
movq %rsi, (%rax,%rcx,8)
incq %rcx
jmp 0x23f9e
movsd 0x8(%rsp), %xmm0
movslq %ebx, %rcx
movsd %xmm0, (%rax,%rcx,8)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq