LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
testl %esi, %esi
je 0x222c9
movslq 0xc(%rdi), %r13
testq %r13, %r13
jle 0x222c5
movl %esi, %ebp
movq (%rdi), %r14
xorl %r15d, %r15d
movq (%r14,%r15,8), %r12
movq %r12, %rdi
movl %ebp, %esi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
callq 0x22214
testl %eax, %eax
cmovneq %r12, %rbx
jne 0x222d9
incq %r15
cmpq %r15, %r13
jne 0x2229d
xorl %ebx, %ebx
jmp 0x222d9
movq (%rdi), %rax
movq (%rax), %rax
xorl %ebx, %ebx
cmpl $0x0, 0x8(%rax)
cmoveq %rax, %rbx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0x8(%rdi)
jle 0x2231c
movq 0x18(%rdi), %rax
xorl %ecx, %ecx
movl (%rax,%rcx,4), %r8d
cmpl (%rdx), %r8d
jle 0x22304
movl %r8d, (%rdx)
movl (%rax,%rcx,4), %r8d
cmpl (%rsi), %r8d
jge 0x22310
movl %r8d, (%rsi)
incq %rcx
movslq 0x8(%rdi), %r8
cmpq %r8, %rcx
jl 0x222f8
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0x8(%rdi)
jle 0x22384
pushq %r14
pushq %rbx
movl 0x20(%rsp), %eax
movq 0x18(%rsp), %rsi
movq 0x18(%rdi), %r10
xorl %r11d, %r11d
movslq (%r10,%r11,4), %rbx
cmpl %r8d, (%rcx,%rbx,4)
je 0x22366
testq %r9, %r9
je 0x2234d
movslq (%rdx), %r14
movl %ebx, (%r9,%r14,4)
testq %rsi, %rsi
je 0x2235c
movl (%rdx), %ebx
movslq (%r10,%r11,4), %r14
movl %ebx, (%rsi,%r14,4)
movslq (%r10,%r11,4), %rbx
movl %r8d, (%rcx,%rbx,4)
incl (%rdx)
testl %eax, %eax
je 0x22375
movslq (%r10,%r11,4), %rbx
movl (%rsi,%rbx,4), %ebx
movl %ebx, (%r10,%r11,4)
incq %r11
movslq 0x8(%rdi), %rbx
cmpq %rbx, %r11
jl 0x22337
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x8(%rsi), %rax
movl %eax, 0x8(%rdi)
movsd 0x10(%rsi), %xmm0
movsd %xmm0, 0x10(%rdi)
testq %rax, %rax
je 0x22624
movq %rsi, %r14
leaq (,%rax,4), %rdi
movq %rax, %r12
shlq $0x3, %r12
testl %eax, %eax
movq $-0x1, %rax
cmovsq %rax, %rdi
cmovsq %rax, %r12
callq 0x4030
movq %rax, %r15
movq %rax, 0x18(%rbx)
movq %r12, %rdi
callq 0x4030
movq %rax, 0x20(%rbx)
cmpl $0x0, 0x8(%rbx)
jle 0x2262b
movq 0x18(%r14), %rcx
movq 0x20(%r14), %rdx
movl 0x8(%rbx), %edi
cmpl $0x2, %edi
movl $0x1, %esi
cmovgel %edi, %esi
xorl %edi, %edi
movl (%rcx,%rdi,4), %r8d
movl %r8d, (%r15,%rdi,4)
movsd (%rdx,%rdi,8), %xmm0
movsd %xmm0, (%rax,%rdi,8)
incq %rdi
cmpq %rdi, %rsi
jne 0x22608
jmp 0x2262b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2266e
callq 0x4350
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x2267c
callq 0x4350
movq $0x0, 0x10(%rbx)
movl $0x0, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x59127(%rip), %rax     # 0x7b800
movq %rax, (%rdi)
movl $0x0, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
testq %rsi, %rsi
je 0x22731
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2129e
testl %eax, %eax
je 0x22725
movq %rbx, %rdi
callq 0x21014
movl $0x10, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4280
movl $0x1, 0x8(%r14)
movq %rbx, 0x20(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x590bb(%rip), %rax     # 0x7b800
movq %rax, (%rdi)
movl $0x0, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
testq %rsi, %rsi
je 0x227ba
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x227c2
testl %eax, %eax
jne 0x227aa
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)
movl $0x0, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq $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_O1/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x8(%rbx), %eax
cmpl $0x6, %eax
jne 0x227d6
movq 0x10(%rbx), %rbx
jmp 0x227c8
jae 0x2285c
movl %eax, %eax
leaq 0x37eeb(%rip), %rcx     # 0x5a6d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%rbx), %rdi
callq 0x227c2
testl %eax, %eax
jne 0x22833
jmp 0x2281d
movq 0x10(%rbx), %rdi
callq 0x227c2
testl %eax, %eax
je 0x2281d
movq 0x18(%rbx), %rdi
callq 0x227c2
xorl %ebp, %ebp
testl %eax, %eax
sete %bpl
jmp 0x2286c
xorl %ebp, %ebp
jmp 0x2286c
movq 0x10(%rbx), %rdi
callq 0x227c2
movl $0x1, %ebp
testl %eax, %eax
jne 0x2286c
movq 0x18(%rbx), %rdi
callq 0x227c2
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
jmp 0x2286c
movl $0x1, %ebp
jmp 0x2286c
movq 0x20(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2129e
leaq 0x38054(%rip), %rdi     # 0x5a8b7
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x297ae
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x58f7b(%rip), %rax     # 0x7b800
movq %rax, (%rdi)
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
movl $0x0, 0x8(%rdi)
xorpd %xmm2, %xmm2
movupd %xmm2, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
jne 0x228ac
jnp 0x228e9
movl %esi, %ebp
movq %rdi, %rbx
movl $0x10, %edi
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, (%rsp)
callq 0x4270
movq %rax, %r14
movq %rax, %rdi
movsd (%rsp), %xmm0
movl %ebp, %esi
movsd 0x8(%rsp), %xmm1
callq 0x20d66
movq %r14, 0x20(%rbx)
movl $0x1, 0x8(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movl $0x10, %esi
movq %r14, %rdi
callq 0x4280
movq %rbx, %rdi
callq 0x44b0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x58ee4(%rip), %rax     # 0x7b800
movq %rax, (%rdi)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl $0x0, 0x8(%rdi)
xorpd %xmm1, %xmm1
movupd %xmm1, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
jne 0x22943
jnp 0x22988
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %rbx
movl $0x10, %edi
movsd %xmm0, (%rsp)
callq 0x4270
movq %rax, %r13
movq %rax, %rdi
movsd (%rsp), %xmm0
movl %r12d, %esi
movq %r15, %rdx
movq %r14, %rcx
movl %ebp, %r8d
callq 0x20dd4
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
movl $0x10, %esi
movq %r13, %rdi
callq 0x4280
movq %rbx, %rdi
callq 0x44b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x58e3e(%rip), %rax     # 0x7b800
movq %rax, (%rdi)
movl $0x0, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
movq %rsi, %rdi
callq 0x2129e
testl %eax, %eax
jne 0x22a0a
movl $0x1, 0x8(%rbx)
movl $0x10, %edi
callq 0x4270
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x20cce
movq %r15, 0x20(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x10, %esi
movq %r15, %rdi
callq 0x4280
movq %rbx, %rdi
callq 0x44b0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x58dc6(%rip), %rax     # 0x7b800
movq %rax, (%rdi)
movl $0x0, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
movq %rsi, %rdi
callq 0x227c2
testl %eax, %eax
je 0x22a65
popq %rbx
popq %r14
popq %r15
retq
movl 0x8(%r14), %eax
testl %eax, %eax
je 0x22a5f
cmpl $0x1, %eax
jne 0x22a98
movl $0x1, 0x8(%rbx)
movl $0x10, %edi
callq 0x4270
movq %rax, %r15
movq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x20cce
movq %r15, 0x20(%rbx)
jmp 0x22a5f
movl %eax, 0x8(%rbx)
movl $0x28, %edi
callq 0x4270
movq %rax, %r15
movq 0x10(%r14), %rsi
movq %rax, %rdi
callq 0x22a28
leaq 0x10(%rbx), %rax
movq %r15, (%rax)
movl $0x28, %edi
callq 0x4270
movq %rax, %r15
movq 0x18(%r14), %rsi
movq %rax, %rdi
callq 0x22a28
movq %r15, 0x18(%rbx)
jmp 0x22a5f
jmp 0x22adc
movq %rax, %rbx
movl $0x28, %esi
jmp 0x22aee
movq %rax, %rbx
movl $0x10, %esi
movq %r15, %rdi
callq 0x4280
movq %rbx, %rdi
callq 0x44b0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2320d
cmpl $0x1, 0x8(%rbx)
jne 0x2320d
movq 0x20(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0x22d8c
movl $0x0, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq $0x0, 0x20(%rbx)
testq %rbx, %rbx
je 0x23255
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
movl $0x28, %edi
movsd %xmm0, (%rsp)
callq 0x4270
movq %rax, %r15
movq %rax, %rdi
movsd (%rsp), %xmm0
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2290a
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %rbx, %rcx
movl $0x1, %r8d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x23dbe
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x28, %esi
movq %r15, %rdi
callq 0x4280
movq %rbx, %rdi
callq 0x44b0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x23aa6
movl $0x28, %edi
callq 0x4270
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x226ce
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
movq %rbx, %rcx
movl $0x1, %r8d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x23dbe
cmpl $0x1, 0x8(%rbx)
jne 0x23aec
movq 0x20(%rbx), %rcx
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0x23630
movl $0x0, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq $0x0, 0x20(%rbx)
testq %rbx, %rbx
je 0x23b4d
movq (%rbx), %rax
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
cmpl $0x1, 0xc(%r14)
jne 0x23a70
movq (%r14), %rax
movq (%rax), %rdi
callq 0x210ca
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x23a70
jp 0x23a70
movq (%r14), %rax
movq (%rax), %rax
movsd 0x10(%rax), %xmm0
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x231b6
movq %r14, %rdi
callq 0x21014
movl $0x10, %esi
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4280
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x28, %esi
movq %r12, %rdi
callq 0x4280
movq %rbx, %rdi
callq 0x44b0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x23bed
cmpl $0x1, 0x8(%rbx)
jne 0x23bed
movq 0x20(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0x232a0
movl $0x0, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq $0x0, 0x20(%rbx)
testq %rbx, %rbx
je 0x23c35
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
movl $0x28, %edi
movsd %xmm0, (%rsp)
callq 0x4270
movq %rax, %r15
movq %rax, %rdi
movsd (%rsp), %xmm0
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2290a
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
movq %r15, %rcx
movl $0x1, %r8d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x23dbe
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x28, %esi
movq %r15, %rdi
callq 0x4280
movq %rbx, %rdi
callq 0x44b0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x23cce
movl $0x28, %edi
callq 0x4270
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x226ce
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
movq %r12, %rcx
movl $0x1, %r8d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x23dbe
cmpl $0x1, 0x8(%rbx)
jne 0x23d14
movq 0x20(%rbx), %rdx
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x23630
movl $0x0, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq $0x0, 0x20(%rbx)
testq %rbx, %rbx
je 0x23d75
movq (%rbx), %rax
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
cmpl $0x1, 0xc(%r14)
jne 0x23c98
movq (%r14), %rax
movq (%rax), %rdi
callq 0x210ca
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x23c98
jp 0x23c98
movq (%r14), %rax
movq (%rax), %rax
movsd 0x10(%rax), %xmm0
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x23b96
movq %r14, %rdi
callq 0x21014
movl $0x10, %esi
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4280
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x28, %esi
movq %r12, %rdi
callq 0x4280
movq %rbx, %rdi
callq 0x44b0
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x36570(%rip), %r14     # 0x5a774
movl 0x8(%rbx), %eax
cmpq $0x6, %rax
ja 0x2422b
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
movq 0x10(%rbx), %rbx
jmp 0x24204
movq 0x10(%rbx), %rdi
callq 0x241f6
movq 0x18(%rbx), %rbx
jmp 0x24204
leaq 0x36685(%rip), %rdi     # 0x5a8b7
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x297ae
movdqu 0x10(%rbx), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x20(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2151a
movsd 0x35599(%rip), %xmm0    # 0x59808
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x24930
// File: /workspace/github_cpp_makefile_star2_O1/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 0x242ed
movq %rdi, %rbx
leaq 0x364fa(%rip), %rax     # 0x5a790
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x10(%rbx), %rdi
callq 0x2427e
testl %eax, %eax
je 0x2430d
movq 0x18(%rbx), %rdi
callq 0x2427e
jmp 0x2433e
movq 0x10(%rbx), %rdi
callq 0x2427e
testl %eax, %eax
je 0x242da
movq 0x18(%rbx), %rdi
callq 0x227c2
movl $0x1, %r14d
testl %eax, %eax
jne 0x24347
movq 0x18(%rbx), %rdi
callq 0x2427e
testl %eax, %eax
je 0x2430d
movq 0x10(%rbx), %rdi
jmp 0x24339
leaq 0x365c3(%rip), %rdi     # 0x5a8b7
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x297ae
jmp 0x24347
movq 0x10(%rbx), %rdi
callq 0x2427e
testl %eax, %eax
jne 0x24335
xorl %r14d, %r14d
jmp 0x24347
movq 0x20(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x212a8
movq 0x10(%rbx), %rdi
callq 0x2427e
movl $0x1, %r14d
testl %eax, %eax
jne 0x24347
movq 0x18(%rbx), %rdi
callq 0x227c2
xorl %r14d, %r14d
testl %eax, %eax
setne %r14b
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2439a
movq %rdi, %r14
movl $0x1, %ebx
leaq 0x3643e(%rip), %rcx     # 0x5a7ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%r14), %rdi
callq 0x24352
testl %eax, %eax
je 0x24396
movq 0x18(%r14), %rdi
callq 0x24352
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x243d6
xorl %ebx, %ebx
jmp 0x243d6
leaq 0x36516(%rip), %rdi     # 0x5a8b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x297ae
jmp 0x243d6
movq 0x20(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x212fa
movq 0x10(%r14), %rdi
callq 0x24352
testl %eax, %eax
je 0x243e0
movq 0x18(%r14), %rdi
callq 0x24352
testl %eax, %eax
je 0x243e0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x18(%r14), %rdi
callq 0x227c2
jmp 0x2438d
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2442d
movq %rdi, %r14
movl $0x1, %ebx
leaq 0x363c0(%rip), %rcx     # 0x5a7c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%r14), %rdi
callq 0x243ec
testl %eax, %eax
je 0x244b2
movq 0x18(%r14), %rdi
callq 0x243ec
jmp 0x24465
leaq 0x36483(%rip), %rdi     # 0x5a8b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x297ae
jmp 0x244b4
movq 0x20(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21328
movq 0x10(%r14), %rdi
callq 0x243ec
testl %eax, %eax
je 0x244b2
movq 0x18(%r14), %rdi
callq 0x24352
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x244b4
movq 0x18(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x227c2
movq 0x10(%r14), %rdi
callq 0x243ec
testl %eax, %eax
je 0x24498
movq 0x18(%r14), %rdi
callq 0x24352
testl %eax, %eax
jne 0x244b4
movq 0x10(%r14), %rdi
callq 0x24352
testl %eax, %eax
je 0x244b2
movq 0x18(%r14), %rdi
callq 0x243ec
testl %eax, %eax
jne 0x244b4
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x244ff
movq %rdi, %r14
movl $0x1, %ebx
leaq 0x3630a(%rip), %rcx     # 0x5a7e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%r14), %rdi
callq 0x244be
testl %eax, %eax
je 0x245a1
movq 0x18(%r14), %rdi
callq 0x244be
jmp 0x2453a
leaq 0x363b1(%rip), %rdi     # 0x5a8b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x297ae
jmp 0x245a3
movq 0x20(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x213b6
movq 0x10(%r14), %rdi
callq 0x244be
testl %eax, %eax
je 0x245a1
movq 0x18(%r14), %rdi
callq 0x24352
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x245a3
movq 0x18(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x227c2
movq 0x10(%r14), %rdi
callq 0x244be
testl %eax, %eax
je 0x2456d
movq 0x18(%r14), %rdi
callq 0x24352
testl %eax, %eax
jne 0x245a3
movq 0x10(%r14), %rdi
callq 0x24352
testl %eax, %eax
je 0x24587
movq 0x18(%r14), %rdi
callq 0x244be
testl %eax, %eax
jne 0x245a3
movq 0x10(%r14), %rdi
callq 0x243ec
testl %eax, %eax
je 0x245a1
movq 0x18(%r14), %rdi
callq 0x243ec
testl %eax, %eax
jne 0x245a3
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x245ea
movq %rdi, %rbx
leaq 0x3623e(%rip), %rcx     # 0x5a800
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%rbx), %rdi
callq 0x245ae
testl %eax, %eax
je 0x2461b
movq 0x18(%rbx), %rdi
callq 0x245ae
jmp 0x24612
movl $0x1, %ebx
jmp 0x2461d
leaq 0x362c6(%rip), %rdi     # 0x5a8b7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x297ae
jmp 0x2461d
movq 0x10(%rbx), %rdi
callq 0x245ae
testl %eax, %eax
je 0x2461b
movq 0x18(%rbx), %rdi
callq 0x24352
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x2461d
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
retq
movq 0x18(%rbx), %rdi
popq %rbx
jmp 0x24352
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2467d
movl %esi, %ebx
movq %rdi, %r14
cmpl $0x1, %eax
jne 0x24653
movq 0x20(%r14), %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21484
movq 0x10(%r14), %rdi
movl %ebx, %esi
callq 0x2462c
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x2467d
movq 0x18(%r14), %rdi
movl %ebx, %esi
callq 0x2462c
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_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl 0x8(%rdi), %eax
testl %eax, %eax
je 0x24776
movq %rdi, %rbx
cmpl $0x1, %eax
jne 0x246be
movq 0x20(%rbx), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x210f0
leaq 0xc(%rsp), %rsi
movl $0x7fffffff, (%rsi)     # imm = 0x7FFFFFFF
leaq 0x14(%rsp), %r14
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
movq %rbx, %rdi
movq %r14, %rdx
callq 0x24786
movl (%r14), %r14d
xorl %eax, %eax
testl %r14d, %r14d
js 0x24776
movl 0xc(%rsp), %ecx
cmpl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
sete %dl
cmpl %ecx, %r14d
setl %sil
orb %dl, %sil
jne 0x24776
movl $0x1, %eax
cmpl %ecx, %r14d
je 0x24776
incl %ecx
movl $0x2, %eax
cmpl %ecx, %r14d
je 0x24776
xorl %ebp, %ebp
leaq 0x10(%rsp), %r15
movl %ebp, (%r15)
leaq 0x4(,%r14,4), %r12
incq %r14
movq %r12, %rdi
callq 0x4030
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x4160
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rdx
movq %r13, %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
pushq %rbp
pushq $0x0
callq 0x247d0
addq $0x10, %rsp
movq %r13, %rdi
callq 0x4350
movl (%r15), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x247ca
cmpl $0x1, %eax
je 0x247b6
movq 0x10(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x24786
movq 0x18(%r15), %r15
jmp 0x24794
movq 0x20(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x211ea
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2485c
cmpl $0x1, %eax
je 0x24832
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 0x247d0
addq $0x10, %rsp
movq 0x18(%r13), %r13
jmp 0x247fd
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 0x21238
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0x0, 0x8(%rdi)
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x24891
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x10(%rbx)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x248a8
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x18(%rbx)
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0x248ce
movq %r14, %rdi
callq 0x21014
movl $0x10, %esi
movq %r14, %rdi
callq 0x4280
movq $0x0, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNMath/RNAlgebraic.cpp
// Function: gaps::RNAlgebraic::Reset(int, gaps::RNAlgebraic*, gaps::RNAlgebraic*)
void RNAlgebraic::
Reset(int operation, RNAlgebraic *operand1, RNAlgebraic *operand2)
{
  // Just checking
  assert(IsValid());
  assert((operation != RN_ZERO_OPERATION) && (operation != RN_POLYNOMIAL_OPERATION));
  assert(operand1 && operand2);

  // Reset everything
  Empty();

  // Set operation
  this->operation = operation;
  this->operands[0] = operand1;
  this->operands[1] = operand2;

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
callq 0x2486c
movl %ebp, 0x8(%r15)
movq %r14, 0x10(%r15)
movq %rbx, 0x18(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2486c
testq %rbx, %rbx
je 0x24928
movl $0x1, 0x8(%r14)
movq %rbx, 0x20(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x24958
jp 0x24958
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2486c
ucomisd 0x346b0(%rip), %xmm0    # 0x59010
jne 0x24968
jnp 0x24a08
movl 0x8(%rbx), %ebp
testl %ebp, %ebp
je 0x24a08
cmpl $0x1, %ebp
jne 0x2498b
movq 0x20(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21548
movsd %xmm0, (%rsp)
movl $0x28, %edi
callq 0x4270
movq %rax, %r14
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
leaq 0x56e54(%rip), %rax     # 0x7b800
movq %rax, (%r14)
movl $0x0, 0x8(%r14)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x10(%r14)
movq $0x0, 0x20(%r14)
movq %r14, %rdi
movl %ebp, %esi
xorl %r8d, %r8d
callq 0x23dbe
movl $0x4, 0x8(%rbx)
movl $0x28, %edi
callq 0x4270
movq %rax, %r15
movq %rax, %rdi
movsd (%rsp), %xmm0
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2290a
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 0x24a1e
movq %rax, %rbx
movl $0x28, %esi
movq %r14, %rdi
callq 0x4280
movq %rbx, %rdi
callq 0x44b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x24a52
jp 0x24a52
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
movl 0x8(%rdi), %ebp
cmpl $0x1, %ebp
je 0x24a96
movsd %xmm0, (%rsp)
testl %ebp, %ebp
jne 0x24ab8
movl $0x1, 0x8(%rbx)
movl $0x10, %edi
callq 0x4270
movq %rax, %r14
movq %rax, %rdi
movsd (%rsp), %xmm0
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x20dd4
movq %r14, 0x20(%rbx)
jmp 0x24a47
movq 0x20(%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20e38
movl $0x28, %edi
callq 0x4270
movq %rax, %r14
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rcx
leaq 0x56d2c(%rip), %rax     # 0x7b800
movq %rax, (%r14)
movl $0x0, 0x8(%r14)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x10(%r14)
movq $0x0, 0x20(%r14)
movq %r14, %rdi
movl %ebp, %esi
xorl %r8d, %r8d
callq 0x23dbe
movl $0x2, 0x8(%rbx)
movl $0x28, %edi
callq 0x4270
movq %rax, %r15
movq %rax, %rdi
movsd (%rsp), %xmm0
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2290a
movq %r15, 0x10(%rbx)
movq %r14, 0x18(%rbx)
jmp 0x24a47
movq %rax, %rbx
movl $0x28, %esi
movq %r15, %rdi
jmp 0x24b57
movq %rax, %rbx
movl $0x28, %esi
jmp 0x24b54
movq %rax, %rbx
movl $0x10, %esi
movq %r14, %rdi
callq 0x4280
movq %rbx, %rdi
callq 0x44b0