// File: jstaursky[P]hutch/src/Sleigh/slghsymbol.cc
// Function: SymbolTable::restoreXml(Element const*, SleighBase*)
void SymbolTable::restoreXml(const Element *el,SleighBase *trans)

{
  {
    uint4 size;
    istringstream s(el->getAttributeValue("scopesize"));
    s.unsetf(ios::dec | ios::hex | ios::oct);
    s >> size;
    table.resize(size,(SymbolScope *)0);
  }
  {
    uint4 size;
    istringstream s(el->getAttributeValue("symbolsize"));
    s.unsetf(ios::dec | ios::hex | ios::oct);
    s >> size;
    symbollist.resize(size,(SleighSymbol *)0);
  }
  const List &list(el->getChildren());
  List::const_iterator iter;
  iter = list.begin();
  for(int4 i=0;i<table.size();++i) { // Restore the scopes
    Element *subel = *iter;
    if (subel->getName() != "scope")
      throw SleighError("Misnumbered symbol scopes");
    uintm id;
    uintm parent;
    {
      istringstream s(subel->getAttributeValue("id"));
      s.unsetf(ios::dec | ios::hex | ios::oct);
      s >> id;
    }
    {
      istringstream s(subel->getAttributeValue("parent"));
      s.unsetf(ios::dec | ios::hex | ios::oct);
      s >> parent;
    }
    SymbolScope *parscope = (parent==id) ? (SymbolScope *)0 : table[parent];
    table[id] = new SymbolScope( parscope, id );
    ++iter;
  }
  curscope = table[0];		// Current scope is global

				// Now restore the symbol shells
  for(int4 i=0;i<symbollist.size();++i) {
    restoreSymbolHeader(*iter);
    ++iter;
  }
				// Now restore the symbol content
  while(iter != list.end()) {
    Element *subel = *iter;
    uintm id;
    SleighSymbol *sym;
    {
      istringstream s(subel->getAttributeValue("id"));
      s.unsetf(ios::dec | ios::hex | ios::oct);
      s >> id;
    }
    sym = findSymbol(id);
    sym->restoreXml(subel,trans);
    ++iter;
  }
}

