// File: /workspace/github_cpp_makefile_star2_O3/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 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x35d79(%rip), %rsi     # 0x7f779
movl $0x2, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x416d0
movq %rax, %r14
movq %rax, %r12
cmpq $-0x1, %rax
je 0x49ab9
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x408d0
movq %rsp, %rdi
leaq 0x48(%rsp), %r13
movq %r13, %rsi
callq 0x40db0
movq (%r13), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x49a5c
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x40880
movq 0x18(%rbp), %rdi
movq (%rdi), %rax
movq %rsp, %rsi
callq *0x38(%rax)
movq 0x8(%rax), %r13
movl 0x10(%rax), %eax
movl %eax, (%rbx)
movq (%r15), %rax
addq %rax, %r14
movb (%rax,%r12), %al
cmpb $0x3a, %al
jne 0x49ad0
leaq 0x1(%r14), %rdi
leaq 0x48(%rsp), %rbp
xorl %r12d, %r12d
movq %rbp, %rsi
xorl %edx, %edx
callq 0x3f700
movq %rax, %r15
movq (%rbp), %rdi
cmpb $0x2b, (%rdi)
jne 0x49ab4
incq %rdi
leaq 0x48(%rsp), %rsi
xorl %edx, %edx
callq 0x3f700
movq %rax, %r12
movb (%r14), %al
jmp 0x49ad9
movq 0x18(%rbp), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x38(%rax)
movq 0x8(%rax), %rcx
movl 0x10(%rax), %r15d
jmp 0x49b01
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
xorl %r12d, %r12d
cmpb $0x2b, %al
jne 0x49af2
incq %r14
leaq 0x48(%rsp), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x3f700
movq %rax, %r12
movl %r12d, %ecx
addq %r13, %rcx
movq %rcx, %r13
cmpl $-0x1, %r15d
je 0x49b07
movl %r15d, (%rbx)
movq %rcx, %r13
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x49b22
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40880
movq %r13, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x49b38
jmp 0x49b38
movq %rax, %r13
cmpl $0x1, %edx
jne 0x49bc6
movq %r13, %rdi
callq 0x3f910
movq (%r15), %rdi
leaq 0x40(%rsp), %rsi
xorl %edx, %edx
callq 0x3f700
movq %rax, %r13
movl 0x5c(%rbp), %eax
movq %rax, 0x38(%rsp)
leaq 0x40(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq (%r15), %rax
movq %rax, 0x28(%rsp)
movq 0x8(%r15), %rax
movq %rax, 0x20(%rsp)
movq 0x10(%rbp), %rax
movq 0xa0(%rax), %rax
movl 0x58(%rax), %eax
movl %eax, (%rbx)
callq 0x41aa0
imulq 0x38(%rsp), %r13
cmpq $-0x1, %r14
je 0x49b07
movq 0x30(%rsp), %rax
subq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
jne 0x49a72
jmp 0x49b07
movq %rax, %r13
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x49be1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x40880
movq %r13, %rdi
callq 0x41f10
nop