LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::ClipperOffset::FixOrientations()
void ClipperOffset::FixOrientations()
{
  //fixup orientations of all closed paths if the orientation of the
  //closed path with the lowermost vertex is wrong ...
  if (m_lowest.X >= 0 && 
    !Orientation(m_polyNodes.Childs[(int)m_lowest.X]->Contour))
  {
    for (int i = 0; i < m_polyNodes.ChildCount(); ++i)
    {
      PolyNode& node = *m_polyNodes.Childs[i];
      if (node.m_endtype == etClosedPolygon ||
        (node.m_endtype == etClosedLine && Orientation(node.Contour)))
          ReversePath(node.Contour);
    }
  } else
  {
    for (int i = 0; i < m_polyNodes.ChildCount(); ++i)
    {
      PolyNode& node = *m_polyNodes.Childs[i];
      if (node.m_endtype == etClosedLine && !Orientation(node.Contour))
        ReversePath(node.Contour);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0xa0(%rdi), %rax
testq %rax, %rax
js 0xee2f
movq 0xc8(%rbx), %r15
cltq
movq (%r15,%rax,8), %rdi
callq 0x862b
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jae 0xee36
movq 0xd0(%rbx), %r13
movq %r13, %rax
subq %r15, %rax
shrq $0x3, %rax
testl %eax, %eax
jle 0xeee2
xorl %r12d, %r12d
movq (%r15,%r12,8), %r14
movl 0x44(%r14), %eax
testl %eax, %eax
je 0xedb7
cmpl $0x1, %eax
jne 0xee12
movq %r14, %rdi
callq 0x862b
ucomisd 0x691b(%rip), %xmm0     # 0x156d0
jb 0xee12
movq (%r14), %rax
movq 0x8(%r14), %rcx
cmpq %rcx, %rax
setne %dl
addq $-0x10, %rcx
cmpq %rax, %rcx
seta %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0xee12
addq $0x10, %rax
movups -0x10(%rax), %xmm0
movaps %xmm0, (%rsp)
movups (%rcx), %xmm0
movups %xmm0, -0x10(%rax)
movapd (%rsp), %xmm0
movupd %xmm0, (%rcx)
addq $-0x10, %rcx
leaq 0x10(%rax), %rdx
cmpq %rcx, %rax
movq %rdx, %rax
jb 0xeddc
movq 0xc8(%rbx), %r15
movq 0xd0(%rbx), %r13
incq %r12
movq %r13, %rax
subq %r15, %rax
shrq $0x3, %rax
cltq
cmpq %rax, %r12
jl 0xed94
jmp 0xeee2
movq 0xc8(%rbx), %r15
movq 0xd0(%rbx), %r13
movq %r13, %rax
subq %r15, %rax
shrq $0x3, %rax
testl %eax, %eax
jle 0xeee2
xorl %r12d, %r12d
movq (%r15,%r12,8), %r14
cmpl $0x1, 0x44(%r14)
jne 0xeeca
movq %r14, %rdi
callq 0x862b
ucomisd 0x6863(%rip), %xmm0     # 0x156d0
jae 0xeeca
movq (%r14), %rax
movq 0x8(%r14), %rcx
cmpq %rcx, %rax
setne %dl
addq $-0x10, %rcx
cmpq %rax, %rcx
seta %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0xeeca
addq $0x10, %rax
movups -0x10(%rax), %xmm0
movaps %xmm0, (%rsp)
movups (%rcx), %xmm0
movups %xmm0, -0x10(%rax)
movapd (%rsp), %xmm0
movupd %xmm0, (%rcx)
addq $-0x10, %rcx
leaq 0x10(%rax), %rdx
cmpq %rcx, %rax
movq %rdx, %rax
jb 0xee94
movq 0xc8(%rbx), %r15
movq 0xd0(%rbx), %r13
incq %r12
movq %r13, %rax
subq %r15, %rax
shrq $0x3, %rax
cltq
cmpq %rax, %r12
jl 0xee52
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::SimplifyPolygon(std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>> const&, std::vector<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>, std::allocator<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>>>&, ClipperLib::PolyFillType)
void SimplifyPolygon(const Path &in_poly, Paths &out_polys, PolyFillType fillType)
{
  Clipper c;
  c.StrictlySimple(true);
  c.AddPath(in_poly, ptSubject, true);
  c.Execute(ctUnion, out_polys, fillType, fillType);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rsi
leaq 0xc0(%rsp), %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
xorl %eax, %eax
movq %rax, 0x30(%rbx)
movups %xmm0, 0x8(%rbx)
leaq 0xb387(%rip), %rcx      # 0x1bcb8
movq %rcx, -0xc0(%rbx)
leaq 0xb3c1(%rip), %rcx      # 0x1bd00
movq %rcx, (%rbx)
leaq 0x78(%rsp), %rcx
movl $0x0, (%rcx)
movq %rax, 0x8(%rcx)
movups %xmm0, -0x70(%rcx)
movups %xmm0, -0x60(%rcx)
movups %xmm0, -0x50(%rcx)
movups %xmm0, -0x40(%rcx)
movups %xmm0, -0x30(%rcx)
movups %xmm0, -0x20(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movb %al, 0x60(%rcx)
movups %xmm0, 0x20(%rcx)
movups %xmm0, 0x29(%rcx)
movb %al, 0x44(%rcx)
movw $0x0, 0x38(%rbx)
movb $0x1, 0x46(%rcx)
movq %rbx, %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x985a
movq %rsp, %rdi
movl $0x1, %esi
movq %r14, %rdx
movl %ebp, %ecx
movl %ebp, %r8d
callq 0xa41c
leaq 0xb36c(%rip), %rsi      # 0x1bd20
movq %rsp, %rdi
callq 0xa258
movq %rbx, %rdi
callq 0x9440
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
leaq 0xb346(%rip), %rsi      # 0x1bd20
movq %rsp, %rdi
callq 0xa258
movq %rbx, %rdi
callq 0x9440
movq %r14, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O3/hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::SimplifyPolygons(std::vector<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>, std::allocator<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>>> const&, std::vector<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>, std::allocator<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>>>&, ClipperLib::PolyFillType)
void SimplifyPolygons(const Paths &in_polys, Paths &out_polys, PolyFillType fillType)
{
  Clipper c;
  c.StrictlySimple(true);
  c.AddPaths(in_polys, ptSubject, true);
  c.Execute(ctUnion, out_polys, fillType, fillType);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rsi
leaq 0xc0(%rsp), %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
xorl %eax, %eax
movq %rax, 0x30(%rbx)
movups %xmm0, 0x8(%rbx)
leaq 0xb293(%rip), %rcx      # 0x1bcb8
movq %rcx, -0xc0(%rbx)
leaq 0xb2cd(%rip), %rcx      # 0x1bd00
movq %rcx, (%rbx)
leaq 0x78(%rsp), %rcx
movl $0x0, (%rcx)
movq %rax, 0x8(%rcx)
movups %xmm0, -0x70(%rcx)
movups %xmm0, -0x60(%rcx)
movups %xmm0, -0x50(%rcx)
movups %xmm0, -0x40(%rcx)
movups %xmm0, -0x30(%rcx)
movups %xmm0, -0x20(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movb %al, 0x60(%rcx)
movups %xmm0, 0x20(%rcx)
movups %xmm0, 0x29(%rcx)
movb %al, 0x44(%rcx)
movw $0x0, 0x38(%rbx)
movb $0x1, 0x46(%rcx)
movq %rbx, %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x9e96
movq %rsp, %rdi
movl $0x1, %esi
movq %r14, %rdx
movl %ebp, %ecx
movl %ebp, %r8d
callq 0xa41c
leaq 0xb278(%rip), %rsi      # 0x1bd20
movq %rsp, %rdi
callq 0xa258
movq %rbx, %rdi
callq 0x9440
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
leaq 0xb252(%rip), %rsi      # 0x1bd20
movq %rsp, %rdi
callq 0xa258
movq %rbx, %rdi
callq 0x9440
movq %r14, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O3/hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::AddPolyNodeToPolygons(ClipperLib::PolyNode const&, ClipperLib::NodeType, std::vector<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>, std::allocator<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>>>&)
void AddPolyNodeToPolygons(const PolyNode& polynode, NodeType nodetype, Paths& paths)
{
  bool match = true;
  if (nodetype == ntClosed) match = !polynode.IsOpen();
  else if (nodetype == ntOpen) return;

  if (!polynode.Contour.empty() && match)
    paths.push_back(polynode.Contour);
  for (int i = 0; i < polynode.ChildCount(); ++i)
    AddPolyNodeToPolygons(*polynode.Childs[i], nodetype, paths);
}

// Assembly:
cmpl $0x1, %esi
je 0x118e1
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
cmpl $0x2, %esi
jne 0x1187f
movb 0x3c(%r14), %al
jmp 0x11881
xorl %eax, %eax
testb %al, %al
jne 0x11899
movq 0x8(%r14), %rax
cmpq %rax, (%r14)
je 0x11899
movq %rbx, %rdi
movq %r14, %rsi
callq 0x11f18
movq 0x18(%r14), %rax
movq 0x20(%r14), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
testl %ecx, %ecx
jle 0x118d7
xorl %r15d, %r15d
movq (%rax,%r15,8), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x11860
incq %r15
movq 0x18(%r14), %rax
movq 0x20(%r14), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r15
jl 0x118af
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::OpenPathsFromPolyTree(ClipperLib::PolyTree&, std::vector<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>, std::allocator<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>>>&)
void OpenPathsFromPolyTree(PolyTree& polytree, Paths& paths)
{
  paths.resize(0); 
  paths.reserve(polytree.Total());
  //Open paths are top level only, so ...
  for (int i = 0; i < polytree.ChildCount(); ++i)
    if (polytree.Childs[i]->IsOpen())
      paths.push_back(polytree.Childs[i]->Contour);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
xorl %esi, %esi
callq 0x11d24
movq 0x50(%r14), %rax
subq 0x48(%r14), %rax
shrq $0x3, %rax
movslq %eax, %rsi
movq %rbx, %rdi
callq 0x11d92
movq 0x18(%r14), %rax
movq 0x20(%r14), %rcx
movq %rcx, %rdx
subq %rax, %rdx
shrq $0x3, %rdx
testl %edx, %edx
jle 0x119d7
xorl %r15d, %r15d
movq (%rax,%r15,8), %rsi
cmpb $0x1, 0x3c(%rsi)
jne 0x119c2
movq %rbx, %rdi
callq 0x11f18
movq 0x18(%r14), %rax
movq 0x20(%r14), %rcx
incq %r15
movq %rcx, %rdx
subq %rax, %rdx
shrq $0x3, %rdx
movslq %edx, %rdx
cmpq %rdx, %r15
jl 0x119a8
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::operator<<(std::ostream&, std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>> const&)
std::ostream& operator <<(std::ostream &s, const Path &p)
{
  if (p.empty()) return s;
  Path::size_type last = p.size() -1;
  for (Path::size_type i = 0; i < last; i++)
    s << "(" << p[i].X << "," << p[i].Y << "), ";
  s << "(" << p[last].X << "," << p[last].Y << ")\n";
  return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
cmpq %rcx, %rax
je 0x11b4c
movq %rsi, %r14
subq %rax, %rcx
sarq $0x4, %rcx
decq %rcx
movq %rcx, (%rsp)
je 0x11ae6
xorl %r15d, %r15d
leaq 0x3de7(%rip), %r13      # 0x15866
movq (%rsp), %r12
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x3dd0(%rip), %rsi      # 0x15862
callq 0x3260
movq (%r14), %rax
movq (%rax,%r15), %rsi
movq %rbx, %rdi
callq 0x30c0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3dac(%rip), %rsi      # 0x15864
callq 0x3260
movq (%r14), %rax
movq 0x8(%rax,%r15), %rsi
movq %rbp, %rdi
callq 0x30c0
movl $0x3, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x3260
addq $0x10, %r15
decq %r12
jne 0x11a83
leaq 0x3d75(%rip), %rsi      # 0x15862
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3260
movq (%r14), %rax
movq (%rsp), %r12
shlq $0x4, %r12
movq (%rax,%r12), %rsi
movq %rbx, %rdi
callq 0x30c0
movq %rax, %r15
leaq 0x3d49(%rip), %rsi      # 0x15864
movl $0x1, %edx
movq %rax, %rdi
callq 0x3260
movq (%r14), %rax
movq 0x8(%rax,%r12), %rsi
movq %r15, %rdi
callq 0x30c0
leaq 0x3b7d(%rip), %rsi      # 0x156bc
movl $0x2, %edx
movq %rax, %rdi
callq 0x3260
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/hzeller[P]gcode-multi-shell-extrude/third_party/clipper.cpp
// Function: ClipperLib::operator<<(std::ostream&, std::vector<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>, std::allocator<std::vector<ClipperLib::IntPoint, std::allocator<ClipperLib::IntPoint>>>> const&)
std::ostream& operator <<(std::ostream &s, const Paths &p)
{
  for (Paths::size_type i = 0; i < p.size(); i++)
    s << p[i];
  s << "\n";
  return s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rsi
cmpq %rsi, 0x8(%r14)
je 0x11baf
xorl %r15d, %r15d
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
xorl %r13d, %r13d
addq %r15, %rsi
movq %rbx, %rdi
callq 0x11a44
incq %r13
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
sarq $0x3, %rax
imulq %r12, %rax
addq $0x18, %r15
cmpq %rax, %r13
jb 0x11b86
leaq 0x3723(%rip), %rsi      # 0x152d9
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3260
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/marxn[P]pupp/3rdparty/gmp/gen-psqr.c
// Function: square_mask
void
square_mask (mpz_t mask, int m)
{
  int    p, i, r, idx;

  p = mul_2exp_mod (1, mod_bits, m);
  p = neg_mod (p, m);

  mpz_set_ui (mask, 0L);
  for (i = 0; i < m; i++)
    {
      r = (i * i) % m;
      idx = (r * p) % m;
      mpz_setbit (mask, (unsigned long) idx);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl 0x672d(%rip), %ecx      # 0xf0e0
testl %ecx, %ecx
jle 0x89ce
incl %ecx
movl $0x1, %edx
addl %edx, %edx
movl %edx, %eax
cltd
idivl %ebx
decl %ecx
cmpl $0x1, %ecx
ja 0x89be
jmp 0x89d3
movl $0x1, %edx
testl %edx, %edx
js 0x8a20
movl %ebx, %r15d
subl %edx, %r15d
jle 0x8a20
testl %edx, %edx
cmovel %edx, %r15d
movl $0x0, 0x4(%r14)
xorl %r12d, %r12d
movl %r12d, %eax
imull %r12d, %eax
xorl %edx, %edx
divl %ebx
movl %edx, %eax
imull %r15d, %eax
cltd
idivl %ebx
movslq %edx, %rsi
movq %r14, %rdi
callq 0x5335
incl %r12d
cmpl %r12d, %ebx
jne 0x89f0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20dc(%rip), %rdi      # 0xab03
leaq 0x20e5(%rip), %rsi      # 0xab13
leaq 0x20e9(%rip), %rcx      # 0xab1e
movl $0xba, %edx
callq 0x10a0
// File: /workspace/github_cpp_makefile_star2_O3/marxn[P]pupp/3rdparty/gmp/gen-psqr.c
// Function: generate_sq_res_0x100
void
generate_sq_res_0x100 (int limb_bits)
{
  int  i, res;

  nsq_res_0x100 = (0x100 + limb_bits - 1) / limb_bits;
  sq_res_0x100 = (mpz_t *) xmalloc (nsq_res_0x100 * sizeof (*sq_res_0x100));

  for (i = 0; i < nsq_res_0x100; i++)
    mpz_init_set_ui (sq_res_0x100[i], 0L);

  for (i = 0; i < 0x100; i++)
    {
      res = (i * i) % 0x100;
      mpz_setbit (sq_res_0x100[res / limb_bits],
                  (unsigned long) (res % limb_bits));
    }

  sq_res_0x100_num = 0;
  for (i = 0; i < nsq_res_0x100; i++)
    sq_res_0x100_num += mpz_popcount (sq_res_0x100[i]);
  sq_res_0x100_fraction = (double) sq_res_0x100_num / 256.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebx
leal 0xff(%rbx), %eax
cltd
idivl %edi
movl %eax, 0x6689(%rip)      # 0xf0e4
movslq %eax, %rdi
shlq $0x4, %rdi
callq 0x1484
movq %rax, 0x667a(%rip)      # 0xf0e8
cmpl $0x0, 0x666f(%rip)      # 0xf0e4
jle 0x8abb
movl $0x8, %r14d
xorl %r15d, %r15d
movq 0x6661(%rip), %r12      # 0xf0e8
movq $0x1, -0x8(%r12,%r14)
movl $0x8, %edi
callq *0x661d(%rip)           # 0xf0b8
movq %rax, (%r12,%r14)
movl $0x0, -0x4(%r12,%r14)
incq %r15
movslq 0x6632(%rip), %rax      # 0xf0e4
addq $0x10, %r14
cmpq %rax, %r15
jl 0x8a80
xorl %r14d, %r14d
movl %r14d, %eax
imull %r14d, %eax
movzbl %al, %eax
xorl %edx, %edx
idivl %ebx
movslq %eax, %rdi
shlq $0x4, %rdi
addq 0x660e(%rip), %rdi      # 0xf0e8
movq %rdx, %rsi
callq 0x5335
incl %r14d
cmpl $0x100, %r14d           # imm = 0x100
jne 0x8abe
movl $0x0, 0x65f8(%rip)      # 0xf0f0
movslq 0x65e5(%rip), %r14      # 0xf0e4
testq %r14, %r14
jle 0x8b38
xorl %r15d, %r15d
movq 0x65da(%rip), %rbx      # 0xf0e8
movq %rbx, %rdi
callq 0x76b1
addl %eax, %r15d
movl %r15d, 0x65d0(%rip)     # 0xf0f0
addq $0x10, %rbx
decq %r14
jne 0x8b0e
cvtsi2sd %r15d, %xmm0
mulsd 0x14fa(%rip), %xmm0     # 0xa030
jmp 0x8b3c
xorpd %xmm0, %xmm0
movsd %xmm0, 0x65b4(%rip)     # 0xf0f8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/marxn[P]pupp/3rdparty/gmp/gen-psqr.c
// Function: main
int
main (int argc, char *argv[])
{
  int  limb_bits, nail_bits;

  if (argc != 3)
    {
      fprintf (stderr, "Usage: gen-psqr <limbbits> <nailbits>\n");
      exit (1);
    }

  limb_bits = atoi (argv[1]);
  nail_bits = atoi (argv[2]);

  if (limb_bits <= 0
      || nail_bits < 0
      || nail_bits >= limb_bits)
    {
      fprintf (stderr, "Invalid limb/nail bits: %d %d\n",
               limb_bits, nail_bits);
      exit (1);
    }

  generate_sq_res_0x100 (limb_bits);
  generate_mod (limb_bits, nail_bits);

  print (limb_bits, nail_bits);

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpl $0x3, %edi
jne 0x9a74
movq %rsi, %r14
movq 0x8(%rsi), %rdi
callq 0x1100
movl %eax, %ebx
movq 0x10(%r14), %rdi
callq 0x1100
movl %eax, %r14d
testl %ebx, %ebx
jle 0x9a79
testl %r14d, %r14d
js 0x9a79
cmpl %ebx, %r14d
jge 0x9a79
movl %ebx, %edi
callq 0x8a3f
movl %ebx, %edi
movl %r14d, %esi
callq 0x8b4d
movl %ebx, %edi
movl %r14d, %esi
callq 0x9436
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
callq 0x12c8
movl %ebx, %edi
movl %r14d, %esi
callq 0x12f0
// File: /workspace/github_cpp_makefile_star2_O3/dlcgold[P]sparsematrix-unimib/main.cpp
// Function: test_vuota(sparse_matrix<int>)
void test_vuota(const smatrixi vuota){
  std::cout << "\n\ntest stampa matrice vuota\n";
  std::cout << vuota << std::endl;
  std::cout << "\ntest evaluate matrice vuota\n";
  positive pos;
  int count = evaluate(vuota, pos);
  assert(count == 0);
  std::cout << "valori accettabili: " << count << "\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x57b0(%rip), %r14      # 0x6fd0
leaq 0x2a31(%rip), %rsi      # 0x4258
movl $0x1c, %edx
movq %r14, %rdi
callq 0x10d0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x25bf
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %esi
movq %r15, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
leaq 0x2a05(%rip), %rsi      # 0x4275
movl $0x1d, %edx
movq %r14, %rdi
callq 0x10d0
movq %rbx, %rdi
callq 0x2571
testl %eax, %eax
jne 0x18cc
movq 0x5740(%rip), %rbx      # 0x6fd0
leaq 0x2a27(%rip), %rsi      # 0x42be
movl $0x14, %edx
movq %rbx, %rdi
callq 0x10d0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1120
leaq 0x288f(%rip), %rsi      # 0x4144
movl $0x1, %edx
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x10d0
leaq 0x29c0(%rip), %rdi      # 0x4293
leaq 0x2771(%rip), %rsi      # 0x404b
leaq 0x29bd(%rip), %rcx      # 0x429e
movl $0x66, %edx
callq 0x1070
// File: /workspace/github_cpp_makefile_star2_O3/dlcgold[P]sparsematrix-unimib/main.cpp
// Function: test_duplicati()
void test_duplicati(){
  std::cout << "\ntest inserimento duplicati\n";
  smatrixi testM(0);
  testM.add(1, 0, 0);
  testM.add(2, 1, 2);
  testM.add(5, 0, 0);
  testM.add(2, 1, 2);

  testM.add(4, 0, 0);
  testM.add(5, 0, 0);
  testM.print();
  assert(testM.get_size() == 2);
  std::cout << "test duplicati superato\n";
  testM.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
movq 0x52f8(%rip), %rdi      # 0x6fd0
leaq 0x26b2(%rip), %rsi      # 0x4391
movl $0x1c, %edx
callq 0x10d0
xorl %eax, %eax
leaq -0x30(%rbp), %rdi
movl %eax, (%rdi)
movb $0x0, 0x4(%rdi)
movabsq $0x7fffffff7fffffff, %rcx # imm = 0x7FFFFFFF7FFFFFFF
movq %rcx, 0x8(%rdi)
movq $0x0, 0x10(%rdi)
movl %eax, 0x18(%rdi)
leaq -0xc(%rbp), %rsi
movl $0x1, (%rsi)
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x29c8
leaq -0xc(%rbp), %rsi
movl $0x2, (%rsi)
leaq -0x30(%rbp), %rdi
movl $0x1, %edx
movl $0x2, %ecx
callq 0x29c8
leaq -0xc(%rbp), %rsi
movl $0x5, (%rsi)
leaq -0x30(%rbp), %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x29c8
leaq -0xc(%rbp), %rsi
movl $0x2, (%rsi)
leaq -0x30(%rbp), %rdi
movl $0x1, %edx
movl $0x2, %ecx
callq 0x29c8
leaq -0xc(%rbp), %rsi
movl $0x4, (%rsi)
leaq -0x30(%rbp), %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x29c8
leaq -0xc(%rbp), %rsi
movl $0x5, (%rsi)
leaq -0x30(%rbp), %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x29c8
leaq -0x30(%rbp), %rdi
callq 0x2bdc
cmpl $0x2, -0x18(%rbp)
jne 0x1dec
movq 0x521a(%rip), %rdi      # 0x6fd0
leaq 0x261d(%rip), %rsi      # 0x43da
movl $0x18, %edx
callq 0x10d0
leaq -0x30(%rbp), %rdi
movq 0x10(%rdi), %rsi
callq 0x30ae
leaq -0x30(%rbp), %rdi
movq $0x0, 0x10(%rdi)
callq 0x2548
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
leaq 0x25bb(%rip), %rdi      # 0x43ae
leaq 0x2251(%rip), %rsi      # 0x404b
leaq 0x25c3(%rip), %rcx      # 0x43c4
movl $0x93, %edx
callq 0x1070
jmp 0x1e17
jmp 0x1e17
jmp 0x1e17
jmp 0x1e17
jmp 0x1e17
jmp 0x1e17
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2548
movq %rbx, %rdi
callq 0x1130
// File: /workspace/github_cpp_makefile_star2_O3/dlcgold[P]sparsematrix-unimib/main.cpp
// Function: main
int main(){
  test_fondamentali();
  smatrixi costante(0);
  test_vuota(costante);
  test_point();
  test_duplicati();
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x48, %rsp
callq 0x127c
xorl %eax, %eax
leaq -0x48(%rbp), %rsi
movl %eax, (%rsi)
movb $0x0, 0x4(%rsi)
movabsq $0x7fffffff7fffffff, %rcx # imm = 0x7FFFFFFF7FFFFFFF
movq %rcx, 0x8(%rsi)
movq $0x0, 0x10(%rsi)
movl %eax, 0x18(%rsi)
leaq -0x28(%rbp), %rdi
callq 0x2492
leaq -0x28(%rbp), %rdi
callq 0x180c
leaq -0x28(%rbp), %rdi
callq 0x2548
callq 0x18eb
callq 0x1cc8
leaq -0x48(%rbp), %rdi
callq 0x2548
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x2548
jmp 0x1ea6
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x2548
movq %rbx, %rdi
callq 0x1130
nop
// File: /workspace/github_cpp_makefile_star2_O3/dlcgold[P]sparsematrix-unimib/./sparsematrix.h
// Function: void printdef<float>(sparse_matrix<float>, int, int)
void printdef(sparse_matrix<T> smatrix, int n, int m){
  if(n < 0 || m < 0)
    throw NegativeIndexSparseMatrixException();
  for(int i = 0; i < n; i++){
    for(int j = 0; j < m; j++){
      std::cout << smatrix(i, j) << " ";
    }
    std::cout << std::endl;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %eax
orl %esi, %eax
js 0x2183
testl %esi, %esi
jle 0x2174
movl %edx, %ebx
movq %rdi, %r15
xorl %r12d, %r12d
movq 0x4ed2(%rip), %r13      # 0x6fd0
movl %esi, -0x2c(%rbp)
testl %ebx, %ebx
jle 0x2141
xorl %r14d, %r14d
movq %r15, %rdi
movl %r12d, %esi
movl %r14d, %edx
callq 0x2dda
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movq %r13, %rdi
callq 0x10f0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x222c(%rip), %rsi      # 0x4360
callq 0x10d0
incl %r14d
cmpl %r14d, %ebx
jne 0x2108
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
incl %r12d
movl -0x2c(%rbp), %esi
cmpl %esi, %r12d
jne 0x2101
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x8, %edi
callq 0x1060
leaq 0x4b34(%rip), %rcx      # 0x6cc8
movq %rcx, (%rax)
leaq 0x4ad2(%rip), %rsi      # 0x6c70
movq 0x4e3b(%rip), %rdx      # 0x6fe0
movq %rax, %rdi
callq 0x1110
nop
// File: /workspace/github_cpp_makefile_star2_O3/dlcgold[P]sparsematrix-unimib/./sparsematrix.h
// Function: sparse_matrix<float>::sparse_matrix(sparse_matrix<float> const&)
sparse_matrix(const sparse_matrix &other): default_value(other.default_value),
					     dim(other.dim),
					     size_row(other.size_row),
					     size_column(other.size_column),
					     head(nullptr), size(0) {
    node *curr = other.head;

    // eseguo una copia nodo per nodo
    try {
      while(curr != nullptr) {
	add(curr->ret->v, curr->ret->x, curr->ret->y);
	curr = curr->next;
      }		
    }
    catch(...) {
      clear();
      throw NoSparseMatrixException();
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movss (%rsi), %xmm0
movss %xmm0, (%rdi)
movb 0x4(%rsi), %al
movb %al, 0x4(%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rdi)
movl 0xc(%rsi), %eax
movl %eax, 0xc(%rdi)
movq $0x0, 0x10(%rdi)
movl $0x0, 0x18(%rdi)
addq $0x10, %r14
movq (%r14), %r14
testq %r14, %r14
je 0x2204
movq 0x8(%r14), %rsi
movl 0x4(%rsi), %edx
movl 0x8(%rsi), %ecx
movq %rbx, %rdi
callq 0x1eb8
jmp 0x21e8
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rdi
callq 0x1050
movq 0x10(%rbx), %rsi
movq %rbx, %rdi
callq 0x2c98
movq $0x0, 0x10(%rbx)
movl $0x8, %edi
callq 0x1060
leaq 0x4b22(%rip), %rcx      # 0x6d58
movq %rcx, (%rax)
leaq 0x4af0(%rip), %rsi      # 0x6d30
movq 0x4d99(%rip), %rdx      # 0x6fe0
movq %rax, %rdi
callq 0x1110
movq %rax, %rbx
callq 0x1100
movq %rbx, %rdi
callq 0x1130
movq %rax, %rdi
callq 0x2c89
nop
// File: /workspace/github_cpp_makefile_star2_O3/dlcgold[P]sparsematrix-unimib/./sparsematrix.h
// Function: sparse_matrix<int>::sparse_matrix<float>(sparse_matrix<float> const&)
sparse_matrix(const sparse_matrix<Q> &other):
    default_value(static_cast<T>(other.get_default_value())),
    dim(other.get_dim()), size_row(other.get_size_row()),
    size_column(other.get_size_column()), head(nullptr), size(0) {
    
    // mi muovo con gli iteratori nella matrice sparsa passata in ingresso
    // effettuo la add alla nuova matrice sparsa con cast del valore
    typename sparse_matrix<Q>::const_iterator i, ie;
    i = other.begin();
    ie = other.end();
    try {
      while(i != ie) {
	add(static_cast<T>(i->v), i->x, i->y);
	++i;
      }		
    }
    catch(...) {
      clear();
      throw NoCastSparseMatrixException();
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cvttss2si (%rsi), %eax
movl %eax, (%rdi)
movb 0x4(%rsi), %al
movb %al, 0x4(%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rdi)
movl 0xc(%rsi), %eax
movl %eax, 0xc(%rdi)
movq $0x0, 0x10(%rdi)
movl $0x0, 0x18(%rdi)
movq 0x10(%rsi), %r15
testq %r15, %r15
je 0x234f
movq %rdi, %rbx
leaq -0x1c(%rbp), %r14
movq 0x8(%r15), %rax
cvttss2si (%rax), %ecx
movl %ecx, -0x1c(%rbp)
movl 0x4(%rax), %edx
movl 0x8(%rax), %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x29c8
movq (%r15), %r15
testq %r15, %r15
jne 0x232b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x1050
movq 0x10(%rbx), %rsi
movq %rbx, %rdi
callq 0x30ae
movq $0x0, 0x10(%rbx)
movl $0x8, %edi
callq 0x1060
leaq 0x4a11(%rip), %rcx      # 0x6d98
movq %rcx, (%rax)
leaq 0x49df(%rip), %rsi      # 0x6d70
movq 0x4c48(%rip), %rdx      # 0x6fe0
movq %rax, %rdi
callq 0x1110
movq %rax, %rbx
callq 0x1100
movq %rbx, %rdi
callq 0x1130
movq %rax, %rdi
callq 0x2c89
// File: /workspace/github_cpp_makefile_star2_O3/dlcgold[P]sparsematrix-unimib/./sparsematrix.h
// Function: std::ostream& operator<<<int>(std::ostream&, sparse_matrix<int> const&)
std::ostream &operator<<(std::ostream &os, 
			 const sparse_matrix<T> &smatrix) {
	
  typename sparse_matrix<T>::const_iterator i, ie;
	
  i = smatrix.begin();
  ie = smatrix.end();
  // evito overflow se provo a stampare su una matrice nulla
  if(smatrix.get_size() == 0)
    return os;
  // mi salvo il numero di riga per andare a capo
  int prevrow = i->x;
  
  while(i!=ie) {
    if(i->x != prevrow)
      std::cout << std::endl;
    os << i->v << "\t";
    prevrow = i->x;
    ++i;
  }
  return os;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x18(%rsi)
sete %al
movq 0x10(%rsi), %r12
testq %r12, %r12
sete %cl
orb %al, %cl
jne 0x265e
movq %r12, %r13
addq $0x8, %r13
leaq 0x1e63(%rip), %r14      # 0x4456
movq 0x49d6(%rip), %r15      # 0x6fd0
movq (%r13), %rcx
leaq 0x8(%r12), %r13
movq 0x8(%r12), %rax
movl 0x4(%rax), %edx
cmpl 0x4(%rcx), %edx
je 0x263b
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %esi
movq %r15, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
movq (%r13), %rax
movl (%rax), %esi
movq %rbx, %rdi
callq 0x1120
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x10d0
movq (%r12), %r12
testq %r12, %r12
jne 0x25fa
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/dlcgold[P]sparsematrix-unimib/./sparsematrix.h
// Function: sparse_matrix<int>::print() const
void print() const{
    node *current = head;
    while(current != nullptr){
      std::cout << current->ret->v << " in (" << current->ret->x << ", "
		<< current->ret->y <<")\n";
      current = current->next;
      
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x10(%rdi), %rbx
testq %rbx, %rbx
je 0x2c7a
leaq 0x185a(%rip), %r14      # 0x4458
leaq 0x175a(%rip), %r15      # 0x435f
leaq 0x15a5(%rip), %r12      # 0x41b1
movq 0x8(%rbx), %rax
movl (%rax), %esi
movq 0x43b7(%rip), %rdi      # 0x6fd0
callq 0x1120
movq %rax, %r13
movl $0x5, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x10d0
movq 0x8(%rbx), %rax
movl 0x4(%rax), %esi
movq %r13, %rdi
callq 0x1120
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x10d0
movq 0x8(%rbx), %rax
movl 0x8(%rax), %esi
movq %r13, %rdi
callq 0x1120
movl $0x2, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x10d0
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x2c0c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/dlcgold[P]sparsematrix-unimib/./sparsematrix.h
// Function: sparse_matrix<float>::recursive_clear(sparse_matrix<float>::node*)
void recursive_clear(node *n){
    if(n!=nullptr) {
      recursive_clear(n->next);
      delete n->ret;
      n->ret = nullptr;
      delete n;
      size--;
      n = nullptr;   
    }
  }

// Assembly:
testq %rsi, %rsi
je 0x2cca
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rsi
callq 0x2c98
movq 0x8(%r14), %rdi
callq 0x10a0
movq %r14, %rdi
callq 0x10a0
decl 0x18(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/dlcgold[P]sparsematrix-unimib/./sparsematrix.h
// Function: sparse_matrix<float>::node::node(float const&, int, int)
node(const T &v, const int x, const int y): next(nullptr){
      try{
	ret = new element(v, x, y);
      }catch(...){
	throw noNodeException{};
      }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %r14
movq $0x0, (%rdi)
movl $0xc, %edi
callq 0x10c0
movss (%r12), %xmm0
movss %xmm0, (%rax)
movl %r15d, 0x4(%rax)
movl %ebx, 0x8(%rax)
movq %rax, 0x8(%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x1050
movl $0x8, %edi
callq 0x1060
leaq 0x3fc6(%rip), %rcx      # 0x6cf0
movq %rcx, (%rax)
leaq 0x3f54(%rip), %rsi      # 0x6c88
movq 0x42a5(%rip), %rdx      # 0x6fe0
movq %rax, %rdi
callq 0x1110
movq %rax, %rbx
callq 0x1100
movq %rbx, %rdi
callq 0x1130
movq %rax, %rdi
callq 0x2c89
nop
// File: /workspace/github_cpp_makefile_star2_O3/dlcgold[P]sparsematrix-unimib/./sparsematrix.h
// Function: sparse_matrix<float>::operator()(int, int)
const T& operator()(int x, int y) {
    if(x < 0 || y < 0)
      throw  NegativeIndexSparseMatrixException();
    if((x < size_row) && (y < size_column)){
      node *current = head;
      T& value = default_value;

      // come per la add avanzo fino alle condizioni di arresto
      while(current->next != nullptr &&
	    ((current->next->ret->x == x && current->next->ret->y <= y)
	     || (current->next->ret->x < x))) {
	
	current = current->next;
      }
      // se mi sono fermato sul nodo corrispondente alle coordinate richieste
      // ne resituisco il valore, altrimenti resituisco il valore di default
      if(current->ret->x == x && current->ret->y == y){
	return current->ret->v;
      }else{
	return value;
      }
    }else{
      throw IndexOutOfBoundsException();
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edx, %eax
orl %esi, %eax
js 0x2e2c
cmpl %esi, 0x8(%rdi)
jle 0x2e49
cmpl %edx, 0xc(%rdi)
jle 0x2e49
movq 0x10(%rdi), %rax
movq (%rax), %r8
testq %r8, %r8
je 0x2e19
movq %r8, %rcx
movq 0x8(%r8), %r8
cmpl %esi, 0x4(%r8)
jne 0x2e0f
cmpl %edx, 0x8(%r8)
jle 0x2e11
jmp 0x2e19
jge 0x2e19
movq (%rcx), %r8
movq %rcx, %rax
jmp 0x2df5
movq 0x8(%rax), %rax
cmpl %esi, 0x4(%rax)
jne 0x2e27
cmpl %edx, 0x8(%rax)
je 0x2e2a
movq %rdi, %rax
popq %rbp
retq
movl $0x8, %edi
callq 0x1060
leaq 0x3e8b(%rip), %rcx      # 0x6cc8
movq %rcx, (%rax)
leaq 0x3e29(%rip), %rsi      # 0x6c70
jmp 0x2e64
movl $0x8, %edi
callq 0x1060
leaq 0x3ebe(%rip), %rcx      # 0x6d18
movq %rcx, (%rax)
leaq 0x3e3c(%rip), %rsi      # 0x6ca0
movq 0x4175(%rip), %rdx      # 0x6fe0
movq %rax, %rdi
callq 0x1110
nop
// File: /workspace/github_cpp_makefile_star2_O3/BlinfoldKing[P]lisval/src/lib/evaluator.cpp
// Function: Evaluator::dec()
pair<Token*, function<Token*(Token*)>> Evaluator::dec() {
    Token* op = new UnaryOperator(UnaryOperatorType::DEC);
    Token* var1 = new Variable("Pattern");
    List* signature = new List();
    signature->list.push_back(op);
    signature->list.push_back(var1);
    Token* token = signature;
    auto res = make_pair(token, [this](Token* input) {
            List* list = static_cast<List*>(input);

            Token* new_signature = this->eval(list->list[1]);

            auto new_rule = make_pair(new_signature, [](Token* input) {
                        Token* res = new Boolean(true);
                        return res;
            });

            this->state.push_back(new_rule);

            Token* res = new Boolean(true);
            return res;
    });

    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movl $0x8, %edi
callq 0x31b0
movabsq $0x100000004, %rcx      # imm = 0x100000004
movq %rcx, (%rax)
movq %rax, -0x58(%rbp)
movl $0x28, %edi
callq 0x31b0
movq %rax, %r14
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xb60a(%rip), %rsi      # 0xf2bb
leaq 0xb60a(%rip), %rdx      # 0xf2c2
leaq -0x48(%rbp), %rdi
callq 0x3bb0
movl $0x3, (%r14)
leaq 0x8(%r14), %rdi
movq %r14, %rax
addq $0x18, %rax
movq %rax, 0x8(%r14)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
callq 0x3a18
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x3cfc
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31c0
movq %r14, -0x50(%rbp)
movl $0x20, %edi
callq 0x31b0
movq %rax, %r12
movl $0x1, (%rax)
leaq 0x8(%rax), %r13
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
leaq -0x58(%rbp), %rdx
movq %r13, %rdi
xorl %esi, %esi
callq 0x9afe
movq 0x10(%r12), %rsi
cmpq 0x18(%r12), %rsi
je 0x3d4b
movq %r14, (%rsi)
addq $0x8, 0x10(%r12)
jmp 0x3d57
leaq -0x50(%rbp), %rdx
movq %r13, %rdi
callq 0x9afe
movq %r12, (%rbx)
movq $0x0, 0x10(%rbx)
movq %r15, 0x8(%rbx)
leaq 0x3413(%rip), %rax      # 0x7180
movq %rax, 0x20(%rbx)
leaq 0x34bc(%rip), %rax      # 0x7234
movq %rax, 0x18(%rbx)
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x3dab
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31c0
jmp 0x3dab
movq %rax, %rbx
movl $0x28, %esi
movq %r14, %rdi
callq 0x31c0
movq %rbx, %rdi
callq 0x32e0
// File: /workspace/github_cpp_makefile_star2_O3/BlinfoldKing[P]lisval/src/lib/evaluator.cpp
// Function: Evaluator::not_()
pair<Token*, function<Token*(Token*)>> Evaluator::not_() {
    Token* op = new UnaryOperator(UnaryOperatorType::NOT);
    Token* var1 = new Variable("Pattern");
    List* signature = new List();
    signature->list.push_back(op);
    signature->list.push_back(var1);
    Token* token = signature;
    auto res = make_pair(token, [this](Token* input) {
            List* list = static_cast<List*>(input);

            Token* pattern_token = this->eval(list->list[1]);
            if (pattern_token->type != TokenType::BOOLEAN) {
                Token* t = new Error("expect a boolean, got:" + pattern_token->debug(), input);
                return t;
            }

            Boolean* pattern = static_cast<Boolean*>(pattern_token);


            Token* res = new Boolean(!pattern->value);
            return res;
    });

    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movq %rdi, %r14
movl $0x8, %edi
callq 0x31b0
movq $0x4, (%rax)
movq %rax, -0x58(%rbp)
movl $0x28, %edi
callq 0x31b0
movq %rax, %rbx
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xb4b2(%rip), %rsi      # 0xf2bb
leaq 0xb4b2(%rip), %rdx      # 0xf2c2
leaq -0x48(%rbp), %rdi
callq 0x3bb0
movl $0x3, (%rbx)
leaq 0x8(%rbx), %rdi
movq %rbx, %rax
addq $0x18, %rax
movq %rax, 0x8(%rbx)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
callq 0x3a18
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x3e53
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31c0
movq %rbx, -0x50(%rbp)
movl $0x20, %edi
callq 0x31b0
movq %rax, %r12
movl $0x1, (%rax)
leaq 0x8(%rax), %r13
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
leaq -0x58(%rbp), %rdx
movq %r13, %rdi
xorl %esi, %esi
callq 0x9afe
movq 0x10(%r12), %rsi
cmpq 0x18(%r12), %rsi
je 0x3ea2
movq %rbx, (%rsi)
addq $0x8, 0x10(%r12)
jmp 0x3eae
leaq -0x50(%rbp), %rdx
movq %r13, %rdi
callq 0x9afe
movq %r12, (%r14)
movq $0x0, 0x10(%r14)
movq %r15, 0x8(%r14)
leaq 0x33d2(%rip), %rax      # 0x7296
movq %rax, 0x20(%r14)
leaq 0x353b(%rip), %rax      # 0x740a
movq %rax, 0x18(%r14)
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x3f02
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31c0
jmp 0x3f02
movq %rax, %r14
movl $0x28, %esi
movq %rbx, %rdi
callq 0x31c0
movq %r14, %rdi
callq 0x32e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/BlinfoldKing[P]lisval/src/lib/evaluator.cpp
// Function: Evaluator::clear()
pair<Token*, function<Token*(Token*)>> Evaluator::clear() {
    Token* op = new Atom("clear");
    List* signature = new List();
    signature->list.push_back(op);
    Token* token = signature;
    auto res = make_pair(token, [this](Token* input) {
            clrscr();
           return nullptr;
    });

    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %r14
movl $0x28, %edi
callq 0x31b0
movq %rax, %rbx
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x9e1f(%rip), %rsi      # 0xf2b5
leaq 0x9e1d(%rip), %rdx      # 0xf2ba
leaq -0x48(%rbp), %rdi
callq 0x3bb0
movl $0x0, (%rbx)
leaq 0x8(%rbx), %rdi
movq %rbx, %rax
addq $0x18, %rax
movq %rax, 0x8(%rbx)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
callq 0x3a18
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x54e0
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31c0
leaq -0x50(%rbp), %r12
movq %rbx, (%r12)
movl $0x20, %edi
callq 0x31b0
movq %rax, %rbx
movl $0x1, (%rax)
leaq 0x8(%rax), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
xorl %r13d, %r13d
movq %r13, 0x18(%rax)
xorl %esi, %esi
movq %r12, %rdx
callq 0x9afe
movq %rbx, (%r14)
movq %r13, 0x10(%r14)
movq %r15, 0x8(%r14)
leaq 0x3335(%rip), %rax      # 0x885e
movq %rax, 0x20(%r14)
leaq 0x333e(%rip), %rax      # 0x8872
movq %rax, 0x18(%r14)
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5567
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31c0
jmp 0x5567
movq %rax, %r14
movl $0x28, %esi
movq %rbx, %rdi
callq 0x31c0
movq %r14, %rdi
callq 0x32e0
// File: /workspace/github_cpp_makefile_star2_O3/BlinfoldKing[P]lisval/src/lib/evaluator.cpp
// Function: Evaluator::definitions()
pair<Token*, function<Token*(Token*)>> Evaluator::definitions() {
    Token* op = new Atom("definitions");
    List* signature = new List();
    signature->list.push_back(op);
    Token* token = signature;
    auto res = make_pair(token, [this](Token* input) {
            for (size_t i = 0; i < this->state.size(); i++) {
                cout << this->state[i].first->debug() << '\n';
            }

            return nullptr;
    });

    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %r14
movl $0x28, %edi
callq 0x31b0
movq %rax, %rbx
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x98ec(%rip), %rsi      # 0xf2e4
leaq 0x98f0(%rip), %rdx      # 0xf2ef
leaq -0x48(%rbp), %rdi
callq 0x3bb0
movl $0x0, (%rbx)
leaq 0x8(%rbx), %rdi
movq %rbx, %rax
addq $0x18, %rax
movq %rax, 0x8(%rbx)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
callq 0x3a18
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5a42
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31c0
leaq -0x50(%rbp), %r12
movq %rbx, (%r12)
movl $0x20, %edi
callq 0x31b0
movq %rax, %rbx
movl $0x1, (%rax)
leaq 0x8(%rax), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
xorl %r13d, %r13d
movq %r13, 0x18(%rax)
xorl %esi, %esi
movq %r12, %rdx
callq 0x9afe
movq %rbx, (%r14)
movq %r13, 0x10(%r14)
movq %r15, 0x8(%r14)
leaq 0x32d3(%rip), %rax      # 0x8d5e
movq %rax, 0x20(%r14)
leaq 0x33a4(%rip), %rax      # 0x8e3a
movq %rax, 0x18(%r14)
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5ac9
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31c0
jmp 0x5ac9
movq %rax, %r14
movl $0x28, %esi
movq %rbx, %rdi
callq 0x31c0
movq %r14, %rdi
callq 0x32e0
// File: /workspace/github_cpp_makefile_star2_O3/BlinfoldKing[P]lisval/src/lib/evaluator.cpp
// Function: Evaluator::print()
pair<Token*, function<Token*(Token*)>> Evaluator::print() {
    Token* op = new Atom("print");
    Token* input = new Variable("INPUT");
    List* signature = new List();
    signature->list.push_back(op);
    signature->list.push_back(input);
    Token* token = signature;
    auto res = make_pair(token, [this](Token* input) {
            List* input_list = static_cast<List*>(input);
            Token* res = this->eval(input_list->list[1]);
            cout << res->debug() << '\n';

            return res;
    });

    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x28, %edi
callq 0x31b0
movq %rax, %r15
leaq -0x60(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x97de(%rip), %rsi      # 0xf2f0
leaq 0x97dc(%rip), %rdx      # 0xf2f5
leaq -0x70(%rbp), %rdi
callq 0x3bb0
movl $0x0, (%r15)
leaq 0x8(%r15), %rdi
movq %r15, %rax
addq $0x18, %rax
movq %rax, 0x8(%r15)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
callq 0x3a18
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x5b5d
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x31c0
movq %r15, -0x78(%rbp)
movl $0x28, %edi
callq 0x31b0
movq %rax, %r15
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x979e(%rip), %rsi      # 0xf31c
leaq 0x979c(%rip), %rdx      # 0xf321
leaq -0x48(%rbp), %rdi
callq 0x3bb0
movl $0x3, (%r15)
leaq 0x8(%r15), %rdi
movq %r15, %rax
addq $0x18, %rax
movq %rax, 0x8(%r15)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
callq 0x3a18
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5bc9
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31c0
movq %r15, -0x50(%rbp)
movl $0x20, %edi
callq 0x31b0
movq %rax, %r12
movl $0x1, (%rax)
leaq 0x8(%rax), %r13
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
leaq -0x78(%rbp), %rdx
movq %r13, %rdi
xorl %esi, %esi
callq 0x9afe
movq 0x10(%r12), %rsi
cmpq 0x18(%r12), %rsi
je 0x5c18
movq %r15, (%rsi)
addq $0x8, 0x10(%r12)
jmp 0x5c24
leaq -0x50(%rbp), %rdx
movq %r13, %rdi
callq 0x9afe
movq %r12, (%rbx)
movq $0x0, 0x10(%rbx)
movq %r14, 0x8(%rbx)
leaq 0x322a(%rip), %rax      # 0x8e64
movq %rax, 0x20(%rbx)
leaq 0x32bf(%rip), %rax      # 0x8f04
movq %rax, 0x18(%rbx)
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5c8c
movq -0x38(%rbp), %rsi
jmp 0x5c7f
jmp 0x5c89
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x5c8c
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x31c0
jmp 0x5c8c
movq %rax, %rbx
movl $0x28, %esi
movq %r15, %rdi
callq 0x31c0
movq %rbx, %rdi
callq 0x32e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/BlinfoldKing[P]lisval/src/lib/evaluator.cpp
// Function: Evaluator::generateVariableArgument(Token*, Token*)
vector<pair<Variable*, Token*>> Evaluator::generateVariableArgument(Token* condition, Token* input) {
    vector<pair<Variable*, Token*>> arguments;
    if (condition->type == TokenType::VARIABLE) {
        Variable* var = static_cast<Variable*>(condition);
        arguments.push_back(make_pair(var, input));
    } else if (condition->type == TokenType::LIST) {
        List* params = static_cast<List*>(condition);
        List* args = static_cast<List*>(input);

        for (size_t i = 0; i < params->list.size(); i++) {
            if (params->list[i]->type == TokenType::VARIABLE) {
                Variable* var = static_cast<Variable*>(params->list[i]);
                arguments.push_back(make_pair(var, args->list[i]));
            }
        }
    }

    return arguments;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl (%rdx), %eax
cmpl $0x3, %eax
je 0x5d46
cmpl $0x1, %eax
jne 0x5d5b
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
cmpq %rax, %rcx
je 0x5d5b
xorl %r13d, %r13d
leaq -0x38(%rbp), %r12
movq (%rax,%r13,8), %rdx
cmpl $0x3, (%rdx)
jne 0x5d32
movq 0x8(%r14), %rax
movq (%rax,%r13,8), %rax
movq %rdx, -0x38(%rbp)
movq %rax, -0x30(%rbp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x5d1f
movups -0x38(%rbp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rbx)
jmp 0x5d2a
movq %rbx, %rdi
movq %r12, %rdx
callq 0x9fc6
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
incq %r13
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rdx, %r13
jb 0x5cee
jmp 0x5d5b
leaq -0x38(%rbp), %rdx
movq %r15, (%rdx)
movq %r14, 0x8(%rdx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9fc6
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5d6f
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x5d86
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x31c0
movq %r14, %rdi
callq 0x32e0
// File: /workspace/github_cpp_makefile_star2_O3/BlinfoldKing[P]lisval/src/lib/evaluator.cpp
// Function: compareSignature(Token*, Token*)
bool compareSignature(Token* input, Token* signature) {
        if (signature->type == TokenType::VARIABLE) {
            return input->type != TokenType::VARIABLE;
        }

        if (input->type != signature->type) {
            return false;
        }

        if (input->type == TokenType::LIST) {
            List* input_list = static_cast<List*>(input);
            List* signature_list = static_cast<List*>(signature);

            return compareList(input_list, signature_list);
        }

        if (input->type == TokenType::ATOM) {
            Atom* i = static_cast<Atom*>(input);
            Atom* s = static_cast<Atom*>(signature);
            return i->str == s->str;
        }

        if (input->type == TokenType::VARIABLE) {
            Variable* i = static_cast<Variable*>(input);
            Variable* s = static_cast<Variable*>(signature);
            return i->str == s->str;
        }

        if (input->type == TokenType::NUMBER) {
            Number* i = static_cast<Number*>(input);
            Number* s = static_cast<Number*>(signature);
            return i->value == s->value;
        }

        if (input->type == TokenType::BOOLEAN) {
            Boolean* i = static_cast<Boolean*>(input);
            Boolean* s = static_cast<Boolean*>(signature);
            return i->value == s->value;
        }

        return false;
}

// Assembly:
movl (%rsi), %ecx
movl (%rdi), %eax
cmpl $0x3, %ecx
jne 0x7113
cmpl $0x3, %eax
setne %al
retq
cmpl %ecx, %eax
jne 0x7157
xorl %eax, %eax
cmpl $0x7, %ecx
ja 0x7112
movl %ecx, %ecx
leaq 0x7f51(%rip), %rdx      # 0xf078
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x10(%rdi), %rdx
cmpq 0x10(%rsi), %rdx
jne 0x7157
testq %rdx, %rdx
je 0x717c
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rsi), %rsi
movq 0x8(%rdi), %rdi
callq 0x31d0
testl %eax, %eax
sete %al
popq %rbp
retq
xorl %eax, %eax
retq
movss 0x4(%rsi), %xmm0
cmpeqss 0x4(%rdi), %xmm0
movd %xmm0, %eax
andl $0x1, %eax
retq
jmp 0x7009
movb 0x4(%rdi), %al
cmpb 0x4(%rsi), %al
sete %al
retq
movb $0x1, %al
retq
nop