// Assembly:
subq $0xa48, %rsp            # imm = 0xA48
movq %rdi, 0xa40(%rsp)
movq %rsi, 0xa38(%rsp)
movq %rdx, 0xa30(%rsp)
movq 0xa40(%rsp), %rax
movq %rax, 0x118(%rsp)
movq 0xa38(%rsp), %rax
movq %rax, 0x120(%rsp)
leaq 0x887(%rsp), %rdi
movq %rdi, 0x128(%rsp)
callq 0xe0c80
movq 0x128(%rsp), %rdx
leaq 0x4b1e1(%rip), %rsi     # 0x188f74
leaq 0x888(%rsp), %rdi
callq 0xe00a0
jmp 0x13dda2
movq 0x120(%rsp), %rdi
leaq 0x888(%rsp), %rsi
callq 0xdb6f0
movq %rax, 0x110(%rsp)
jmp 0x13ddc1
movq 0x110(%rsp), %rsi
leaq 0x8a8(%rsp), %rdi
movl $0x8, %edx
callq 0xdfcc0
jmp 0x13dddd
leaq 0x888(%rsp), %rdi
callq 0xd4550
leaq 0x887(%rsp), %rdi
callq 0xd8ec0
movq 0x8a8(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x8a8(%rsp,%rax), %rax
movq %rax, 0x100(%rsp)
movl $0x2, %edi
movl $0x8, %esi
callq 0xe0e70
movl %eax, 0x10c(%rsp)
jmp 0x13de2b
movl 0x10c(%rsp), %edi
movl $0x40, %esi
callq 0xe0e70
movl %eax, 0xfc(%rsp)
jmp 0x13de45
movl 0xfc(%rsp), %esi
movq 0x100(%rsp), %rdi
callq 0xda6e0
jmp 0x13de5b
leaq 0x8a8(%rsp), %rdi
leaq 0xa2c(%rsp), %rsi
callq 0xceae0
jmp 0x13de72
movq 0x118(%rsp), %rdi
addq $0x18, %rdi
movl 0xa2c(%rsp), %eax
movl %eax, %esi
movq $0x0, 0x868(%rsp)
leaq 0x868(%rsp), %rdx
callq 0xdef60
jmp 0x13dea2
leaq 0x8a8(%rsp), %rdi
callq 0xd25a0
movq 0xa38(%rsp), %rax
movq %rax, 0xe8(%rsp)
leaq 0x6bf(%rsp), %rdi
movq %rdi, 0xf0(%rsp)
callq 0xe0c80
movq 0xf0(%rsp), %rdx
leaq 0x4b09b(%rip), %rsi     # 0x188f7e
leaq 0x6c0(%rsp), %rdi
callq 0xe00a0
jmp 0x13def2
movq 0xe8(%rsp), %rdi
leaq 0x6c0(%rsp), %rsi
callq 0xdb6f0
movq %rax, 0xe0(%rsp)
jmp 0x13df11
movq 0xe0(%rsp), %rsi
leaq 0x6e0(%rsp), %rdi
movl $0x8, %edx
callq 0xdfcc0
jmp 0x13df2d
leaq 0x6c0(%rsp), %rdi
callq 0xd4550
leaq 0x6bf(%rsp), %rdi
callq 0xd8ec0
movq 0x6e0(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x6e0(%rsp,%rax), %rax
movq %rax, 0xd0(%rsp)
movl $0x2, %edi
movl $0x8, %esi
callq 0xe0e70
movl %eax, 0xdc(%rsp)
jmp 0x13df7b
movl 0xdc(%rsp), %edi
movl $0x40, %esi
callq 0xe0e70
movl %eax, 0xcc(%rsp)
jmp 0x13df95
movl 0xcc(%rsp), %esi
movq 0xd0(%rsp), %rdi
callq 0xda6e0
jmp 0x13dfab
leaq 0x6e0(%rsp), %rdi
leaq 0x864(%rsp), %rsi
callq 0xceae0
jmp 0x13dfc2
movq 0x118(%rsp), %rdi
movl 0x864(%rsp), %eax
movl %eax, %esi
movq $0x0, 0x6b0(%rsp)
leaq 0x6b0(%rsp), %rdx
callq 0xda280
jmp 0x13dfee
leaq 0x6e0(%rsp), %rdi
callq 0xd25a0
movq 0xa38(%rsp), %rdi
callq 0xde930
movq %rax, 0x6a8(%rsp)
leaq 0x6a0(%rsp), %rdi
callq 0xd03e0
movq 0x6a8(%rsp), %rdi
callq 0xd4960
movq %rax, 0x698(%rsp)
movq 0x698(%rsp), %rax
movq %rax, 0x6a0(%rsp)
movl $0x0, 0x694(%rsp)
movq 0x118(%rsp), %rdi
movslq 0x694(%rsp), %rax
movq %rax, 0xc0(%rsp)
addq $0x18, %rdi
callq 0xdd9b0
movq %rax, %rcx
movq 0xc0(%rsp), %rax
cmpq %rcx, %rax
jae 0x13e665
leaq 0x6a0(%rsp), %rdi
callq 0xddc90
movq (%rax), %rax
movq %rax, 0x688(%rsp)
movq 0x688(%rsp), %rdi
callq 0xcea10
movq %rax, %rdi
leaq 0x4aed8(%rip), %rsi     # 0x188f89
callq 0xd6530
testb $0x1, %al
jne 0x13e0bf
jmp 0x13e28b
movb $0x1, 0x666(%rsp)
movl $0x20, %edi
callq 0xd2b40
movq %rax, 0xb0(%rsp)
leaq 0x667(%rsp), %rdi
movq %rdi, 0xb8(%rsp)
callq 0xe0c80
movq 0xb8(%rsp), %rdx
leaq 0x4ae92(%rip), %rsi     # 0x188f8f
leaq 0x668(%rsp), %rdi
callq 0xe00a0
jmp 0x13e10c
movq 0xb0(%rsp), %rdi
leaq 0x668(%rsp), %rsi
callq 0xd06e0
jmp 0x13e123
movq 0xb0(%rsp), %rdi
movb $0x0, 0x666(%rsp)
movq 0x89d2e(%rip), %rsi     # 0x1c7e68
movq 0x898df(%rip), %rdx     # 0x1c7a20
callq 0xe01f0
jmp 0x13e90e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
jmp 0x13e182
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
leaq 0x888(%rsp), %rdi
callq 0xd4550
leaq 0x887(%rsp), %rdi
callq 0xd8ec0
jmp 0x13e901
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
leaq 0x8a8(%rsp), %rdi
callq 0xd25a0
jmp 0x13e901
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
jmp 0x13e1f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
leaq 0x6c0(%rsp), %rdi
callq 0xd4550
leaq 0x6bf(%rsp), %rdi
callq 0xd8ec0
jmp 0x13e901
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
leaq 0x6e0(%rsp), %rdi
callq 0xd25a0
jmp 0x13e901
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
jmp 0x13e260
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
leaq 0x668(%rsp), %rdi
callq 0xd4550
leaq 0x667(%rsp), %rdi
callq 0xd8ec0
testb $0x1, 0x666(%rsp)
jne 0x13e279
jmp 0x13e286
movq 0xb0(%rsp), %rdi
callq 0xd5400
jmp 0x13e901
movq 0x688(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0x4b7(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
callq 0xe0c80
movq 0xa8(%rsp), %rdx
leaq 0x49a4d(%rip), %rsi     # 0x187d0c
leaq 0x4b8(%rsp), %rdi
callq 0xe00a0
jmp 0x13e2ce
movq 0xa0(%rsp), %rdi
leaq 0x4b8(%rsp), %rsi
callq 0xdb6f0
movq %rax, 0x98(%rsp)
jmp 0x13e2ed
movq 0x98(%rsp), %rsi
leaq 0x4d8(%rsp), %rdi
movl $0x8, %edx
callq 0xdfcc0
jmp 0x13e309
leaq 0x4b8(%rsp), %rdi
callq 0xd4550
leaq 0x4b7(%rsp), %rdi
callq 0xd8ec0
movq 0x4d8(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x4d8(%rsp,%rax), %rax
movq %rax, 0x88(%rsp)
movl $0x2, %edi
movl $0x8, %esi
callq 0xe0e70
movl %eax, 0x94(%rsp)
jmp 0x13e357
movl 0x94(%rsp), %edi
movl $0x40, %esi
callq 0xe0e70
movl %eax, 0x84(%rsp)
jmp 0x13e371
movl 0x84(%rsp), %esi
movq 0x88(%rsp), %rdi
callq 0xda6e0
jmp 0x13e387
leaq 0x4d8(%rsp), %rdi
leaq 0x660(%rsp), %rsi
callq 0xceae0
jmp 0x13e39e
leaq 0x4d8(%rsp), %rdi
callq 0xd25a0
movq 0x688(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x30f(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0xe0c80
movq 0x78(%rsp), %rdx
leaq 0x4b1d0(%rip), %rsi     # 0x1895a6
leaq 0x310(%rsp), %rdi
callq 0xe00a0
jmp 0x13e3e5
movq 0x70(%rsp), %rdi
leaq 0x310(%rsp), %rsi
callq 0xdb6f0
movq %rax, 0x68(%rsp)
jmp 0x13e3fe
movq 0x68(%rsp), %rsi
leaq 0x330(%rsp), %rdi
movl $0x8, %edx
callq 0xdfcc0
jmp 0x13e417
leaq 0x310(%rsp), %rdi
callq 0xd4550
leaq 0x30f(%rsp), %rdi
callq 0xd8ec0
movq 0x330(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x330(%rsp,%rax), %rax
movq %rax, 0x58(%rsp)
movl $0x2, %edi
movl $0x8, %esi
callq 0xe0e70
movl %eax, 0x64(%rsp)
jmp 0x13e45f
movl 0x64(%rsp), %edi
movl $0x40, %esi
callq 0xe0e70
movl %eax, 0x54(%rsp)
jmp 0x13e473
movl 0x54(%rsp), %esi
movq 0x58(%rsp), %rdi
callq 0xda6e0
jmp 0x13e483
leaq 0x330(%rsp), %rdi
leaq 0x65c(%rsp), %rsi
callq 0xceae0
jmp 0x13e49a
leaq 0x330(%rsp), %rdi
callq 0xd25a0
movl 0x65c(%rsp), %eax
cmpl 0x660(%rsp), %eax
jne 0x13e4c0
xorl %eax, %eax
movq %rax, 0x48(%rsp)
jmp 0x13e4e2
movq 0x118(%rsp), %rdi
addq $0x18, %rdi
movl 0x65c(%rsp), %eax
movl %eax, %esi
callq 0xe19d0
movq (%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x300(%rsp)
movl $0x40, %edi
callq 0xd8380
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x40(%rsp)
movq 0x300(%rsp), %rsi
movl 0x660(%rsp), %edx
callq 0xd8a00
jmp 0x13e51a
movq 0x118(%rsp), %rdi
addq $0x18, %rdi
movl 0x660(%rsp), %eax
movl %eax, %esi
callq 0xe19d0
movq 0x40(%rsp), %rcx
movq %rcx, (%rax)
leaq 0x6a0(%rsp), %rdi
callq 0xd0700
movl 0x694(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x694(%rsp)
jmp 0x13e04d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
jmp 0x13e596
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
leaq 0x4b8(%rsp), %rdi
callq 0xd4550
leaq 0x4b7(%rsp), %rdi
callq 0xd8ec0
jmp 0x13e901
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
leaq 0x4d8(%rsp), %rdi
callq 0xd25a0
jmp 0x13e901
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
jmp 0x13e605
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
leaq 0x310(%rsp), %rdi
callq 0xd4550
leaq 0x30f(%rsp), %rdi
callq 0xd8ec0
jmp 0x13e901
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
leaq 0x330(%rsp), %rdi
callq 0xd25a0
jmp 0x13e901
movq 0x40(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
movl $0x40, %esi
callq 0xd8620
jmp 0x13e901
movq 0x118(%rsp), %rdi
addq $0x18, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xe19d0
movq %rax, %rcx
movq 0x118(%rsp), %rax
movq (%rcx), %rcx
movq %rcx, 0x30(%rax)
movl $0x0, 0x2fc(%rsp)
movq 0x118(%rsp), %rdi
movslq 0x2fc(%rsp), %rax
movq %rax, 0x38(%rsp)
callq 0xd6170
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0x13e6fb
leaq 0x6a0(%rsp), %rdi
callq 0xddc90
movq 0x118(%rsp), %rdi
movq (%rax), %rsi
callq 0xd0620
leaq 0x6a0(%rsp), %rdi
callq 0xd0700
movl 0x2fc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2fc(%rsp)
jmp 0x13e697
jmp 0x13e6fd
movq 0x6a8(%rsp), %rdi
callq 0xd7a70
movq %rax, 0x2f0(%rsp)
leaq 0x6a0(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
callq 0xd72b0
testb $0x1, %al
jne 0x13e730
jmp 0x13e8f9
leaq 0x6a0(%rsp), %rdi
callq 0xddc90
movq (%rax), %rax
movq %rax, 0x2e8(%rsp)
movq 0x2e8(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x137(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xe0c80
movq 0x30(%rsp), %rdx
leaq 0x49599(%rip), %rsi     # 0x187d0c
leaq 0x138(%rsp), %rdi
callq 0xe00a0
jmp 0x13e782
movq 0x28(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0xdb6f0
movq %rax, 0x20(%rsp)
jmp 0x13e79b
movq 0x20(%rsp), %rsi
leaq 0x158(%rsp), %rdi
movl $0x8, %edx
callq 0xdfcc0
jmp 0x13e7b4
leaq 0x138(%rsp), %rdi
callq 0xd4550
leaq 0x137(%rsp), %rdi
callq 0xd8ec0
movq 0x158(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x158(%rsp,%rax), %rax
movq %rax, 0x10(%rsp)
movl $0x2, %edi
movl $0x8, %esi
callq 0xe0e70
movl %eax, 0x1c(%rsp)
jmp 0x13e7fc
movl 0x1c(%rsp), %edi
movl $0x40, %esi
callq 0xe0e70
movl %eax, 0xc(%rsp)
jmp 0x13e810
movl 0xc(%rsp), %esi
movq 0x10(%rsp), %rdi
callq 0xda6e0
jmp 0x13e820
leaq 0x158(%rsp), %rdi
leaq 0x2e4(%rsp), %rsi
callq 0xceae0
jmp 0x13e837
leaq 0x158(%rsp), %rdi
callq 0xd25a0
movq 0x118(%rsp), %rdi
movl 0x2e4(%rsp), %esi
callq 0xdd020
movq %rax, 0x2d8(%rsp)
movq 0x2d8(%rsp), %rdi
movq 0x2e8(%rsp), %rsi
movq 0xa30(%rsp), %rdx
movq (%rdi), %rax
callq *0x28(%rax)
leaq 0x6a0(%rsp), %rdi
callq 0xd0700
jmp 0x13e6fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
jmp 0x13e8c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
leaq 0x138(%rsp), %rdi
callq 0xd4550
leaq 0x137(%rsp), %rdi
callq 0xd8ec0
jmp 0x13e901
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x878(%rsp)
movl %eax, 0x874(%rsp)
leaq 0x158(%rsp), %rdi
callq 0xd25a0
jmp 0x13e901
addq $0xa48, %rsp            # imm = 0xA48
retq
movq 0x878(%rsp), %rdi
callq 0xe0be0
nop