// File: /workspace/github_cpp_makefile_star2_O2/jstaursky[P]hutch/src/Sleigh/address.cc
// Function: Range::restoreXml(Element const*, AddrSpaceManager const*)
void Range::restoreXml(const Element *el,const AddrSpaceManager *manage)

{
  spc = (AddrSpace *)0;
  first = 0;
  last = ~((uintb)0);
  for(int4 i=0;i<el->getNumAttributes();++i) {
    if (el->getAttributeName(i) == "space") {
      spc = manage->getSpaceByName(el->getAttributeValue(i));
      if (spc == (AddrSpace *)0)
        throw LowlevelError("Undefined space: "+el->getAttributeValue(i));
    }
    else if (el->getAttributeName(i) == "first") {
      istringstream s(el->getAttributeValue(i));
      s.unsetf(ios::dec | ios::hex | ios::oct);
      s >> first;
    }
    else if (el->getAttributeName(i) == "last") {
      istringstream s(el->getAttributeValue(i));
      s.unsetf(ios::dec | ios::hex | ios::oct);
      s >> last;
    }
    else if (el->getAttributeName(i) == "name") {
      const Translate *trans = manage->getDefaultSpace()->getTrans();
      const VarnodeData &point(trans->getRegister(el->getAttributeValue(i)));
      spc = point.space;
      first = point.offset;
      last = (first-1) + point.size;
      break;		// There should be no (space,first,last) attributes
    }
  }
  if (spc == (AddrSpace *)0)
	  throw LowlevelError("No address space indicated in range tag");
  last = spc->wrapOffset(last);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdx, 0x18(%rsp)
movq %rsi, %r12
movq %rdi, %r14
leaq 0x8(%rdi), %rax
movq %rax, 0x20(%rsp)
leaq 0x10(%rdi), %rax
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
orq $-0x1, 0x10(%rdi)
xorl %r15d, %r15d
leaq 0x342a4(%rip), %rbx     # 0x86afd
leaq 0x28(%rsp), %rbp
xorl %r13d, %r13d
movq 0x40(%r12), %rdi
movq 0x48(%r12), %rax
subq %rdi, %rax
shrq $0x5, %rax
cltq
cmpq %rax, %r13
jge 0x5296b
addq %r15, %rdi
movq %rbx, %rsi
callq 0x520f0
testb %al, %al
je 0x528af
movq 0x58(%r12), %rsi
addq %r15, %rsi
movq 0x18(%rsp), %rdi
callq 0x519f0
movq %rax, (%r14)
testq %rax, %rax
jne 0x5295f
jmp 0x529f5
movq 0x40(%r12), %rdi
addq %r15, %rdi
leaq 0x33756(%rip), %rsi     # 0x86014
callq 0x520f0
testb %al, %al
je 0x528f7
movq 0x58(%r12), %rsi
addq %r15, %rsi
movq %rbp, %rdi
pushq $0x8
popq %rdx
callq 0x51500
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
andl $-0x4b, 0x40(%rsp,%rax)
movq %rbp, %rdi
movq 0x20(%rsp), %rsi
callq 0x4e460
jmp 0x5293d
movq 0x40(%r12), %rdi
addq %r15, %rdi
leaq 0x33714(%rip), %rsi     # 0x8601a
callq 0x520f0
testb %al, %al
je 0x52947
movq 0x58(%r12), %rsi
addq %r15, %rsi
movq %rbp, %rdi
pushq $0x8
popq %rdx
callq 0x51500
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
andl $-0x4b, 0x40(%rsp,%rax)
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
callq 0x4e460
movq %rbp, %rdi
callq 0x4e070
jmp 0x5295f
movq 0x40(%r12), %rdi
addq %r15, %rdi
leaq 0x336db(%rip), %rsi     # 0x86031
callq 0x520f0
testb %al, %al
jne 0x529b7
incq %r13
addq $0x20, %r15
jmp 0x52861
movq (%r14), %rcx
testq %rcx, %rcx
je 0x52a43
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rcx), %rcx
cmpq %rax, %rcx
jae 0x5299d
incq %rcx
cqto
idivq %rcx
movq %rdx, %rax
sarq $0x3f, %rax
andq %rcx, %rax
addq %rdx, %rax
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x18(%rax), %rdi
addq 0x58(%r12), %r15
movq (%rdi), %rax
movq %r15, %rsi
callq *0x38(%rax)
movq (%rax), %rcx
movq %rcx, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%r14)
movl 0x10(%rax), %eax
addq %rdx, %rax
decq %rax
movq %rax, 0x10(%r14)
jmp 0x5296e
pushq $0x20
popq %rdi
callq 0x4e180
movq %rax, %r14
addq 0x58(%r12), %r15
leaq 0x33613(%rip), %rsi     # 0x8601f
leaq 0x28(%rsp), %rdi
movq %r15, %rdx
callq 0x4f1c0
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x4ddf0
xorl %ebp, %ebp
movq 0x5c46e(%rip), %rsi     # 0xaeea0
movq 0x5c1ff(%rip), %rdx     # 0xaec38
movq %r14, %rdi
callq 0x51630
jmp 0x52a8c
pushq $0x20
popq %rdi
callq 0x4e180
movq %rax, %r14
leaq 0x335e1(%rip), %rsi     # 0x86036
leaq 0x28(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x515e0
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x4ddf0
xorl %ebp, %ebp
movq 0x5c423(%rip), %rsi     # 0xaeea0
movq 0x5c1b4(%rip), %rdx     # 0xaec38
movq %r14, %rdi
callq 0x51630
jmp 0x52a92
jmp 0x52aa6
jmp 0x52ab3
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4e020
testb %bpl, %bpl
jne 0x52aa9
jmp 0x52ac0
movq %rax, %rbx
movq %r14, %rdi
callq 0x4ea60
jmp 0x52ac0
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4e070
movq %rbx, %rdi
callq 0x518c0