LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/imrosan[P]sql-format/./sql_format/detail/sf_detail_data.h
// Function: SqlFormat::Detail::Data<SqlFormat::Detail::LikeData, false>::format[abi:cxx11](DefaultEscapeHandler&)
virtual std::string format(EscapeHandler& escapeHandler)
    {
        const LikeData& likeData = GetData();
        int likeMode = likeData.likeMode;

        std::string result = "'";

        if ((likeMode & LikeData::LIKE_MODE_LEFT) != 0)
        {
            result += '%';
        }

        result += HandleEscape(escapeHandler, likeData.s);

        if ((likeMode & LikeData::LIKE_MODE_RIGHT) != 0)
        {
            result += '%';
        }

        result += "'";

        return result; 
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x28(%rsi), %r15d
leaq 0xee3(%rip), %rsi       # 0x40ef
leaq -0x38(%rbp), %rdx
callq 0x2080
testb $0x1, %r15b
je 0x3226
pushq $0x25
popq %rsi
movq %rbx, %rdi
callq 0x2100
addq $0x8, %r14
leaq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x2170
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0x2220
leaq -0x38(%rbp), %rdi
callq 0x2248
testb $0x2, %r15b
je 0x325c
pushq $0x25
popq %rsi
movq %rbx, %rdi
callq 0x2100
leaq 0xe8c(%rip), %rsi       # 0x40ef
movq %rbx, %rdi
callq 0x2210
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq -0x38(%rbp), %rdi
callq 0x2248
jmp 0x328c
jmp 0x3289
movq %rax, %r14
movq %rbx, %rdi
callq 0x2248
movq %r14, %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O2/imrosan[P]sql-format/./sql_format/detail/sf_detail_data.h
// Function: SqlFormat::Detail::Data<SqlFormat::Detail::InData<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, false>::format(DefaultEscapeHandler&)
virtual std::string format(EscapeHandler& escapeHandler)
    {
        const InData<T>& inData = this->GetData();
        const std::vector<T>& dataList = inData.dataList;

        std::string result = "(";

        for (size_t i = 0; i < dataList.size(); ++i)
        {
            if (i > 0)
            {
                result += ',';
            }

            DataBase* d = NewData(dataList[i]);
            result += d->format(escapeHandler);
            delete d;
        }

        result += ")";

        return result; 
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, -0x38(%rbp)
movq %rsi, %r15
leaq 0x9c5(%rip), %rsi       # 0x4122
leaq -0x58(%rbp), %r12
movq %rdi, -0x30(%rbp)
movq %r12, %rdx
callq 0x2080
xorl %r14d, %r14d
xorl %ebx, %ebx
movq 0x8(%r15), %rdi
movq 0x10(%r15), %rax
subq %rdi, %rax
sarq $0x5, %rax
cmpq %rax, %rbx
jae 0x37da
testq %rbx, %rbx
je 0x379b
movq -0x30(%rbp), %rdi
pushq $0x2c
popq %rsi
callq 0x2100
movq 0x8(%r15), %rdi
addq %r14, %rdi
callq 0x3827
movq %rax, %r13
movq (%rax), %rax
movq %r12, %rdi
movq %r13, %rsi
movq -0x38(%rbp), %rdx
callq *(%rax)
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0x2220
movq %r12, %rdi
callq 0x2248
movq %r13, %rdi
callq 0x2130
incq %rbx
addq $0x20, %r14
jmp 0x3772
leaq 0x93f(%rip), %rsi       # 0x4120
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x2210
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3813
jmp 0x3813
movq %rax, %r14
leaq -0x58(%rbp), %rdi
callq 0x2248
jmp 0x3816
jmp 0x3813
movq %rax, %r14
movq -0x30(%rbp), %rdi
callq 0x2248
movq %r14, %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/pfm2pfm/../../pkgs/R2Shapes/R2Grid.h
// Function: Delta(gaps::R2Grid*, int, int)
inline RNScalar R2Grid::
GridValue(int i, int j) const
{
  // Return value at grid point
  assert((0 <= i) && (i < XResolution()));
  assert((0 <= j) && (j < YResolution()));
  return grid_values[j * grid_row_size + i];
}

// Assembly:
movq 0xb8(%rdi), %rax
movslq 0xc8(%rdi), %rcx
movl %ecx, %r8d
imull %edx, %r8d
addl %esi, %r8d
movslq %r8d, %r8
movsd (%rax,%r8,8), %xmm1
movsd 0x4c2d3(%rip), %xmm0    # 0x51008
ucomisd %xmm0, %xmm1
jne 0x4d3e
jp 0x4d3e
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movslq %esi, %rsi
movslq %edx, %rdx
leaq -0x1(%rdx), %r8
imulq %rcx, %r8
leaq (,%rsi,8), %r9
leaq (%r9,%r8,8), %r8
addq %r8, %rax
shlq $0x3, %rcx
xorl %r8d, %r8d
xorpd %xmm2, %xmm2
movabsq $-0x1, %r9
movsd 0x4c28a(%rip), %xmm0    # 0x51008
movq %r9, %r10
cmpq $0x2, %r10
je 0x4dea
leaq (%r10,%rdx), %r11
movq %r9, %rbx
cmpq $0x2, %rbx
je 0x4de2
movl %ebx, %ebp
orl %r10d, %ebp
je 0x4ddd
movq %rsi, %r14
addq %rbx, %r14
js 0x4ddd
testq %r11, %r11
sets %bpl
movslq 0xc0(%rdi), %r15
cmpq %r15, %r14
setge %r14b
orb %bpl, %r14b
jne 0x4ddd
movslq 0xc4(%rdi), %r14
cmpq %r14, %r11
jge 0x4ddd
movsd (%rax,%rbx,8), %xmm3
ucomisd %xmm0, %xmm3
jne 0x4dd6
jnp 0x4ddd
addsd %xmm3, %xmm2
incl %r8d
incq %rbx
jmp 0x4d8e
incq %r10
addq %rcx, %rax
jmp 0x4d81
testl %r8d, %r8d
popq %rbx
popq %r14
popq %r15
popq %rbp
je 0x4d3d
cvtsi2sd %r8d, %xmm0
divsd %xmm0, %xmm2
subsd %xmm2, %xmm1
movapd %xmm1, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/pfm2pfm/pfm2pfm.cpp
// Function: SUN3DBitshift(gaps::R2Grid*)
void SUN3DBitshift(R2Grid *grid)
{
  for (int i = 0; i < grid->NEntries(); i++) {
    unsigned int d = (unsigned int) (grid->GridValue(i) + 0.5);
    d = ((d >> 3) & 0x1FFF) | ((d & 0x7) << 13);
    grid->SetGridValue(i, d);
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
xorl %ecx, %ecx
movsd 0x4ba69(%rip), %xmm0    # 0x51038
cmpq %rax, %rcx
jge 0x560e
movq 0xb8(%rdi), %rdx
movsd (%rdx,%rcx,8), %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rsi
movl %esi, %r8d
shrl $0x3, %r8d
andl $0x1fff, %r8d           # imm = 0x1FFF
shll $0xd, %esi
movzwl %si, %esi
orl %r8d, %esi
cvtsi2sd %esi, %xmm1
movsd %xmm1, (%rdx,%rcx,8)
incq %rcx
jmp 0x55cf
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/pfm2pfm/pfm2pfm.cpp
// Function: Hash(gaps::R2Grid*, int)
void Hash(R2Grid *grid, int nvalues)
{
  // Get some stats
  RNInterval range = grid->Range();
  if (range.Diameter() == 0) return;
  RNScalar scale = 1.0 / range.Diameter();
  
  // Replace values with hash to value in [0:nvalues-1]
  for (int iy = 0; iy < grid->YResolution(); iy++) {
    for (int ix = 0; ix < grid->XResolution(); ix++) {
      RNScalar value = grid->GridValue(ix, iy);
      if (value == R2_GRID_UNKNOWN_VALUE) continue;
      int hash = (int) (nvalues * scale * (value - range.Min()));
      if (hash > nvalues-1) hash = nvalues-1;
      grid->SetGridValue(ix, iy, hash);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x88c4
movsd 0x8(%r15), %xmm0
subsd (%r15), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5650
jp 0x5650
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movsd 0x4b9b8(%rip), %xmm1    # 0x51010
divsd %xmm0, %xmm1
movl 0xc4(%r14), %eax
cvtsi2sd %ebx, %xmm0
mulsd %xmm1, %xmm0
leal -0x1(%rbx), %ecx
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
movsd 0x4b98b(%rip), %xmm1    # 0x51008
xorl %esi, %esi
cmpl %eax, %esi
je 0x5645
movl 0xc0(%r14), %edi
testl %edi, %edi
cmovlel %edx, %edi
movslq %esi, %r8
xorl %r9d, %r9d
cmpl %r9d, %edi
je 0x56e0
movq 0xb8(%r14), %r10
movslq 0xc8(%r14), %r11
imulq %r8, %r11
addq %r9, %r11
movsd (%r10,%r11,8), %xmm2
ucomisd %xmm1, %xmm2
jne 0x56bd
jnp 0x56db
subsd 0x8(%rsp), %xmm2
mulsd %xmm0, %xmm2
cvttsd2si %xmm2, %ebp
cmpl %ebx, %ebp
jl 0x56d1
movl %ecx, %ebp
cvtsi2sd %ebp, %xmm2
movsd %xmm2, (%r10,%r11,8)
incq %r9
jmp 0x5695
incl %esi
jmp 0x567f
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/pfm2pfm/pfm2pfm.cpp
// Function: DU(gaps::R2Grid*)
void DU(R2Grid *grid)
{
  R2Grid f(*grid);
  grid->Clear(R2_GRID_UNKNOWN_VALUE);
  for (int iy = 0; iy < grid->YResolution(); iy++) {
    for (int ix = 0; ix < grid->XResolution()-1; ix++) {
      RNScalar d0 = f.GridValue(ix, iy);
      if (RNIsZero(d0) || (d0 == R2_GRID_UNKNOWN_VALUE)) continue;
      RNScalar d1 = f.GridValue(ix+1, iy);
      if (RNIsZero(d1) || (d1 == R2_GRID_UNKNOWN_VALUE)) continue;
      grid->SetGridValue(ix, iy, d1 - d0);
    }
  }
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x86e4
movsd 0x4b906(%rip), %xmm0    # 0x51008
movq %rbx, %rdi
callq 0x9ca8
movl 0xc4(%rbx), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
pushq $0x1
popq %rdx
leaq 0x71c87(%rip), %rsi     # 0x773a8
movapd 0x4b937(%rip), %xmm0    # 0x51060
movsd 0x4b8d7(%rip), %xmm6    # 0x51008
cmpl %eax, %ecx
je 0x580b
movl 0xc0(%rbx), %edi
cmpl $0x2, %edi
cmovll %edx, %edi
movq 0xb8(%rsp), %r8
decl %edi
movl 0xc8(%rsp), %r9d
imull %ecx, %r9d
movslq %r9d, %r9
leaq (%r8,%r9,8), %r8
addq $0x8, %r8
movslq %ecx, %r9
xorl %r10d, %r10d
cmpq %r10, %rdi
je 0x5804
movsd -0x8(%r8,%r10,8), %xmm1
ucomisd %xmm6, %xmm1
jne 0x5784
jnp 0x57fc
movsd (%rsi), %xmm4
movapd %xmm4, %xmm3
xorpd %xmm0, %xmm3
movapd %xmm1, %xmm2
cmplepd %xmm4, %xmm2
movapd %xmm3, %xmm5
cmplepd %xmm1, %xmm5
andpd %xmm2, %xmm5
movd %xmm5, %r11d
testb $0x1, %r11b
jne 0x57fc
movsd (%r8,%r10,8), %xmm2
ucomisd %xmm6, %xmm2
jne 0x57bf
jnp 0x57fc
movapd %xmm2, %xmm5
cmplepd %xmm4, %xmm5
cmplepd %xmm2, %xmm3
andpd %xmm5, %xmm3
movd %xmm3, %r11d
testb $0x1, %r11b
jne 0x57fc
subsd %xmm1, %xmm2
movslq 0xc8(%rbx), %r11
imulq %r9, %r11
shlq $0x3, %r11
addq 0xb8(%rbx), %r11
movsd %xmm2, (%r11,%r10,8)
incq %r10
jmp 0x576c
incl %ecx
jmp 0x5731
movq %rsp, %rdi
callq 0x889c
addq $0xd0, %rsp
popq %rbx
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x889c
movq %rbx, %rdi
callq 0x44d0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/pfm2pfm/pfm2pfm.cpp
// Function: DV(gaps::R2Grid*)
void DV(R2Grid *grid)
{
  R2Grid f(*grid);
  grid->Clear(R2_GRID_UNKNOWN_VALUE);
  for (int iy = 0; iy < grid->YResolution()-1; iy++) {
    for (int ix = 0; ix < grid->XResolution(); ix++) {
      RNScalar d0 = f.GridValue(ix, iy);
      if (RNIsZero(d0) || (d0 == R2_GRID_UNKNOWN_VALUE)) continue;
      RNScalar d1 = f.GridValue(ix, iy+1);
      if (RNIsZero(d1) || (d1 == R2_GRID_UNKNOWN_VALUE)) continue;
      grid->SetGridValue(ix, iy, d1 - d0);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x86e4
movsd 0x4b7b4(%rip), %xmm0    # 0x51008
movq %rbx, %rdi
callq 0x9ca8
movl 0xc4(%rbx), %eax
cmpl $0x2, %eax
pushq $0x1
popq %rcx
cmovll %ecx, %eax
decl %eax
xorl %edx, %edx
leaq 0x71b32(%rip), %rsi     # 0x773a8
movapd 0x4b7e2(%rip), %xmm0    # 0x51060
xorl %r11d, %r11d
movsd 0x4b77f(%rip), %xmm6    # 0x51008
cmpl %eax, %r11d
je 0x5971
movl 0xc0(%rbx), %r8d
movq 0xc0(%rsp), %r10
movl 0xd0(%rsp), %ebp
leal 0x1(%r11), %edi
testl %r8d, %r8d
cmovlel %edx, %r8d
movl %ebp, %r9d
imull %ecx, %r9d
movslq %r9d, %r9
leaq (%r10,%r9,8), %r9
imull %r11d, %ebp
movslq %ebp, %r14
leaq (%r10,%r14,8), %r10
movslq %r11d, %r11
xorl %r14d, %r14d
cmpq %r14, %r8
je 0x5967
movsd (%r10,%r14,8), %xmm1
ucomisd %xmm6, %xmm1
jne 0x58e9
jnp 0x595f
movsd (%rsi), %xmm4
movapd %xmm4, %xmm3
xorpd %xmm0, %xmm3
movapd %xmm1, %xmm2
cmplepd %xmm4, %xmm2
movapd %xmm3, %xmm5
cmplepd %xmm1, %xmm5
andpd %xmm2, %xmm5
movd %xmm5, %ebp
testb $0x1, %bpl
jne 0x595f
movsd (%r9,%r14,8), %xmm2
ucomisd %xmm6, %xmm2
jne 0x5923
jnp 0x595f
movapd %xmm2, %xmm5
cmplepd %xmm4, %xmm5
cmplepd %xmm2, %xmm3
andpd %xmm5, %xmm3
movd %xmm3, %ebp
testb $0x1, %bpl
jne 0x595f
subsd %xmm1, %xmm2
movslq 0xc8(%rbx), %r15
imulq %r11, %r15
shlq $0x3, %r15
addq 0xb8(%rbx), %r15
movsd %xmm2, (%r15,%r14,8)
incq %r14
jmp 0x58d2
incl %ecx
movl %edi, %r11d
jmp 0x5889
leaq 0x8(%rsp), %rdi
callq 0x889c
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x889c
movq %rbx, %rdi
callq 0x44d0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/pfm2pfm/pfm2pfm.cpp
// Function: ReadGrid(char const*)
static R2Grid *
ReadGrid(const char *filename)
{
  // Start statistics
  RNTime start_time;
  start_time.Read();

  // Allocate a grid
  R2Grid *grid = new R2Grid();
  if (!grid) {
    RNFail("Unable to allocate grid");
    return NULL;
  }

  // Read grid
  int status = grid->Read(filename);
  if (!status) {
    RNFail("Unable to read grid file %s", filename);
    return NULL;
  }

  // Print statistics
  if (print_verbose) {
    printf("Read grid from %s\n", filename);
    printf("  Time = %.2f seconds\n", start_time.Elapsed());
    printf("  Resolution = %d %d\n", grid->XResolution(), grid->YResolution());
    printf("  Spacing = %g\n", grid->GridToWorldScaleFactor());
    printf("  Cardinality = %d\n", grid->Cardinality());
    RNInterval grid_range = grid->Range();
    printf("  Minimum = %g\n", grid_range.Min());
    printf("  Maximum = %g\n", grid_range.Max());
    printf("  L1Norm = %g\n", grid->L1Norm());
    printf("  L2Norm = %g\n", grid->L2Norm());
    fflush(stdout);
  }

  // Return success
  return grid;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x24516
movq %rbx, %rdi
callq 0x7a1c
movl $0xd0, %edi
callq 0x4280
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7d58
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf6ae
testl %eax, %eax
je 0x7778
cmpb $0x1, 0x713a3(%rip)     # 0x78a30
jne 0x778b
leaq 0x4a150(%rip), %rdi     # 0x517ea
movq %r14, %rsi
xorl %eax, %eax
callq 0x4050
leaq 0x8(%rsp), %rdi
callq 0x24550
leaq 0x4a148(%rip), %rdi     # 0x517fd
movb $0x1, %al
callq 0x4050
movl 0xc0(%rbx), %esi
movl 0xc4(%rbx), %edx
leaq 0x4a145(%rip), %rdi     # 0x51814
xorl %eax, %eax
callq 0x4050
movq %rbx, %rdi
callq 0x7a24
leaq 0x4a145(%rip), %rdi     # 0x5182a
movb $0x1, %al
callq 0x4050
movq %rbx, %rdi
callq 0x8ab8
leaq 0x4a13f(%rip), %rdi     # 0x5183a
movl %eax, %esi
xorl %eax, %eax
callq 0x4050
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x88c4
movsd (%r14), %xmm0
leaq 0x4a12e(%rip), %rdi     # 0x5184e
movb $0x1, %al
callq 0x4050
movsd 0x8(%r14), %xmm0
leaq 0x4a12a(%rip), %rdi     # 0x5185e
movb $0x1, %al
callq 0x4050
movq %rbx, %rdi
callq 0x8a06
leaq 0x4a124(%rip), %rdi     # 0x5186e
movb $0x1, %al
callq 0x4050
movq %rbx, %rdi
callq 0x8a54
leaq 0x4a11d(%rip), %rdi     # 0x5187d
movb $0x1, %al
callq 0x4050
movq 0x6f842(%rip), %rax     # 0x76fb0
movq (%rax), %rdi
callq 0x42f0
jmp 0x778b
leaq 0x4a04f(%rip), %rdi     # 0x517ce
xorl %ebx, %ebx
movq %r14, %rsi
xorl %eax, %eax
callq 0x26582
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movl $0xd0, %esi
movq %rbx, %rdi
callq 0x4290
movq %r14, %rdi
callq 0x44d0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/pfm2pfm/../../pkgs/RNMath/RNSystemOfEquations.h
// Function: gaps::RNSystemOfEquations::Minimize(double*, int, double) const
inline int RNSystemOfEquations::
Minimize(RNScalar *x, int solver, RNScalar tolerance) const
{
  // Check solver
  if (solver == RN_SPLM_SOLVER) return MinimizeSPLM(this, x, tolerance);
  else if (solver == RN_MINPACK_SOLVER) return MinimizeMINPACK(this, x, tolerance);
  else if (solver == RN_CERES_SOLVER) return MinimizeCERES(this, x, tolerance);
  else if (solver == RN_CSPARSE_SOLVER) return MinimizeCSPARSE(this, x, tolerance);
  RNFail("System of equation solver not recognized: %d\n", solver);
  return 0;
}

// Assembly:
pushq %rax
cmpl $0x3, %edx
ja 0x79ef
movl %edx, %eax
leaq 0x496ff(%rip), %rcx     # 0x51080
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x4998a(%rip), %rdi     # 0x5131b
xorl %eax, %eax
callq 0x26582
leaq 0x499bd(%rip), %rdi     # 0x5135c
jmp 0x79e4
leaq 0x4984a(%rip), %rdi     # 0x511f2
xorl %eax, %eax
callq 0x26582
leaq 0x4987c(%rip), %rdi     # 0x51232
jmp 0x79e4
leaq 0x499f3(%rip), %rdi     # 0x513b2
xorl %eax, %eax
callq 0x26582
leaq 0x49a28(%rip), %rdi     # 0x513f5
jmp 0x79e4
leaq 0x498ac(%rip), %rdi     # 0x51282
xorl %eax, %eax
callq 0x26582
leaq 0x498e1(%rip), %rdi     # 0x512c5
xorl %eax, %eax
callq 0x26582
xorl %eax, %eax
popq %rcx
retq
leaq 0x497ce(%rip), %rdi     # 0x511c4
movl %edx, %esi
xorl %eax, %eax
callq 0x26582
jmp 0x79eb
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::RNPolynomial(gaps::RNPolynomial const&)
RNPolynomial::
RNPolynomial(const RNPolynomial& polynomial)
  :terms()
{
  // Copy polynomial terms
  terms.Resize(polynomial.NTerms());
  for (int i = 0; i < polynomial.NTerms(); i++) {
    RNPolynomialTerm *polynomial_term = polynomial.Term(i);
    RNPolynomialTerm *term = new RNPolynomialTerm(*polynomial_term);
    terms.Insert(term); 
    term->polynomial = this; 
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2477e
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x24864
xorl %ebp, %ebp
pushq $0x28
popq %r15
movslq 0xc(%r14), %rax
cmpq %rax, %rbp
jge 0x1e910
movq (%r14), %rax
movq (%rax,%rbp,8), %r13
movq %r15, %rdi
callq 0x4280
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0x1ff08
movq %rbx, %rdi
movq %r12, %rsi
callq 0x11a32
movq %rbx, (%r12)
incq %rbp
jmp 0x1e8d6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1e931
movq %rax, %r14
pushq $0x28
popq %rsi
movq %r12, %rdi
callq 0x4290
jmp 0x1e934
movq %rax, %r14
movq %rbx, %rdi
callq 0x247ec
movq %r14, %rdi
callq 0x44d0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::Empty()
void RNPolynomial::
Empty(void)
{
  // Delete all terms
  for (int i = 0; i < NTerms(); i++) {
    RNPolynomialTerm *term = Term(i);
    delete term;
  }

  // Empty array of terms
  terms.Empty();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r12d, %r12d
pushq $0x28
popq %r14
movslq 0xc(%rbx), %rax
cmpq %rax, %r12
jge 0x1ec19
movq (%rbx), %rax
movq (%rax,%r12,8), %r15
testq %r15, %r15
je 0x1ec09
movq %r15, %rdi
callq 0x1ffb0
movq %r15, %rdi
movq %r14, %rsi
callq 0x4290
incq %r12
jmp 0x1ebec
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2499c
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::Degree() const
RNScalar RNPolynomial::
Degree(void) const
{
  // Return highest degree of any term
  RNScalar max_degree = 0;
  for (int i = 0; i < NTerms(); i++) {
    RNPolynomialTerm *term = Term(i);
    RNScalar degree = term->Degree();
    if (degree > max_degree) max_degree = degree;
  }
  return max_degree;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl 0xc(%rdi), %ebx
movq (%rdi), %r14
xorl %r15d, %r15d
testl %ebx, %ebx
cmovlel %r15d, %ebx
xorpd %xmm0, %xmm0
cmpq %r15, %rbx
je 0x1ec69
movq (%r14,%r15,8), %rdi
movsd %xmm0, 0x8(%rsp)
callq 0x1ec74
maxsd 0x8(%rsp), %xmm0
incq %r15
jmp 0x1ec4a
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::NVariables() const
int RNPolynomial::
NVariables(void) const
{
  // Check if there are no terms
  if (NTerms() == 0) return 0;

  // 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:
cmpl $0x0, 0xc(%rdi)
je 0x1ecf6
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rsi
movl $0x7fffffff, (%rsi)     # imm = 0x7FFFFFFF
leaq 0x24(%rsp), %r14
orl $-0x1, (%r14)
movq %r14, %rdx
callq 0x1ed6e
movl (%r14), %r14d
xorl %eax, %eax
testl %r14d, %r14d
js 0x1ed61
movl 0x20(%rsp), %ecx
cmpl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
sete %dl
cmpl %ecx, %r14d
setl %sil
orb %dl, %sil
jne 0x1ed61
cmpl %ecx, %r14d
jne 0x1ecf9
pushq $0x1
jmp 0x1ed02
xorl %eax, %eax
retq
incl %ecx
cmpl %ecx, %r14d
jne 0x1ed05
pushq $0x2
popq %rax
jmp 0x1ed61
andl $0x0, 0x1c(%rsp)
leaq 0x4(,%r14,4), %rdi
incq %r14
callq 0x4030
movq %rax, %r15
xorl %eax, %eax
cmpq %rax, %r14
je 0x1ed2e
andl $0x0, (%r15,%rax,4)
incq %rax
jmp 0x1ed1f
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 0x1edae
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/RNPolynomial.cpp
// Function: gaps::RNPolynomial::UpdateVariableRange(int&, int&) const
void RNPolynomial::
UpdateVariableRange(int& min_v, int& max_v) const
{
  // Update variable index for each term
  for (int i = 0; i < NTerms(); i++) {
    RNPolynomialTerm *term = Term(i);
    term->UpdateVariableRange(min_v, max_v);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
movslq 0xc(%r15), %rax
cmpq %rax, %r12
jge 0x1eda2
movq (%r15), %rax
movq (%rax,%r12,8), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1fc8c
incq %r12
jmp 0x1ed82
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::UpdateVariableIndex(int, int&, int*, int, int*, int*, int) const
void RNPolynomial::
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 index for each term
  for (int i = 0; i < NTerms(); i++) {
    RNPolynomialTerm *term = Term(i);
    term->UpdateVariableIndex(max_variables, variable_count, 
      variable_marks, current_mark,
      index_to_variable, variable_to_index,
      remap_variables);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %r12
xorl %r13d, %r13d
movslq 0xc(%r12), %rax
cmpq %rax, %r13
jge 0x1edfe
movq (%r12), %rax
movq (%rax,%r13,8), %rdi
movq %r15, %rdx
movq %r14, %rcx
movl %ebp, %r8d
movq %rbx, %r9
movl 0x48(%rsp), %eax
pushq %rax
pushq 0x48(%rsp)
callq 0x1fcba
popq %rax
popq %rcx
incq %r13
jmp 0x1edcb
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::RNPolynomial::IsLinear() const
RNBoolean RNPolynomial::
IsLinear(void) const
{
  // Check each term
  for (int i = 0; i < NTerms(); i++) {
    RNPolynomialTerm *term = Term(i);
    if (!term->IsLinear()) return FALSE;
  }

  // Passed all tests
  return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movslq 0xc(%rdi), %rbx
movq (%rdi), %r14
xorl %ecx, %ecx
testl %ebx, %ebx
movl $0x0, %r15d
cmovgl %ebx, %r15d
movq %rcx, %r12
cmpq %rcx, %r15
je 0x1eecd
movq (%r14,%r12,8), %rdi
callq 0x1eee2
leaq 0x1(%r12), %rcx
testl %eax, %eax
jne 0x1eeb3
xorl %eax, %eax
cmpq %rbx, %r12
setge %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::IsQuadratic() const
RNBoolean RNPolynomial::
IsQuadratic(void) const
{
  // Check each term
  for (int i = 0; i < NTerms(); i++) {
    RNPolynomialTerm *term = Term(i);
    if (!term->IsQuadratic()) return FALSE;
  }

  // Passed all tests
  return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movslq 0xc(%rdi), %rbx
movq (%rdi), %r14
xorl %ecx, %ecx
testl %ebx, %ebx
movl $0x0, %r15d
cmovgl %ebx, %r15d
movq %rcx, %r12
cmpq %rcx, %r15
je 0x1ef41
movq (%r14,%r12,8), %rdi
callq 0x1ef56
leaq 0x1(%r12), %rcx
testl %eax, %eax
jne 0x1ef27
xorl %eax, %eax
cmpq %rbx, %r12
setge %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::HasVariable(int) const
RNBoolean RNPolynomial::
HasVariable(int variable) const
{
  // Check terms
  for (int i = 0; i < NTerms(); i++) {
    RNPolynomialTerm *term = Term(i);
    if (term->HasVariable(variable)) return TRUE;
  }

  // Not found
  return FALSE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %esi, %ebx
movslq 0xc(%rdi), %r14
movq (%rdi), %r15
xorl %ecx, %ecx
testl %r14d, %r14d
movl $0x0, %r12d
cmovgl %r14d, %r12d
movq %rcx, %r13
cmpq %rcx, %r12
je 0x1efec
movq (%r15,%r13,8), %rdi
movl %ebx, %esi
callq 0x1effe
leaq 0x1(%r13), %rcx
testl %eax, %eax
je 0x1efd1
xorl %eax, %eax
cmpq %r14, %r13
setl %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::Negate()
void RNPolynomial::
Negate(void)
{
  // Negate all terms
  for (int i = 0; i < NTerms(); i++) {
    RNPolynomialTerm *term = Term(i);
    term->Negate();
  }
}

// Assembly:
movslq 0xc(%rdi), %rax
movq (%rdi), %rcx
xorl %edx, %edx
movaps 0x32022(%rip), %xmm0    # 0x51060
cmpq %rax, %rdx
jge 0x1f058
movq (%rcx,%rdx,8), %rsi
movsd 0x10(%rsi), %xmm1
xorps %xmm0, %xmm1
movlps %xmm1, 0x10(%rsi)
incq %rdx
jmp 0x1f03e
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::Multiply(double)
void RNPolynomial::
Multiply(RNScalar factor)
{
  // Check if factor is zero
  if (factor == 0.0) {
    // Delete all terms
    Empty();
  }
  else {
    // Multiply all terms by factor
    for (int i = 0; i < NTerms(); i++) {
      RNPolynomialTerm *term = Term(i);
      term->Multiply(factor);
    }
  }
}

// Assembly:
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1f06b
jp 0x1f06b
jmp 0x1ebda
movl 0xc(%rdi), %eax
movq (%rdi), %rcx
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
cmpq %rdx, %rax
je 0x1f094
movq (%rcx,%rdx,8), %rsi
movsd 0x10(%rsi), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsi)
incq %rdx
jmp 0x1f078
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::Add(gaps::RNPolynomial const&)
void RNPolynomial::
Add(const RNPolynomial& polynomial)
{
  // Add polynomial
  for (int i = 0; i < polynomial.NTerms(); i++) {
    RNPolynomialTerm *term = polynomial.Term(i);
    AddTerm(term->Coefficient(), term->NVariables(), term->Variables(), term->Exponents(), TRUE, TRUE);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
pushq $0x1
popq %rbp
movslq 0xc(%rbx), %rax
cmpq %rax, %r15
jge 0x1f116
movq (%rbx), %rax
movq (%rax,%r15,8), %rax
movsd 0x10(%rax), %xmm0
movl 0x8(%rax), %esi
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rcx
movq %r14, %rdi
movl %ebp, %r8d
movl %ebp, %r9d
callq 0x1e9fa
incq %r15
jmp 0x1f0e3
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::Subtract(gaps::RNPolynomial const&)
void RNPolynomial::
Subtract(const RNPolynomial& polynomial)
{
  // Subtract polynomial
  for (int i = 0; i < polynomial.NTerms(); i++) {
    RNPolynomialTerm *term = polynomial.Term(i);
    AddTerm(-(term->Coefficient()), term->NVariables(), term->Variables(), term->Exponents(), TRUE, TRUE);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
pushq $0x1
popq %rbp
movslq 0xc(%rbx), %rax
cmpq %rax, %r15
jge 0x1f16f
movq (%rbx), %rax
movq (%rax,%r15,8), %rax
movsd 0x10(%rax), %xmm0
xorps 0x31f0f(%rip), %xmm0    # 0x51060
movl 0x8(%rax), %esi
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rcx
movq %r14, %rdi
movl %ebp, %r8d
movl %ebp, %r9d
callq 0x1e9fa
incq %r15
jmp 0x1f135
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::operator=(gaps::RNPolynomial const&)
RNPolynomial& RNPolynomial::
operator=(const RNPolynomial& polynomial)
{
  // Empty this polynomial
  Empty();

  // Copy polynomial terms
  terms.Resize(polynomial.NTerms());
  for (int i = 0; i < polynomial.NTerms(); i++) {
    RNPolynomialTerm *polynomial_term = polynomial.Term(i);
    RNPolynomialTerm *term = new RNPolynomialTerm(*polynomial_term);
    terms.Insert(term); 
    term->polynomial = this; 
  }

  // Return this
  return *this;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x1ebda
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x24864
xorl %ebp, %ebp
pushq $0x28
popq %r15
movslq 0xc(%r14), %rax
cmpq %rax, %rbp
jge 0x1f396
movq (%r14), %rax
movq (%rax,%rbp,8), %r13
movq %r15, %rdi
callq 0x4280
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0x1ff08
movq %rbx, %rdi
movq %r12, %rsi
callq 0x11a32
movq %rbx, (%r12)
incq %rbp
jmp 0x1f35c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
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/RNPolynomial.cpp
// Function: gaps::RNPolynomial::FindTermWithSameVariables(gaps::RNPolynomialTerm const*) const
static int
RNComparePolynomialTerms(const RNPolynomialTerm *term1, const RNPolynomialTerm *term1)
{
  // Check number of variables
  if (term1->NVariables() < term2->NVariables()) return -1;
  else if (term1->NVariables() > term2->NVariables()) return 1;

  // Compare variables and exponents 
  for (int i = 0; i < term1->NVariables(); i++) {
    // This assumes variables are sorted
    if (term1->Variable(i) < term2->Variable(i)) return -1;
    else if (term1->Variable(i) > term2->Variable(i)) return 1;
    if (term1->Exponent(i) < term2->Exponent(i)) return -1;
    else if (term1->Exponent(i) > term2->Exponent(i)) return 1;
  }

  // Terms have the same variables and exponents
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0xc(%rdi), %r15d
testl %r15d, %r15d
je 0x1f40f
movq %rsi, %rbx
movl 0x8(%rsi), %ebp
movq (%rdi), %r12
testl %ebp, %ebp
je 0x1f414
xorl %eax, %eax
testl %r15d, %r15d
cmovlel %eax, %r15d
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x1f40f
movq (%r12,%r13,8), %r14
movq 0x18(%rbx), %rdx
movq 0x20(%rbx), %rcx
movq %r14, %rdi
movl %ebp, %esi
callq 0x1fbc6
incq %r13
testl %eax, %eax
je 0x1f3eb
jmp 0x1f423
xorl %r14d, %r14d
jmp 0x1f423
movq (%r12), %rax
xorl %r14d, %r14d
cmpl $0x0, 0x8(%rax)
cmoveq %rax, %r14
movq %r14, %rax
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::RNPolynomial::Evaluate(double const*) const
RNScalar RNPolynomial::
Evaluate(const RNScalar *x) const
{
  // Return sum of terms
  RNScalar sum = 0;
  for (int i = 0; i < NTerms(); i++) {
    RNPolynomialTerm *term = Term(i);
    sum += term->Evaluate(x);
  }
  return sum;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorpd %xmm0, %xmm0
xorl %r15d, %r15d
movslq 0xc(%r14), %rax
cmpq %rax, %r15
jge 0x1f485
movq (%r14), %rax
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
movsd %xmm0, 0x8(%rsp)
callq 0x1f490
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
incq %r15
jmp 0x1f44c
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomialTerm::Evaluate(double const*) const
RNScalar RNPolynomialTerm::
Evaluate(const RNScalar *x) const
{
  // Evaluate the term
  RNScalar result = c;
  for (int i = 0; i < NVariables(); i++) {
    int k = Variable(i);
    if (e[i] == 1.0) result *= x[k];
    else if (e[i] == 2.0) result *= x[k] *x[k];
    else if ((e[i] < 0) && RNIsZero(x[k])) result *= RN_INFINITY;
    else result *= pow(x[k], e[i]);
  }
  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movsd 0x10(%rdi), %xmm4
xorl %r15d, %r15d
movsd 0x31b5d(%rip), %xmm5    # 0x51010
movsd 0x333b5(%rip), %xmm6    # 0x52870
leaq 0x57ee6(%rip), %r12     # 0x773a8
leaq 0x57eef(%rip), %r13     # 0x773b8
movslq 0x8(%r14), %rax
cmpq %rax, %r15
jge 0x1f56c
movq 0x18(%r14), %rax
movq 0x20(%r14), %rcx
movslq (%rax,%r15,4), %rax
movsd (%rcx,%r15,8), %xmm1
ucomisd %xmm5, %xmm1
jne 0x1f4f7
jp 0x1f4f7
movsd (%rbx,%rax,8), %xmm0
jmp 0x1f560
ucomisd %xmm6, %xmm1
jne 0x1f50a
jp 0x1f50a
movsd (%rbx,%rax,8), %xmm0
mulsd %xmm0, %xmm0
jmp 0x1f560
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
movsd (%rbx,%rax,8), %xmm0
jbe 0x1f53f
movsd (%r12), %xmm2
movapd %xmm2, %xmm3
xorpd 0x31b35(%rip), %xmm3    # 0x51060
ucomisd %xmm3, %xmm0
jb 0x1f53f
ucomisd %xmm0, %xmm2
jb 0x1f53f
movsd (%r13), %xmm0
jmp 0x1f560
movsd %xmm4, 0x8(%rsp)
callq 0x44c0
movsd 0x3331e(%rip), %xmm6    # 0x52870
movsd 0x31ab6(%rip), %xmm5    # 0x51010
movsd 0x8(%rsp), %xmm4
mulsd %xmm0, %xmm4
incq %r15
jmp 0x1f4c9
movapd %xmm4, %xmm0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::Evaluate(double const* const*) const
RNScalar RNPolynomial::
Evaluate(double const* const* x) const
{
  // Evaluate polynomial (in format suitable for CERES)
  RNScalar sum = 0;
  for (int i = 0; i < NTerms(); i++) {
    RNPolynomialTerm *term = Term(i);
    sum += term->Evaluate(x);
  }
  return sum;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorpd %xmm0, %xmm0
xorl %r15d, %r15d
movslq 0xc(%r14), %rax
cmpq %rax, %r15
jge 0x1f5cd
movq (%r14), %rax
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
movsd %xmm0, 0x8(%rsp)
callq 0x1f5d8
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
incq %r15
jmp 0x1f594
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomialTerm::Evaluate(double const* const*) const
RNScalar RNPolynomialTerm::
Evaluate(double const* const* x) const
{
  // Evaluate the term (in format suitable for CERES)
  RNScalar result = c;
  for (int i = 0; i < NVariables(); i++) {
    int k = Variable(i);
    if (e[i] == 1.0) result *= x[k][0];
    else if (e[i] == 2.0) result *= x[k][0] * x[k][0];
    else if ((e[i] < 0) && RNIsZero(x[k][0])) result *= RN_INFINITY;
    else result *= pow(x[k][0], e[i]);
  }
  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movsd 0x10(%rdi), %xmm4
xorl %r15d, %r15d
movsd 0x31a15(%rip), %xmm5    # 0x51010
movsd 0x3326d(%rip), %xmm6    # 0x52870
leaq 0x57d9e(%rip), %r12     # 0x773a8
leaq 0x57da7(%rip), %r13     # 0x773b8
movslq 0x8(%r14), %rax
cmpq %rax, %r15
jge 0x1f6bd
movq 0x18(%r14), %rax
movq 0x20(%r14), %rcx
movslq (%rax,%r15,4), %rax
movsd (%rcx,%r15,8), %xmm1
ucomisd %xmm5, %xmm1
jne 0x1f642
jp 0x1f642
movq (%rbx,%rax,8), %rax
movsd (%rax), %xmm0
jmp 0x1f6b1
ucomisd %xmm6, %xmm1
jne 0x1f658
jp 0x1f658
movq (%rbx,%rax,8), %rax
movsd (%rax), %xmm0
mulsd %xmm0, %xmm0
jmp 0x1f6b1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
movq (%rbx,%rax,8), %rax
movsd (%rax), %xmm0
jbe 0x1f690
movsd (%r12), %xmm2
movapd %xmm2, %xmm3
xorpd 0x319e4(%rip), %xmm3    # 0x51060
ucomisd %xmm3, %xmm0
jb 0x1f690
ucomisd %xmm0, %xmm2
jb 0x1f690
movsd (%r13), %xmm0
jmp 0x1f6b1
movsd %xmm4, 0x8(%rsp)
callq 0x44c0
movsd 0x331cd(%rip), %xmm6    # 0x52870
movsd 0x31965(%rip), %xmm5    # 0x51010
movsd 0x8(%rsp), %xmm4
mulsd %xmm0, %xmm4
incq %r15
jmp 0x1f611
movapd %xmm4, %xmm0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomial::PartialDerivative(double const*, int) const
RNScalar RNPolynomial::
PartialDerivative(const RNScalar *x, int variable) const
{
  // Return sum of term partial derivatives for variable
  RNScalar sum = 0;
  for (int i = 0; i < NTerms(); i++) {
    RNPolynomialTerm *term = Term(i);
    sum += term->PartialDerivative(x, variable);
  }
  return sum;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
xorpd %xmm0, %xmm0
xorl %r12d, %r12d
movslq 0xc(%r15), %rax
cmpq %rax, %r12
jge 0x1f71e
movq (%r15), %rax
movq (%rax,%r12,8), %rdi
movq %r14, %rsi
movl %ebx, %edx
movsd %xmm0, (%rsp)
callq 0x1f72a
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r12
jmp 0x1f6e7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomialTerm::PartialDerivative(double const*, int) const
RNScalar RNPolynomialTerm::
PartialDerivative(const RNScalar *x, int variable) const
{
  // Check if has variable
  if (!HasVariable(variable)) return 0.0;

  // Evaluate the derivative with respect to variable
  RNScalar result = c;
  for (int i = 0; i < NVariables(); i++) {
    int k = Variable(i);
    if (variable == k) {
      if (e[i] == 1.0) result *= 1.0;
      else if (e[i] == 2.0) result *= 2.0 * x[k];
      else if ((e[i] < 1.0) && RNIsZero(x[k])) result *= RN_INFINITY;
      else result *= e[i] * pow(x[k], e[i] - 1.0);
    }
    else {
      if (e[i] == 1.0) result *= x[k];
      else if (e[i] == 2.0) result *= x[k] * x[k];
      else if ((e[i] < 0) && RNIsZero(x[k])) result *= RN_INFINITY;
      else result *= pow(x[k], e[i]);
    }
  }
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %esi
callq 0x1effe
testl %eax, %eax
je 0x1f8bd
movsd 0x10(%r15), %xmm3
movslq %ebx, %r12
xorl %r13d, %r13d
movsd 0x318ad(%rip), %xmm4    # 0x51010
movsd 0x33105(%rip), %xmm5    # 0x52870
leaq 0x57c36(%rip), %rbp     # 0x773a8
movslq 0x8(%r15), %rax
cmpq %rax, %r13
jge 0x1f8c1
movq 0x18(%r15), %rax
movq 0x20(%r15), %rcx
movslq (%rax,%r13,4), %rax
movsd (%rcx,%r13,8), %xmm6
cmpl %ebx, %eax
jne 0x1f7b8
ucomisd %xmm4, %xmm6
jne 0x1f7a1
jnp 0x1f8b5
ucomisd %xmm5, %xmm6
jne 0x1f7e2
jp 0x1f7e2
movsd (%r14,%r12,8), %xmm0
addsd %xmm0, %xmm0
jmp 0x1f8b1
ucomisd %xmm4, %xmm6
jne 0x1f7cb
jp 0x1f7cb
mulsd (%r14,%rax,8), %xmm3
jmp 0x1f8b5
ucomisd %xmm5, %xmm6
jne 0x1f811
jp 0x1f811
movsd (%r14,%rax,8), %xmm0
mulsd %xmm0, %xmm0
jmp 0x1f8b1
ucomisd %xmm6, %xmm4
jbe 0x1f872
movsd (%r14,%r12,8), %xmm0
movsd (%rbp), %xmm1
movapd %xmm1, %xmm2
xorpd 0x3185d(%rip), %xmm2    # 0x51060
ucomisd %xmm2, %xmm0
jb 0x1f878
ucomisd %xmm0, %xmm1
jae 0x1f83e
jmp 0x1f878
xorpd %xmm0, %xmm0
ucomisd %xmm6, %xmm0
movsd (%r14,%rax,8), %xmm0
jbe 0x1f84b
movsd (%rbp), %xmm1
movapd %xmm1, %xmm2
xorpd 0x3182e(%rip), %xmm2    # 0x51060
ucomisd %xmm2, %xmm0
jb 0x1f84b
ucomisd %xmm0, %xmm1
jb 0x1f84b
leaq 0x57b73(%rip), %rax     # 0x773b8
mulsd (%rax), %xmm3
jmp 0x1f8b5
movapd %xmm6, %xmm1
movsd %xmm3, 0x8(%rsp)
callq 0x44c0
movsd 0x3300e(%rip), %xmm5    # 0x52870
movsd 0x317a6(%rip), %xmm4    # 0x51010
movsd 0x8(%rsp), %xmm3
jmp 0x1f8b1
movsd (%r14,%r12,8), %xmm0
movapd %xmm6, %xmm1
addsd 0x3217c(%rip), %xmm1    # 0x51a00
movsd %xmm3, 0x8(%rsp)
movsd %xmm6, 0x10(%rsp)
callq 0x44c0
movsd 0x32fd3(%rip), %xmm5    # 0x52870
movsd 0x3176b(%rip), %xmm4    # 0x51010
movsd 0x8(%rsp), %xmm3
mulsd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm3
incq %r13
jmp 0x1f772
xorpd %xmm3, %xmm3
movapd %xmm3, %xmm0
addq $0x18, %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::RNPolynomial::PartialDerivative(double const* const*, int) const
RNScalar RNPolynomial::
PartialDerivative(double const* const* x, int variable) const
{
  // Return sum of term partial derivatives for variable
  RNScalar sum = 0;
  for (int i = 0; i < NTerms(); i++) {
    RNPolynomialTerm *term = Term(i);
    sum += term->PartialDerivative(x, variable);
  }
  return sum;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
xorpd %xmm0, %xmm0
xorl %r12d, %r12d
movslq 0xc(%r15), %rax
cmpq %rax, %r12
jge 0x1f922
movq (%r15), %rax
movq (%rax,%r12,8), %rdi
movq %r14, %rsi
movl %ebx, %edx
movsd %xmm0, (%rsp)
callq 0x1f92e
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r12
jmp 0x1f8eb
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomialTerm::PartialDerivative(double const* const*, int) const
RNScalar RNPolynomialTerm::
PartialDerivative(double const* const* x, int variable) const
{
  // Check if has variable
  if (!HasVariable(variable)) return 0.0;

  // Evaluate the derivative with respect to variable
  RNScalar result = c;
  for (int i = 0; i < NVariables(); i++) {
    int k = Variable(i);
    if (k == variable) {
      if (e[i] == 1.0) result *= 1.0;
      else if (e[i] == 2.0) result *= 2.0 * x[k][0];
      else if ((e[i] < 1.0) && RNIsZero(x[k][0])) result *= RN_INFINITY;
      else result *= e[i] * pow(x[k][0], e[i] - 1.0);
    }
    else {
      if (e[i] == 1.0) result *= x[k][0];
      else if (e[i] == 2.0) result *= x[k][0] * x[k][0];
      else if ((e[i] < 0) && RNIsZero(x[k][0])) result *= RN_INFINITY;
      else result *= pow(x[k][0], e[i]);
    }
  }
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %esi
callq 0x1effe
testl %eax, %eax
je 0x1facc
movsd 0x10(%r15), %xmm3
movslq %ebx, %r12
xorl %r13d, %r13d
movsd 0x316a9(%rip), %xmm4    # 0x51010
movsd 0x32f01(%rip), %xmm5    # 0x52870
leaq 0x57a32(%rip), %rbp     # 0x773a8
movslq 0x8(%r15), %rax
cmpq %rax, %r13
jge 0x1fad0
movq 0x18(%r15), %rax
movq 0x20(%r15), %rcx
movslq (%rax,%r13,4), %rax
movsd (%rcx,%r13,8), %xmm6
cmpl %ebx, %eax
jne 0x1f9be
ucomisd %xmm4, %xmm6
jne 0x1f9a5
jnp 0x1fac4
ucomisd %xmm5, %xmm6
jne 0x1f9ec
jp 0x1f9ec
movq (%r14,%r12,8), %rax
movsd (%rax), %xmm0
addsd %xmm0, %xmm0
jmp 0x1fac0
ucomisd %xmm4, %xmm6
jne 0x1f9d3
jp 0x1f9d3
movq (%r14,%rax,8), %rax
mulsd (%rax), %xmm3
jmp 0x1fac4
ucomisd %xmm5, %xmm6
jne 0x1fa1d
jp 0x1fa1d
movq (%r14,%rax,8), %rax
movsd (%rax), %xmm0
mulsd %xmm0, %xmm0
jmp 0x1fac0
ucomisd %xmm6, %xmm4
jbe 0x1fa7f
movq (%r14,%r12,8), %rax
movsd (%rax), %xmm0
movsd (%rbp), %xmm1
movapd %xmm1, %xmm2
xorpd 0x31651(%rip), %xmm2    # 0x51060
ucomisd %xmm2, %xmm0
jb 0x1fa87
ucomisd %xmm0, %xmm1
jae 0x1fa4c
jmp 0x1fa87
xorpd %xmm0, %xmm0
ucomisd %xmm6, %xmm0
movq (%r14,%rax,8), %rax
movsd (%rax), %xmm0
jbe 0x1fa58
movsd (%rbp), %xmm1
movapd %xmm1, %xmm2
xorpd 0x31620(%rip), %xmm2    # 0x51060
ucomisd %xmm2, %xmm0
jb 0x1fa58
ucomisd %xmm0, %xmm1
jb 0x1fa58
leaq 0x57965(%rip), %rax     # 0x773b8
jmp 0x1f9ca
movapd %xmm6, %xmm1
movsd %xmm3, 0x8(%rsp)
callq 0x44c0
movsd 0x32e01(%rip), %xmm5    # 0x52870
movsd 0x31599(%rip), %xmm4    # 0x51010
movsd 0x8(%rsp), %xmm3
jmp 0x1fac0
movq (%r14,%r12,8), %rax
movsd (%rax), %xmm0
movapd %xmm6, %xmm1
addsd 0x31f6d(%rip), %xmm1    # 0x51a00
movsd %xmm3, 0x8(%rsp)
movsd %xmm6, 0x10(%rsp)
callq 0x44c0
movsd 0x32dc4(%rip), %xmm5    # 0x52870
movsd 0x3155c(%rip), %xmm4    # 0x51010
movsd 0x8(%rsp), %xmm3
mulsd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm3
incq %r13
jmp 0x1f976
xorpd %xmm3, %xmm3
movapd %xmm3, %xmm0
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/RNPolynomial.cpp
// Function: gaps::RNPolynomial::Print(_IO_FILE*) const
void RNPolynomial::
Print(FILE *fp) const
{
  // Print polynomial
  printf("{ ");
  for (int i = 0; i < NTerms(); i++) {
    RNPolynomialTerm *term = Term(i);
    fprintf(fp, "  ");
    term->Print(fp);
  }
  printf(" }\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x32d7c(%rip), %rdi     # 0x52878
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x4050
pushq $0x2
popq %r12
pushq $0x1
popq %r13
movslq 0xc(%r14), %rax
cmpq %rax, %r15
jge 0x1fb43
movq (%r14), %rax
movq (%rax,%r15,8), %rbp
leaq 0x3300c(%rip), %rdi     # 0x52b31
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x4570
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x1fb5e
incq %r15
jmp 0x1fb0e
leaq 0x32d3a(%rip), %rdi     # 0x52884
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4440
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomialTerm::Print(_IO_FILE*) const
void RNPolynomialTerm::
Print(FILE *fp) const
{
  // Print term
  fprintf(fp, "%g ", Coefficient());
  for (int j = 0; j < NVariables(); j++) {
    fprintf(fp, "(%d^%g) ", Variable(j), Exponent(j));
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movsd 0x10(%rdi), %xmm0
leaq 0x32414(%rip), %rsi     # 0x51f8c
movq %rbx, %rdi
movb $0x1, %al
callq 0x43f0
xorl %r12d, %r12d
leaq 0x32cef(%rip), %r15     # 0x5287b
movslq 0x8(%r14), %rax
cmpq %rax, %r12
jge 0x1fbb9
movq 0x18(%r14), %rax
movq 0x20(%r14), %rcx
movl (%rax,%r12,4), %edx
movsd (%rcx,%r12,8), %xmm0
movq %rbx, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x43f0
incq %r12
jmp 0x1fb8c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNMath/RNPolynomial.cpp
// Function: gaps::RNPolynomialTerm::HasVariables(int, int const*, double const*) const
RNBoolean RNPolynomialTerm::
HasVariables(int query_n, const int *query_v, const RNScalar *query_e) const
{
  // Check if query has same number of variables
  if (n != query_n) return FALSE;

  // Compare variables and exponents 
  for (int i = 0; i < n; i++) {
    // This assumes variables are sorted
    if (v[i] != query_v[i]) return FALSE;
    if (e[i] != query_e[i]) return FALSE;
  }

  // Passed all tests
  return TRUE;
}

// Assembly:
xorl %eax, %eax
cmpl %esi, 0x8(%rdi)
jne 0x1fc15
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rdi
movslq %esi, %rsi
xorl %r10d, %r10d
testl %esi, %esi
movl $0x0, %r8d
cmovgl %esi, %r8d
movq %r10, %r9
cmpq %r10, %r8
je 0x1fc0d
movl (%rax,%r9,4), %r10d
cmpl (%rdx,%r9,4), %r10d
jne 0x1fc0d
movsd (%rdi,%r9,8), %xmm0
leaq 0x1(%r9), %r10
ucomisd (%rcx,%r9,8), %xmm0
jne 0x1fc0d
jnp 0x1fbe7
xorl %eax, %eax
cmpq %rsi, %r9
setge %al
retq