// File: jstaursky[P]hutch/src/Sleigh/space.cc
// Function: JoinSpace::saveXmlAttributes(std::ostream&, unsigned long, int) const
void JoinSpace::saveXmlAttributes(ostream &s,uintb offset,int4 size) const

{
  JoinRecord *rec = getManager()->findJoin(offset); // Record must already exist
  a_v(s,"space",getName());
  int4 num = rec->numPieces();
  int4 count = 0;
  for(int4 i=0;i<num;++i) {
    const VarnodeData &vdata( rec->getPiece(i) );
    ostringstream t;
    t << " piece" << dec << (i+1) << "=\"";
    t << vdata.space->getName() << ":0x";
    t << hex << vdata.offset << ':' << dec << vdata.size << '\"';
    count += vdata.size;
    s << t.str();
  }
  if (num == 1)
    a_v_i(s,"logicalsize",rec->getUnified().size);
  if ((count != size)&&(num>1))
    throw LowlevelError("size attribute in join tag does not match size of pieces");
}

// Assembly:
subq $0x308, %rsp            # imm = 0x308
movq %rdi, 0x300(%rsp)
movq %rsi, 0x2f8(%rsp)
movq %rdx, 0x2f0(%rsp)
movl %ecx, 0x2ec(%rsp)
movq 0x300(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0xd6150
movq %rax, %rdi
movq 0x2f0(%rsp), %rsi
callq 0xdcde0
movq %rax, 0x2e0(%rsp)
movq 0x2f8(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0x2bf(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
callq 0xe0c80
movq 0xa8(%rsp), %rdx
leaq 0x8ff32(%rip), %rsi     # 0x187b19
leaq 0x2c0(%rsp), %rdi
callq 0xe00a0
jmp 0xf7bf6
movq 0x98(%rsp), %rdi
callq 0xd06f0
movq %rax, 0x90(%rsp)
jmp 0xf7c0d
movq 0x90(%rsp), %rdx
movq 0xa0(%rsp), %rdi
leaq 0x2c0(%rsp), %rsi
callq 0xd18c0
jmp 0xf7c2c
leaq 0x2c0(%rsp), %rdi
callq 0xd4550
leaq 0x2bf(%rsp), %rdi
callq 0xd8ec0
movq 0x2e0(%rsp), %rdi
callq 0xd2b90
movl %eax, 0x2a8(%rsp)
movl $0x0, 0x2a4(%rsp)
movl $0x0, 0x2a0(%rsp)
movl 0x2a0(%rsp), %eax
cmpl 0x2a8(%rsp), %eax
jge 0xf7f06
movq 0x2e0(%rsp), %rdi
movl 0x2a0(%rsp), %esi
callq 0xdd0e0
movq %rax, 0x298(%rsp)
leaq 0x120(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0xdbe90
movq 0x80(%rsp), %rdi
leaq 0x8fbb7(%rip), %rsi     # 0x18787b
callq 0xd8300
movq %rax, 0x88(%rsp)
jmp 0xf7cd3
movq 0x88(%rsp), %rdi
movq 0xd00b6(%rip), %rsi     # 0x1c7d98
callq 0xd1180
movq %rax, 0x78(%rsp)
jmp 0xf7cee
movq 0x78(%rsp), %rdi
movl 0x2a0(%rsp), %esi
incl %esi
callq 0xe03e0
movq %rax, 0x70(%rsp)
jmp 0xf7d08
movq 0x70(%rsp), %rdi
leaq 0x918e9(%rip), %rsi     # 0x1895fd
callq 0xd8300
jmp 0xf7d1b
movq 0x298(%rsp), %rax
movq (%rax), %rdi
callq 0xd06f0
movq %rax, 0x68(%rsp)
jmp 0xf7d32
movq 0x68(%rsp), %rsi
leaq 0x120(%rsp), %rdi
callq 0xd7350
movq %rax, 0x60(%rsp)
jmp 0xf7d4b
movq 0x60(%rsp), %rdi
leaq 0x8fb2b(%rip), %rsi     # 0x187882
callq 0xd8300
jmp 0xf7d5e
movq 0xd0263(%rip), %rsi     # 0x1c7fc8
leaq 0x120(%rsp), %rdi
callq 0xd1180
movq %rax, 0x58(%rsp)
jmp 0xf7d79
movq 0x58(%rsp), %rdi
movq 0x298(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0xd0050
movq %rax, 0x50(%rsp)
jmp 0xf7d96
movq 0x50(%rsp), %rdi
movl $0x3a, %esi
callq 0xda0c0
movq %rax, 0x48(%rsp)
jmp 0xf7dac
movq 0x48(%rsp), %rdi
movq 0xcffe0(%rip), %rsi     # 0x1c7d98
callq 0xd1180
movq %rax, 0x40(%rsp)
jmp 0xf7dc4
movq 0x40(%rsp), %rdi
movq 0x298(%rsp), %rax
movl 0x10(%rax), %esi
callq 0xdbce0
movq %rax, 0x38(%rsp)
jmp 0xf7de0
movq 0x38(%rsp), %rdi
movl $0x22, %esi
callq 0xda0c0
jmp 0xf7df1
movq 0x298(%rsp), %rax
movl 0x10(%rax), %ecx
movl 0x2a4(%rsp), %eax
addl %ecx, %eax
movl %eax, 0x2a4(%rsp)
movq 0x2f8(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0xd8840
jmp 0xf7e30
movq 0x30(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0xd7350
jmp 0xf7e44
leaq 0x100(%rsp), %rdi
callq 0xd4550
leaq 0x120(%rsp), %rdi
callq 0xd0160
movl 0x2a0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2a0(%rsp)
jmp 0xf7c70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b0(%rsp)
movl %eax, 0x2ac(%rsp)
jmp 0xf7eab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b0(%rsp)
movl %eax, 0x2ac(%rsp)
leaq 0x2c0(%rsp), %rdi
callq 0xd4550
leaq 0x2bf(%rsp), %rdi
callq 0xd8ec0
jmp 0xf80e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b0(%rsp)
movl %eax, 0x2ac(%rsp)
jmp 0xf7ef4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b0(%rsp)
movl %eax, 0x2ac(%rsp)
leaq 0x100(%rsp), %rdi
callq 0xd4550
leaq 0x120(%rsp), %rdi
callq 0xd0160
jmp 0xf80e5
cmpl $0x1, 0x2a8(%rsp)
jne 0xf7fe5
movq 0x2f8(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0xdf(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xe0c80
movq 0x28(%rsp), %rdx
leaq 0x8f947(%rip), %rsi     # 0x187886
leaq 0xe0(%rsp), %rdi
callq 0xe00a0
jmp 0xf7f4e
movq 0x2e0(%rsp), %rdi
callq 0xd20e0
movq %rax, 0x18(%rsp)
jmp 0xf7f62
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, %edx
leaq 0xe0(%rsp), %rsi
callq 0xde2b0
jmp 0xf7f80
leaq 0xe0(%rsp), %rdi
callq 0xd4550
leaq 0xdf(%rsp), %rdi
callq 0xd8ec0
jmp 0xf7fe5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b0(%rsp)
movl %eax, 0x2ac(%rsp)
jmp 0xf7fd3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b0(%rsp)
movl %eax, 0x2ac(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0xd4550
leaq 0xdf(%rsp), %rdi
callq 0xd8ec0
jmp 0xf80e5
movl 0x2a4(%rsp), %eax
cmpl 0x2ec(%rsp), %eax
je 0xf80dd
cmpl $0x1, 0x2a8(%rsp)
jle 0xf80dd
movb $0x1, 0xb6(%rsp)
movl $0x20, %edi
callq 0xd2b40
movq %rax, 0x8(%rsp)
leaq 0xb7(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xe0c80
movq 0x10(%rsp), %rdx
leaq 0x8f856(%rip), %rsi     # 0x187892
leaq 0xb8(%rsp), %rdi
callq 0xe00a0
jmp 0xf804b
movq 0x8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0xd1ae0
jmp 0xf805f
movq 0x8(%rsp), %rdi
movb $0x0, 0xb6(%rsp)
movq 0xcfe1d(%rip), %rsi     # 0x1c7e90
movq 0xcfb56(%rip), %rdx     # 0x1c7bd0
callq 0xe01f0
jmp 0xf80f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b0(%rsp)
movl %eax, 0x2ac(%rsp)
jmp 0xf80b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b0(%rsp)
movl %eax, 0x2ac(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0xd4550
leaq 0xb7(%rsp), %rdi
callq 0xd8ec0
testb $0x1, 0xb6(%rsp)
jne 0xf80d1
jmp 0xf80db
movq 0x8(%rsp), %rdi
callq 0xd5400
jmp 0xf80e5
addq $0x308, %rsp            # imm = 0x308
retq
movq 0x2b0(%rsp), %rdi
callq 0xe0be0
nopw %cs:(%rax,%rax)