// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/space.cc
// Function: AddrSpace::read(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int&) const
uintb AddrSpace::read(const string &s,int4 &size) const

{
  const char *enddata;
  char *tmpdata;
  int4 expsize;
  string::size_type append;
  string frontpart;
  uintb offset;
  
  append = s.find_first_of(":+");
  try {
    if (append == string::npos) {
      const VarnodeData &point(trans->getRegister(s));
      offset = point.offset;
      size = point.size;
    }
    else {
      frontpart = s.substr(0,append);
      const VarnodeData &point(trans->getRegister(frontpart));
      offset = point.offset;
      size = point.size;
    }
  }
  catch(LowlevelError &err) {	// Name doesn't exist
    offset = strtoul(s.c_str(),&tmpdata,0);
    offset = addressToByte(offset,wordsize);
    enddata = (const char *) tmpdata;
    if (enddata - s.c_str() == s.size()) { // If no size or offset override
      size = manage->getDefaultSize();	// Return "natural" size
      return offset;
    }
    size = manage->getDefaultSize();
  }
  if (append != string::npos) {
    enddata = s.c_str()+append;
    expsize = get_offset_size( enddata, offset );
    if (expsize!=-1) {
      size = expsize;
      return offset;
    }
  }
  return offset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r13
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x35d03(%rip), %rsi     # 0x7f779
movl $0x2, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x416c0
movq %rax, %r14
movq %rax, %r12
cmpq $-0x1, %rax
je 0x49add
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x408c0
movq %rsp, %rdi
leaq 0x48(%rsp), %rbp
movq %rbp, %rsi
callq 0x40da0
movq (%rbp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x49ace
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x40870
movq 0x18(%r13), %rdi
movq (%rdi), %rax
movq %rsp, %rsi
callq *0x38(%rax)
jmp 0x49aea
movq 0x18(%r13), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x38(%rax)
movq 0x8(%rax), %rbp
movl 0x10(%rax), %eax
movl %eax, (%rbx)
cmpq $-0x1, %r14
je 0x49b3c
movq (%r15), %rax
addq %rax, %r14
cmpb $0x3a, (%rax,%r12)
jne 0x49b41
leaq 0x1(%r14), %rdi
leaq 0x48(%rsp), %r13
xorl %r12d, %r12d
movq %r13, %rsi
xorl %edx, %edx
callq 0x3f700
movq %rax, %r15
movq (%r13), %rdi
cmpb $0x2b, (%rdi)
jne 0x49b4a
incq %rdi
leaq 0x48(%rsp), %rsi
xorl %edx, %edx
callq 0x3f700
movq %rax, %r12
jmp 0x49b4a
movq %rbp, %r13
jmp 0x49b74
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
xorl %r12d, %r12d
cmpb $0x2b, (%r14)
jne 0x49b65
incq %r14
leaq 0x48(%rsp), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x3f700
movq %rax, %r12
movl %r12d, %r13d
addq %rbp, %r13
cmpl $-0x1, %r15d
je 0x49b74
movl %r15d, (%rbx)
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x49b8f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40870
movq %r13, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x49ba5
jmp 0x49ba5
movq %rax, %rbp
cmpl $0x1, %edx
jne 0x49c29
movq %rbp, %rdi
callq 0x3f910
movq (%r15), %rdi
leaq 0x40(%rsp), %rsi
xorl %edx, %edx
callq 0x3f700
movq %rax, %rbp
movl 0x5c(%r13), %eax
movq %rax, 0x28(%rsp)
leaq 0x40(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movq (%r15), %rax
movq %rax, 0x20(%rsp)
movq 0x8(%r15), %rax
movq %rax, 0x30(%rsp)
movq 0x10(%r13), %rax
movq 0xa0(%rax), %rax
movl 0x58(%rax), %eax
movl %eax, (%rbx)
callq 0x41a90
movq 0x38(%rsp), %rax
subq 0x20(%rsp), %rax
imulq 0x28(%rsp), %rbp
movq %rbp, %r13
cmpq 0x30(%rsp), %rax
jne 0x49af3
jmp 0x49b74
movq %rax, %rbp
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x49c44
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40870
movq %rbp, %rdi
callq 0x41f00