// File: /workspace/github_cpp_makefile_star2_O2/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, %rbp
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x2ea20(%rip), %rsi     # 0x86779
movq %r15, %rdi
xorl %edx, %edx
callq 0x4e250
movq %rax, %r14
movq %rax, %r12
cmpq $-0x1, %rax
je 0x57e0c
movq %rbx, (%rsp)
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x4f700
leaq 0x40(%rsp), %r13
leaq 0x20(%rsp), %rbx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4fef0
movq %rbx, %rdi
callq 0x4e020
movq 0x18(%rbp), %rdi
movq (%rdi), %rax
movq %r13, %rsi
callq *0x38(%rax)
movq 0x8(%rax), %r13
movl 0x10(%rax), %eax
movq (%rsp), %rbx
movl %eax, (%rbx)
movq (%r15), %rax
addq %rax, %r14
movb (%rax,%r12), %al
cmpb $0x3a, %al
jne 0x57e23
movq %rbx, %rbp
leaq 0x1(%r14), %rdi
leaq 0x20(%rsp), %rbx
xorl %r12d, %r12d
movq %rbx, %rsi
xorl %edx, %edx
callq 0x4db40
movq %rax, %r15
movq (%rbx), %rdi
cmpb $0x2b, (%rdi)
jne 0x57e04
incq %rdi
leaq 0x20(%rsp), %rsi
xorl %edx, %edx
callq 0x4db40
movq %rax, %r12
movb (%r14), %al
movq %rbp, %rbx
jmp 0x57e2a
movq 0x18(%rbp), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x38(%rax)
movq 0x8(%rax), %rcx
movl 0x10(%rax), %r15d
jmp 0x57e52
pushq $-0x1
popq %r15
xorl %r12d, %r12d
cmpb $0x2b, %al
jne 0x57e43
incq %r14
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x4db40
movq %rax, %r12
movl %r12d, %ecx
addq %r13, %rcx
movq %rcx, %r13
cmpl $-0x1, %r15d
je 0x57e58
movl %r15d, (%rbx)
movq %rcx, %r13
leaq 0x40(%rsp), %rdi
callq 0x4e020
movq %r13, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, (%rsp)
jmp 0x57e7c
jmp 0x57e7c
movq %rax, %r13
cmpl $0x1, %edx
jne 0x57f02
movq %r13, %rdi
callq 0x4de70
movq (%r15), %rdi
leaq 0x60(%rsp), %rbx
movq %rbx, %rsi
xorl %edx, %edx
callq 0x4db40
movq %rax, %r13
movl 0x5c(%rbp), %eax
movq %rax, 0x18(%rsp)
movq (%rbx), %rbx
movq (%r15), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%r15), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rbp), %rax
movq 0xa0(%rax), %rax
movl 0x58(%rax), %eax
movq (%rsp), %rcx
movl %eax, (%rcx)
callq 0x51210
imulq 0x18(%rsp), %r13
cmpq $-0x1, %r14
je 0x57e58
subq 0x10(%rsp), %rbx
cmpq 0x8(%rsp), %rbx
movq (%rsp), %rbx
jne 0x57dc0
jmp 0x57e58
movq %rax, %r13
leaq 0x40(%rsp), %rdi
callq 0x4e020
movq %r13, %rdi
callq 0x518c0