// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/space.cc
// Function: OverlaySpace::restoreXml(Element const*)
void OverlaySpace::restoreXml(const Element *el)

{
  name = el->getAttributeValue("name");
  istringstream s1(el->getAttributeValue("index"));
  s1.unsetf(ios::dec | ios::hex | ios::oct);
  s1 >> index;
  
  string basename = el->getAttributeValue("base");
  baseSpace = getManager()->getSpaceByName(basename);
  if (baseSpace == (AddrSpace *)0)
    throw LowlevelError("Base space does not exist for overlay space: "+name);
  addressSize = baseSpace->getAddrSize();
  wordsize = baseSpace->getWordSize();
  delay = baseSpace->getDelay();
  deadcodedelay = baseSpace->getDeadcodeDelay();
  calcScaleMask();

  if (baseSpace->isBigEndian())
    setFlags(big_endian);
  if (baseSpace->hasPhysical())
    setFlags(hasphysical);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x33559(%rip), %rsi     # 0x7f031
leaq 0x33556(%rip), %rdx     # 0x7f035
leaq 0x48(%rsp), %rdi
callq 0x3f8a0
leaq 0x48(%rsp), %rsi
movq %r15, %rdi
callq 0x40f80
leaq 0x38(%rbx), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x3fc60
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x4bb1c
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x40880
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x33bf9(%rip), %rsi     # 0x7f726
leaq 0x33bf7(%rip), %rdx     # 0x7f72b
leaq 0x8(%rsp), %rdi
callq 0x3f8a0
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x40f80
leaq 0x48(%rsp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0x41c90
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4bb74
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40880
leaq 0x48(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
andl $-0x4b, 0x60(%rsp,%rax)
leaq 0x60(%rbx), %rsi
callq 0x3fe80
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x33f09(%rip), %rsi     # 0x7faa7
leaq 0x33f06(%rip), %rdx     # 0x7faab
leaq 0x28(%rsp), %rdi
callq 0x3f8a0
leaq 0x28(%rsp), %rsi
movq %r15, %rdi
callq 0x40f80
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0x3f8e0
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x4bbea
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x40880
movq 0x10(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x41fe0
movq %rax, 0x70(%rbx)
testq %rax, %rax
je 0x4bc9d
movl 0x58(%rax), %ecx
movl %ecx, 0x58(%rbx)
movl 0x5c(%rax), %edx
movl %edx, 0x5c(%rbx)
movq 0x64(%rax), %rsi
movq %rsi, 0x64(%rbx)
cmpl $0x8, %ecx
movl $0x8, %esi
cmovll %ecx, %esi
movslq %esi, %rcx
movq 0x56fa2(%rip), %rsi     # 0xa2bd0
leal -0x1(%rdx), %edi
imulq (%rsi,%rcx,8), %rdx
addq %rdx, %rdi
movq %rdi, 0x28(%rbx)
movl 0x24(%rax), %ecx
testb $0x1, %cl
je 0x4bc4c
orb $0x1, 0x24(%rbx)
movl 0x24(%rax), %ecx
btl $0x8, %ecx
jae 0x4bc56
orb $0x1, 0x25(%rbx)
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4bc6d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40880
movq 0x5709c(%rip), %rsi     # 0xa2d10
leaq 0x48(%rsp), %rdi
callq 0x41450
leaq 0xc0(%rsp), %rdi
callq 0x3f730
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x3fb00
movq %rax, %r15
leaq 0x33c3c(%rip), %rsi     # 0x7f8ed
leaq 0x28(%rsp), %rdi
movq %r14, %rdx
callq 0x40510
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %r15, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x571d1(%rip), %rsi     # 0xa2ea8
movq 0x56f5a(%rip), %rdx     # 0xa2c38
movq %r15, %rdi
callq 0x41d70
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x4bd00
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x40880
testb %bpl, %bpl
jne 0x4bd0a
jmp 0x4bd17
movq %rax, %rbx
movq %r15, %rdi
callq 0x40090
jmp 0x4bd17
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4bd50
movq 0x18(%rsp), %rsi
jmp 0x4bd48
jmp 0x4bd2a
movq %rax, %rbx
jmp 0x4bd50
jmp 0x4bd31
movq %rax, %rbx
jmp 0x4bd9e
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x4bd50
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x40880
movq 0x56fb9(%rip), %rsi     # 0xa2d10
leaq 0x48(%rsp), %rdi
callq 0x41450
leaq 0xc0(%rsp), %rdi
callq 0x3f730
jmp 0x4bd9e
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4bd9e
movq 0x18(%rsp), %rsi
jmp 0x4bd96
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x4bd9e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x40880
movq %rbx, %rdi
callq 0x41f10