// File: 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:
subq $0x2f8, %rsp            # imm = 0x2F8
movq %rdi, 0x2f0(%rsp)
movq %rsi, 0x2e8(%rsp)
movq 0x2f0(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x2e8(%rsp), %rax
movq %rax, 0x88(%rsp)
leaq 0x2c7(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0xe0c80
movq 0x90(%rsp), %rdx
leaq 0x8da86(%rip), %rsi     # 0x187031
leaq 0x2c8(%rsp), %rdi
callq 0xe00a0
jmp 0xf95ba
movq 0x88(%rsp), %rdi
leaq 0x2c8(%rsp), %rsi
callq 0xdb6f0
movq %rax, 0x78(%rsp)
jmp 0xf95d6
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdi
addq $0x38, %rdi
callq 0xce450
jmp 0xf95ee
leaq 0x2c8(%rsp), %rdi
callq 0xd4550
leaq 0x2c7(%rsp), %rdi
callq 0xd8ec0
movq 0x2e8(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x10f(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0xe0c80
movq 0x70(%rsp), %rdx
leaq 0x8e173(%rip), %rsi     # 0x1877a6
leaq 0x110(%rsp), %rdi
callq 0xe00a0
jmp 0xf9642
movq 0x68(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0xdb6f0
movq %rax, 0x60(%rsp)
jmp 0xf965b
movq 0x60(%rsp), %rsi
leaq 0x130(%rsp), %rdi
movl $0x8, %edx
callq 0xdfcc0
jmp 0xf9674
leaq 0x110(%rsp), %rdi
callq 0xd4550
leaq 0x10f(%rsp), %rdi
callq 0xd8ec0
movq 0x130(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x130(%rsp,%rax), %rax
movq %rax, 0x50(%rsp)
movl $0x2, %edi
movl $0x8, %esi
callq 0xe0e70
movl %eax, 0x5c(%rsp)
jmp 0xf96bc
movl 0x5c(%rsp), %edi
movl $0x40, %esi
callq 0xe0e70
movl %eax, 0x4c(%rsp)
jmp 0xf96d0
movl 0x4c(%rsp), %esi
movq 0x50(%rsp), %rdi
callq 0xda6e0
jmp 0xf96e0
movq 0x80(%rsp), %rsi
addq $0x60, %rsi
leaq 0x130(%rsp), %rdi
callq 0xd4480
jmp 0xf96fb
movq 0x2e8(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0xc7(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0xe0c80
movq 0x40(%rsp), %rdx
leaq 0x8e37d(%rip), %rsi     # 0x187aa3
leaq 0xc8(%rsp), %rdi
callq 0xe00a0
jmp 0xf9735
movq 0x38(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0xdb6f0
movq %rax, 0x30(%rsp)
jmp 0xf974e
movq 0x30(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
callq 0xd2230
jmp 0xf9762
leaq 0xc8(%rsp), %rdi
callq 0xd4550
leaq 0xc7(%rsp), %rdi
callq 0xd8ec0
movq 0x80(%rsp), %rdi
callq 0xd6150
movq %rax, 0x28(%rsp)
jmp 0xf9790
movq 0x28(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0xe10d0
movq %rax, 0x20(%rsp)
jmp 0xf97a9
movq 0x80(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rcx, 0x70(%rax)
cmpq $0x0, 0x70(%rax)
jne 0xf9996
movb $0x1, 0x9f(%rsp)
movl $0x20, %edi
callq 0xd2b40
movq 0x80(%rsp), %rdx
movq %rax, 0x18(%rsp)
addq $0x38, %rdx
leaq 0x8e17e(%rip), %rsi     # 0x18796d
leaq 0xa0(%rsp), %rdi
callq 0xd7370
jmp 0xf97fe
movq 0x18(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xd1ae0
jmp 0xf9812
movq 0x18(%rsp), %rdi
movb $0x0, 0x9f(%rsp)
movq 0xce66a(%rip), %rsi     # 0x1c7e90
movq 0xce3a3(%rip), %rdx     # 0x1c7bd0
callq 0xe01f0
jmp 0xf9ad4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
jmp 0xf986e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
leaq 0x2c8(%rsp), %rdi
callq 0xd4550
leaq 0x2c7(%rsp), %rdi
callq 0xd8ec0
jmp 0xf9ac7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
jmp 0xf98b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
leaq 0x110(%rsp), %rdi
callq 0xd4550
leaq 0x10f(%rsp), %rdi
callq 0xd8ec0
jmp 0xf9ac7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
jmp 0xf9aba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
jmp 0xf9919
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0xd4550
leaq 0xc7(%rsp), %rdi
callq 0xd8ec0
jmp 0xf9aba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
jmp 0xf9aad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
jmp 0xf997b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0xd4550
testb $0x1, 0x9f(%rsp)
jne 0xf9987
jmp 0xf9991
movq 0x18(%rsp), %rdi
callq 0xd5400
jmp 0xf9aad
movq 0x80(%rsp), %rax
movq 0x70(%rax), %rdi
callq 0xd7510
movl %eax, 0x14(%rsp)
jmp 0xf99ad
movq 0x80(%rsp), %rax
movl 0x14(%rsp), %ecx
movl %ecx, 0x58(%rax)
movq 0x70(%rax), %rdi
callq 0xde1c0
movl %eax, 0x10(%rsp)
jmp 0xf99cb
movq 0x80(%rsp), %rax
movl 0x10(%rsp), %ecx
movl %ecx, 0x5c(%rax)
movq 0x70(%rax), %rdi
callq 0xd4900
movl %eax, 0xc(%rsp)
jmp 0xf99e9
movq 0x80(%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, 0x64(%rax)
movq 0x70(%rax), %rdi
callq 0xe1560
movl %eax, 0x8(%rsp)
jmp 0xf9a07
movq 0x80(%rsp), %rdi
movl 0x8(%rsp), %eax
movl %eax, 0x68(%rdi)
callq 0xd4760
jmp 0xf9a1d
movq 0x80(%rsp), %rax
movq 0x70(%rax), %rdi
callq 0xddec0
movb %al, 0x7(%rsp)
jmp 0xf9a34
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0xf9a3e
jmp 0xf9a54
movq 0x80(%rsp), %rdi
movl $0x1, %esi
callq 0xd7ff0
jmp 0xf9a52
jmp 0xf9a54
movq 0x80(%rsp), %rax
movq 0x70(%rax), %rdi
callq 0xdd260
movb %al, 0x6(%rsp)
jmp 0xf9a6b
movb 0x6(%rsp), %al
testb $0x1, %al
jne 0xf9a75
jmp 0xf9a8b
movq 0x80(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0xd7ff0
jmp 0xf9a89
jmp 0xf9a8b
leaq 0xe8(%rsp), %rdi
callq 0xd4550
leaq 0x130(%rsp), %rdi
callq 0xd25a0
addq $0x2f8, %rsp            # imm = 0x2F8
retq
leaq 0xe8(%rsp), %rdi
callq 0xd4550
leaq 0x130(%rsp), %rdi
callq 0xd25a0
movq 0x2b8(%rsp), %rdi
callq 0xe0be0
nopw %cs:(%rax,%rax)
nop