LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/slghsymbol.cc
// Function: DecisionNode::resolve(ParserWalker&) const
Constructor *DecisionNode::resolve(ParserWalker &walker) const

{
  if (bitsize == 0) {		// The node is terminal
    vector<pair<DisjointPattern *,Constructor *> >::const_iterator iter;
    for(iter=list.begin();iter!=list.end();++iter)
      if ((*iter).first->isMatch(walker))
	return (*iter).second;
    ostringstream s;
    s << walker.getAddr().getShortcut();
    walker.getAddr().printRaw(s);
    s << ": Unable to resolve constructor";
    throw BadDataError(s.str());
  }
  uintm val;
  if (contextdecision)
    val = walker.getContextBits(startbit,bitsize);
  else
    val = walker.getInstructionBits(startbit,bitsize);
  return children[val]->resolve(walker);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rsi, %rbx
movq %rdi, %r14
movl 0x3c(%r14), %edx
testl %edx, %edx
je 0x6d246
movl 0x38(%r14), %esi
movq (%rbx), %rdi
cmpb $0x1, 0x34(%r14)
jne 0x6d22e
callq 0x41870
jmp 0x6d23a
movq 0x10(%rbx), %rax
movl 0x64(%rax), %ecx
callq 0x3f9b0
movl %eax, %eax
movq 0x18(%r14), %rcx
movq (%rcx,%rax,8), %r14
jmp 0x6d211
movq (%r14), %r15
cmpq 0x8(%r14), %r15
je 0x6d277
movq (%r15), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x38(%rax)
testb %al, %al
jne 0x6d265
addq $0x10, %r15
jmp 0x6d249
movq 0x8(%r15), %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x41110
movq 0x8(%rbx), %rax
testq %rax, %rax
jne 0x6d290
movq (%rbx), %rax
movq 0x50(%rax), %rax
movb 0x30(%rax), %al
movq %rsp, %rsi
movb %al, (%rsi)
movl $0x1, %edx
movq %r14, %rdi
callq 0x40b80
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
jne 0x6d2b5
movq (%rbx), %rdi
addq $0x50, %rdi
leaq 0x20(%rsp), %rsi
callq 0x407e0
leaq 0x1443e(%rip), %rsi     # 0x81708
leaq 0x20(%rsp), %rdi
movl $0x1f, %edx
callq 0x40b80
movl $0x20, %edi
callq 0x3fb00
movq %rax, %rbx
leaq 0x28(%rsp), %rsi
movq %rsp, %rdi
callq 0x418b0
movb $0x1, %bpl
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x35846(%rip), %rsi     # 0xa2b50
movq 0x35927(%rip), %rdx     # 0xa2c38
movq %rbx, %rdi
callq 0x41d60
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6d33f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40870
jmp 0x6d33f
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x6d351
movq %rbx, %rdi
callq 0x40080
jmp 0x6d351
movq %rax, %r14
movq 0x35a28(%rip), %rsi     # 0xa2d80
leaq 0x20(%rsp), %rdi
callq 0x3fc30
leaq 0x90(%rsp), %rdi
callq 0x3f730
movq %r14, %rdi
callq 0x41f00
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/slghsymbol.cc
// Function: calc_maskword(int, int, int&, int&, unsigned int&)
static void calc_maskword(int4 sbit,int4 ebit,int4 &num,int4 &shift,uintm &mask)

{
  num = sbit/(8*sizeof(uintm));
  if ( num != ebit/(8*sizeof(uintm)))
    throw SleighError("Context field not contained within one machine int");
  sbit -= num*8*sizeof(uintm);
  ebit -= num*8*sizeof(uintm);

  shift = 8*sizeof(uintm)-ebit-1;
  mask = (~((uintm)0))>>(sbit+shift);
  mask <<= shift;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rax
movl %edi, %ecx
sarl $0x5, %ecx
movl %ecx, (%rdx)
movslq %ecx, %rcx
movslq %esi, %rdx
shrq $0x5, %rdx
cmpq %rcx, %rdx
jne 0x6d40a
movl %edi, %ecx
andl $-0x20, %ecx
andl $0x1f, %edi
subl %esi, %ecx
leal 0x1f(%rcx), %edx
addl %edi, %ecx
addl $0x1f, %ecx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
shrl %cl, %esi
movl %edx, (%rax)
movl %esi, (%r8)
movb (%rax), %cl
shll %cl, %esi
movl %esi, (%r8)
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 0x143be(%rip), %rsi     # 0x817e5
leaq 0x143e9(%rip), %rdx     # 0x81817
leaq 0x8(%rsp), %rdi
callq 0x3f8a0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x35a3f(%rip), %rsi     # 0xa2e90
movq 0x357e0(%rip), %rdx     # 0xa2c38
movq %rbx, %rdi
callq 0x41d60
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x6d482
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40870
jmp 0x6d482
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x6d48f
movq %rbx, %rdi
callq 0x40080
movq %r14, %rdi
callq 0x41f00
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/slghsymbol.cc
// Function: ContextOp::saveXml(std::ostream&) const
void ContextOp::saveXml(ostream &s) const

{
  s << "<context_op";
  s << " i=\"" << dec << num << "\"";
  s << " shift=\"" << shift << "\"";
  s << " mask=\"0x" << hex << mask << "\" >\n";
  patexp->saveXml(s);
  s << "</context_op>\n";
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x14170(%rip), %rsi     # 0x817ac
movl $0xb, %edx
movq %rbx, %rdi
callq 0x40b80
leaq 0x14168(%rip), %rsi     # 0x817b8
movl $0x4, %edx
movq %rbx, %rdi
callq 0x40b80
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
movl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0x41da0
leaq 0x13f62(%rip), %r15     # 0x815e7
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x40b80
leaq 0x1316f(%rip), %rsi     # 0x8080b
movl $0x8, %edx
movq %rbx, %rdi
callq 0x40b80
movl 0x18(%r14), %esi
movq %rbx, %rdi
callq 0x41da0
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x40b80
leaq 0x140f1(%rip), %rsi     # 0x817bd
movl $0x9, %edx
movq %rbx, %rdi
callq 0x40b80
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movl 0x14(%r14), %esi
movq %rbx, %rdi
callq 0x3ffb0
leaq 0x140c6(%rip), %rsi     # 0x817c7
movl $0x4, %edx
movq %rax, %rdi
callq 0x40b80
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x38(%rax)
leaq 0x140aa(%rip), %rsi     # 0x817cc
movl $0xe, %edx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x40b80
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/slghsymbol.cc
// Function: ContextOp::clone() const
ContextChange *ContextOp::clone(void) const

{
  ContextOp *res = new ContextOp();
  (res->patexp = patexp)->layClaim();
  res->mask = mask;
  res->num = num;
  res->shift = shift;
  return res;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x20, %edi
callq 0x40800
movq 0x35333(%rip), %rcx     # 0xa2cb0
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%rax)
incl 0x8(%rcx)
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
movl 0x18(%rbx), %ecx
movl %ecx, 0x18(%rax)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/slghsymbol.cc
// Function: ContextCommit::ContextCommit(TripleSymbol*, int, int, bool)
ContextCommit::ContextCommit(TripleSymbol *s,int4 sbit,int4 ebit,bool fl)

{
  sym = s;
  flow = fl;

  int4 shift;
  calc_maskword(sbit,ebit,num,shift,mask);
}

// Assembly:
pushq %rax
movl %edx, %eax
movq 0x35206(%rip), %rdx     # 0xa2bb0
addq $0x10, %rdx
movq %rdx, (%rdi)
movq %rsi, 0x8(%rdi)
movb %r8b, 0x18(%rdi)
leaq 0x10(%rdi), %rdx
leaq 0x14(%rdi), %r8
leaq 0x4(%rsp), %r9
movl %eax, %edi
movl %ecx, %esi
movq %r9, %rcx
callq 0x6d3b7
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/slghsymbol.cc
// Function: ContextCommit::clone() const
ContextChange *ContextCommit::clone(void) const

{
  ContextCommit *res = new ContextCommit();
  res->sym = sym;
  res->flow = flow;
  res->mask = mask;
  res->num = num;
  return res;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x20, %edi
callq 0x40800
movq 0x34bad(%rip), %rcx     # 0xa2bb0
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%rax)
movb 0x18(%rbx), %cl
movb %cl, 0x18(%rax)
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/loadimage.cc
// Function: RawLoadImage::RawLoadImage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
RawLoadImage::RawLoadImage(const string &f) : LoadImage(f)

{
  vma = 0;
  thefile = (ifstream *)0;
  spaceid = (AddrSpace *)0;
  filesize = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x31f0b(%rip), %rax     # 0xa2d58
addq $0x10, %rax
movq %rax, (%rdi)
leaq 0x8(%rdi), %r14
leaq 0x18(%rdi), %r15
movq %r15, 0x8(%rdi)
movq $0x0, 0x10(%rdi)
movb $0x0, 0x18(%rdi)
movq %r14, %rdi
callq 0x3fc60
movq 0x31f55(%rip), %rax     # 0xa2dd0
addq $0x10, %rax
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movups %xmm0, 0x38(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x70ea9
movq (%r15), %rsi
incq %rsi
callq 0x40870
movq %rbx, %rdi
callq 0x41f00
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/loadimage.cc
// Function: RawLoadImage::open()
void RawLoadImage::open(void)

{
  if (thefile != (ifstream *)0) throw LowlevelError("loadimage is already open");
  thefile = new ifstream(filename.c_str());
  if (!(*thefile)) {
    string errmsg = "Unable to open raw image file: "+filename;
    throw LowlevelError(errmsg);
  }
  thefile->seekg(0,ios::end);
  filesize = thefile->tellg();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
cmpq $0x0, 0x30(%rdi)
jne 0x70f96
movq %rdi, %rbx
movl $0x208, %edi            # imm = 0x208
callq 0x40800
movq %rax, %r14
movq 0x8(%rbx), %rsi
movq %rax, %rdi
movl $0x8, %edx
callq 0x420f0
movq %r14, 0x30(%rbx)
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r14,%rax)
jne 0x70fee
movq %r14, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x41120
movq 0x30(%rbx), %rdi
callq 0x41db0
movq %rax, 0x38(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x3fb00
movq %rax, %r14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x10924(%rip), %rsi     # 0x818d7
leaq 0x10936(%rip), %rdx     # 0x818f0
leaq 0x8(%rsp), %rdi
callq 0x3f8a0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x31ecb(%rip), %rsi     # 0xa2ea8
movq 0x31c54(%rip), %rdx     # 0xa2c38
movq %r14, %rdi
callq 0x41d60
jmp 0x71037
addq $0x8, %rbx
leaq 0x108f8(%rip), %rsi     # 0x818f1
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rdx
callq 0x40500
movl $0x20, %edi
callq 0x3fb00
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x3f890
movq 0x31e80(%rip), %rsi     # 0xa2ea8
movq 0x31c09(%rip), %rdx     # 0xa2c38
movq %r14, %rdi
callq 0x41d60
movq %rax, %rbx
jmp 0x71047
movq %rax, %rbx
movq %r14, %rdi
callq 0x40080
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x710a0
movq 0x18(%rsp), %rsi
incq %rsi
jmp 0x7109b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x71081
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40870
jmp 0x71081
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x710a0
movq %r14, %rdi
callq 0x40080
jmp 0x710a0
movq %rax, %rbx
movl $0x208, %esi            # imm = 0x208
movq %r14, %rdi
callq 0x40870
movq %rbx, %rdi
callq 0x41f00
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: BreakTableCallBack::registerPcodeCallback(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, BreakCallBack*)
void BreakTableCallBack::registerPcodeCallback(const string &name,BreakCallBack *func)

{
  func->setEmulate(emulate);
  vector<string> userops;
  trans->getUserOpNames(userops);
  for(int4 i=0;i<userops.size();++i) {
    if (userops[i] == name) {
      pcodecallback[(uintb)i] = func;
      return;
    }
  }
  throw LowlevelError("Bad userop name: "+name);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, (%rsp)
movq %rdi, %r15
movq 0x8(%rdi), %rax
movq %rdx, 0x8(%rsp)
movq %rax, 0x8(%rdx)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq 0x10(%rdi), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movq 0x10(%rsp), %r13
movq 0x18(%rsp), %rbp
subq %r13, %rbp
je 0x71386
sarq $0x5, %rbp
movq (%rsp), %rax
movq (%rax), %r12
movq 0x8(%rax), %rbx
cmpq $0x1, %rbp
adcq $0x0, %rbp
addq $0x8, %r13
xorl %r14d, %r14d
movq (%r13), %rdx
cmpq %rbx, %rdx
jne 0x7137a
testq %rdx, %rdx
je 0x713d0
movq -0x8(%r13), %rdi
movq %r12, %rsi
callq 0x408b0
testl %eax, %eax
je 0x713d0
incq %r14
addq $0x20, %r13
cmpq %r14, %rbp
jne 0x7135c
movl $0x20, %edi
callq 0x3fb00
movq %rax, %rbx
leaq 0x10660(%rip), %rsi     # 0x819fa
leaq 0x28(%rsp), %rdi
movq (%rsp), %rdx
callq 0x40500
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x31ae7(%rip), %rsi     # 0xa2ea8
movq 0x31870(%rip), %rdx     # 0xa2c38
movq %rbx, %rdi
callq 0x41d60
addq $0x48, %r15
leaq 0x28(%rsp), %rsi
movq %r14, (%rsi)
movq %r15, %rdi
callq 0x41ea0
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x40090
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x71407
movq %rax, %r14
jmp 0x7143f
movq %rax, %r14
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x71432
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x40870
jmp 0x71432
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x7143f
movq %rbx, %rdi
callq 0x40080
leaq 0x10(%rsp), %rdi
callq 0x40090
movq %r14, %rdi
callq 0x41f00
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: BreakTableCallBack::setEmulate(Emulate*)
void BreakTableCallBack::setEmulate(Emulate *emu)

{ // Make sure all callbbacks are aware of new emulator
  emulate = emu;
  map<Address,BreakCallBack *>::iterator iter1;

  for(iter1=addresscallback.begin();iter1!=addresscallback.end();++iter1)
    (*iter1).second->setEmulate(emu);

  map<uintb,BreakCallBack *>::iterator iter2;


  for(iter2=pcodecallback.begin();iter2!=pcodecallback.end();++iter2)
    (*iter2).second->setEmulate(emu);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, 0x8(%rdi)
movq 0x30(%rdi), %rax
leaq 0x20(%rdi), %r15
cmpq %r15, %rax
je 0x7149a
movq 0x30(%rax), %rcx
movq %rbx, 0x8(%rcx)
movq %rax, %rdi
callq 0x40030
jmp 0x71483
movq 0x60(%r14), %rax
addq $0x50, %r14
cmpq %r14, %rax
je 0x714b9
movq 0x28(%rax), %rcx
movq %rbx, 0x8(%rcx)
movq %rax, %rdi
callq 0x40030
jmp 0x714a2
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: BreakTableCallBack::doAddressBreak(Address const&)
bool BreakTableCallBack::doAddressBreak(const Address &addr)

{
  map<Address,BreakCallBack *>::const_iterator iter;
  
  iter = addresscallback.find(addr);
  if (iter == addresscallback.end()) return false;
  return (*iter).second->addressCallback(addr);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x18, %rdi
callq 0x42030
addq $0x20, %r14
cmpq %r14, %rax
je 0x71553
movq 0x30(%rax), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: PcodeEmitCache::createVarnode(VarnodeData const*)
VarnodeData *PcodeEmitCache::createVarnode(const VarnodeData *var)

{
  VarnodeData *res = new VarnodeData();
  *res = *var;
  varcache.push_back(res);
  return res;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x18, %edi
callq 0x40800
movq %rax, (%rsp)
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
movups (%rbx), %xmm0
movups %xmm0, (%rax)
movq 0x10(%r14), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x715bc
movq %rax, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x715c4
movq %rsp, %rdx
callq 0x3f0f0
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: PcodeEmitCache::dump(Address const&, OpCode, VarnodeData*, VarnodeData*, int)
void PcodeEmitCache::dump(const Address &addr,OpCode opc,VarnodeData *outvar,VarnodeData *vars,int4 isize)

{
  PcodeOpRaw *op = new PcodeOpRaw();
  op->setSeqNum(addr,uniq);
  opcache.push_back(op);
  op->setBehavior( inst[opc] );
  uniq += 1;
  if (outvar != (VarnodeData *)0) {
    VarnodeData *outvn = createVarnode(outvar);
    op->setOutput(outvn);
  }
  for(int4 i=0;i<isize;++i) {
    VarnodeData *invn = createVarnode(vars+i);
    op->addInput(invn);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %ebp
movq %r8, %rbx
movq %rcx, %r15
movl %edx, %r12d
movq %rsi, %r13
movq %rdi, %r14
movl $0x40, %edi
callq 0x40800
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
movq %rax, 0x8(%rsp)
movl 0x20(%r14), %ecx
movups (%r13), %xmm0
movups %xmm0, 0x8(%rax)
movq %rcx, 0x18(%rax)
movq 0x8(%r14), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x7163a
movq %rax, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x71644
leaq 0x8(%rsp), %rdx
callq 0x41040
movq 0x8(%rsp), %rax
movq 0x18(%r14), %rcx
movl %r12d, %edx
movq (%rcx), %rcx
movq (%rcx,%rdx,8), %rcx
movq %rcx, (%rax)
incl 0x20(%r14)
testq %r15, %r15
je 0x71677
movq %r14, %rdi
movq %r15, %rsi
callq 0x40cd0
movq 0x8(%rsp), %rcx
movq %rax, 0x20(%rcx)
testl %ebp, %ebp
jle 0x716c1
movl %ebp, %r12d
leaq 0x10(%rsp), %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x40cd0
movq 0x8(%rsp), %rdi
movq %rax, 0x10(%rsp)
movq 0x30(%rdi), %rsi
cmpq 0x38(%rdi), %rsi
je 0x716ac
movq %rax, (%rsi)
addq $0x8, 0x30(%rdi)
jmp 0x716b8
addq $0x28, %rdi
movq %r15, %rdx
callq 0x3f0f0
addq $0x18, %rbx
decq %r12
jne 0x71683
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: EmulateMemory::executeUnary()
void EmulateMemory::executeUnary(void)

{
  uintb in1 = memstate->getValue(currentOp->getInput(0));
  uintb out = currentBehave->evaluateUnary(currentOp->getOutput()->size,
					   currentOp->getInput(0)->size,in1);
  memstate->setValue(currentOp->getOutput(),out);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq 0x20(%rbx), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movl 0x10(%rax), %ecx
callq 0x3f8c0
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rcx
movq 0x20(%rcx), %rdx
movq 0x28(%rcx), %rcx
movl 0x10(%rdx), %esi
movq (%rcx), %rcx
movl 0x10(%rcx), %edx
movq (%rdi), %r8
movq %rax, %rcx
callq *0x10(%r8)
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rcx
movq 0x20(%rcx), %rcx
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
movl 0x10(%rcx), %ecx
movq %rax, %r8
popq %rbx
jmp 0x42100
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: EmulateMemory::executeBinary()
void EmulateMemory::executeBinary(void)

{
  uintb in1 = memstate->getValue(currentOp->getInput(0));
  uintb in2 = memstate->getValue(currentOp->getInput(1));
  uintb out = currentBehave->evaluateBinary(currentOp->getOutput()->size,
					    currentOp->getInput(0)->size,in1,in2);
  memstate->setValue(currentOp->getOutput(),out);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq 0x20(%rbx), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movl 0x10(%rax), %ecx
callq 0x3f8c0
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movl 0x10(%rax), %ecx
callq 0x3f8c0
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rcx
movq 0x20(%rcx), %rdx
movq 0x28(%rcx), %rcx
movl 0x10(%rdx), %esi
movq (%rcx), %rcx
movl 0x10(%rcx), %edx
movq (%rdi), %r9
movq %r14, %rcx
movq %rax, %r8
callq *0x18(%r9)
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rcx
movq 0x20(%rcx), %rcx
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
movl 0x10(%rcx), %ecx
movq %rax, %r8
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x42100
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: EmulateMemory::executeLoad()
void EmulateMemory::executeLoad(void)

{
  uintb off = memstate->getValue(currentOp->getInput(1));
  AddrSpace *spc = Address::getSpaceFromConst(currentOp->getInput(0)->getAddr());

  off = AddrSpace::addressToByte(off,spc->getWordSize());
  uintb res = memstate->getValue(spc,off,currentOp->getOutput()->size);
  memstate->setValue(currentOp->getOutput(),res);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq 0x20(%rbx), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movl 0x10(%rax), %ecx
callq 0x3f8c0
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rcx
movq 0x20(%rcx), %r8
movq 0x28(%rcx), %rcx
movq (%rcx), %rcx
movq 0x8(%rcx), %rsi
movl 0x5c(%rsi), %edx
imulq %rax, %rdx
movl 0x10(%r8), %ecx
callq 0x3f8c0
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rcx
movq 0x20(%rcx), %rcx
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
movl 0x10(%rcx), %ecx
movq %rax, %r8
popq %rbx
jmp 0x42100
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: EmulateMemory::executeStore()
void EmulateMemory::executeStore(void)

{
  uintb val = memstate->getValue(currentOp->getInput(2)); // Value being stored
  uintb off = memstate->getValue(currentOp->getInput(1)); // Offset to store at
  AddrSpace *spc = Address::getSpaceFromConst(currentOp->getInput(0)->getAddr()); // Space to store in

  off = AddrSpace::addressToByte(off,spc->getWordSize());
  memstate->setValue(spc,off,currentOp->getInput(2)->size,val);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq 0x20(%rbx), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movl 0x10(%rax), %ecx
callq 0x3f8c0
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movl 0x10(%rax), %ecx
callq 0x3f8c0
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rcx
movq 0x28(%rcx), %rcx
movq (%rcx), %rdx
movq 0x10(%rcx), %rcx
movq 0x8(%rdx), %rsi
movl 0x5c(%rsi), %edx
imulq %rax, %rdx
movl 0x10(%rcx), %ecx
movq %r14, %r8
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x42100
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: EmulatePcodeCache::EmulatePcodeCache(Translate*, MemoryState*, BreakTable*)
EmulatePcodeCache::EmulatePcodeCache(Translate *t,MemoryState *s,BreakTable *b)
  : EmulateMemory(s)
{
  trans = t;
  OpBehavior::registerInstructions(inst,t);
  breaktable = b;
  breaktable->setEmulate(this);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r12
movq %rdi, %rbx
movb $0x1, 0x8(%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq 0x30bcc(%rip), %rcx     # 0xa2ae8
addq $0x10, %rcx
movq %rcx, (%rdi)
leaq 0x30(%rdi), %r14
leaq 0x48(%rdi), %r15
leaq 0x60(%rdi), %r13
movq %rax, 0x80(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x50(%rdi)
movups %xmm0, 0x60(%rdi)
movq %rax, 0x70(%rdi)
movq %rsi, 0x28(%rdi)
movq %r13, %rdi
callq 0x42450
movq %r12, 0x78(%rbx)
movq (%r12), %rax
movq %r12, %rdi
movq %rbx, %rsi
callq *0x10(%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r12
movq (%r13), %rdi
testq %rdi, %rdi
je 0x71f8c
movq 0x70(%rbx), %rsi
subq %rdi, %rsi
callq 0x40870
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x42838
movq %r12, %rdi
callq 0x41f00
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: EmulatePcodeCache::clearCache()
void EmulatePcodeCache::clearCache(void)

{
  for(int4 i=0;i<opcache.size();++i)
    delete opcache[i];
  for(int4 i=0;i<varcache.size();++i)
    delete varcache[i];
  opcache.clear();
  varcache.clear();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rax
cmpq %rax, 0x38(%rdi)
je 0x71ff9
xorl %r15d, %r15d
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x71fe2
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x71fd5
movq 0x38(%r14), %rsi
subq %rdi, %rsi
callq 0x40870
movl $0x40, %esi
movq %r14, %rdi
callq 0x40870
incq %r15
movq 0x30(%rbx), %rax
movq 0x38(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x71fb7
movq 0x48(%rbx), %rax
movq 0x50(%rbx), %rcx
cmpq %rax, %rcx
je 0x72036
xorl %r14d, %r14d
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x7201c
movl $0x18, %esi
callq 0x40870
incq %r14
movq 0x48(%rbx), %rax
movq 0x50(%rbx), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r14, %rdx
ja 0x72009
movq 0x30(%rbx), %rdx
cmpq %rdx, 0x38(%rbx)
je 0x72044
movq %rdx, 0x38(%rbx)
cmpq %rax, %rcx
je 0x7204d
movq %rax, 0x50(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: EmulatePcodeCache::~EmulatePcodeCache()
EmulatePcodeCache::~EmulatePcodeCache(void)

{
  clearCache();
  for(int4 i=0;i<inst.size();++i) {
    OpBehavior *t_op = inst[i];
    if (t_op != (OpBehavior *)0)
      delete t_op;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30a86(%rip), %rax     # 0xa2ae8
addq $0x10, %rax
movq %rax, (%rdi)
callq 0x3f770
movq 0x60(%rbx), %rdi
cmpq %rdi, 0x68(%rbx)
je 0x720a1
xorl %r14d, %r14d
movq (%rdi,%r14,8), %rdi
testq %rdi, %rdi
je 0x7208a
movq (%rdi), %rax
callq *0x8(%rax)
incq %r14
movq 0x60(%rbx), %rdi
movq 0x68(%rbx), %rax
subq %rdi, %rax
sarq $0x3, %rax
cmpq %r14, %rax
ja 0x7207b
testq %rdi, %rdi
je 0x720b2
movq 0x70(%rbx), %rsi
subq %rdi, %rsi
callq 0x40870
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x720c7
movq 0x58(%rbx), %rsi
subq %rdi, %rsi
callq 0x40870
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x720e3
movq 0x40(%rbx), %rsi
subq %rdi, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x40870
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: EmulatePcodeCache::createInstruction(Address const&)
void EmulatePcodeCache::createInstruction(const Address &addr)

{
  clearCache();
  PcodeEmitCache emit(opcache,varcache,inst,0);
  instruction_length = trans->oneInstruction(emit,addr);
  current_op = 0;
  instruction_start = true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3f770
leaq 0x30(%r14), %rsi
leaq 0x48(%r14), %rdx
leaq 0x60(%r14), %rcx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
xorl %r8d, %r8d
callq 0x41bb0
movq 0x28(%r14), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movq %rbx, %rdx
callq *0x60(%rax)
movl %eax, 0x98(%r14)
movl $0x0, 0x94(%r14)
movb $0x1, 0x90(%r14)
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: EmulatePcodeCache::establishOp()
void EmulatePcodeCache::establishOp(void)

{
  if (current_op < opcache.size()) {
    currentOp = opcache[current_op];
    currentBehave = currentOp->getBehavior();
    return;
  }
  currentOp = (PcodeOpRaw *)0;
  currentBehave = (OpBehavior *)0;
}

// Assembly:
movslq 0x94(%rdi), %rax
movq 0x30(%rdi), %rcx
movq 0x38(%rdi), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rax, %rdx
jbe 0x72190
movq (%rcx,%rax,8), %rax
movq %rax, 0x20(%rdi)
movq (%rax), %rax
jmp 0x7219a
movq $0x0, 0x20(%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: EmulatePcodeCache::fallthruOp()
void EmulatePcodeCache::fallthruOp(void)

{
  instruction_start = false;
  current_op += 1;
  if (current_op >= opcache.size()) {
    current_address = current_address + instruction_length;
    createInstruction(current_address);
  }
  establishOp();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movb $0x0, 0x90(%rdi)
movslq 0x94(%rdi), %rax
incq %rax
movl %eax, 0x94(%rdi)
movq 0x38(%rdi), %rcx
subq 0x30(%rdi), %rcx
sarq $0x3, %rcx
cmpq %rax, %rcx
ja 0x72215
leaq 0x80(%rbx), %rsi
movslq 0x98(%rbx), %rax
movq 0x80(%rbx), %rcx
addq 0x88(%rbx), %rax
movq 0x28(%rcx), %rcx
cmpq %rax, %rcx
jae 0x72206
incq %rcx
cqto
idivq %rcx
movq %rdx, %rax
sarq $0x3f, %rax
andq %rcx, %rax
addq %rdx, %rax
movq %rax, 0x88(%rbx)
movq %rbx, %rdi
callq 0x40510
movslq 0x94(%rbx), %rax
movq 0x30(%rbx), %rcx
movq 0x38(%rbx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rax, %rdx
jbe 0x7223d
movq (%rcx,%rax,8), %rax
movq %rax, 0x20(%rbx)
movq (%rax), %rax
jmp 0x72247
movq $0x0, 0x20(%rbx)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: EmulatePcodeCache::executeBranch()
void EmulatePcodeCache::executeBranch(void)

{
  const Address &destaddr( currentOp->getInput(0)->getAddr() );
  if (destaddr.isConstant()) {
    uintm id = destaddr.getOffset();
    id = id + (uintm)current_op;
    current_op = id;
    if (current_op == opcache.size())
      fallthruOp();
    else if ((current_op < 0)||(current_op >= opcache.size()))
      throw LowlevelError("Bad intra-instruction branch");
  }
  else
    setExecuteAddress(destaddr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq 0x20(%rdi), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
cmpl $0x0, 0x8(%rcx)
je 0x7228a
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
callq *0x90(%rax)
jmp 0x722c5
addl 0x94(%rdi), %eax
movl %eax, 0x94(%rdi)
movslq %eax, %rdx
movq 0x38(%rdi), %rcx
subq 0x30(%rdi), %rcx
sarq $0x3, %rcx
cmpq %rdx, %rcx
jne 0x722ba
movq (%rdi), %rax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0x78(%rax)
testl %eax, %eax
js 0x722d0
movl %eax, %eax
cmpq %rax, %rcx
jbe 0x722d0
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x3fb00
movq %rax, %rbx
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xf826(%rip), %rsi      # 0x81b13
leaq 0xf83b(%rip), %rdx      # 0x81b2f
leaq 0x18(%rsp), %rdi
callq 0x3f8a0
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x30b91(%rip), %rsi     # 0xa2ea8
movq 0x3091a(%rip), %rdx     # 0xa2c38
movq %rbx, %rdi
callq 0x41d60
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x72348
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x40870
jmp 0x72348
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x72355
movq %rbx, %rdi
callq 0x40080
movq %r14, %rdi
callq 0x41f00
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: EmulatePcodeCache::setExecuteAddress(Address const&)
void EmulatePcodeCache::setExecuteAddress(const Address &addr)

{
  current_address = addr;	// Copy -addr- BEFORE calling createInstruction
                                // as it calls clear and may delete -addr-
  createInstruction(current_address);
  establishOp();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x80(%rdi), %rax
movq (%rsi), %rcx
movq %rcx, 0x80(%rdi)
movq 0x8(%rsi), %rcx
movq %rcx, 0x88(%rdi)
movq %rax, %rsi
callq 0x40510
movslq 0x94(%rbx), %rax
movq 0x30(%rbx), %rcx
movq 0x38(%rbx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rax, %rdx
jbe 0x7246e
movq (%rcx,%rax,8), %rax
movq %rax, 0x20(%rbx)
movq (%rax), %rax
jmp 0x72478
movq $0x0, 0x20(%rbx)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/emulate.cc
// Function: EmulatePcodeCache::executeInstruction()
void EmulatePcodeCache::executeInstruction(void)

{
  if (instruction_start) {
    if (breaktable->doAddressBreak(current_address))
      return;
  }
  do {
    executeCurrentOp();
  } while(!instruction_start);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpb $0x1, 0x90(%rdi)
jne 0x724a0
movq 0x78(%rbx), %rdi
leaq 0x80(%rbx), %rsi
movq (%rdi), %rax
callq *0x20(%rax)
testb %al, %al
jne 0x724b1
movq %rbx, %rdi
callq 0x3f1c0
cmpb $0x1, 0x90(%rbx)
jne 0x724a0
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/memstate.cc
// Function: MemoryBank::constructValue(unsigned char const*, int, bool)
uintb MemoryBank::constructValue(const uint1 *ptr,int4 size,bool bigendian)

{
  uintb res = 0;

  if (bigendian) {
    for(int4 i=0;i<size;++i) {
      res <<= 8;
      res += (uintb) ptr[i];
    }
  }
  else {
    for(int4 i=size-1;i>=0;--i) {
      res <<= 8;
      res += (uintb) ptr[i];
    }
  }
  return res;
}

// Assembly:
testl %edx, %edx
je 0x72e9b
testl %esi, %esi
jle 0x72ebc
movl %esi, %ecx
xorl %edx, %edx
xorl %eax, %eax
shlq $0x8, %rax
movzbl (%rdi,%rdx), %esi
orq %rsi, %rax
incq %rdx
cmpq %rdx, %rcx
jne 0x72e86
jmp 0x72ebb
testl %esi, %esi
jle 0x72ebc
movl %esi, %ecx
incq %rcx
xorl %eax, %eax
shlq $0x8, %rax
movzbl -0x2(%rdi,%rcx), %edx
orq %rdx, %rax
decq %rcx
cmpq $0x1, %rcx
jg 0x72ea6
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/memstate.cc
// Function: MemoryBank::deconstructValue(unsigned char*, unsigned long, int, bool)
void MemoryBank::deconstructValue(uint1 *ptr,uintb val,int4 size,bool bigendian)

{
  if (bigendian) {
    for(int4 i=size-1;i>=0;--i) {
      ptr[i] = (uint1) (val & 0xff);
      val >>= 8;
    }
  }
  else {
    for(int4 i=0;i<size;++i) {
      ptr[i] = (uint1) (val & 0xff);
      val >>= 8;
    }
  }
}

// Assembly:
testl %ecx, %ecx
je 0x72ee1
testl %edx, %edx
jle 0x72ef9
movl %edx, %eax
incq %rax
movb %sil, -0x2(%rdi,%rax)
shrq $0x8, %rsi
decq %rax
cmpq $0x1, %rax
jg 0x72ecd
jmp 0x72ef9
testl %edx, %edx
jle 0x72ef9
movl %edx, %eax
xorl %ecx, %ecx
movb %sil, (%rdi,%rcx)
shrq $0x8, %rsi
incq %rcx
cmpq %rcx, %rax
jne 0x72ee9
retq
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/memstate.cc
// Function: MemoryBank::getPage(unsigned long, unsigned char*, int, int) const
void MemoryBank::getPage(uintb addr,uint1 *res,int4 skip,int4 size) const

{ // Default implementation just iterates using find
  // but could be optimized
  uintb ptraddr = addr + skip;
  uintb endaddr = ptraddr + size;
  uintb startalign = ptraddr & ~((uintb)(wordsize-1));
  uintb endalign = endaddr & ~((uintb)(wordsize-1));
  if ((endaddr & ((uintb)(wordsize-1))) != 0)
    endalign += wordsize;

  uintb curval;
  bool bswap = ((HOST_ENDIAN==1) != space->isBigEndian());
  uint1 *ptr;
  do {
    curval = find(startalign);
    if (bswap)
      curval = byte_swap(curval,wordsize);
    ptr = (uint1 *)&curval;
    int4 sz = wordsize;
    if (startalign < addr) {
      ptr += (addr-startalign);
      sz = wordsize - (addr-startalign);
    }
    if (startalign + wordsize > endaddr)
      sz -= (startalign + wordsize -endaddr);
    memcpy(res,ptr,sz);
    res += sz;
    startalign += wordsize;
  } while(startalign != endalign);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movslq %ecx, %r12
addq %rsi, %r12
movslq %r8d, %rdx
addq %r12, %rdx
movslq 0x8(%rdi), %rax
leaq -0x1(%rax), %rbp
movq %rax, %rcx
negq %rcx
andq %rcx, %r12
andq %rdx, %rcx
movq %rdx, 0x10(%rsp)
andq %rdx, %rbp
cmovneq %rax, %rbp
addq %rcx, %rbp
movq 0x10(%rdi), %rax
movl 0x24(%rax), %eax
movl %eax, 0x4(%rsp)
movq (%r15), %rax
movq %r15, %rdi
movq %r12, %rsi
callq *0x8(%rax)
movq %rax, 0x8(%rsp)
testb $0x1, 0x4(%rsp)
je 0x72f8e
movl 0x8(%r15), %esi
movq %rax, %rdi
callq 0x3f6a0
movq %rax, 0x8(%rsp)
movslq 0x8(%r15), %rax
movq %r14, %rcx
subq %r12, %rcx
movl $0x0, %edx
cmovaeq %rcx, %rdx
movq %r12, %rcx
subq %r14, %rcx
leaq 0x8(%rsp,%rdx), %rsi
movl $0x0, %edi
cmovael %edi, %ecx
addl %eax, %ecx
addq %r12, %rax
movq 0x10(%rsp), %rdx
subq %rax, %rdx
cmovael %edi, %edx
addl %ecx, %edx
movslq %edx, %r13
movq %rbx, %rdi
movq %r13, %rdx
callq 0x40370
addq %r13, %rbx
movslq 0x8(%r15), %rax
addq %rax, %r12
cmpq %rbp, %r12
jne 0x72f65
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/memstate.cc
// Function: MemoryBank::setPage(unsigned long, unsigned char const*, int, int)
void MemoryBank::setPage(uintb addr,const uint1 *val,int4 skip,int4 size)
  
{  // Default implementation just iterates using insert
   // but could be optimized
  uintb ptraddr = addr + skip;
  uintb endaddr = ptraddr + size;
  uintb startalign = ptraddr & ~((uintb)(wordsize-1));
  uintb endalign = endaddr & ~((uintb)(wordsize-1));
  if ((endaddr & ((uintb)(wordsize-1))) != 0)
    endalign += wordsize;

  uintb curval;
  bool bswap = ((HOST_ENDIAN==1) != space->isBigEndian());
  uint1 *ptr;
  do {
    ptr = (uint1 *)&curval;
    int4 sz = wordsize;
    if (startalign < addr) {
      ptr += (addr-startalign);
      sz = wordsize - (addr-startalign);
    }
    if (startalign + wordsize > endaddr)
      sz -= (startalign + wordsize - endaddr);
    if (sz != wordsize) {
      curval = find(startalign); // Part of word is copied from underlying
      memcpy(ptr,val,sz);	 // Rest is taken from -val-
    }
    else
      curval = *((const uintb *)val); // -val- supplies entire word
    if (bswap)
      curval = byte_swap(curval,wordsize);
    insert(startalign,curval);
    val += sz;
    startalign += wordsize;
  } while(startalign != endalign);
}

// 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
movslq %ecx, %r12
addq %rsi, %r12
movslq %r8d, %rbp
addq %r12, %rbp
movslq 0x8(%rdi), %rax
leaq -0x1(%rax), %rdx
movq %rax, %rcx
negq %rcx
andq %rcx, %r12
andq %rbp, %rcx
andq %rbp, %rdx
cmovneq %rax, %rdx
addq %rcx, %rdx
movq %rdx, 0x20(%rsp)
movq 0x10(%rdi), %rax
movl 0x24(%rax), %eax
movl %eax, 0x14(%rsp)
movq %rsi, 0x18(%rsp)
movq %r12, %rax
subq %r14, %rax
movl $0x0, %edi
cmovael %edi, %eax
movslq 0x8(%r15), %rcx
addl %ecx, %eax
movq %rcx, %rdx
addq %r12, %rdx
movq %rbp, %rsi
subq %rdx, %rsi
cmovael %edi, %esi
addl %eax, %esi
movslq %esi, %r13
cmpl %ecx, %esi
jne 0x7307e
movq (%rbx), %rax
movq %rax, 0x8(%rsp)
jmp 0x730bc
movq %r14, %rax
subq %r12, %rax
movl $0x0, %ecx
cmovaeq %rax, %rcx
movq %rbp, %r14
leaq 0x8(%rsp,%rcx), %rbp
movq (%r15), %rax
movq %r15, %rdi
movq %r12, %rsi
callq *0x8(%rax)
movq %rax, 0x8(%rsp)
movq %rbp, %rdi
movq %r14, %rbp
movq 0x18(%rsp), %r14
movq %rbx, %rsi
movq %r13, %rdx
callq 0x40370
testb $0x1, 0x14(%rsp)
je 0x730d6
movq 0x8(%rsp), %rdi
movl 0x8(%r15), %esi
callq 0x3f6a0
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdx
movq (%r15), %rax
movq %r15, %rdi
movq %r12, %rsi
callq *(%rax)
addq %r13, %rbx
movslq 0x8(%r15), %rax
addq %rax, %r12
cmpq 0x20(%rsp), %r12
jne 0x73048
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/memstate.cc
// Function: MemoryBank::getValue(unsigned long, int) const
uintb MemoryBank::getValue(uintb offset,int4 size) const

{
    uintb res;

    uintb alignmask = (uintb) (wordsize - 1);
    uintb ind = offset & (~alignmask);
    int4 skip = offset & alignmask;
    int4 size1 = wordsize - skip;
    int4 size2;
    int4 gap;
    uintb val1, val2;
    if (size > size1) { // We have spill over
        size2 = size - size1;
        val1 = find (ind);
        val2 = find (ind + wordsize);
        gap = wordsize - size2;
    } else {
        val1 = find (ind);
        val2 = 0;
        if (size == wordsize)
            return val1;
        gap = size1 - size;
        size1 = size;
        size2 = 0;
    }

    if (space->isBigEndian ()) {
        if (size2 == 0)
            res = val1 >> (8 * gap);
        else
            res = (val1 << (8 * size2)) | (val2 >> (8 * gap));
    } else {
        if (size2 == 0)
            res = val1 >> (skip * 8);
        else
            res = (val1 >> (skip * 8)) | (val2 << (size1 * 8));
    }
    res &= (uintb)calc_mask (size);
    return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r13
movl 0x8(%rdi), %r12d
leal -0x1(%r12), %eax
movl %r12d, %ecx
negl %ecx
movslq %ecx, %rbp
andq %rsi, %rbp
andl %eax, %r15d
subl %r15d, %r12d
movl %r12d, %ebx
subl %edx, %ebx
movl %edx, 0x4(%rsp)
jge 0x73351
movl %edx, %ebx
subl %r12d, %ebx
movq (%r13), %rax
movq %r13, %rdi
movq %rbp, %rsi
callq *0x8(%rax)
movq %rax, %r14
movslq 0x8(%r13), %rsi
addq %rbp, %rsi
movq (%r13), %rax
movq %r13, %rdi
callq *0x8(%rax)
movq %rbx, %rsi
movl 0x8(%r13), %ebx
subl %esi, %ebx
jmp 0x73372
movq (%r13), %rax
movq %r13, %rdi
movq %rbp, %rsi
callq *0x8(%rax)
movl 0x4(%rsp), %ecx
movq %rax, %r14
cmpl %ecx, 0x8(%r13)
je 0x733d7
xorl %esi, %esi
movl %ecx, %r12d
xorl %eax, %eax
movq 0x10(%r13), %rcx
testb $0x1, 0x24(%rcx)
jne 0x7339a
shll $0x3, %r15d
movl %r15d, %ecx
shrq %cl, %r14
testl %esi, %esi
movl 0x4(%rsp), %edx
je 0x733bf
shll $0x3, %r12d
movl %r12d, %ecx
shlq %cl, %rax
jmp 0x733b2
testl %esi, %esi
movl 0x4(%rsp), %edx
je 0x733b7
shll $0x3, %esi
movl %esi, %ecx
shlq %cl, %r14
shll $0x3, %ebx
movl %ebx, %ecx
shrq %cl, %rax
orq %rax, %r14
jmp 0x733bf
shll $0x3, %ebx
movl %ebx, %ecx
shrq %cl, %r14
cmpl $0x8, %edx
movl $0x8, %eax
cmovll %edx, %eax
cltq
movq 0x2f7fd(%rip), %rcx     # 0xa2bd0
andq (%rcx,%rax,8), %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/memstate.cc
// Function: MemoryBank::setChunk(unsigned long, int, unsigned char const*)
void MemoryBank::setChunk(uintb offset,int4 size,const uint1 *val)

{
  int4 cursize;
  int4 count;
  uintb pagemask = (uintb) (pagesize - 1);
  uintb offalign;
  int4 skip;

  count = 0;
  while(count < size) {
    cursize = pagesize;
    offalign = offset & ~pagemask;
    skip = 0;
    if (offalign != offset) {
      skip = offset - offalign;
      cursize -= skip;
    }
    if (size - count < cursize)
      cursize = size - count;
    setPage(offalign,val,skip,cursize);
    count += cursize;
    offset += cursize;
    val += cursize;
  }
}

// Assembly:
testl %edx, %edx
jle 0x7345f
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
xorl %eax, %eax
subl 0xc(%rdi), %eax
cltq
movq %rax, (%rsp)
movl 0xc(%r15), %eax
movq %r14, %rsi
andq (%rsp), %rsi
movl %r14d, %ecx
subl %esi, %ecx
subl %ecx, %eax
movl %ebp, %r12d
subl %r13d, %r12d
cmpl %eax, %r12d
cmovgel %eax, %r12d
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rdx
movl %r12d, %r8d
callq *0x18(%rax)
addl %r12d, %r13d
movslq %r12d, %rax
addq %rax, %r14
addq %rax, %rbx
cmpl %ebp, %r13d
jl 0x73412
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/memstate.cc
// Function: MemoryImage::find(unsigned long) const
uintb MemoryImage::find(uintb addr) const

{ // Assume that -addr- is word aligned
  uintb res = 0;		// Make sure all bytes start as 0, as load may not fill all bytes
  AddrSpace *spc = getSpace();
  try {
    uint1 *ptr = (uint1 *)&res;
    ptr += (HOST_ENDIAN==1) ? (sizeof(uintb) - getWordSize()) : 0;
    loader->loadFill(ptr,getWordSize(),Address(spc,addr));
  } catch(DataUnavailError &err) {
    // Pages not mapped in the load image, are assumed to be zero
    res = 0;
  }
  if ((HOST_ENDIAN==1) != spc->isBigEndian())
    res = byte_swap(res,getWordSize());
  return res;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rsp, %rax
movq $0x0, (%rax)
movq 0x10(%rdi), %r14
movq 0x18(%rdi), %rdi
movl 0x8(%rbx), %edx
leaq 0x8(%rsp), %rcx
movq %r14, (%rcx)
movq %rsi, 0x8(%rcx)
movq (%rdi), %r8
movq %rax, %rsi
callq *0x10(%r8)
testb $0x1, 0x24(%r14)
je 0x73522
movq (%rsp), %rdi
movl 0x8(%rbx), %esi
callq 0x3f6a0
movq %rax, (%rsp)
movq (%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
cmpl $0x1, %edx
jne 0x7354a
callq 0x3f910
movq $0x0, (%rsp)
callq 0x41a90
jmp 0x7350b
callq 0x41f00
nop
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/memstate.cc
// Function: MemoryImage::getPage(unsigned long, unsigned char*, int, int) const
void MemoryImage::getPage(uintb addr,uint1 *res,int4 skip,int4 size) const

{  // Assume that -addr- is page aligned
  AddrSpace *spc = getSpace();

  try {
    loader->loadFill(res,size,Address(spc,addr+skip));
  }
  catch(DataUnavailError &err) {
    // Pages not mapped in the load image, are assumed to be zero
    for(int4 i=0;i<size;++i)
      res[i] = 0;
  }
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %r8d, %ebp
movq %rdx, %rbx
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %rdi
movslq %ecx, %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq %rdx, 0x8(%rcx)
movq (%rdi), %rax
movq %rbx, %rsi
movl %r8d, %edx
callq *0x10(%rax)
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rdi
cmpl $0x1, %edx
jne 0x735ad
callq 0x3f910
testl %ebp, %ebp
jle 0x735a6
movl %ebp, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3fca0
callq 0x41a90
jmp 0x73582
callq 0x41f00
// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/memstate.cc
// Function: MemoryPageOverlay::insert(unsigned long, unsigned long)
void MemoryPageOverlay::insert(uintb addr,uintb val)

{
  uintb pageaddr = addr & ~((uintb)(getPageSize()-1));
  map<uintb,uint1 *>::iterator iter;

  uint1 *pageptr;

  iter = page.find(pageaddr);
  if (iter != page.end())
    pageptr = (*iter).second;
  else {
    pageptr = new uint1[getPageSize()];
    page[pageaddr] = pageptr;
    if (underlie == (MemoryBank *)0) {
      for(int4 i=0;i<getPageSize();++i)
	pageptr[i] = 0;
    }
    else
      underlie->getPage(pageaddr,pageptr,0,getPageSize());
  }
  
  uintb pageoffset = addr & ((uintb)(getPageSize()-1));
  deconstructValue(pageptr + pageoffset,val,getWordSize(),getSpace()->isBigEndian());
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movslq 0xc(%rdi), %rdi
movl %edi, %eax
negl %eax
movslq %eax, %rcx
andq %rsi, %rcx
movq %rcx, 0x8(%rsp)
movq 0x30(%r14), %rsi
leaq 0x28(%r14), %rax
movq %rax, %rdx
testq %rsi, %rsi
je 0x73625
movq %rax, %rdx
xorl %r8d, %r8d
cmpq %rcx, 0x20(%rsi)
setb %r8b
cmovaeq %rsi, %rdx
movq 0x10(%rsi,%r8,8), %rsi
testq %rsi, %rsi
jne 0x7360c
movq %rax, %rsi
cmpq %rax, %rdx
je 0x73638
cmpq 0x20(%rdx), %rcx
cmovbq %rax, %rdx
movq %rdx, %rsi
cmpq %rax, %rsi
je 0x73643
movq 0x28(%rsi), %r12
jmp 0x73691
leaq 0x20(%r14), %r13
callq 0x3f060
movq %rax, %r12
leaq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x403b0
movq %r12, (%rax)
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x7367e
movq 0x8(%rsp), %rsi
movl 0xc(%r14), %r8d
movq (%rdi), %rax
movq %r12, %rdx
xorl %ecx, %ecx
callq *0x10(%rax)
jmp 0x73691
movslq 0xc(%r14), %rdx
testq %rdx, %rdx
jle 0x73691
movq %r12, %rdi
xorl %esi, %esi
callq 0x3fca0
movslq 0xc(%r14), %rax
decq %rax
andq %r15, %rax
addq %r12, %rax
movl 0x8(%r14), %ecx
movq 0x10(%r14), %rdx
testb $0x1, 0x24(%rdx)
jne 0x736c3
testl %ecx, %ecx
jle 0x736db
xorl %edx, %edx
movb %bl, (%rax,%rdx)
shrq $0x8, %rbx
incq %rdx
cmpq %rdx, %rcx
jne 0x736b2
jmp 0x736db
testl %ecx, %ecx
jle 0x736db
incq %rcx
movb %bl, -0x2(%rax,%rcx)
shrq $0x8, %rbx
decq %rcx
cmpq $0x1, %rcx
jg 0x736ca
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop