LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::FindTermWithVariables(int, int*, double*) const
RNPolynomialTerm *RNPolynomial::
FindTermWithVariables(int n, int *v, RNScalar *e) const
{
  // Check if query has variables
  if (n == 0) {
    // Check for constant term (must be first)
    RNPolynomialTerm *term = Term(0);
    if (term->IsConstant()) return term;
    else return NULL;
  }
  else {
    // Find matching term
    for (int i = 0; i < NTerms(); i++) {
      RNPolynomialTerm *term = Term(i);
      assert((i == 0) || (!term->IsConstant()));
      if (term->HasVariables(n, v, e)) return term;
    }
  }

  // Did not find matching term
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
testl %esi, %esi
je 0x1fc64
movq %rdx, %r14
movl %esi, %ebp
movl 0xc(%rdi), %r12d
movq (%rdi), %r13
xorl %eax, %eax
testl %r12d, %r12d
cmovlel %eax, %r12d
xorl %ebx, %ebx
cmpq %rbx, %r12
je 0x1fc77
movq (%r13,%rbx,8), %r15
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
movq (%rsp), %rcx
callq 0x1fbc6
incq %rbx
testl %eax, %eax
je 0x1fc40
jmp 0x1fc7a
movq (%rdi), %rax
movq (%rax), %rax
xorl %r15d, %r15d
cmpl $0x0, 0x8(%rax)
cmoveq %rax, %r15
jmp 0x1fc7a
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomialTerm::UpdateVariableRange(int&, int&) const
void RNPolynomialTerm::
UpdateVariableRange(int& min_v, int& max_v) const
{
  // Update indices
  for (int i = 0; i < n; i++) {
    if (v[i] > max_v) max_v = v[i];
    if (v[i] < min_v) min_v = v[i];
  }
}

// Assembly:
movq 0x18(%rdi), %rax
xorl %ecx, %ecx
movslq 0x8(%rdi), %r8
cmpq %r8, %rcx
jge 0x1fcb8
movl (%rax,%rcx,4), %r8d
cmpl (%rdx), %r8d
jle 0x1fcab
movl %r8d, (%rdx)
movl (%rax,%rcx,4), %r8d
cmpl (%rsi), %r8d
jge 0x1fcb3
movl %r8d, (%rsi)
incq %rcx
jmp 0x1fc92
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomialTerm::UpdateVariableIndex(int, int&, int*, int, int*, int*, int) const
void RNPolynomialTerm::
UpdateVariableIndex(int max_variables, int& variable_count, 
  int *variable_marks, int current_mark, 
  int *index_to_variable, int *variable_to_index,
  RNBoolean remap_variables) const
{
  // Just checking
  assert(variable_to_index || !remap_variables);

  // Process each variable
  for (int i = 0; i < n; i++) {
    assert((v[i] >= 0) && (v[i] < max_variables));
    // Update index
    if (variable_marks[v[i]] != current_mark) {
      if (index_to_variable) index_to_variable[variable_count] = v[i];
      if (variable_to_index) variable_to_index[v[i]] = variable_count;
      variable_marks[v[i]] = current_mark;
      variable_count++;
    }

    // Remap variable
    if (remap_variables) {
      v[i] = variable_to_index[v[i]];
    }
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x28(%rsp), %eax
movq 0x20(%rsp), %rsi
movq 0x18(%rdi), %r10
xorl %r11d, %r11d
movslq 0x8(%rdi), %rbx
cmpq %rbx, %r11
jge 0x1fd1f
movslq (%r10,%r11,4), %rbx
cmpl %r8d, (%rcx,%rbx,4)
je 0x1fd0b
testq %r9, %r9
je 0x1fcf1
movslq (%rdx), %r14
movl %ebx, (%r9,%r14,4)
movl (%r10,%r11,4), %ebx
testq %rsi, %rsi
je 0x1fd02
movl (%rdx), %ebp
movslq %ebx, %rbx
movl %ebp, (%rsi,%rbx,4)
movl (%r10,%r11,4), %ebx
movslq %ebx, %rbx
movl %r8d, (%rcx,%rbx,4)
incl (%rdx)
testl %eax, %eax
je 0x1fd1a
movslq (%r10,%r11,4), %rbx
movl (%rsi,%rbx,4), %ebx
movl %ebx, (%r10,%r11,4)
incq %r11
jmp 0x1fcce
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomialTerm::RNPolynomialTerm(gaps::RNPolynomialTerm const&)
RNPolynomialTerm::
RNPolynomialTerm(const RNPolynomialTerm& term)
  : n(term.n),
    c(term.c)
{
  // Copy stuff from term
  if (n == 0) {
#ifndef RN_POLYNOMIAL_TERM_STATIC_MEMORY
    v = NULL;
    e = NULL;
#endif
  }
  else {
#ifndef RN_POLYNOMIAL_TERM_STATIC_MEMORY
    v = new int [ n ];
    e = new RNScalar [ n ];
#endif
    for (int i = 0; i < n; i++) {
      v[i] = term.v[i];
      e[i] = term.e[i];
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movslq 0x8(%rsi), %rax
movl %eax, 0x8(%rdi)
movsd 0x10(%rsi), %xmm0
movsd %xmm0, 0x10(%rdi)
testq %rax, %rax
je 0x1ff98
movq %rsi, %rbx
xorl %r13d, %r13d
testl %eax, %eax
movl $0x0, %ebp
cmovgl %eax, %ebp
leaq (,%rax,8), %r12
testl %eax, %eax
pushq $-0x1
popq %rcx
cmovsq %rcx, %r12
movq %rax, %rdi
shlq $0x2, %rdi
testl %eax, %eax
cmovsq %rcx, %rdi
callq 0x4030
movq %rax, %r15
movq %rax, 0x18(%r14)
movq %r12, %rdi
callq 0x4030
movq %rax, 0x20(%r14)
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %rdx
cmpq %r13, %rbp
je 0x1ffa0
movl (%rcx,%r13,4), %esi
movl %esi, (%r15,%r13,4)
movsd (%rdx,%r13,8), %xmm0
movsd %xmm0, (%rax,%r13,8)
incq %r13
jmp 0x1ff7a
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomialTerm::Empty()
void RNPolynomialTerm::
Empty(void)
{
  // Delete stuff
#ifndef RN_POLYNOMIAL_TERM_STATIC_MEMORY
  if (v) delete [] v;
  if (e) delete [] e;
#endif
  c = 0;
  n = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x1ffe6
callq 0x4370
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x1fff4
callq 0x4370
andq $0x0, 0x10(%rbx)
andl $0x0, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::RNAlgebraic(gaps::RNPolynomial*)
RNAlgebraic::
RNAlgebraic(RNPolynomial *p)
  : operation(RN_ZERO_OPERATION),
    polynomial(NULL)
{
  // NOTE: THIS TAKES OVER MANAGEMENT OF MEMORY FOR POLYNOMIAL
  // SPECIFICALLY, POLYNOMIAL WILL BE DELETED WHEN ALGEBRAIC IS DECONSTRUCTED

  // Initialize operands
  operands[0] = NULL;
  operands[1] = NULL;

  // Check polynomial
  if (!p) {
    return;
  }
  else if (p->IsZero()) {
    delete p;
    return;
  }

  // Assign polynomial
  operation = RN_POLYNOMIAL_OPERATION;
  this->polynomial = p;

  // Just checking
  assert(IsValid());
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x567a1(%rip), %rax     # 0x76810
movq %rax, (%rdi)
andl $0x0, 0x8(%rdi)
andq $0x0, 0x20(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
testq %rsi, %rsi
je 0x200bf
movq %rdi, %r14
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x1ee0e
testl %eax, %eax
je 0x200b3
movq %rbx, %rdi
callq 0x1ebc0
pushq $0x10
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4290
movl $0x1, 0x8(%r14)
movq %rbx, 0x20(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::RNAlgebraic(gaps::RNAlgebraic*)
RNAlgebraic::
RNAlgebraic(RNAlgebraic *algebraic)
  : operation(RN_ZERO_OPERATION),
    polynomial(NULL)
{
  // NOTE: THIS TAKES OVER MANAGEMENT OF MEMORY FOR ALGEBRAIC 
  // SPECIFICALLY, ALGEBRAIC WILL BE DELETED WHEN THIS ALGEBRAIC IS DECONSTRUCTED

  // Initialize operands
  operands[0] = NULL;
  operands[1] = NULL;

  // Check algebraic
  if (!algebraic) {
    return;
  }
  else if (algebraic->IsZero()) {
    delete algebraic;
    return;
  }

  // Copy stuff from algebraic
  operation = algebraic->operation;
  polynomial = algebraic->polynomial;
  operands[0] = algebraic->operands[0];
  operands[1] = algebraic->operands[1];

  // Delete algebraic
  algebraic->operation = RN_ZERO_OPERATION;
  algebraic->operands[0] = NULL;
  algebraic->operands[1] = NULL;
  algebraic->polynomial = NULL;
  delete algebraic;

  // Just checking
  assert(IsValid());
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x5673d(%rip), %rax     # 0x76810
movq %rax, (%rdi)
andl $0x0, 0x8(%rdi)
andq $0x0, 0x20(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
testq %rsi, %rsi
je 0x2013c
movq %rdi, %r14
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x20144
testl %eax, %eax
jne 0x2012c
movl 0x8(%rbx), %eax
movl %eax, 0x8(%r14)
movq 0x20(%rbx), %rax
movq %rax, 0x20(%r14)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%r14)
movq 0x18(%rbx), %rax
movq %rax, 0x18(%r14)
andl $0x0, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
andq $0x0, 0x20(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::IsZero() const
RNBoolean RNAlgebraic::
IsZero(void) const
{
  // Return if algebraic is definitely zero for all variable settings
  switch(operation) {
  case RN_ZERO_OPERATION:
    return TRUE;

  case RN_POLYNOMIAL_OPERATION:
    return polynomial->IsZero();

  case RN_ADD_OPERATION:
  case RN_SUBTRACT_OPERATION:
    return (operands[0]->IsZero() && operands[1]->IsZero());

  case RN_MULTIPLY_OPERATION:
    return (operands[0]->IsZero() || operands[1]->IsZero());

  case RN_DIVIDE_OPERATION:
    return (operands[0]->IsZero() && !operands[1]->IsZero());

  case RN_POW_OPERATION:
    return (operands[0]->IsZero());
  }

  // Should never get here
  RNAbort("Unrecognized operation %d in algebraic");
  return FALSE;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x32739(%rip), %rax     # 0x52888
movl 0x8(%rbx), %ecx
cmpq $0x6, %rcx
ja 0x201c7
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x10(%rbx), %rbx
jmp 0x2014f
movq 0x10(%rbx), %rdi
callq 0x20144
testl %eax, %eax
jne 0x201ab
jmp 0x20195
movq 0x10(%rbx), %rdi
callq 0x20144
testl %eax, %eax
je 0x20195
movq 0x18(%rbx), %rdi
callq 0x20144
xorl %ebx, %ebx
testl %eax, %eax
sete %bl
jmp 0x201d7
xorl %ebx, %ebx
jmp 0x201d7
movq 0x10(%rbx), %rdi
callq 0x20144
testl %eax, %eax
je 0x201ab
pushq $0x1
popq %rbx
jmp 0x201d7
movq 0x18(%rbx), %rdi
callq 0x20144
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x201d7
movq 0x20(%rbx), %rdi
popq %rbx
jmp 0x1ee0e
leaq 0x328a5(%rip), %rdi     # 0x52a73
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x264a8
movl %ebx, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::RNAlgebraic(double, int, double)
RNAlgebraic::
RNAlgebraic(RNScalar c, int v, RNScalar e)
  : operation(RN_ZERO_OPERATION),
    polynomial(NULL)
{
  // Initialize operands
  operands[0] = NULL;
  operands[1] = NULL;

  // Initialize polynomial
  if (c != 0) {
    polynomial = new RNPolynomial(c, v, e);
    operation = RN_POLYNOMIAL_OPERATION;
  }

  // Just checking
  assert(IsValid());
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x56625(%rip), %rax     # 0x76810
movq %rax, (%rdi)
andl $0x0, 0x8(%rdi)
andq $0x0, 0x20(%rdi)
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
xorpd %xmm2, %xmm2
movupd %xmm2, 0x10(%rdi)
jne 0x2020c
jnp 0x20247
movl %esi, %ebp
movq %rdi, %rbx
pushq $0x10
popq %rdi
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, (%rsp)
callq 0x4280
movq %rax, %r14
movq %rax, %rdi
movsd (%rsp), %xmm0
movl %ebp, %esi
movsd 0x8(%rsp), %xmm1
callq 0x1e944
movq %r14, 0x20(%rbx)
movl $0x1, 0x8(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
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::RNAlgebraic(double, int, int const*, double const*, int)
RNAlgebraic::
RNAlgebraic(RNScalar c, int nv, const int *v, const RNScalar *e, RNBoolean already_sorted)
  : operation(RN_ZERO_OPERATION),
    polynomial(NULL)
{
  // Initialize operands
  operands[0] = NULL;
  operands[1] = NULL;

  // Initialize polynomial
  if (c != 0) {
    polynomial = new RNPolynomial(c, nv, v, e, already_sorted);
    operation = RN_POLYNOMIAL_OPERATION;
  }

  // Just checking
  assert(IsValid());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x56598(%rip), %rax     # 0x76810
movq %rax, (%rdi)
andl $0x0, 0x8(%rdi)
andq $0x0, 0x20(%rdi)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
xorpd %xmm1, %xmm1
movupd %xmm1, 0x10(%rdi)
jne 0x20299
jnp 0x202dc
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %rbx
pushq $0x10
popq %rdi
movsd %xmm0, (%rsp)
callq 0x4280
movq %rax, %r13
movq %rax, %rdi
movsd (%rsp), %xmm0
movl %r12d, %esi
movq %r15, %rdx
movq %r14, %rcx
movl %ebp, %r8d
callq 0x1e996
movq %r13, 0x20(%rbx)
movl $0x1, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r13, %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::RNAlgebraic(gaps::RNPolynomial const&, int)
RNAlgebraic::
RNAlgebraic(const RNPolynomial& p, int dummy)
  : operation(RN_ZERO_OPERATION),
    polynomial(NULL)
{
  // Initialize operands
  operands[0] = NULL;
  operands[1] = NULL;

  // Check polynomial
  if (p.IsZero()) return;

  // Initialize polynomial
  this->operation = RN_POLYNOMIAL_OPERATION;
  this->polynomial = new RNPolynomial(p);

  // Just checking
  assert(IsValid());
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x564fc(%rip), %rax     # 0x76810
movq %rax, (%rdi)
andl $0x0, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
andq $0x0, 0x20(%rdi)
movq %rsi, %rdi
callq 0x1ee0e
testl %eax, %eax
jne 0x20354
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)
popq %rbx
popq %r14
popq %r15
retq
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::RNAlgebraic(gaps::RNAlgebraic const&)
RNAlgebraic::
RNAlgebraic(const RNAlgebraic& algebraic)
  : operation(RN_ZERO_OPERATION),
    polynomial(NULL)
{
  // Initialize operands
  operands[0] = NULL;
  operands[1] = NULL;

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

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

  case RN_POLYNOMIAL_OPERATION:
    assert(algebraic.polynomial);
    operation = algebraic.operation;
    polynomial = new RNPolynomial(*(algebraic.polynomial));
    break;

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

  // Just checking
  assert(IsValid());
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x5648e(%rip), %rax     # 0x76810
movq %rax, (%rdi)
andl $0x0, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
andq $0x0, 0x20(%rdi)
movq %rsi, %rdi
callq 0x20144
testl %eax, %eax
je 0x203a7
popq %rbx
popq %r14
popq %r15
retq
movl 0x8(%r14), %eax
testl %eax, %eax
je 0x203a1
cmpl $0x1, %eax
jne 0x203d8
movl $0x1, 0x8(%rbx)
pushq $0x10
popq %rdi
callq 0x4280
movq %rax, %r15
movq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x1e8ae
movq %r15, 0x20(%rbx)
jmp 0x203a1
movl %eax, 0x8(%rbx)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r15
movq 0x10(%r14), %rsi
movq %rax, %rdi
callq 0x20370
leaq 0x10(%rbx), %rax
movq %r15, (%rax)
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r15
movq 0x18(%r14), %rsi
movq %rax, %rdi
callq 0x20370
movq %r15, 0x18(%rbx)
jmp 0x203a1
jmp 0x20418
movq %rax, %rbx
pushq $0x28
jmp 0x20424
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::Construct(int, double, gaps::RNAlgebraic*, int)
void RNAlgebraic::
Construct(int op, RNScalar operand1, RNAlgebraic *operand2, RNBoolean force)
{
  // NOTE: THIS TAKES OVER MANAGEMENT OF MEMORY FOR OPERAND2
  // SPECIFICALLY, OPERANDS WILL BE DELETED WHEN ALGEBRAIC IS DECONSTRUCTED
  assert(operand2);
  assert(operand2->IsValid());

  // Check type of operand2
  if (!force && (operand2->operation == RN_POLYNOMIAL_OPERATION)) {
    // Construct with polynomial
    Construct(op, operand1, operand2->polynomial);
    operand2->operation = RN_ZERO_OPERATION;
    operand2->operands[0] = NULL;
    operand2->operands[1] = NULL;
    operand2->polynomial = NULL;
    delete operand2;
  }
  else {
    // Construct with algebraic
    Construct(op, new RNAlgebraic(operand1, 0), operand2, TRUE);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
testl %ecx, %ecx
jne 0x20ae2
cmpl $0x1, 0x8(%rbx)
jne 0x20ae2
movq 0x20(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0x206a4
andl $0x0, 0x8(%rbx)
andq $0x0, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
pushq $0x28
popq %rdi
movsd %xmm0, (%rsp)
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
pushq $0x1
popq %r8
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x215d6
movq %rax, %rbx
pushq $0x28
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::Construct(int, gaps::RNPolynomial*, gaps::RNAlgebraic*, int)
void RNAlgebraic::
Construct(int op, RNPolynomial *operand1, RNAlgebraic *operand2, RNBoolean force)
{
  // NOTE: THIS TAKES OVER MANAGEMENT OF MEMORY FOR OPERANDS
  // SPECIFICALLY, OPERANDS WILL BE DELETED WHEN ALGEBRAIC IS DECONSTRUCTED

  // Check types of operands
  if (!force && (operand2->operation == RN_POLYNOMIAL_OPERATION)) {
    Construct(op, operand1, operand2->polynomial);
    operand2->operation = RN_ZERO_OPERATION;
    operand2->operands[0] = NULL;
    operand2->operands[1] = NULL;
    operand2->polynomial = NULL;
    delete operand2;
  }
  else if (!force && (operand1->NTerms() == 1) && (operand1->Term(0)->Degree() == 0)) {
    Construct(op, operand1->Term(0)->Coefficient(), operand2);
    delete operand1;
  }
  else {
    Construct(op, new RNAlgebraic(operand1), operand2, TRUE);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
testl %r8d, %r8d
je 0x21328
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x20064
pushq $0x1
popq %r8
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
movq %rbx, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x215d6
cmpl $0x1, 0x8(%rbx)
jne 0x21363
movq 0x20(%rbx), %rcx
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0x20edc
andl $0x0, 0x8(%rbx)
andq $0x0, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
cmpl $0x1, 0xc(%r14)
jne 0x212f6
movq (%r14), %rax
movq (%rax), %rdi
callq 0x1ec74
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x212f6
jp 0x212f6
movq (%r14), %rax
movq (%rax), %rax
movsd 0x10(%rax), %xmm0
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x20a96
movq %r14, %rdi
callq 0x1ebc0
pushq $0x10
popq %rsi
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4290
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r12, %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::Construct(int, gaps::RNAlgebraic*, double, int)
void RNAlgebraic::
Construct(int op, RNAlgebraic *operand1, RNScalar operand2, RNBoolean force)
{
  // Check type of operand1
  if (!force && (operand1->operation == RN_POLYNOMIAL_OPERATION)) {
    Construct(op, operand1->polynomial, operand2);
    operand1->operation = RN_ZERO_OPERATION;
    operand1->operands[0] = NULL;
    operand1->operands[1] = NULL;
    operand1->polynomial = NULL;
    delete operand1;
  }
  else {
    Construct(op, operand1, new RNAlgebraic(operand2, 0), TRUE);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
testl %ecx, %ecx
jne 0x21442
cmpl $0x1, 0x8(%rbx)
jne 0x21442
movq 0x20(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0x20b5e
andl $0x0, 0x8(%rbx)
andq $0x0, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
pushq $0x28
popq %rdi
movsd %xmm0, (%rsp)
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
pushq $0x1
popq %r8
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
movq %r15, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x215d6
movq %rax, %rbx
pushq $0x28
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::Construct(int, gaps::RNAlgebraic*, gaps::RNPolynomial*, int)
void RNAlgebraic::
Construct(int op, RNAlgebraic *operand1, RNPolynomial *operand2, RNBoolean force)
{
  // NOTE: THIS TAKES OVER MANAGEMENT OF MEMORY FOR OPERANDS
  // SPECIFICALLY, OPERANDS WILL BE DELETED WHEN ALGEBRAIC IS DECONSTRUCTED

  // Check types of operands
  if (!force && (operand1->operation == RN_POLYNOMIAL_OPERATION)) {
    Construct(op, operand1->polynomial, operand2);
    operand1->operation = RN_ZERO_OPERATION;
    operand1->operands[0] = NULL;
    operand1->operands[1] = NULL;
    operand1->polynomial = NULL;
    delete operand1;
  }
  else if (!force && (operand2->NTerms() == 1) && (operand2->Term(0)->Degree() == 0)) {
    Construct(op, operand1, operand2->Term(0)->Coefficient());
    delete operand2;
  }
  else {
    Construct(op, operand1, new RNAlgebraic(operand2), TRUE);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r15
testl %r8d, %r8d
je 0x21508
pushq $0x28
popq %rdi
callq 0x4280
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x20064
pushq $0x1
popq %r8
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
movq %r12, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x215d6
cmpl $0x1, 0x8(%rbx)
jne 0x21543
movq 0x20(%rbx), %rdx
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x20edc
andl $0x0, 0x8(%rbx)
andq $0x0, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
cmpl $0x1, 0xc(%r14)
jne 0x214d6
movq (%r14), %rax
movq (%rax), %rdi
callq 0x1ec74
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x214d6
jp 0x214d6
movq (%r14), %rax
movq (%rax), %rax
movsd 0x10(%rax), %xmm0
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x213f6
movq %r14, %rdi
callq 0x1ebc0
pushq $0x10
popq %rsi
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4290
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r12, %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::~RNAlgebraic()
RNAlgebraic::
~RNAlgebraic(void)
{
  // Just checking
  assert(IsValid());

  // Delete everything
  if (polynomial) delete polynomial;
  if (operands[0]) delete operands[0];
  if (operands[1]) delete operands[1];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x54ec4(%rip), %rax     # 0x76810
movq %rax, (%rdi)
movq 0x20(%rdi), %r14
testq %r14, %r14
je 0x2196b
movq %r14, %rdi
callq 0x1ebc0
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x4290
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x2197a
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x21990
movq (%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Negate()
void RNAlgebraic::
Negate(void)
{
  // Just checking
  assert(IsValid());

  // Flip sign
  switch(operation) {
  case RN_ZERO_OPERATION:
    return;

  case RN_POLYNOMIAL_OPERATION:
    polynomial->Negate();
    return;

  case RN_ADD_OPERATION:
    operands[0]->Negate();
    operands[1]->Negate();
    return;

  case RN_SUBTRACT_OPERATION: {
    RNAlgebraic *swap = operands[0];
    operands[0] = operands[1];
    operands[1] = swap;
    return; }

  case RN_MULTIPLY_OPERATION:
  case RN_DIVIDE_OPERATION:
    operands[0]->Negate();
    return;

  case RN_POW_OPERATION: 
    Multiply(-1.0);
    return;
  }

  // Should never get here
  RNAbort("Unrecognized operation %d in algebraic");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x10
popq %r14
leaq 0x30f6c(%rip), %r15     # 0x52930
pushq $0x18
popq %r12
movl 0x8(%rbx), %eax
cmpq $0x6, %rax
ja 0x21a0a
movslq (%r15,%rax,4), %rcx
addq %r15, %rcx
movq %r14, %rax
jmpq *%rcx
movq 0x10(%rbx), %rdi
callq 0x219ae
movq %r12, %rax
movq (%rbx,%rax), %rbx
jmp 0x219c8
movdqu 0x10(%rbx), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x31062(%rip), %rdi     # 0x52a73
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x264a8
movq 0x20(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1f02e
movsd 0x2ffc1(%rip), %xmm0    # 0x51a00
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x220d8
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::IsOne() const
RNBoolean RNAlgebraic::
IsOne(void) const
{
  // Return if algebraic algebraic is constant
  switch(operation) {
  case RN_ZERO_OPERATION:
    return FALSE;

  case RN_POLYNOMIAL_OPERATION:
    return polynomial->IsOne();

  case RN_ADD_OPERATION:
    return ((operands[0]->IsOne() && operands[1]->IsZero()) ||
            (operands[1]->IsOne() && operands[0]->IsZero()));

  case RN_SUBTRACT_OPERATION:
    return (operands[0]->IsOne() && operands[1]->IsZero());

  case RN_MULTIPLY_OPERATION:
  case RN_DIVIDE_OPERATION:
    return (operands[0]->IsOne() && operands[1]->IsOne());

  case RN_POW_OPERATION:
    if (operands[0]->IsOne()) return TRUE;
    if (operands[1]->IsZero()) return TRUE;
    return FALSE;
  }

  // Should never get here
  RNAbort("Unrecognized operation %d in algebraic");
  return FALSE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x8(%rdi), %r14d
cmpq $0x6, %r14
ja 0x21ab8
movq %rdi, %rbx
leaq 0x30ee2(%rip), %rax     # 0x5294c
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x10(%rbx), %rdi
callq 0x21a52
testl %eax, %eax
je 0x21ad8
movq 0x18(%rbx), %rdi
callq 0x21a52
jmp 0x21b09
movq 0x10(%rbx), %rdi
callq 0x21a52
testl %eax, %eax
je 0x21aa5
movq 0x18(%rbx), %rdi
callq 0x20144
testl %eax, %eax
jne 0x21afa
movq 0x18(%rbx), %rdi
callq 0x21a52
testl %eax, %eax
je 0x21ad8
movq 0x10(%rbx), %rdi
jmp 0x21b04
leaq 0x30fb4(%rip), %rdi     # 0x52a73
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x264a8
jmp 0x21b12
movq 0x10(%rbx), %rdi
callq 0x21a52
testl %eax, %eax
jne 0x21b00
xorl %r14d, %r14d
jmp 0x21b12
movq 0x20(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1ee18
movq 0x10(%rbx), %rdi
callq 0x21a52
testl %eax, %eax
je 0x21b00
pushq $0x1
popq %r14
jmp 0x21b12
movq 0x18(%rbx), %rdi
callq 0x20144
xorl %r14d, %r14d
testl %eax, %eax
setne %r14b
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::IsConstant() const
RNBoolean RNAlgebraic::
IsConstant(void) const
{
  // Return if algebraic algebraic is constant
  switch(operation) {
  case RN_ZERO_OPERATION:
    return TRUE;

  case RN_POLYNOMIAL_OPERATION:
    return polynomial->IsConstant();

  case RN_ADD_OPERATION:
  case RN_SUBTRACT_OPERATION:
  case RN_MULTIPLY_OPERATION:
  case RN_DIVIDE_OPERATION:
    return (operands[0]->IsConstant() && operands[1]->IsConstant());

  case RN_POW_OPERATION:
    if (operands[0]->IsConstant() && operands[1]->IsConstant()) return TRUE;
    if (operands[1]->IsZero()) return TRUE;
    return FALSE;
  }

  // Should never get here
  RNAbort("Unrecognized operation %d in algebraic");
  return FALSE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x8(%rdi), %eax
cmpq $0x6, %rax
ja 0x21b64
movq %rdi, %r14
pushq $0x1
popq %rbx
leaq 0x30e30(%rip), %rcx     # 0x52968
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%r14), %rdi
callq 0x21b1e
testl %eax, %eax
je 0x21b60
movq 0x18(%r14), %rdi
callq 0x21b1e
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x21ba0
xorl %ebx, %ebx
jmp 0x21ba0
leaq 0x30f08(%rip), %rdi     # 0x52a73
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x264a8
jmp 0x21ba0
movq 0x20(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1ee6a
movq 0x10(%r14), %rdi
callq 0x21b1e
testl %eax, %eax
je 0x21baa
movq 0x18(%r14), %rdi
callq 0x21b1e
testl %eax, %eax
je 0x21baa
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x18(%r14), %rdi
callq 0x20144
jmp 0x21b57
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::IsLinear() const
RNBoolean RNAlgebraic::
IsLinear(void) const
{
  // Return if algebraic is linear
  switch(operation) {
  case RN_ZERO_OPERATION:
    return TRUE;

  case RN_POLYNOMIAL_OPERATION:
    return polynomial->IsLinear();

  case RN_ADD_OPERATION:
  case RN_SUBTRACT_OPERATION:
    return (operands[0]->IsLinear() && operands[1]->IsLinear());

  case RN_MULTIPLY_OPERATION:
    if (operands[0]->IsLinear() && operands[1]->IsConstant()) return TRUE;
    if (operands[0]->IsConstant() && operands[1]->IsLinear()) return TRUE;
    return FALSE;

  case RN_DIVIDE_OPERATION:
    return (operands[0]->IsLinear() && operands[1]->IsConstant());

  case RN_POW_OPERATION:
    return (operands[1]->IsZero());
  }

  // Should never get here
  RNAbort("Unrecognized operation %d in algebraic");
  return FALSE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x8(%rdi), %eax
cmpq $0x6, %rax
ja 0x21bf5
movq %rdi, %r14
pushq $0x1
popq %rbx
leaq 0x30db4(%rip), %rcx     # 0x52984
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%r14), %rdi
callq 0x21bb6
testl %eax, %eax
je 0x21c7a
movq 0x18(%r14), %rdi
callq 0x21bb6
jmp 0x21c2d
leaq 0x30e77(%rip), %rdi     # 0x52a73
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x264a8
jmp 0x21c7c
movq 0x20(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1ee96
movq 0x10(%r14), %rdi
callq 0x21bb6
testl %eax, %eax
je 0x21c7a
movq 0x18(%r14), %rdi
callq 0x21b1e
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x21c7c
movq 0x18(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x20144
movq 0x10(%r14), %rdi
callq 0x21bb6
testl %eax, %eax
je 0x21c60
movq 0x18(%r14), %rdi
callq 0x21b1e
testl %eax, %eax
jne 0x21c7c
movq 0x10(%r14), %rdi
callq 0x21b1e
testl %eax, %eax
je 0x21c7a
movq 0x18(%r14), %rdi
callq 0x21bb6
testl %eax, %eax
jne 0x21c7c
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::IsQuadratic() const
RNBoolean RNAlgebraic::
IsQuadratic(void) const
{
  // Return if algebraic is quadratic
  switch(operation) {
  case RN_ZERO_OPERATION:
    return TRUE;

  case RN_POLYNOMIAL_OPERATION:
    return polynomial->IsQuadratic();

  case RN_ADD_OPERATION:
  case RN_SUBTRACT_OPERATION:
    return (operands[0]->IsQuadratic() && operands[1]->IsQuadratic());

  case RN_MULTIPLY_OPERATION:
    if (operands[0]->IsQuadratic() && operands[1]->IsConstant()) return TRUE;
    if (operands[0]->IsConstant() && operands[1]->IsQuadratic()) return TRUE;
    if (operands[0]->IsLinear() && operands[1]->IsLinear()) return TRUE;
    return FALSE;

  case RN_DIVIDE_OPERATION:
    return (operands[0]->IsQuadratic() && operands[1]->IsConstant());

  case RN_POW_OPERATION:
    return (operands[1]->IsZero());
  }

  // Should never get here
  RNAbort("Unrecognized operation %d in algebraic");
  return FALSE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x8(%rdi), %eax
cmpq $0x6, %rax
ja 0x21cc5
movq %rdi, %r14
pushq $0x1
popq %rbx
leaq 0x30d00(%rip), %rcx     # 0x529a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%r14), %rdi
callq 0x21c86
testl %eax, %eax
je 0x21d67
movq 0x18(%r14), %rdi
callq 0x21c86
jmp 0x21d00
leaq 0x30da7(%rip), %rdi     # 0x52a73
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x264a8
jmp 0x21d69
movq 0x20(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1ef0a
movq 0x10(%r14), %rdi
callq 0x21c86
testl %eax, %eax
je 0x21d67
movq 0x18(%r14), %rdi
callq 0x21b1e
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x21d69
movq 0x18(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x20144
movq 0x10(%r14), %rdi
callq 0x21c86
testl %eax, %eax
je 0x21d33
movq 0x18(%r14), %rdi
callq 0x21b1e
testl %eax, %eax
jne 0x21d69
movq 0x10(%r14), %rdi
callq 0x21b1e
testl %eax, %eax
je 0x21d4d
movq 0x18(%r14), %rdi
callq 0x21c86
testl %eax, %eax
jne 0x21d69
movq 0x10(%r14), %rdi
callq 0x21bb6
testl %eax, %eax
je 0x21d67
movq 0x18(%r14), %rdi
callq 0x21bb6
testl %eax, %eax
jne 0x21d69
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::IsPolynomial() const
RNBoolean RNAlgebraic::
IsPolynomial(void) const
{
  // Return if algebraic is polynomial
  switch(operation) {
  case RN_ZERO_OPERATION:
    return TRUE;

  case RN_POLYNOMIAL_OPERATION:
    return TRUE;

  case RN_ADD_OPERATION:
  case RN_SUBTRACT_OPERATION:
  case RN_MULTIPLY_OPERATION:
    return (operands[0]->IsPolynomial() && operands[1]->IsPolynomial());

  case RN_DIVIDE_OPERATION:
    return (operands[0]->IsPolynomial() && operands[1]->IsConstant());

  case RN_POW_OPERATION:
    return (operands[1]->IsConstant());
  }

  // Should never get here
  RNAbort("Unrecognized operation %d in algebraic");
  return FALSE;
}

// Assembly:
pushq %rbx
movl 0x8(%rdi), %eax
cmpq $0x6, %rax
ja 0x21dae
movq %rdi, %rbx
leaq 0x30c34(%rip), %rcx     # 0x529bc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%rbx), %rdi
callq 0x21d74
testl %eax, %eax
je 0x21ddf
movq 0x18(%rbx), %rdi
callq 0x21d74
jmp 0x21dd6
pushq $0x1
popq %rbx
jmp 0x21de1
leaq 0x30cbe(%rip), %rdi     # 0x52a73
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x264a8
jmp 0x21de1
movq 0x10(%rbx), %rdi
callq 0x21d74
testl %eax, %eax
je 0x21ddf
movq 0x18(%rbx), %rdi
callq 0x21b1e
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x21de1
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
retq
movq 0x18(%rbx), %rdi
popq %rbx
jmp 0x21b1e
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::HasVariable(int) const
RNBoolean RNAlgebraic::
HasVariable(int variable) const
{
  // Return whether algebraic has a variable
  switch(operation) {
  case RN_ZERO_OPERATION:
    return FALSE;

  case RN_POLYNOMIAL_OPERATION:
    return polynomial->HasVariable(variable);
   
  default:
    if (operands[0]->HasVariable(variable)) return TRUE;
    if (operands[1]->HasVariable(variable)) return TRUE;
    return FALSE;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x8(%rdi), %eax
testl %eax, %eax
je 0x21e3f
movl %esi, %ebx
movq %rdi, %r14
cmpl $0x1, %eax
jne 0x21e17
movq 0x20(%r14), %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1efb0
movq 0x10(%r14), %rdi
movl %ebx, %esi
callq 0x21df0
testl %eax, %eax
je 0x21e2b
pushq $0x1
popq %rax
jmp 0x21e3f
movq 0x18(%r14), %rdi
movl %ebx, %esi
callq 0x21df0
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::NVariables() const
int RNAlgebraic::
NVariables(void) const
{
  // Return whether algebraic has a variable
  switch(operation) {
  case RN_ZERO_OPERATION:
    return 0;

  case RN_POLYNOMIAL_OPERATION:
    return polynomial->NVariables();

  default: {
    // Find variable index range
    int min_v = INT_MAX, max_v = -1;
    UpdateVariableRange(min_v, max_v);

    // Check variable index range
    if (max_v < 0) return 0;
    if (min_v == INT_MAX) return 0;
    if (max_v < min_v) return 0;
    if (max_v == min_v) return 1;
    if (max_v == min_v + 1) return 2;
   
    // Allocate index stuff
    int nvariables = 0;
    int *marks = new int [ max_v + 1 ];
    for (int k = 0; k < max_v + 1; k++) marks[k] = 0;
    UpdateVariableIndex(max_v + 1, nvariables, marks, 1);
    delete [] marks;

    // Return count of unique variables
    return nvariables; }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl 0x8(%rdi), %eax
testl %eax, %eax
je 0x21f31
movq %rdi, %rbx
cmpl $0x1, %eax
jne 0x21e7a
movq 0x20(%rbx), %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1ec96
leaq 0x20(%rsp), %rsi
movl $0x7fffffff, (%rsi)     # imm = 0x7FFFFFFF
leaq 0x24(%rsp), %r14
orl $-0x1, (%r14)
movq %rbx, %rdi
movq %r14, %rdx
callq 0x21f3e
movl (%r14), %r14d
xorl %eax, %eax
testl %r14d, %r14d
js 0x21f31
movl 0x20(%rsp), %ecx
cmpl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
sete %dl
cmpl %ecx, %r14d
setl %sil
orb %dl, %sil
jne 0x21f31
cmpl %ecx, %r14d
jne 0x21ec9
pushq $0x1
jmp 0x21ed2
incl %ecx
cmpl %ecx, %r14d
jne 0x21ed5
pushq $0x2
popq %rax
jmp 0x21f31
andl $0x0, 0x1c(%rsp)
leaq 0x4(,%r14,4), %rdi
incq %r14
callq 0x4030
movq %rax, %r15
xorl %eax, %eax
cmpq %rax, %r14
je 0x21efe
andl $0x0, (%r15,%rax,4)
incq %rax
jmp 0x21eef
andl $0x0, 0x8(%rsp)
andq $0x0, (%rsp)
leaq 0x1c(%rsp), %r12
pushq $0x1
popq %r8
movq %rbx, %rdi
movl %r14d, %esi
movq %r12, %rdx
movq %r15, %rcx
xorl %r9d, %r9d
callq 0x21f88
movq %r15, %rdi
callq 0x4370
movl (%r12), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::UpdateVariableRange(int&, int&) const
void RNAlgebraic::
UpdateVariableRange(int& min_v, int& max_v) const
{
  // Update variable indices
  switch(operation) {
  case RN_ZERO_OPERATION: 
    return;
    
  case RN_POLYNOMIAL_OPERATION: 
    polynomial->UpdateVariableRange(min_v, max_v);
    return;

  default:
    operands[0]->UpdateVariableRange(min_v, max_v);
    operands[1]->UpdateVariableRange(min_v, max_v);
    return;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x8(%r15), %eax
testl %eax, %eax
je 0x21f82
cmpl $0x1, %eax
je 0x21f6e
movq 0x10(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x21f3e
movq 0x18(%r15), %r15
jmp 0x21f4c
movq 0x20(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x1ed6e
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::UpdateVariableIndex(int, int&, int*, int, int*, int*, int) const
void RNAlgebraic::
UpdateVariableIndex(int max_variables, int& variable_count, 
  int *variable_marks, int current_mark, 
  int *index_to_variable, int *variable_to_index,
  RNBoolean remap_variables) const
{
  // Just checking
  assert(variable_to_index || !remap_variables);

  // Update variable indices
  switch(operation) {
  case RN_ZERO_OPERATION: 
    return;
    
  case RN_POLYNOMIAL_OPERATION: 
    polynomial->UpdateVariableIndex(max_variables, variable_count, 
      variable_marks, current_mark, index_to_variable, variable_to_index, remap_variables);
    return;

  default:
    operands[0]->UpdateVariableIndex(max_variables, variable_count, 
      variable_marks, current_mark, index_to_variable, variable_to_index, remap_variables);
    operands[1]->UpdateVariableIndex(max_variables, variable_count, 
      variable_marks, current_mark, index_to_variable, variable_to_index, remap_variables);
    return;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movl %r8d, 0xc(%rsp)
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %r13
movl 0x58(%rsp), %ebx
movq 0x50(%rsp), %rbp
movl 0x8(%r13), %eax
testl %eax, %eax
je 0x22012
cmpl $0x1, %eax
je 0x21fe8
movq 0x10(%r13), %rdi
movl %r12d, %esi
movq %r15, %rdx
movq %r14, %rcx
movl 0xc(%rsp), %r8d
movq 0x10(%rsp), %r9
pushq %rbx
pushq %rbp
callq 0x21f88
popq %rax
popq %rcx
movq 0x18(%r13), %r13
jmp 0x21fb5
movq 0x20(%r13), %rdi
movl %r12d, %esi
movq %r15, %rdx
movq %r14, %rcx
movl 0xc(%rsp), %r8d
movq 0x10(%rsp), %r9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1edae
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Empty()
void RNAlgebraic::
Empty(void)
{
  // Just checking
  assert(IsValid());

  // Delete everything
  operation = RN_ZERO_OPERATION;
  if (operands[0]) { delete operands[0]; operands[0] = NULL; }
  if (operands[1]) { delete operands[1]; operands[1] = NULL; }
  if (polynomial) { delete polynomial; polynomial = NULL; }

  // Just checking
  assert(IsValid());
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
andl $0x0, 0x8(%rdi)
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x22041
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x10(%rbx)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x22055
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, 0x18(%rbx)
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0x22076
movq %r14, %rdi
callq 0x1ebc0
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x4290
andq $0x0, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Reset(gaps::RNPolynomial*)
void RNAlgebraic::
Reset(RNPolynomial *polynomial)
{
  // NOTE: THIS TAKES OVER MANAGEMENT OF MEMORY FOR POLYNOMIAL
  // SPECIFICALLY, POLYNOMIAL WILL BE DELETED WHEN ALGEBRAIC IS DECONSTRUCTED

  // Empty everything
  Empty();

  // Set polynomial
  if (polynomial) {
    operation = RN_POLYNOMIAL_OPERATION;
    this->polynomial = polynomial;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x22022
testq %rbx, %rbx
je 0x220d0
movl $0x1, 0x8(%r14)
movq %rbx, 0x20(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Multiply(double)
void RNAlgebraic::
Multiply(RNScalar value)
{
  // Just checking
  assert(IsValid());

  // Check value 
  if (value == 0.0) {
    Empty();
  }
  else if (value != 1.0) {
    switch(operation) {
    case RN_ZERO_OPERATION: 
      return;
    
    case RN_POLYNOMIAL_OPERATION:
      polynomial->Multiply(value);
      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 %rbx
pushq %rax
movq %rdi, %rbx
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x22100
jp 0x22100
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x22022
ucomisd 0x2ef08(%rip), %xmm0    # 0x51010
jne 0x2210c
jnp 0x2217d
movl 0x8(%rbx), %ebp
testl %ebp, %ebp
je 0x2217d
cmpl $0x1, %ebp
jne 0x2212b
movq 0x20(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1f05a
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 $0x4, 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
movq %r15, %r14
jmp 0x22193
movq %rax, %rbx
pushq $0x28
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(double)
void RNAlgebraic::
Add(RNScalar value)
{
  // Just checking
  assert(IsValid());

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

  // Add scalar
  switch(operation) {
  case RN_ZERO_OPERATION: 
    operation = RN_POLYNOMIAL_OPERATION;
    polynomial = new RNPolynomial(value, 0);
    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 %rbx
pushq %rax
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x221c4
jp 0x221c4
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
movl 0x8(%rdi), %ebp
cmpl $0x1, %ebp
je 0x22206
movsd %xmm0, (%rsp)
testl %ebp, %ebp
jne 0x22219
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)
jmp 0x221b9
movq 0x20(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7a02
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 $0x2, 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)
jmp 0x221b9
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r15, %rdi
jmp 0x22286
movq %rax, %rbx
pushq $0x28
jmp 0x22282
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x4290
movq %rbx, %rdi
callq 0x44d0
nop