// File: jstaursky[P]hutch/src/Sleigh/translate.cc
// Function: AddrSpaceManager::restoreXmlSpaces(Element const*, Translate const*)
void AddrSpaceManager::restoreXmlSpaces(const Element *el,const Translate *trans)

{
  // The first space should always be the constant space
  insertSpace(new ConstantSpace(this,trans,"const",AddrSpace::constant_space_index));

  string defname(el->getAttributeValue("defaultspace"));
  const List &list(el->getChildren());
  List::const_iterator iter;
  iter = list.begin();
  while(iter!=list.end()) {
    AddrSpace *spc = restoreXmlSpace(*iter,trans);
    insertSpace(spc);
    ++iter;
  }
  AddrSpace *spc = getSpaceByName(defname);
  if (spc == (AddrSpace *)0)
    throw LowlevelError("Bad 'defaultspace' attribute: "+defname);
  setDefaultSpace(spc->getIndex());
}

// Assembly:
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0x150(%rsp)
movq %rsi, 0x148(%rsp)
movq %rdx, 0x140(%rsp)
movq 0x150(%rsp), %rax
movq %rax, 0x48(%rsp)
movl $0x70, %edi
callq 0xd8380
movq %rax, 0x50(%rsp)
movb $0x1, 0x10b(%rsp)
movq 0x140(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x11f(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0xe0c80
movq 0x60(%rsp), %rdx
leaq 0x8c2b2(%rip), %rsi     # 0x187ab0
leaq 0x120(%rsp), %rdi
callq 0xe00a0
jmp 0xfb80d
movq 0x58(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdi
leaq 0x120(%rsp), %rcx
xorl %r8d, %r8d
callq 0xdd6f0
jmp 0xfb82e
movq 0x50(%rsp), %rsi
movq 0x48(%rsp), %rdi
movb $0x0, 0x10b(%rsp)
callq 0xd26f0
jmp 0xfb847
leaq 0x120(%rsp), %rdi
callq 0xd4550
leaq 0x11f(%rsp), %rdi
callq 0xd8ec0
movq 0x148(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0xc7(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0xe0c80
movq 0x40(%rsp), %rdx
leaq 0x8c22a(%rip), %rsi     # 0x187ab6
leaq 0xc8(%rsp), %rdi
callq 0xe00a0
jmp 0xfb89b
movq 0x38(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0xdb6f0
movq %rax, 0x30(%rsp)
jmp 0xfb8b4
movq 0x30(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
callq 0xd2230
jmp 0xfb8c8
leaq 0xc8(%rsp), %rdi
callq 0xd4550
leaq 0xc7(%rsp), %rdi
callq 0xd8ec0
movq 0x148(%rsp), %rdi
callq 0xde930
movq %rax, 0x28(%rsp)
jmp 0xfb8f6
movq 0x28(%rsp), %rax
movq %rax, 0xb8(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0xd03e0
movq 0xb8(%rsp), %rdi
callq 0xd4960
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0xb8(%rsp), %rdi
callq 0xd7a70
movq %rax, 0xa0(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xd72b0
testb $0x1, %al
jne 0xfb968
jmp 0xfba8a
leaq 0xb0(%rsp), %rdi
callq 0xddc90
movq 0x48(%rsp), %rdi
movq (%rax), %rsi
movq 0x140(%rsp), %rdx
callq 0xd6ff0
movq %rax, 0x20(%rsp)
jmp 0xfb991
movq 0x48(%rsp), %rdi
movq 0x20(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rsi
callq 0xd26f0
jmp 0xfb9b2
leaq 0xb0(%rsp), %rdi
callq 0xd0700
jmp 0xfb935
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0xfb9fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
leaq 0x120(%rsp), %rdi
callq 0xd4550
leaq 0x11f(%rsp), %rdi
callq 0xd8ec0
testb $0x1, 0x10b(%rsp)
jne 0xfba14
jmp 0xfba23
movq 0x50(%rsp), %rdi
movl $0x70, %esi
callq 0xd8620
jmp 0xfbbaf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0xfba5f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0xd4550
leaq 0xc7(%rsp), %rdi
callq 0xd8ec0
jmp 0xfbbaf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0xfbba2
movq 0x48(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0xe10d0
movq %rax, 0x18(%rsp)
jmp 0xfbaa3
movq 0x18(%rsp), %rax
movq %rax, 0x90(%rsp)
cmpq $0x0, 0x90(%rsp)
jne 0xfbb6a
movb $0x1, 0x6f(%rsp)
movl $0x20, %edi
callq 0xd2b40
movq %rax, 0x10(%rsp)
leaq 0x8bfe9(%rip), %rsi     # 0x187ac3
leaq 0x70(%rsp), %rdi
leaq 0xe8(%rsp), %rdx
callq 0xd7370
jmp 0xfbaee
movq 0x10(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0xd1ae0
jmp 0xfbaff
movq 0x10(%rsp), %rdi
movb $0x0, 0x6f(%rsp)
movq 0xcc380(%rip), %rsi     # 0x1c7e90
movq 0xcc0b9(%rip), %rdx     # 0x1c7bd0
callq 0xe01f0
jmp 0xfbbbc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0xfbb55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0xd4550
testb $0x1, 0x6f(%rsp)
jne 0xfbb5e
jmp 0xfbb68
movq 0x10(%rsp), %rdi
callq 0xd5400
jmp 0xfbba2
movq 0x90(%rsp), %rdi
callq 0xd89c0
movl %eax, 0xc(%rsp)
jmp 0xfbb7d
movl 0xc(%rsp), %esi
movq 0x48(%rsp), %rdi
callq 0xe3130
jmp 0xfbb8d
leaq 0xe8(%rsp), %rdi
callq 0xd4550
addq $0x158, %rsp            # imm = 0x158
retq
leaq 0xe8(%rsp), %rdi
callq 0xd4550
movq 0x110(%rsp), %rdi
callq 0xe0be0
nopl (%rax)