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

{
  int4 numAttribs = el->getNumAttributes();
  deadcodedelay = -1;
  for (int4 i=0; i < numAttribs; i++) {
    string attrName = el->getAttributeName(i);
    string attrValue = el->getAttributeValue(i);
    
    if (attrName == "name") {
      name = attrValue;
    }
    if (attrName == "index")
      {
	istringstream s1(attrValue);
	s1.unsetf(ios::dec | ios::hex | ios::oct);
	s1 >> index;
      }
    if (attrName == "size")
      {
	istringstream s1(attrValue);
	s1.unsetf(ios::dec | ios::hex | ios::oct);
	s1 >> addressSize;
      }
    if (attrName == "wordsize")
      {
	istringstream s1(attrValue);
	s1.unsetf(ios::dec | ios::hex | ios::oct);
	s1 >> wordsize;
      }
    if (attrName == "bigendian") {
      if (xml_readbool(attrValue))
	flags |= big_endian;
    }
    if (attrName == "delay") {
      istringstream s1(attrValue);
      s1.unsetf(ios::dec | ios::hex | ios::oct);
      s1 >> delay;
    }
    if (attrName == "deadcodedelay") {
      istringstream s1(attrValue);
      s1.unsetf(ios::dec | ios::hex | ios::oct);
      s1 >> deadcodedelay;
    }      
    if (attrName == "physical") {
      if (xml_readbool(attrValue))
	flags |= hasphysical;
    }
    
  }
  if (deadcodedelay == -1)
    deadcodedelay = delay;	// If deadcodedelay attribute not present, set it to delay
  calcScaleMask();
}

