// File: /workspace/github_cpp_makefile_star2_O1/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
leaq 0x10(%rdi), %rax
movq %rax, (%rsp)
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 0x434c7
movq %rsi, %r15
leaq 0x8(%r14), %rax
movq %rax, 0x10(%rsp)
xorl %r12d, %r12d
leaq 0x3c779(%rip), %rbx     # 0x7fb1d
leaq 0x18(%rsp), %rbp
xorl %r13d, %r13d
addq %r12, %rdi
movq %rbx, %rsi
callq 0x3f590
testl %eax, %eax
je 0x43409
movq 0x40(%r15), %rdi
addq %r12, %rdi
leaq 0x3bc4b(%rip), %rsi     # 0x7f014
callq 0x3f590
testl %eax, %eax
je 0x4342b
movq 0x40(%r15), %rdi
addq %r12, %rdi
leaq 0x3bc3a(%rip), %rsi     # 0x7f01a
callq 0x3f590
testl %eax, %eax
je 0x4345c
movq 0x40(%r15), %rdi
addq %r12, %rdi
leaq 0x3bc3a(%rip), %rsi     # 0x7f031
callq 0x3f590
testl %eax, %eax
jne 0x434a6
jmp 0x43511
movq 0x58(%r15), %rsi
addq %r12, %rsi
movq 0x8(%rsp), %rdi
callq 0x41fd0
movq %rax, (%r14)
testq %rax, %rax
jne 0x434a6
jmp 0x4354e
movq 0x58(%r15), %rsi
addq %r12, %rsi
movq %rbp, %rdi
movl $0x8, %edx
callq 0x41c80
movq 0x18(%rsp), %rax
movq -0x18(%rax), %rax
andl $-0x4b, 0x30(%rsp,%rax)
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
callq 0x3fc90
jmp 0x4348a
movq 0x58(%r15), %rsi
addq %r12, %rsi
movq %rbp, %rdi
movl $0x8, %edx
callq 0x41c80
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 0x5f87c(%rip), %rsi     # 0xa2d10
callq 0x41440
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 0x433ac
movq (%r14), %rcx
testq %rcx, %rcx
je 0x4359d
movq (%rsp), %rax
movq (%rax), %rax
movq 0x28(%rcx), %rcx
cmpq %rax, %rcx
jae 0x434f8
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), %rcx
movq %rcx, 0x8(%r14)
movl 0x10(%rax), %eax
addq %rcx, %rax
decq %rax
movq %rax, 0x10(%r14)
jmp 0x434c7
movl $0x20, %edi
callq 0x3fb00
movq %rax, %r14
addq 0x58(%r15), %r12
leaq 0x3bab9(%rip), %rsi     # 0x7f01f
leaq 0x18(%rsp), %rdi
movq %r12, %rdx
callq 0x40500
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x5f91c(%rip), %rsi     # 0xa2ea8
movq 0x5f6a5(%rip), %rdx     # 0xa2c38
movq %r14, %rdi
callq 0x41d60
jmp 0x435f3
movl $0x20, %edi
callq 0x3fb00
movq %rax, %r14
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x3ba7c(%rip), %rsi     # 0x7f036
leaq 0x3ba9c(%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 0x5f8c4(%rip), %rsi     # 0xa2ea8
movq 0x5f64d(%rip), %rdx     # 0xa2c38
movq %r14, %rdi
callq 0x41d60
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
jne 0x43617
jmp 0x4362c
jmp 0x43626
jmp 0x4363b
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4362c
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x40870
jmp 0x4362c
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x4365c
movq %r14, %rdi
callq 0x40080
jmp 0x4365c
movq %rax, %rbx
movq 0x5f6cb(%rip), %rsi     # 0xa2d10
leaq 0x18(%rsp), %rdi
callq 0x41440
leaq 0x90(%rsp), %rdi
callq 0x3f730
movq %rbx, %rdi
callq 0x41f00