// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdx, 0x48(%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x19197(%rip), %rsi     # 0x880a4
leaq 0x20(%rsp), %rdi
leaq 0x14(%rsp), %rdx
callq 0x515e0
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
callq 0x50230
leaq 0x58(%rsp), %rdi
pushq $0x8
popq %rdx
movq %rax, %rsi
callq 0x51500
leaq 0x20(%rsp), %rdi
callq 0x4e020
leaq 0x58(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
andl $-0x4b, 0x70(%rsp,%rax)
leaq 0xc(%rsp), %rsi
callq 0x51830
leaq 0x18(%r12), %rdi
movl 0xc(%rsp), %esi
leaq 0x20(%rsp), %rdx
andq $0x0, (%rdx)
movq %rdi, 0x50(%rsp)
callq 0x51110
leaq 0x58(%rsp), %rdi
callq 0x4e070
leaq 0x19123(%rip), %rsi     # 0x880ae
leaq 0x20(%rsp), %rdi
leaq 0x14(%rsp), %rdx
callq 0x515e0
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
callq 0x50230
leaq 0x58(%rsp), %rdi
pushq $0x8
popq %rdx
movq %rax, %rsi
callq 0x51500
leaq 0x20(%rsp), %rdi
callq 0x4e020
leaq 0x58(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
andl $-0x4b, 0x70(%rsp,%rax)
leaq 0xc(%rsp), %rsi
callq 0x51830
movl 0xc(%rsp), %esi
leaq 0x20(%rsp), %rdx
andq $0x0, (%rdx)
movq %r12, %rdi
callq 0x4fce0
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x4e070
movq 0x78(%r15), %rax
movq %rax, 0x18(%rsp)
xorl %r13d, %r13d
leaq 0x20(%rsp), %r14
leaq 0x13(%rsp), %rbp
movq %r12, 0x40(%rsp)
movq 0x18(%r12), %rax
movq 0x20(%r12), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r13, %rcx
jbe 0x6f173
movq 0x18(%rsp), %rax
movq (%rax), %r12
movq %r12, %rdi
leaq 0x19074(%rip), %rsi     # 0x880b9
callq 0x4ee50
testb %al, %al
jne 0x6f258
movq %r14, %rdi
leaq 0x17c94(%rip), %rsi     # 0x86cf0
movq %rbp, %rdx
callq 0x515e0
movq %r12, %rdi
movq %r14, %rsi
callq 0x50230
movq %rbx, %rdi
movq %rax, %rsi
pushq $0x8
popq %rdx
callq 0x51500
movq %r14, %rdi
callq 0x4e020
movq 0x58(%rsp), %rax
movq -0x18(%rax), %rax
andl $-0x4b, 0x70(%rsp,%rax)
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
callq 0x51830
movq %rbx, %rdi
callq 0x4e070
movq %r14, %rdi
leaq 0x19624(%rip), %rsi     # 0x886d6
movq %rbp, %rdx
callq 0x515e0
movq %r12, %rdi
movq %r14, %rsi
callq 0x50230
movq %rbx, %rdi
movq %rax, %rsi
pushq $0x8
popq %rdx
callq 0x51500
movq %r14, %rbp
movq %r14, %rdi
callq 0x4e020
movq 0x58(%rsp), %rax
movq -0x18(%rax), %rax
andl $-0x4b, 0x70(%rsp,%rax)
movq %rbx, %rdi
leaq 0x14(%rsp), %rsi
callq 0x51830
movq %r13, %r14
movq %rbx, %rdi
callq 0x4e070
movl 0x14(%rsp), %eax
movl 0xc(%rsp), %r12d
movq 0x50(%rsp), %rcx
movq (%rcx), %rbx
cmpl %r12d, %eax
jne 0x6f11f
xorl %r13d, %r13d
jmp 0x6f123
movq (%rbx,%rax,8), %r13
pushq $0x40
popq %rdi
callq 0x4f5d0
andl $0x0, 0x10(%rax)
andq $0x0, 0x18(%rax)
leaq 0x10(%rax), %rcx
movq %rcx, 0x20(%rax)
movq %rcx, 0x28(%rax)
andq $0x0, 0x30(%rax)
movq %r13, (%rax)
movl %r12d, 0x38(%rax)
movq %rax, (%rbx,%r12,8)
addq $0x8, 0x18(%rsp)
movq %r14, %r13
incq %r13
movq 0x40(%rsp), %r12
leaq 0x58(%rsp), %rbx
movq %rbp, %r14
leaq 0x13(%rsp), %rbp
jmp 0x6f019
movq (%rax), %rax
movq %rax, 0x30(%r12)
xorl %ebx, %ebx
movq 0x18(%rsp), %rbp
movq 0x8(%r12), %rax
subq (%r12), %rax
sarq $0x3, %rax
cmpq %rbx, %rax
jbe 0x6f1a9
movq (%rbp), %rsi
movq %r12, %rdi
callq 0x4d8e0
addq $0x8, %rbp
incq %rbx
jmp 0x6f182
leaq 0x20(%rsp), %r14
leaq 0x58(%rsp), %r13
leaq 0xc(%rsp), %rbx
cmpq 0x80(%r15), %rbp
je 0x6f246
movq (%rbp), %r12
movq %r14, %rdi
leaq 0x17b1d(%rip), %rsi     # 0x86cf0
leaq 0x14(%rsp), %rdx
callq 0x515e0
movq %r12, %rdi
movq %r14, %rsi
callq 0x50230
movq %r13, %rdi
movq %rax, %rsi
pushq $0x8
popq %rdx
callq 0x51500
movq %r14, %rdi
callq 0x4e020
movq 0x58(%rsp), %rax
movq -0x18(%rax), %rax
andl $-0x4b, 0x70(%rsp,%rax)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x51830
movq %r13, %rdi
callq 0x4e070
movl 0xc(%rsp), %eax
movq 0x40(%rsp), %rcx
movq (%rcx), %rcx
movq (%rcx,%rax,8), %rdi
movq (%rdi), %rax
movq %r12, %rsi
movq 0x48(%rsp), %rdx
callq *0x28(%rax)
addq $0x8, %rbp
jmp 0x6f1b8
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x4e180
movq %rax, %r14
leaq 0x18e55(%rip), %rsi     # 0x880bf
leaq 0x58(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x515e0
movb $0x1, %bpl
leaq 0x58(%rsp), %rsi
movq %r14, %rdi
callq 0x4ddf0
xorl %ebp, %ebp
movq 0x3fbf6(%rip), %rsi     # 0xaee88
movq 0x3f99f(%rip), %rdx     # 0xaec38
movq %r14, %rdi
callq 0x51630
jmp 0x6f2da
jmp 0x6f2da
jmp 0x6f2e9
jmp 0x6f2da
jmp 0x6f2da
jmp 0x6f2e9
jmp 0x6f2f2
jmp 0x6f2f2
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x4e020
testb %bpl, %bpl
jne 0x6f2c8
jmp 0x6f2ff
movq %rax, %rbx
movq %r14, %rdi
callq 0x4ea60
jmp 0x6f2ff
jmp 0x6f2e9
jmp 0x6f2da
jmp 0x6f2e9
jmp 0x6f2da
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x4e070
jmp 0x6f2ff
movq %rax, %rbx
jmp 0x6f2ff
jmp 0x6f2f2
jmp 0x6f2f2
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4e020
movq %rbx, %rdi
callq 0x518c0
nop