// Assembly:
subq $0x878, %rsp            # imm = 0x878
movq %rdi, 0x870(%rsp)
movq %rsi, 0x868(%rsp)
movq 0x870(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x868(%rsp), %rdi
callq 0xd2b80
movl %eax, %ecx
movq 0x88(%rsp), %rax
movl %ecx, 0x864(%rsp)
movl $0xffffffff, 0x68(%rax) # imm = 0xFFFFFFFF
movl $0x0, 0x860(%rsp)
movl 0x860(%rsp), %eax
cmpl 0x864(%rsp), %eax
jge 0xf6fe7
movq 0x868(%rsp), %rdi
movl 0x860(%rsp), %esi
callq 0xd5520
movq %rax, %rsi
leaq 0x840(%rsp), %rdi
callq 0xd2230
movq 0x868(%rsp), %rdi
movl 0x860(%rsp), %esi
callq 0xd9670
movq %rax, 0x80(%rsp)
jmp 0xf69ed
movq 0x80(%rsp), %rsi
leaq 0x820(%rsp), %rdi
callq 0xd2230
jmp 0xf6a04
leaq 0x90626(%rip), %rsi     # 0x187031
leaq 0x840(%rsp), %rdi
callq 0xe30f0
movb %al, 0x7f(%rsp)
jmp 0xf6a1e
movb 0x7f(%rsp), %al
testb $0x1, %al
jne 0xf6a28
jmp 0xf6a77
movq 0x88(%rsp), %rdi
addq $0x38, %rdi
leaq 0x820(%rsp), %rsi
callq 0xce450
jmp 0xf6a43
jmp 0xf6a77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x818(%rsp)
movl %eax, 0x814(%rsp)
jmp 0xf6fd8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x818(%rsp)
movl %eax, 0x814(%rsp)
jmp 0xf6fcb
leaq 0x90d28(%rip), %rsi     # 0x1877a6
leaq 0x840(%rsp), %rdi
callq 0xe30f0
movb %al, 0x7e(%rsp)
jmp 0xf6a91
movb 0x7e(%rsp), %al
testb $0x1, %al
jne 0xf6a9e
jmp 0xf6b5c
leaq 0x690(%rsp), %rdi
leaq 0x820(%rsp), %rsi
movl $0x8, %edx
callq 0xdfcc0
jmp 0xf6aba
movq 0x690(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x690(%rsp,%rax), %rax
movq %rax, 0x70(%rsp)
movl $0x2, %edi
movl $0x8, %esi
callq 0xe0e70
movl %eax, 0x78(%rsp)
jmp 0xf6ae8
movl 0x78(%rsp), %edi
movl $0x40, %esi
callq 0xe0e70
movl %eax, 0x6c(%rsp)
jmp 0xf6afc
movl 0x6c(%rsp), %esi
movq 0x70(%rsp), %rdi
callq 0xda6e0
jmp 0xf6b0c
movq 0x88(%rsp), %rsi
addq $0x60, %rsi
leaq 0x690(%rsp), %rdi
callq 0xd4480
jmp 0xf6b27
leaq 0x690(%rsp), %rdi
callq 0xd25a0
jmp 0xf6b5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x818(%rsp)
movl %eax, 0x814(%rsp)
leaq 0x690(%rsp), %rdi
callq 0xd25a0
jmp 0xf6fcb
leaq 0x96e4a(%rip), %rsi     # 0x18d9ad
leaq 0x840(%rsp), %rdi
callq 0xe30f0
movb %al, 0x6b(%rsp)
jmp 0xf6b76
movb 0x6b(%rsp), %al
testb $0x1, %al
jne 0xf6b83
jmp 0xf6c41
leaq 0x510(%rsp), %rdi
leaq 0x820(%rsp), %rsi
movl $0x8, %edx
callq 0xdfcc0
jmp 0xf6b9f
movq 0x510(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x510(%rsp,%rax), %rax
movq %rax, 0x58(%rsp)
movl $0x2, %edi
movl $0x8, %esi
callq 0xe0e70
movl %eax, 0x64(%rsp)
jmp 0xf6bcd
movl 0x64(%rsp), %edi
movl $0x40, %esi
callq 0xe0e70
movl %eax, 0x54(%rsp)
jmp 0xf6be1
movl 0x54(%rsp), %esi
movq 0x58(%rsp), %rdi
callq 0xda6e0
jmp 0xf6bf1
movq 0x88(%rsp), %rsi
addq $0x58, %rsi
leaq 0x510(%rsp), %rdi
callq 0xceae0
jmp 0xf6c0c
leaq 0x510(%rsp), %rdi
callq 0xd25a0
jmp 0xf6c41
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x818(%rsp)
movl %eax, 0x814(%rsp)
leaq 0x510(%rsp), %rdi
callq 0xd25a0
jmp 0xf6fcb
leaq 0x90b7c(%rip), %rsi     # 0x1877c4
leaq 0x840(%rsp), %rdi
callq 0xe30f0
movb %al, 0x53(%rsp)
jmp 0xf6c5b
movb 0x53(%rsp), %al
testb $0x1, %al
jne 0xf6c68
jmp 0xf6d26
leaq 0x390(%rsp), %rdi
leaq 0x820(%rsp), %rsi
movl $0x8, %edx
callq 0xdfcc0
jmp 0xf6c84
movq 0x390(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x390(%rsp,%rax), %rax
movq %rax, 0x40(%rsp)
movl $0x2, %edi
movl $0x8, %esi
callq 0xe0e70
movl %eax, 0x4c(%rsp)
jmp 0xf6cb2
movl 0x4c(%rsp), %edi
movl $0x40, %esi
callq 0xe0e70
movl %eax, 0x3c(%rsp)
jmp 0xf6cc6
movl 0x3c(%rsp), %esi
movq 0x40(%rsp), %rdi
callq 0xda6e0
jmp 0xf6cd6
movq 0x88(%rsp), %rsi
addq $0x5c, %rsi
leaq 0x390(%rsp), %rdi
callq 0xceae0
jmp 0xf6cf1
leaq 0x390(%rsp), %rdi
callq 0xd25a0
jmp 0xf6d26
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x818(%rsp)
movl %eax, 0x814(%rsp)
leaq 0x390(%rsp), %rdi
callq 0xd25a0
jmp 0xf6fcb
leaq 0x90a7f(%rip), %rsi     # 0x1877ac
leaq 0x840(%rsp), %rdi
callq 0xe30f0
movb %al, 0x3b(%rsp)
jmp 0xf6d40
movb 0x3b(%rsp), %al
testb $0x1, %al
jne 0xf6d4a
jmp 0xf6d7a
leaq 0x820(%rsp), %rdi
callq 0xd9e90
movb %al, 0x3a(%rsp)
jmp 0xf6d5d
movb 0x3a(%rsp), %al
testb $0x1, %al
jne 0xf6d67
jmp 0xf6d78
movq 0x88(%rsp), %rax
movl 0x24(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x24(%rax)
jmp 0xf6d7a
leaq 0x90a3d(%rip), %rsi     # 0x1877be
leaq 0x840(%rsp), %rdi
callq 0xe30f0
movb %al, 0x39(%rsp)
jmp 0xf6d94
movb 0x39(%rsp), %al
testb $0x1, %al
jne 0xf6da1
jmp 0xf6e5f
leaq 0x210(%rsp), %rdi
leaq 0x820(%rsp), %rsi
movl $0x8, %edx
callq 0xdfcc0
jmp 0xf6dbd
movq 0x210(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x210(%rsp,%rax), %rax
movq %rax, 0x28(%rsp)
movl $0x2, %edi
movl $0x8, %esi
callq 0xe0e70
movl %eax, 0x34(%rsp)
jmp 0xf6deb
movl 0x34(%rsp), %edi
movl $0x40, %esi
callq 0xe0e70
movl %eax, 0x24(%rsp)
jmp 0xf6dff
movl 0x24(%rsp), %esi
movq 0x28(%rsp), %rdi
callq 0xda6e0
jmp 0xf6e0f
movq 0x88(%rsp), %rsi
addq $0x64, %rsi
leaq 0x210(%rsp), %rdi
callq 0xd4480
jmp 0xf6e2a
leaq 0x210(%rsp), %rdi
callq 0xd25a0
jmp 0xf6e5f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x818(%rsp)
movl %eax, 0x814(%rsp)
leaq 0x210(%rsp), %rdi
callq 0xd25a0
jmp 0xf6fcb
leaq 0x90950(%rip), %rsi     # 0x1877b6
leaq 0x840(%rsp), %rdi
callq 0xe30f0
movb %al, 0x23(%rsp)
jmp 0xf6e79
movb 0x23(%rsp), %al
testb $0x1, %al
jne 0xf6e86
jmp 0xf6f44
leaq 0x90(%rsp), %rdi
leaq 0x820(%rsp), %rsi
movl $0x8, %edx
callq 0xdfcc0
jmp 0xf6ea2
movq 0x90(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x90(%rsp,%rax), %rax
movq %rax, 0x10(%rsp)
movl $0x2, %edi
movl $0x8, %esi
callq 0xe0e70
movl %eax, 0x1c(%rsp)
jmp 0xf6ed0
movl 0x1c(%rsp), %edi
movl $0x40, %esi
callq 0xe0e70
movl %eax, 0xc(%rsp)
jmp 0xf6ee4
movl 0xc(%rsp), %esi
movq 0x10(%rsp), %rdi
callq 0xda6e0
jmp 0xf6ef4
movq 0x88(%rsp), %rsi
addq $0x68, %rsi
leaq 0x90(%rsp), %rdi
callq 0xd4480
jmp 0xf6f0f
leaq 0x90(%rsp), %rdi
callq 0xd25a0
jmp 0xf6f44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x818(%rsp)
movl %eax, 0x814(%rsp)
leaq 0x90(%rsp), %rdi
callq 0xd25a0
jmp 0xf6fcb
leaq 0x90882(%rip), %rsi     # 0x1877cd
leaq 0x840(%rsp), %rdi
callq 0xe30f0
movb %al, 0xb(%rsp)
jmp 0xf6f5e
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0xf6f68
jmp 0xf6f9b
leaq 0x820(%rsp), %rdi
callq 0xd9e90
movb %al, 0xa(%rsp)
jmp 0xf6f7b
movb 0xa(%rsp), %al
testb $0x1, %al
jne 0xf6f85
jmp 0xf6f99
movq 0x88(%rsp), %rax
movl 0x24(%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x24(%rax)
jmp 0xf6f9b
leaq 0x820(%rsp), %rdi
callq 0xd4550
leaq 0x840(%rsp), %rdi
callq 0xd4550
movl 0x860(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x860(%rsp)
jmp 0xf6997
leaq 0x820(%rsp), %rdi
callq 0xd4550
leaq 0x840(%rsp), %rdi
callq 0xd4550
jmp 0xf7018
movq 0x88(%rsp), %rax
cmpl $-0x1, 0x68(%rax)
jne 0xf7003
movq 0x88(%rsp), %rax
movl 0x64(%rax), %ecx
movl %ecx, 0x68(%rax)
movq 0x88(%rsp), %rdi
callq 0xd4760
addq $0x878, %rsp            # imm = 0x878
retq
movq 0x818(%rsp), %rdi
callq 0xe0be0
nopw %cs:(%rax,%rax)