// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/space.cc
// Function: AddrSpace::restoreXmlAttributes(Element const*, unsigned int&) const
uintb AddrSpace::restoreXmlAttributes(const Element *el,uint4 &size) const

{
  uintb offset;
  int4 num = el->getNumAttributes();
  bool foundoffset = false;
  for(int4 i=0;i<num;++i) {
    if (el->getAttributeName(i)=="offset") {
      foundoffset = true;
      istringstream s1(el->getAttributeValue(i));
      s1.unsetf(ios::dec | ios::hex | ios::oct);
      s1 >> offset;
    }
    else if (el->getAttributeName(i)=="size") {
      istringstream s2(el->getAttributeValue(i));
      s2.unsetf(ios::dec | ios::hex | ios::oct);
      s2 >> size;
    }
  }
  if (!foundoffset)
    throw LowlevelError("Address is missing offset");

  return offset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdx, 0x8(%rsp)
movq 0x48(%rsi), %r14
subq 0x40(%rsi), %r14
shrq $0x5, %r14
testl %r14d, %r14d
jle 0x49804
movq %rsi, %r12
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
negq %r14
xorl %r13d, %r13d
leaq 0x18(%rsp), %rbp
leaq 0x3c0b8(%rip), %rbx     # 0x8579d
xorl %ecx, %ecx
movq %rcx, (%rsp)
leaq 0x1(%r13), %rax
shlq $0x5, %r13
movq %r13, %r15
movq %rax, %r13
movq 0x40(%r12), %rdi
addq %r15, %rdi
leaq 0x36616(%rip), %rsi     # 0x7fd1e
callq 0x3f590
testl %eax, %eax
je 0x4978b
movq 0x40(%r12), %rdi
addq %r15, %rdi
movq %rbx, %rsi
callq 0x3f590
testl %eax, %eax
jne 0x49771
movq 0x58(%r12), %rsi
addq %r15, %rsi
movq %rbp, %rdi
movl $0x8, %edx
callq 0x41c90
movq 0x18(%rsp), %rax
movq -0x18(%rax), %rax
andl $-0x4b, 0x30(%rsp,%rax)
movq %rbp, %rdi
movq 0x8(%rsp), %rsi
callq 0x41ec0
movq %rbp, %rdi
movq 0x595b1(%rip), %rsi     # 0xa2d10
callq 0x41450
leaq 0x90(%rsp), %rdi
callq 0x3f730
addq $0x20, %r15
leaq (%r14,%r13), %rax
incq %rax
incq %r13
cmpq $0x1, %rax
jne 0x496f9
jmp 0x497e7
addq 0x58(%r12), %r15
movq %rbp, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x41c90
movq 0x18(%rsp), %rax
movq -0x18(%rax), %rax
andl $-0x4b, 0x30(%rsp,%rax)
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x3fc90
movq %rbp, %rdi
movq 0x5954b(%rip), %rsi     # 0xa2d10
callq 0x41450
leaq 0x90(%rsp), %rdi
callq 0x3f730
movb $0x1, %cl
movq %r14, %rax
addq %r13, %rax
jne 0x496e7
jmp 0x497ed
testb $0x1, (%rsp)
je 0x49804
movq 0x10(%rsp), %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x3fb00
movq %rax, %rbx
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x35f3e(%rip), %rsi     # 0x7f75f
leaq 0x35f50(%rip), %rdx     # 0x7f778
leaq 0x18(%rsp), %rdi
callq 0x3f8a0
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x5965d(%rip), %rsi     # 0xa2ea8
movq 0x593e6(%rip), %rdx     # 0xa2c38
movq %rbx, %rdi
callq 0x41d70
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x49874
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x40880
testb %bpl, %bpl
jne 0x4987e
jmp 0x498ab
movq %rax, %r14
movq %rbx, %rdi
callq 0x40090
jmp 0x498ab
jmp 0x4988a
movq %rax, %r14
movq 0x5947c(%rip), %rsi     # 0xa2d10
leaq 0x18(%rsp), %rdi
callq 0x41450
leaq 0x90(%rsp), %rdi
callq 0x3f730
movq %r14, %rdi
callq 0x41f10
nop