// File: /workspace/github_cpp_makefile_star2_O3/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 $0x198, %rsp            # imm = 0x198
movq %rdx, 0x8(%rsp)
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $-0x1, 0x10(%rdi)
movq 0x40(%rsi), %rdi
movq 0x48(%rsi), %rax
subq %rdi, %rax
shrq $0x5, %rax
testl %eax, %eax
jle 0x43549
movq %rsi, %r15
leaq 0x8(%r14), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%r14), %rax
movq %rax, (%rsp)
xorl %r12d, %r12d
leaq 0x3c7cd(%rip), %rbx     # 0x7fb1d
leaq 0x18(%rsp), %rbp
xorl %r13d, %r13d
addq %r12, %rdi
movq %rbx, %rsi
callq 0x3f590
testl %eax, %eax
je 0x433b5
movq 0x40(%r15), %rdi
addq %r12, %rdi
leaq 0x3bc9f(%rip), %rsi     # 0x7f014
callq 0x3f590
testl %eax, %eax
je 0x433d7
movq 0x40(%r15), %rdi
addq %r12, %rdi
leaq 0x3bc8e(%rip), %rsi     # 0x7f01a
callq 0x3f590
testl %eax, %eax
je 0x43408
movq 0x40(%r15), %rdi
addq %r12, %rdi
leaq 0x3bc8e(%rip), %rsi     # 0x7f031
callq 0x3f590
testl %eax, %eax
jne 0x43452
jmp 0x434bd
movq 0x58(%r15), %rsi
addq %r12, %rsi
movq 0x8(%rsp), %rdi
callq 0x41fe0
movq %rax, (%r14)
testq %rax, %rax
jne 0x43452
jmp 0x434fa
movq 0x58(%r15), %rsi
addq %r12, %rsi
movq %rbp, %rdi
movl $0x8, %edx
callq 0x41c90
movq 0x18(%rsp), %rax
movq -0x18(%rax), %rax
andl $-0x4b, 0x30(%rsp,%rax)
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
callq 0x3fc90
jmp 0x43436
movq 0x58(%r15), %rsi
addq %r12, %rsi
movq %rbp, %rdi
movl $0x8, %edx
callq 0x41c90
movq 0x18(%rsp), %rax
movq -0x18(%rax), %rax
andl $-0x4b, 0x30(%rsp,%rax)
movq %rbp, %rdi
movq (%rsp), %rsi
callq 0x3fc90
movq %rbp, %rdi
movq 0x5f8d0(%rip), %rsi     # 0xa2d10
callq 0x41450
leaq 0x90(%rsp), %rdi
callq 0x3f730
incq %r13
movq 0x40(%r15), %rdi
movq 0x48(%r15), %rax
subq %rdi, %rax
shrq $0x5, %rax
cltq
addq $0x20, %r12
cmpq %rax, %r13
jl 0x43358
movq (%r14), %rcx
testq %rcx, %rcx
je 0x43549
movq (%rsp), %rax
movq (%rax), %rax
movq 0x28(%rcx), %rcx
cmpq %rax, %rcx
jae 0x434a4
incq %rcx
cqto
idivq %rcx
movq %rdx, %rax
sarq $0x3f, %rax
andq %rcx, %rax
addq %rdx, %rax
movq (%rsp), %rcx
movq %rax, (%rcx)
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x18(%rax), %rdi
addq 0x58(%r15), %r12
movq (%rdi), %rax
movq %r12, %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 0x43476
movl $0x20, %edi
callq 0x3fb00
movq %rax, %r14
addq 0x58(%r15), %r12
leaq 0x3bb0d(%rip), %rsi     # 0x7f01f
leaq 0x18(%rsp), %rdi
movq %r12, %rdx
callq 0x40510
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x5f970(%rip), %rsi     # 0xa2ea8
movq 0x5f6f9(%rip), %rdx     # 0xa2c38
movq %r14, %rdi
callq 0x41d70
jmp 0x4359f
movl $0x20, %edi
callq 0x3fb00
movq %rax, %r14
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x3bad0(%rip), %rsi     # 0x7f036
leaq 0x3baf0(%rip), %rdx     # 0x7f05d
leaq 0x18(%rsp), %rdi
callq 0x3f8a0
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x5f918(%rip), %rsi     # 0xa2ea8
movq 0x5f6a1(%rip), %rdx     # 0xa2c38
movq %r14, %rdi
callq 0x41d70
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
jne 0x435c3
jmp 0x435d0
jmp 0x435d7
jmp 0x435e4
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x435d0
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x40880
testb %bpl, %bpl
jne 0x435da
jmp 0x43605
movq %rax, %rbx
movq %r14, %rdi
callq 0x40090
jmp 0x43605
movq %rax, %rbx
movq 0x5f722(%rip), %rsi     # 0xa2d10
leaq 0x18(%rsp), %rdi
callq 0x41450
leaq 0x90(%rsp), %rdi
callq 0x3f730
movq %rbx, %rdi
callq 0x41f10
nop