LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: HandleTpl::fix(FixedHandle&, ParserWalker const&) const
void HandleTpl::fix(FixedHandle &hand,const ParserWalker &walker) const

{
  if (ptrspace.getType() == ConstTpl::real) {
    // The export is unstarred, but this doesn't mean the varnode
    // being exported isn't dynamic
    space.fillinSpace(hand,walker);
    hand.size = size.fix(walker);
    ptroffset.fillinOffset(hand,walker);
  }
  else {
    hand.space = space.fixSpace(walker);
    hand.size = size.fix(walker);
    hand.offset_offset = ptroffset.fix(walker);
    hand.offset_space = ptrspace.fixSpace(walker);
    if (hand.offset_space->getType()==IPTR_CONSTANT) {
				// Handle could have been dynamic but wasn't
      hand.offset_space = (AddrSpace *)0;
      hand.offset_offset = AddrSpace::addressToByte(hand.offset_offset,hand.space->getWordSize());
      hand.offset_offset = hand.space->wrapOffset(hand.offset_offset);
    }
    else {
      hand.offset_size = ptrsize.fix(walker);
      hand.temp_space = temp_space.fixSpace(walker);
      hand.temp_offset = temp_offset.fix(walker);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
cmpl $0x0, 0x40(%rdi)
je 0x55c56
leaq 0x40(%r15), %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x3ffa0
movq %rax, (%rbx)
leaq 0x20(%r15), %rdi
movq %r14, %rsi
callq 0x40030
movl %eax, 0x8(%rbx)
leaq 0x60(%r15), %rdi
movq %r14, %rsi
callq 0x40030
movq %rax, 0x18(%rbx)
movq %r12, %rdi
movq %r14, %rsi
callq 0x3ffa0
movq %rax, 0x10(%rbx)
cmpl $0x0, 0x8(%rax)
je 0x55c90
leaq 0x80(%r15), %rdi
movq %r14, %rsi
callq 0x40030
movl %eax, 0x20(%rbx)
leaq 0xa0(%r15), %rdi
movq %r14, %rsi
callq 0x3ffa0
movq %rax, 0x28(%rbx)
addq $0xc0, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x40030
movq %rax, 0x30(%rbx)
jmp 0x55cc5
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x411c0
leaq 0x20(%r15), %rdi
movq %r14, %rsi
callq 0x40030
movl %eax, 0x8(%rbx)
addq $0x60, %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x422c0
movq $0x0, 0x10(%rbx)
movq (%rbx), %rcx
movl 0x5c(%rcx), %eax
imulq 0x18(%rbx), %rax
movq 0x28(%rcx), %rcx
cmpq %rax, %rcx
jae 0x55cc1
incq %rcx
cqto
idivq %rcx
movq %rdx, %rax
sarq $0x3f, %rax
andq %rcx, %rax
addq %rdx, %rax
movq %rax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: HandleTpl::saveXml(std::ostream&) const
void HandleTpl::saveXml(ostream &s) const

{
  s << "<handle_tpl>";
  space.saveXml(s);
  size.saveXml(s);
  ptrspace.saveXml(s);
  ptroffset.saveXml(s);
  ptrsize.saveXml(s);
  temp_space.saveXml(s);
  temp_offset.saveXml(s);
  s << "</handle_tpl>\n";
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x2a5df(%rip), %rsi     # 0x80362
movl $0xc, %edx
movq %rbx, %rdi
callq 0x40b90
movq %r14, %rdi
movq %rbx, %rsi
callq 0x41150
leaq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x41150
leaq 0x40(%r14), %rdi
movq %rbx, %rsi
callq 0x41150
leaq 0x60(%r14), %rdi
movq %rbx, %rsi
callq 0x41150
leaq 0x80(%r14), %rdi
movq %rbx, %rsi
callq 0x41150
leaq 0xa0(%r14), %rdi
movq %rbx, %rsi
callq 0x41150
addq $0xc0, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x41150
leaq 0x2a579(%rip), %rsi     # 0x8036f
movl $0xe, %edx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x40b90
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: HandleTpl::restoreXml(Element const*, AddrSpaceManager const*)
void HandleTpl::restoreXml(const Element *el,const AddrSpaceManager *manage)

{
  const List &list(el->getChildren());
  List::const_iterator iter;
  iter = list.begin();
  space.restoreXml(*iter,manage);
  ++iter;
  size.restoreXml(*iter,manage);
  ++iter;
  ptrspace.restoreXml(*iter,manage);
  ++iter;
  ptroffset.restoreXml(*iter,manage);
  ++iter;
  ptrsize.restoreXml(*iter,manage);
  ++iter;
  temp_space.restoreXml(*iter,manage);
  ++iter;
  temp_offset.restoreXml(*iter,manage);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movq 0x78(%rsi), %r15
movq (%r15), %rsi
callq 0x40310
leaq 0x20(%r14), %rdi
movq 0x8(%r15), %rsi
movq %rbx, %rdx
callq 0x40310
leaq 0x40(%r14), %rdi
movq 0x10(%r15), %rsi
movq %rbx, %rdx
callq 0x40310
leaq 0x60(%r14), %rdi
movq 0x18(%r15), %rsi
movq %rbx, %rdx
callq 0x40310
leaq 0x80(%r14), %rdi
movq 0x20(%r15), %rsi
movq %rbx, %rdx
callq 0x40310
leaq 0xa0(%r14), %rdi
movq 0x28(%r15), %rsi
movq %rbx, %rdx
callq 0x40310
addq $0xc0, %r14
movq 0x30(%r15), %rsi
movq %r14, %rdi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x40310
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: OpTpl::~OpTpl()
OpTpl::~OpTpl(void)

{				// An OpTpl owns its varnode_tpls
  if (output != (VarnodeTpl *)0)
    delete output;
  vector<VarnodeTpl *>::iterator iter;
  for(iter=input.begin();iter!=input.end();++iter)
    delete *iter;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x55eab
movl $0x68, %esi
callq 0x40880
movq 0x10(%rbx), %r14
cmpq 0x18(%rbx), %r14
je 0x55ed0
movq (%r14), %rdi
movl $0x68, %esi
callq 0x40880
addq $0x8, %r14
cmpq 0x18(%rbx), %r14
jne 0x55eb5
movq 0x10(%rbx), %r14
testq %r14, %r14
je 0x55eeb
movq 0x20(%rbx), %rsi
subq %r14, %rsi
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x40880
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: OpTpl::isZeroSize() const
bool OpTpl::isZeroSize(void) const

{				// Return if any input or output has zero size
  vector<VarnodeTpl *>::const_iterator iter;

  if (output != (VarnodeTpl *)0)
    if (output->isZeroSize()) return true;
  for(iter=input.begin();iter!=input.end();++iter)
    if ((*iter)->isZeroSize()) return true;
  return false;
}

// Assembly:
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x55f0c
cmpl $0x0, 0x40(%rcx)
jne 0x55f0c
movb $0x1, %al
cmpq $0x0, 0x50(%rcx)
jne 0x55f0c
retq
movq 0x10(%rdi), %rdx
movq 0x18(%rdi), %rcx
cmpq %rcx, %rdx
je 0x55f44
addq $0x8, %rdx
movq -0x8(%rdx), %rax
cmpl $0x0, 0x40(%rax)
sete %sil
cmpq $0x0, 0x50(%rax)
sete %al
andb %sil, %al
jne 0x55f0b
leaq 0x8(%rdx), %rsi
cmpq %rcx, %rdx
movq %rsi, %rdx
jne 0x55f1d
jmp 0x55f0b
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: OpTpl::removeInput(int)
void OpTpl::removeInput(int4 index)

{ // Remove the indicated input
  delete input[index];
  for(int4 i=index;i<input.size()-1;++i)
    input[i] = input[i+1];
  input.pop_back();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq %esi, %r14
movq 0x10(%rdi), %rax
movq (%rax,%r14,8), %rdi
movl $0x68, %esi
callq 0x40880
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
decq %rdx
cmpq %r14, %rdx
jbe 0x55fa8
movq 0x8(%rax,%r14,8), %rcx
movq %rcx, (%rax,%r14,8)
leaq 0x1(%r14), %rdx
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
movq %rcx, %rsi
subq %rax, %rsi
sarq $0x3, %rsi
decq %rsi
movq %rdx, %r14
cmpq %rdx, %rsi
ja 0x55f7e
addq $-0x8, %rcx
movq %rcx, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: OpTpl::changeHandleIndex(std::vector<int, std::allocator<int>> const&)
void OpTpl::changeHandleIndex(const vector<int4> &handmap)

{
  if (output != (VarnodeTpl *)0)
    output->changeHandleIndex(handmap);
  vector<VarnodeTpl *>::const_iterator iter;

  for(iter=input.begin();iter!=input.end();++iter)
    (*iter)->changeHandleIndex(handmap);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x55fd3
movq %rbx, %rsi
callq 0x418d0
movq 0x10(%r14), %r15
cmpq 0x18(%r14), %r15
je 0x55fee
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x418d0
addq $0x8, %r15
jmp 0x55fd7
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: OpTpl::saveXml(std::ostream&) const
void OpTpl::saveXml(ostream &s) const

{
  s << "<op_tpl code=\"" << get_opname(opc) << "\">";
  if (output == (VarnodeTpl *)0)
    s << "<null/>\n";
  else
    output->saveXml(s);
  for(int4 i=0;i<input.size();++i)
    input[i]->saveXml(s);
  s << "</op_tpl>\n";
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x2a378(%rip), %rsi     # 0x8037e
movl $0xe, %edx
movq %rbx, %rdi
callq 0x40b90
movl 0x8(%r14), %edi
callq 0x402f0
testq %rax, %rax
je 0x5603c
movq %rax, %r15
movq %rax, %rdi
callq 0x3f9e0
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x40b90
jmp 0x56053
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x41d30
leaq 0x2a333(%rip), %rsi     # 0x8038d
movl $0x2, %edx
movq %rbx, %rdi
callq 0x40b90
movq (%r14), %rdi
testq %rdi, %rdi
je 0x56079
movq %rbx, %rsi
callq 0x3fc70
jmp 0x5608d
leaq 0x2a310(%rip), %rsi     # 0x80390
movl $0x8, %edx
movq %rbx, %rdi
callq 0x40b90
movq 0x10(%r14), %rax
cmpq %rax, 0x18(%r14)
je 0x560bd
xorl %r15d, %r15d
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
callq 0x3fc70
incq %r15
movq 0x10(%r14), %rax
movq 0x18(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x5609a
leaq 0x2a2d5(%rip), %rsi     # 0x80399
movl $0xa, %edx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x40b90
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: OpTpl::restoreXml(Element const*, AddrSpaceManager const*)
void OpTpl::restoreXml(const Element *el,const AddrSpaceManager *manage)

{
  opc = get_opcode(el->getAttributeValue("code"));
  const List &list(el->getChildren());
  List::const_iterator iter;
  iter = list.begin();
  if ((*iter)->getName() == "null")
    output = (VarnodeTpl *)0;
  else {
    output = new VarnodeTpl();
    output->restoreXml(*iter,manage);
  }
  ++iter;
  while(iter != list.end()) {
    VarnodeTpl *vn = new VarnodeTpl();
    vn->restoreXml(*iter,manage);
    input.push_back(vn);
    ++iter;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x29c04(%rip), %rsi     # 0x7fd01
leaq 0x29c01(%rip), %rdx     # 0x7fd05
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x3f8a0
movq %r14, %rdi
movq %r12, %rsi
callq 0x40f80
movq %rax, %rdi
callq 0x41bb0
movl %eax, 0x8(%r15)
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x5613f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40880
movq 0x78(%r14), %rbp
movq (%rbp), %rdi
leaq 0x2a256(%rip), %rsi     # 0x803a4
callq 0x3f590
testl %eax, %eax
je 0x5618f
movl $0x68, %edi
callq 0x40810
xorl %ecx, %ecx
movl %ecx, (%rax)
movq %rcx, 0x10(%rax)
movl %ecx, 0x20(%rax)
movq %rcx, 0x30(%rax)
movl %ecx, 0x40(%rax)
movq %rcx, 0x50(%rax)
movb $0x0, 0x60(%rax)
movq %rax, (%r15)
movq (%rbp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x41e90
jmp 0x56196
movq $0x0, (%r15)
addq $0x8, %rbp
cmpq 0x80(%r14), %rbp
je 0x56216
leaq 0x10(%r15), %r12
xorl %r13d, %r13d
movl $0x68, %edi
callq 0x40810
movl %r13d, (%rax)
movq %r13, 0x10(%rax)
movl %r13d, 0x20(%rax)
movq %r13, 0x30(%rax)
movl %r13d, 0x40(%rax)
movq %r13, 0x50(%rax)
movb $0x0, 0x60(%rax)
movq %rax, 0x8(%rsp)
movq (%rbp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x41e90
movq 0x18(%r15), %rsi
cmpq 0x20(%r15), %rsi
je 0x561fc
movq 0x8(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x18(%r15)
jmp 0x56209
movq %r12, %rdi
leaq 0x8(%rsp), %rdx
callq 0x40b10
addq $0x8, %rbp
cmpq 0x80(%r14), %rbp
jne 0x561aa
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x5623f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40880
movq %rbx, %rdi
callq 0x41f10
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: ConstructTpl::~ConstructTpl()
ConstructTpl::~ConstructTpl(void)

{				// Constructor owns its ops and handles
  vector<OpTpl *>::iterator oiter;
  for(oiter=vec.begin();oiter!=vec.end();++oiter)
    delete *oiter;
  if (result != (HandleTpl *)0)
    delete result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %r15
cmpq 0x10(%rdi), %r15
je 0x56281
movq (%r15), %r14
testq %r14, %r14
je 0x5626a
movq %r14, %rdi
callq 0x3f1f0
movl $0x28, %esi
movq %r14, %rdi
callq 0x40880
addq $0x8, %r15
cmpq 0x10(%rbx), %r15
jne 0x5625a
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x56294
movl $0xe0, %esi
callq 0x40880
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x562ae
movq 0x18(%rbx), %rsi
subq %rdi, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x40880
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: ConstructTpl::addOp(OpTpl*)
bool ConstructTpl::addOp(OpTpl *ot)

{
  if (ot->getOpcode() == DELAY_SLOT) {
    if (delayslot != 0)
      return false;		// Cannot have multiple delay slots
    delayslot = ot->getIn(0)->getOffset().getReal();
  }
  else if (ot->getOpcode() == LABELBUILD)
    numlabels += 1;		// Count labels
  vec.push_back(ot);
  return true;
}

// Assembly:
pushq %rax
movq %rsi, (%rsp)
movl 0x8(%rsi), %eax
cmpl $0x41, %eax
je 0x562cf
cmpl $0x3d, %eax
jne 0x562e0
cmpl $0x0, (%rdi)
je 0x562d4
xorl %eax, %eax
jmp 0x56305
incl 0x4(%rdi)
jmp 0x562e0
movq 0x10(%rsi), %rax
movq (%rax), %rax
movl 0x30(%rax), %eax
movl %eax, (%rdi)
movq 0x10(%rdi), %rax
cmpq 0x18(%rdi), %rax
je 0x562f4
movq %rsi, (%rax)
addq $0x8, 0x10(%rdi)
jmp 0x56303
addq $0x8, %rdi
movq %rsp, %rdx
movq %rax, %rsi
callq 0x3f150
movb $0x1, %al
popq %rcx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: ConstructTpl::fillinBuild(std::vector<int, std::allocator<int>>&, AddrSpace*)
int4 ConstructTpl::fillinBuild(vector<int4> &check,AddrSpace *const_space)

{ // Make sure there is a build statement for all subtable params
  // Return 0 upon success, 1 if there is a duplicate BUILD, 2 if there is a build for a non-subtable
  vector<OpTpl *>::iterator iter;
  OpTpl *op;
  VarnodeTpl *indvn;

  for(iter=vec.begin();iter!=vec.end();++iter) {
    op = *iter;
    if (op->getOpcode() == BUILD) {
      int4 index = op->getIn(0)->getOffset().getReal();
      if (check[index] != 0)
	return check[index];	// Duplicate BUILD statement or non-subtable
      check[index] = 1;		// Mark to avoid future duplicate build
    }
  }
  for(int4 i=0;i<check.size();++i) {
    if (check[i] == 0) {	// Didn't see a BUILD statement
      op = new OpTpl(BUILD);
      indvn = new VarnodeTpl(ConstTpl(const_space),
			      ConstTpl(ConstTpl::real,i),
			      ConstTpl(ConstTpl::real,4));
      op->addInput(indvn);
      vec.insert(vec.begin(),op);
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rsi
movq (%r14), %rcx
cmpq %rsi, %rdx
je 0x563a7
movq (%rdx), %rax
cmpl $0x3c, 0x8(%rax)
jne 0x563a1
movq 0x10(%rax), %rax
movq (%rax), %rax
movslq 0x30(%rax), %rdi
movl (%rcx,%rdi,4), %eax
testl %eax, %eax
jne 0x5647b
shlq $0x2, %rdi
movl $0x1, (%rcx,%rdi)
addq $0x8, %rdx
jmp 0x56372
movq 0x8(%r14), %rax
cmpq %rcx, %rax
je 0x56479
addq $0x8, %r15
leaq 0x58(%rsp), %r13
leaq 0x38(%rsp), %rbp
xorl %ebx, %ebx
cmpl $0x0, (%rcx,%rbx,4)
jne 0x56463
movl $0x28, %edi
callq 0x40810
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
xorl %ecx, %ecx
movq %rcx, 0x20(%rax)
movl $0x3c, 0x8(%rax)
movq %rcx, (%rax)
movq %rax, 0x8(%rsp)
movl $0x68, %edi
callq 0x40810
movq %rax, %r12
leaq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x403a0
movq %r13, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x40b20
movl $0x4, %edx
movq %rbp, %rdi
xorl %esi, %esi
callq 0x40b20
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x41ab0
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x42020
movq (%r15), %rsi
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0x3fc00
movq (%r14), %rcx
movq 0x8(%r14), %rax
incq %rbx
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rbx, %rdx
ja 0x563c4
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5648e
jmp 0x5648e
movq %rax, %rbx
movl $0x68, %esi
movq %r12, %rdi
callq 0x40880
movq %rbx, %rdi
callq 0x41f10
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: ConstructTpl::changeHandleIndex(std::vector<int, std::allocator<int>> const&)
void ConstructTpl::changeHandleIndex(const vector<int4> &handmap)

{
  vector<OpTpl *>::const_iterator iter;
  OpTpl *op;

  for(iter=vec.begin();iter!=vec.end();++iter) {
    op = *iter;
    if (op->getOpcode() == BUILD) {
      int4 index = op->getIn(0)->getOffset().getReal();
      index = handmap[index];
      op->getIn(0)->setOffset(index);
    }
    else
      op->changeHandleIndex(handmap);
  }
  if (result != (HandleTpl *)0)
    result->changeHandleIndex(handmap);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %r12
cmpq 0x10(%rdi), %r12
je 0x56541
movq %rsp, %r15
movq (%r12), %rdi
cmpl $0x3c, 0x8(%rdi)
jne 0x5652f
movq 0x10(%rdi), %rax
movq (%rax), %r13
movslq 0x30(%r13), %rax
movq (%rbx), %rcx
movslq (%rcx,%rax,4), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x40b20
movups (%rsp), %xmm0
movups 0xc(%rsp), %xmm1
movups %xmm1, 0x2c(%r13)
movups %xmm0, 0x20(%r13)
jmp 0x56537
movq %rbx, %rsi
callq 0x40540
addq $0x8, %r12
cmpq 0x10(%r14), %r12
jne 0x564f4
movq 0x20(%r14), %rdi
testq %rdi, %rdi
je 0x56552
movq %rbx, %rsi
callq 0x3fdf0
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: ConstructTpl::setInput(VarnodeTpl*, int, int)
void ConstructTpl::setInput(VarnodeTpl *vn,int4 index,int4 slot)

{ // set the VarnodeTpl input for a particular op
  // for use with optimization routines
  OpTpl *op = vec[index];
  VarnodeTpl *oldvn = op->getIn(slot);
  op->setInput(vn,slot);
  if (oldvn != (VarnodeTpl *)0)
    delete oldvn;
}

// Assembly:
movslq %edx, %rax
movq 0x8(%rdi), %rdx
movq (%rdx,%rax,8), %rax
movslq %ecx, %rcx
movq 0x10(%rax), %rax
movq (%rax,%rcx,8), %rdi
movq %rsi, (%rax,%rcx,8)
testq %rdi, %rdi
je 0x56589
movl $0x68, %esi
jmp 0x40880
retq
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: ConstructTpl::setOutput(VarnodeTpl*, int)
void ConstructTpl::setOutput(VarnodeTpl *vn,int4 index)

{ // set the VarnodeTpl output for a particular op
  // for use with optimization routines
  OpTpl *op = vec[index];
  VarnodeTpl *oldvn = op->getOut();
  op->setOutput(vn);
  if (oldvn != (VarnodeTpl *)0)
    delete oldvn;
}

// Assembly:
movslq %edx, %rax
movq 0x8(%rdi), %rcx
movq (%rcx,%rax,8), %rax
movq (%rax), %rdi
movq %rsi, (%rax)
testq %rdi, %rdi
je 0x565aa
movl $0x68, %esi
jmp 0x40880
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: ConstructTpl::deleteOps(std::vector<int, std::allocator<int>> const&)
void ConstructTpl::deleteOps(const vector<int4> &indices)

{ // delete a particular set of ops
  for(uint4 i=0;i<indices.size();++i) {
    delete vec[indices[i]];
    vec[indices[i]] = (OpTpl *)0;
  }
  uint4 poscur = 0;
  for(uint4 i=0;i<vec.size();++i) {
    OpTpl *op = vec[i];
    if (op != (OpTpl *)0) {
      vec[poscur] = op;
      poscur += 1;
    }
  }
  while(vec.size() > poscur)
    vec.pop_back();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x5661c
movq %rsi, %r14
movl $0x1, %ebp
xorl %r12d, %r12d
movslq (%rax,%r12,4), %rax
movq 0x8(%rbx), %rcx
movq (%rcx,%rax,8), %r15
testq %r15, %r15
je 0x565e4
movq %r15, %rdi
callq 0x3f1f0
movl $0x28, %esi
movq %r15, %rdi
callq 0x40880
movq (%r14), %rax
movslq (%rax,%r12,4), %rax
movq 0x8(%rbx), %rcx
movq $0x0, (%rcx,%rax,8)
movl %ebp, %r12d
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
incl %ebp
cmpq %r12, %rcx
ja 0x565cb
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rax
movq %rax, %rdi
subq %rcx, %rdi
je 0x56667
xorl %r8d, %r8d
movl $0x1, %edx
xorl %esi, %esi
movq (%rcx,%r8,8), %rdi
testq %rdi, %rdi
je 0x5664f
movl %esi, %eax
movq %rdi, (%rcx,%rax,8)
incl %esi
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rax
movl %edx, %r8d
movq %rax, %rdi
subq %rcx, %rdi
sarq $0x3, %rdi
incl %edx
cmpq %r8, %rdi
ja 0x56636
movl %esi, %edx
jmp 0x5666d
sarq $0x3, %rdi
xorl %edx, %edx
cmpq %rdx, %rdi
jbe 0x56694
movq %rax, %rsi
subq %rcx, %rsi
addq $-0x8, %rsi
addq $-0x8, %rax
movq %rsi, %rcx
sarq $0x3, %rcx
addq $-0x8, %rsi
cmpq %rdx, %rcx
ja 0x5667c
movq %rax, 0x10(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: ConstructTpl::saveXml(std::ostream&, int) const
void ConstructTpl::saveXml(ostream &s,int4 sectionid) const

{
  s << "<construct_tpl";
  if (sectionid >=0 )
    s << " section=\"" << dec << sectionid << "\"";
  if (delayslot != 0)
    s << " delay=\"" << dec << delayslot << "\"";
  if (numlabels != 0)
    s << " labels=\"" << dec << numlabels << "\"";
  s << ">\n";
  if (result != (HandleTpl *)0)
    result->saveXml(s);
  else
    s << "<null/>";
  for(int4 i=0;i<vec.size();++i)
    vec[i]->saveXml(s);
  s << "</construct_tpl>\n";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x29cf5(%rip), %rsi     # 0x803a9
movl $0xe, %edx
movq %rbx, %rdi
callq 0x40b90
testl %ebp, %ebp
js 0x5670c
leaq 0x29cec(%rip), %rsi     # 0x803b8
movl $0xa, %edx
movq %rbx, %rdi
callq 0x40b90
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x41db0
leaq 0x2aee8(%rip), %rsi     # 0x815e7
movl $0x1, %edx
movq %rax, %rdi
callq 0x40b90
cmpl $0x0, (%r14)
je 0x5675a
leaq 0x29caa(%rip), %rsi     # 0x803c3
movl $0x8, %edx
movq %rbx, %rdi
callq 0x40b90
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
movl (%r14), %esi
movq %rbx, %rdi
callq 0x3ffc0
leaq 0x2ae9a(%rip), %rsi     # 0x815e7
movl $0x1, %edx
movq %rax, %rdi
callq 0x40b90
cmpl $0x0, 0x4(%r14)
je 0x567aa
leaq 0x29c64(%rip), %rsi     # 0x803cc
movl $0x9, %edx
movq %rbx, %rdi
callq 0x40b90
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x3ffc0
leaq 0x2ae4a(%rip), %rsi     # 0x815e7
movl $0x1, %edx
movq %rax, %rdi
callq 0x40b90
leaq 0x2b018(%rip), %rsi     # 0x817c9
movl $0x2, %edx
movq %rbx, %rdi
callq 0x40b90
movq 0x20(%r14), %rdi
testq %rdi, %rdi
je 0x567d1
movq %rbx, %rsi
callq 0x40cf0
jmp 0x567e5
leaq 0x29bfe(%rip), %rsi     # 0x803d6
movl $0x7, %edx
movq %rbx, %rdi
callq 0x40b90
movq 0x8(%r14), %rax
cmpq %rax, 0x10(%r14)
je 0x56815
xorl %r15d, %r15d
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
callq 0x41c70
incq %r15
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x567f2
leaq 0x29bc2(%rip), %rsi     # 0x803de
movl $0x11, %edx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x40b90
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/semantics.cc
// Function: PcodeBuilder::build(ConstructTpl*, int)
void PcodeBuilder::build(ConstructTpl *construct,int4 secnum)

{
  if (construct == (ConstructTpl *)0)
    throw UnimplError("",0);	// Pcode is not implemented for this constructor

  uint4 oldbase = labelbase;	// Recursively store old labelbase
  labelbase = labelcount;	// Set the newbase
  labelcount += construct->numLabels();	// Add labels from this template

  vector<OpTpl *>::const_iterator iter;
  OpTpl *op;
  const vector<OpTpl *> &ops(construct->getOpvec());

  for(iter=ops.begin();iter!=ops.end();++iter) {
    op = *iter;
    switch(op->getOpcode()) {
    case BUILD:
      appendBuild( op, secnum );
      break;
    case DELAY_SLOT:
      delaySlot( op );
      break;
    case LABELBUILD:
      setLabel( op );
      break;
    case CROSSBUILD:
      appendCrossBuild(op,secnum);
      break;
    default:
      dump( op );
      break;
    }
  }
  labelbase = oldbase;		// Restore old labelbase
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rsi, %rsi
je 0x56b6d
movq %rsi, %r15
movq %rdi, %r14
movl 0x8(%rdi), %ebp
movl 0xc(%rdi), %eax
movl %eax, 0x8(%rdi)
addl 0x4(%rsi), %eax
movl %eax, 0xc(%rdi)
movq 0x8(%rsi), %r12
cmpq 0x10(%rsi), %r12
je 0x56b5a
movl %edx, %ebx
leaq 0x2967d(%rip), %r13     # 0x80188
movq (%r12), %rsi
movl 0x8(%rsi), %ecx
movq (%r14), %rax
addl $-0x3c, %ecx
cmpl $0x6, %ecx
ja 0x56b4b
movslq (%r13,%rcx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
movq %r14, %rdi
movl %ebx, %edx
callq *0x18(%rax)
jmp 0x56b50
movq %r14, %rdi
callq *0x28(%rax)
jmp 0x56b50
movq %r14, %rdi
callq *0x20(%rax)
jmp 0x56b50
movq %r14, %rdi
movl %ebx, %edx
callq *0x30(%rax)
jmp 0x56b50
movq %r14, %rdi
callq *(%rax)
addq $0x8, %r12
cmpq 0x10(%r15), %r12
jne 0x56b0b
movl %ebp, 0x8(%r14)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x3fb00
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2a666(%rip), %rdx     # 0x811f0
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x3f8a0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x3f890
movl $0x0, 0x20(%rbx)
xorl %ebp, %ebp
movq 0x4c371(%rip), %rsi     # 0xa2f28
movq 0x4c07a(%rip), %rdx     # 0xa2c38
movq %rbx, %rdi
callq 0x41d70
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x56be0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40880
testb %bpl, %bpl
jne 0x56bea
jmp 0x56bf2
movq %rax, %r14
movq %rbx, %rdi
callq 0x40090
movq %r14, %rdi
callq 0x41f10
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: PcodeCacher::PcodeCacher()
PcodeCacher::PcodeCacher (void)

{
    // We aim to allocate this array only once
    uint4 maxsize = 600;
    poolstart = new VarnodeData[maxsize];
    endpool = poolstart + maxsize;
    curpool = poolstart;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
movq $0x0, 0x28(%rdi)
leaq 0x30(%rdi), %rax
movq %rax, 0x38(%rdi)
movq %rax, 0x30(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x50(%rdi)
movl $0x3840, %edi           # imm = 0x3840
callq 0x3f060
movq %rax, (%rbx)
leaq 0x3840(%rax), %rcx
movq %rcx, 0x10(%rbx)
movq %rax, 0x8(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: PcodeCacher::addLabel(unsigned int)
void PcodeCacher::addLabel (uint4 id)

{ // Attach a label to the address of the next instruction
    while (labels.size () <= id)
        labels.push_back (0xbadbeef);
    labels[id] = issued.size ();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, %r12d
movq 0x48(%rdi), %rax
movq 0x50(%rdi), %rsi
movq %rsi, %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
ja 0x56f3f
leaq 0x48(%rbx), %r14
movq %rsp, %r15
movq $0xbadbeef, (%rsp)      # imm = 0xBADBEEF
cmpq 0x58(%rbx), %rsi
je 0x56f1d
movq $0xbadbeef, (%rsi)      # imm = 0xBADBEEF
addq $0x8, %rsi
movq %rsi, 0x50(%rbx)
jmp 0x56f30
movq %r14, %rdi
movq %r15, %rdx
callq 0x3fa20
movq 0x48(%rbx), %rax
movq 0x50(%rbx), %rsi
movq %rsi, %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jbe 0x56efe
movq 0x20(%rbx), %rcx
subq 0x18(%rbx), %rcx
sarq $0x5, %rcx
movq %rcx, (%rax,%r12,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: PcodeCacher::clear()
void PcodeCacher::clear (void)

{
    curpool = poolstart;
    issued.clear ();
    label_refs.clear ();
    labels.clear ();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rcx
movq 0x18(%rdi), %rax
movq %rcx, 0x8(%rdi)
cmpq %rax, 0x20(%rdi)
je 0x56f75
movq %rax, 0x20(%rbx)
leaq 0x30(%rbx), %rdi
callq 0x41910
movq 0x48(%rbx), %rax
cmpq %rax, 0x50(%rbx)
je 0x56f8c
movq %rax, 0x50(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: PcodeCacher::resolveRelatives()
void PcodeCacher::resolveRelatives (void)

{ // Assuming all the PcodeData has been generated for an
    // instruction, go resolve any relative offsets and back
    // patch their value(s) into the PcodeData
    list<RelativeRecord>::const_iterator iter;
    for (iter = label_refs.begin (); iter != label_refs.end (); ++iter) {
        VarnodeData* ptr = (*iter).dataptr;
        uint4 id = ptr->offset;
        if ((id >= labels.size ()) || (labels[id] == 0xbadbeef))
            throw LowlevelError ("Reference to non-existant sleigh label");
        // Calculate the relative index given the two absolute indices
        uintb res = labels[id] - (*iter).calling_index;
        res &= calc_mask (ptr->size);
        ptr->offset = res;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
leaq 0x30(%rdi), %rax
movq 0x30(%rdi), %rcx
cmpq %rax, %rcx
je 0x56ffd
movq 0x48(%rdi), %rdx
movq 0x50(%rdi), %rsi
subq %rdx, %rsi
sarq $0x3, %rsi
movl $0x8, %edi
movq 0x4bc10(%rip), %r8      # 0xa2bd0
movq 0x10(%rcx), %r9
movl 0x8(%r9), %r10d
cmpq %rsi, %r10
jae 0x57008
movq (%rdx,%r10,8), %r10
cmpq $0xbadbeef, %r10        # imm = 0xBADBEEF
je 0x57008
subq 0x18(%rcx), %r10
movl 0x10(%r9), %r11d
cmpl $0x8, %r11d
cmovgel %edi, %r11d
movslq %r11d, %r11
andq (%r8,%r11,8), %r10
movq %r10, 0x8(%r9)
movq (%rcx), %rcx
cmpq %rax, %rcx
jne 0x56fc0
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x3fb00
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x293e0(%rip), %rsi     # 0x80405
leaq 0x293ff(%rip), %rdx     # 0x8042b
leaq 0x8(%rsp), %rdi
callq 0x3f8a0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x4be59(%rip), %rsi     # 0xa2ea8
movq 0x4bbe2(%rip), %rdx     # 0xa2c38
movq %rbx, %rdi
callq 0x41d70
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x57078
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40880
testb %bpl, %bpl
jne 0x57082
jmp 0x5708a
movq %rax, %r14
movq %rbx, %rdi
callq 0x40090
movq %r14, %rdi
callq 0x41f10
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: PcodeCacher::hutch_emitIR() const
vector<struct PcodeData> PcodeCacher::hutch_emitIR () const

{
    vector<PcodeData> result;
    struct PcodeData tmp;
    vector<PcodeData>::const_iterator iter;

    for (iter = issued.begin (); iter != issued.end (); ++iter) {
        tmp.outvar = (*iter).outvar;
        tmp.invar = (*iter).invar;
        tmp.isize = (*iter).isize;
        tmp.opc = (*iter).opc;

        result.push_back (tmp);
    }
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x18(%rsi), %r12
cmpq 0x20(%rsi), %r12
je 0x57141
movq %rsi, %r14
leaq 0x8(%rsp), %r15
movups 0x8(%r12), %xmm0
movups %xmm0, 0x10(%rsp)
movl 0x18(%r12), %eax
movl %eax, 0x20(%rsp)
movl (%r12), %eax
movl %eax, 0x8(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x41240
addq $0x20, %r12
cmpq 0x20(%r14), %r12
jne 0x57110
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x57167
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x40880
movq %r14, %rdi
callq 0x41f10
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: SleighBuilder::generateLocation(VarnodeTpl const*, VarnodeData&)
void SleighBuilder::generateLocation (const VarnodeTpl* vntpl, VarnodeData& vn)

{ // Generate a concrete varnode -vn- from the template -vntpl-
    vn.space = vntpl->getSpace ().fixSpace (*walker);
    vn.size = vntpl->getSize ().fix (*walker);
    if (vn.space == const_space)
        vn.offset = vntpl->getOffset ().fix (*walker) & calc_mask (vn.size);
    else if (vn.space == uniq_space) {
        vn.offset = vntpl->getOffset ().fix (*walker);
        vn.offset |= uniqueoffset;
    } else
        vn.offset = vn.space->wrapOffset (vntpl->getOffset ().fix (*walker));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x10(%rdi), %rsi
movq %r15, %rdi
callq 0x3ffa0
movq %rax, (%rbx)
leaq 0x40(%r15), %rdi
movq 0x10(%r14), %rsi
callq 0x40030
movl %eax, 0x10(%rbx)
movq (%rbx), %r12
cmpq 0x18(%r14), %r12
je 0x571e4
movq 0x20(%r14), %r13
addq $0x20, %r15
movq 0x10(%r14), %rsi
movq %r15, %rdi
callq 0x40030
cmpq %r13, %r12
je 0x57216
movq 0x28(%r12), %rcx
cmpq %rax, %rcx
jae 0x57210
incq %rcx
cqto
idivq %rcx
movq %rdx, %rax
sarq $0x3f, %rax
andq %rcx, %rax
addq %rdx, %rax
jmp 0x57210
addq $0x20, %r15
movq 0x10(%r14), %rsi
movq %r15, %rdi
callq 0x40030
movl 0x10(%rbx), %ecx
cmpl $0x8, %ecx
movl $0x8, %edx
cmovll %ecx, %edx
movslq %edx, %rcx
movq 0x4b9c4(%rip), %rdx     # 0xa2bd0
andq (%rdx,%rcx,8), %rax
movq %rax, 0x8(%rbx)
jmp 0x57221
movq 0x30(%r14), %rcx
orq %rax, %rcx
movq %rcx, 0x8(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: SleighBuilder::generatePointer(VarnodeTpl const*, VarnodeData&)
AddrSpace* SleighBuilder::generatePointer (const VarnodeTpl* vntpl,
                                           VarnodeData& vn)

{ // Generate the pointer varnode -vn- from a dynamic template -vntpl-
    const FixedHandle& hand (
        walker->getFixedHandle (vntpl->getOffset ().getHandleIndex ()));
    vn.space = hand.offset_space;
    vn.size = hand.offset_size;
    if (vn.space == const_space)
        vn.offset = hand.offset_offset & calc_mask (vn.size);
    else if (vn.space == uniq_space)
        vn.offset = hand.offset_offset | uniqueoffset;
    else
        vn.offset = vn.space->wrapOffset (hand.offset_offset);
    return hand.space;
}

// Assembly:
movq %rdx, %rcx
movq 0x10(%rdi), %rax
movslq 0x28(%rsi), %rdx
movq 0x10(%rax), %rax
movq 0x40(%rax), %rax
movq (%rax,%rdx,8), %rsi
movq 0x18(%rsi), %rdx
movq %rdx, (%rcx)
movl 0x28(%rsi), %eax
movl %eax, 0x10(%rcx)
cmpq 0x18(%rdi), %rdx
je 0x57280
movq 0x20(%rsi), %rax
cmpq 0x20(%rdi), %rdx
je 0x5729f
movq 0x28(%rdx), %rdi
cmpq %rax, %rdi
jae 0x572a3
incq %rdi
cqto
idivq %rdi
movq %rdx, %rax
sarq $0x3f, %rax
andq %rdi, %rax
addq %rdx, %rax
jmp 0x572a3
cmpl $0x8, %eax
movl $0x8, %edx
cmovll %eax, %edx
movslq %edx, %rax
movq 0x4b93b(%rip), %rdx     # 0xa2bd0
movq (%rdx,%rax,8), %rax
andq 0x20(%rsi), %rax
jmp 0x572a3
orq 0x30(%rdi), %rax
movq %rax, 0x8(%rcx)
movq 0x8(%rsi), %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: SleighBuilder::SleighBuilder(ParserWalker*, DisassemblyCache*, PcodeCacher*, AddrSpace*, AddrSpace*, unsigned int)
SleighBuilder::SleighBuilder (ParserWalker* w, DisassemblyCache* dcache,
                              PcodeCacher* pc, AddrSpace* cspc, AddrSpace* uspc,
                              uint4 umask) :
PcodeBuilder (0)
{
    walker = w;
    discache = dcache;
    cache = pc;
    const_space = cspc;
    uniq_space = uspc;
    uniquemask = umask;
    uniqueoffset = (walker->getAddr ().getOffset () & uniquemask) << 4;
}

// Assembly:
movl 0x8(%rsp), %eax
movq $0x0, 0x8(%rdi)
movq 0x4b753(%rip), %r10     # 0xa2da8
addq $0x10, %r10
movq %r10, (%rdi)
movq %rsi, 0x10(%rdi)
movq %rdx, 0x38(%rdi)
movq %rcx, 0x40(%rdi)
movq %r8, 0x18(%rdi)
movq %r9, 0x20(%rdi)
movq %rax, 0x28(%rdi)
movq 0x8(%rsi), %rcx
testq %rcx, %rcx
jne 0x57680
movq (%rsi), %rcx
movl 0x58(%rcx), %ecx
andl %eax, %ecx
shlq $0x4, %rcx
movq %rcx, 0x30(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: SleighBuilder::appendBuild(OpTpl*, int)
void SleighBuilder::appendBuild (OpTpl* bld, int4 secnum)
// Append pcode for a particular build statement
{
    // Recover operand index from build statement
    int4 index = bld->getIn (0)->getOffset ().getReal ();
    // Check if operand is a subtable
    SubtableSymbol* sym = (SubtableSymbol*)walker->getConstructor ()
                              ->getOperand (index)
                              ->getDefiningSymbol ();
    if ((sym == (SubtableSymbol*)0) ||
        (sym->getType () != SleighSymbol::subtable_symbol))
        return;

    walker->pushOperand (index);
    Constructor* ct = walker->getConstructor ();
    if (secnum >= 0) {
        ConstructTpl* construct = ct->getNamedTempl (secnum);
        if (construct == (ConstructTpl*)0)
            buildEmpty (ct, secnum);
        else
            build (construct, secnum);
    } else {
        ConstructTpl* construct = ct->getTempl ();
        build (construct, -1);
    }
    walker->popOperand ();
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rsi), %rax
movq (%rax), %rax
movq 0x30(%rax), %rax
movq 0x10(%rdi), %rcx
movq 0x10(%rcx), %rcx
movq (%rcx), %rcx
movslq %eax, %r14
movq 0x18(%rcx), %rax
movq (%rax,%r14,8), %rax
movq 0x48(%rax), %rdi
testq %rdi, %rdi
je 0x57756
movl %edx, %ebp
movq (%rdi), %rax
callq *0x10(%rax)
cmpl $0xb, %eax
jne 0x57756
movq 0x10(%rbx), %rax
leal 0x1(%r14), %ecx
movslq 0x18(%rax), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x18(%rax)
movl %ecx, 0x1c(%rax,%rdx,4)
movq 0x10(%rax), %rcx
movq 0x40(%rcx), %rcx
movq (%rcx,%r14,8), %rcx
movq %rcx, 0x10(%rax)
movslq 0x18(%rax), %rdx
movl $0x0, 0x1c(%rax,%rdx,4)
movq (%rcx), %r14
testl %ebp, %ebp
js 0x57726
movq %r14, %rdi
movl %ebp, %esi
callq 0x41f60
movq %rbx, %rdi
testq %rax, %rax
je 0x57739
movq %rax, %rsi
movl %ebp, %edx
jmp 0x57732
movq 0x60(%r14), %rsi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3f5a0
jmp 0x57743
movq %r14, %rsi
movl %ebp, %edx
callq 0x417e0
movq 0x10(%rbx), %rax
movq 0x10(%rax), %rcx
movq 0x58(%rcx), %rcx
movq %rcx, 0x10(%rax)
decl 0x18(%rax)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: DisassemblyCache::initialize(int, int)
void DisassemblyCache::initialize (int4 min, int4 hashsize)

{
    minimumreuse = min;
    mask = hashsize - 1;
    uintb masktest = coveringmask ((uintb)mask);
    if (masktest != (uintb)mask) // -hashsize- must be a power of 2
        throw LowlevelError ("Bad windowsize for disassembly cache");
    list = new ParserContext*[minimumreuse];
    nextfree = 0;
    hashtable = new ParserContext*[hashsize];
    for (int4 i = 0; i < minimumreuse; ++i) {
        ParserContext* pos = new ParserContext (contextcache);
        pos->initialize (75, 20, constspace);
        list[i] = pos;
    }
    // Make sure all hashtable positions point to a real ParserContext
    ParserContext* pos = list[0];
    for (int4 i = 0; i < hashsize; ++i)
        hashtable[i] = pos;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %r14d
movq %rdi, %rbx
movl %esi, 0x10(%rdi)
leal -0x1(%r14), %edi
movl %edi, 0x14(%rbx)
callq 0x3f6f0
movl 0x14(%rbx), %ecx
cmpq %rcx, %rax
jne 0x57c3d
movslq 0x10(%rbx), %r15
leaq (,%r15,8), %rdi
testq %r15, %r15
movq $-0x1, %r13
cmovsq %r13, %rdi
callq 0x3f060
movq %rax, 0x18(%rbx)
movl $0x0, 0x20(%rbx)
movl %r14d, %r12d
leaq (,%r12,8), %rdi
testl %r14d, %r14d
cmovsq %r13, %rdi
callq 0x3f060
movq %rax, 0x28(%rbx)
testq %r15, %r15
jle 0x57c17
xorl %r13d, %r13d
movl $0xa8, %edi
callq 0x40810
movq %rax, %r15
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x41870
movq 0x8(%rbx), %rcx
movq %r15, %rdi
movl $0x4b, %esi
movl $0x14, %edx
callq 0x40a10
movq 0x18(%rbx), %rax
movq %r15, (%rax,%r13,8)
incq %r13
movslq 0x10(%rbx), %rax
cmpq %rax, %r13
jl 0x57bcc
movq 0x18(%rbx), %rax
movq (%rax), %rax
jmp 0x57c17
testl %r14d, %r14d
jle 0x57c2e
xorl %ecx, %ecx
movq 0x28(%rbx), %rdx
movq %rax, (%rdx,%rcx,8)
incq %rcx
cmpq %rcx, %r12
jne 0x57c1e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x3fb00
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2885c(%rip), %rsi     # 0x804b6
leaq 0x28879(%rip), %rdx     # 0x804da
leaq 0x8(%rsp), %rdi
callq 0x3f8a0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x4b224(%rip), %rsi     # 0xa2ea8
movq 0x4afad(%rip), %rdx     # 0xa2c38
movq %rbx, %rdi
callq 0x41d70
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x57cad
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40880
testb %bpl, %bpl
jne 0x57cb7
jmp 0x57cd1
movq %rax, %r14
movq %rbx, %rdi
callq 0x40090
jmp 0x57cd1
movq %rax, %r14
movl $0xa8, %esi
movq %r15, %rdi
callq 0x40880
movq %r14, %rdi
callq 0x41f10
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: DisassemblyCache::free()
void DisassemblyCache::free (void)

{
    for (int4 i = 0; i < minimumreuse; ++i)
        delete list[i];
    delete[] list;
    delete[] hashtable;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x10(%rdi)
jle 0x57d19
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x57d00
movq %r14, %rdi
callq 0x40ef0
movl $0xa8, %esi
movq %r14, %rdi
callq 0x40880
incq %r15
movslq 0x10(%rbx), %rax
cmpq %rax, %r15
jl 0x57ceb
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x57d27
callq 0x40f10
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x57d3a
popq %rbx
popq %r14
popq %r15
jmp 0x40f10
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: Sleigh::Sleigh(LoadImage*, ContextDatabase*)
Sleigh::Sleigh (LoadImage* ld, ContextDatabase* c_db) : SleighBase ()

{
    loader = ld;
    context_db = c_db;
    cache = new ContextCache (c_db);
    discache = (DisassemblyCache*)0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
callq 0x40610
movq 0x4ae91(%rip), %rax     # 0xa2c00
addq $0x10, %rax
movq %rax, (%rbx)
leaq 0x200(%rbx), %r14
movq %r14, %rdi
callq 0x411a0
movq %r12, 0x1e0(%rbx)
movq %r15, 0x1e8(%rbx)
movl $0x30, %edi
callq 0x40810
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x40320
movq %r12, 0x1f0(%rbx)
movq $0x0, 0x1f8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r15
movl $0x30, %esi
movq %r12, %rdi
callq 0x40880
jmp 0x57dde
movq %rax, %r15
movq %r14, %rdi
callq 0x41c20
jmp 0x57deb
movq %rax, %r15
movq %rbx, %rdi
callq 0x417f0
movq %r15, %rdi
callq 0x41f10
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: Sleigh::reset(LoadImage*, ContextDatabase*)
void Sleigh::reset (LoadImage* ld, ContextDatabase* c_db)

{ // Completely clear everything except the base and reconstruct
    // with a new loader and context
    clearForDelete ();
    pcode_cache.clear ();
    loader = ld;
    context_db = c_db;
    cache = new ContextCache (c_db);
    discache = (DisassemblyCache*)0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0x41930
leaq 0x200(%rbx), %rdi
callq 0x3f0d0
movq %r14, 0x1e0(%rbx)
movq %r15, 0x1e8(%rbx)
movl $0x30, %edi
callq 0x40810
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x40320
movq %r14, 0x1f0(%rbx)
movq $0x0, 0x1f8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x30, %esi
movq %r14, %rdi
callq 0x40880
movq %rbx, %rdi
callq 0x41f10
nop
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: Sleigh::initialize(DocumentStorage&)
void Sleigh::initialize (DocumentStorage& store)

{
    if (!isInitialized ()) { // Initialize the base if not already
        const Element* el = store.getTag ("sleigh");
        if (el == (const Element*)0)
            throw LowlevelError ("Could not find sleigh tag");
        restoreXml (el);
    } else
        reregisterContext ();
    uint4 parser_cachesize = 2;
    uint4 parser_windowsize = 32;
    if ((maxdelayslotbytes > 1) || (unique_allocatemask != 0)) {
        parser_cachesize = 8;
        parser_windowsize = 256;
    }
    discache = new DisassemblyCache (cache, getConstantSpace (),
                                     parser_cachesize, parser_windowsize);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x190(%rdi)
je 0x57f11
movq %rbx, %rdi
callq 0x3f7a0
jmp 0x57f6c
movq %rsi, %r14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x286bc(%rip), %rsi     # 0x805e0
leaq 0x286bb(%rip), %rdx     # 0x805e6
leaq 0x8(%rsp), %rdi
callq 0x3f8a0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x3fff0
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x57f5c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40880
testq %r14, %r14
je 0x57fd8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40ad0
cmpl $0x2, 0x1d0(%rbx)
setb %al
cmpl $0x0, 0x1d4(%rbx)
sete %cl
testb %cl, %al
movl $0x2, %eax
movl $0x8, %ebp
cmovnel %eax, %ebp
movl $0x20, %eax
movl $0x100, %r14d           # imm = 0x100
cmovnel %eax, %r14d
movl $0x30, %edi
callq 0x40810
movq %rax, %r15
movq 0x98(%rbx), %rdx
movq 0x1f0(%rbx), %rsi
movq %rax, %rdi
movl %ebp, %ecx
movl %r14d, %r8d
callq 0x3fd70
movq %r15, 0x1f8(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x3fb00
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x284e7(%rip), %rsi     # 0x804db
leaq 0x284f9(%rip), %rdx     # 0x804f4
callq 0x3f8a0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x4ae8f(%rip), %rsi     # 0xa2ea8
movq 0x4ac18(%rip), %rdx     # 0xa2c38
movq %rbx, %rdi
callq 0x41d70
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x58042
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40880
testb %bpl, %bpl
jne 0x5804c
jmp 0x58082
movq %rax, %r14
movq %rbx, %rdi
callq 0x40090
jmp 0x58082
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x58082
movq 0x18(%rsp), %rsi
incq %rsi
jmp 0x5807d
movq %rax, %r14
jmp 0x58082
movq %rax, %r14
movl $0x30, %esi
movq %r15, %rdi
callq 0x40880
movq %r14, %rdi
callq 0x41f10
// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/sleigh.cc
// Function: Sleigh::obtainContext(Address const&, int) const
ParserContext* Sleigh::obtainContext (const Address& addr, int4 state) const
// Obtain a ParserContext for the instruction at the given -addr-. This may be
// cached.
{
    // Make sure parsing has proceeded to at least the given -state.
    ParserContext* pos = discache->getParserContext (addr);
    int4 curstate = pos->getParserState ();
    if (curstate >= state)
        return pos;
    if (curstate == ParserContext::uninitialized) {
        resolve (*pos);
        if (state == ParserContext::disassembly)
            return pos;
    }
    // If we reach here,  state must be ParserContext::pcode
    resolveHandles (*pos);
    return pos;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rdi, %r14
movq 0x1f8(%rdi), %rdi
callq 0x3fd60
movq %rax, %rbx
movl (%rax), %eax
cmpl %ebp, %eax
jge 0x580c4
testl %eax, %eax
jne 0x580bc
movq %r14, %rdi
movq %rbx, %rsi
callq 0x41180
cmpl $0x1, %ebp
je 0x580c4
movq %rbx, %rsi
callq 0x3fcd0
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq