// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %r15
movq 0x10(%rdi), %rdi
movq %rdx, %rsi
callq 0x508c0
movq %rax, 0x8(%rsp)
leaq 0x2e324(%rip), %rsi     # 0x86afd
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x515e0
movl %ebp, 0x14(%rsp)
addq $0x38, %r15
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x4dd90
leaq 0x50(%rsp), %rdi
callq 0x4e020
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
xorl %r12d, %r12d
testl %eax, %eax
movl $0x0, %ecx
movq %rax, 0x18(%rsp)
cmovgl %eax, %ecx
imulq $0x18, %rcx, %rax
movq %rax, 0x28(%rsp)
pushq $0x1
popq %r15
leaq 0x30(%rsp), %r13
xorl %r14d, %r14d
movq %rbx, 0x20(%rsp)
cmpq %r12, 0x28(%rsp)
je 0x58967
movq 0x8(%rsp), %rax
movq (%rax), %rbx
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
callq 0x504a0
movq %rbp, %rdi
leaq 0x2df87(%rip), %rsi     # 0x867fb
callq 0x4f5b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movl %r15d, %esi
callq 0x51690
movq %rax, %rdi
leaq 0x2fe8a(%rip), %rsi     # 0x8872d
callq 0x4f5b0
movq (%rbx,%r12), %rsi
addq $0x38, %rsi
leaq 0x50(%rsp), %rdi
callq 0x4f1b0
movq %rax, %rdi
leaq 0x2df3e(%rip), %rsi     # 0x86802
callq 0x4f5b0
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x68(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x68(%rsp,%rax)
movq 0x8(%rbx,%r12), %rsi
leaq 0x50(%rsp), %rdi
callq 0x4e990
movq %rax, %rdi
pushq $0x3a
popq %rsi
callq 0x4fc10
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
movl 0x10(%rbx,%r12), %esi
movq %rax, %rdi
callq 0x4e990
movq %rax, %rdi
pushq $0x22
popq %rsi
callq 0x4fc10
addl 0x10(%rbx,%r12), %r14d
movq %r13, %rdi
leaq 0x58(%rsp), %rsi
callq 0x50fb0
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4f1b0
movq %r13, %rdi
callq 0x4e020
leaq 0x50(%rsp), %rdi
callq 0x4d7c0
addq $0x18, %r12
incl %r15d
jmp 0x5884a
cmpl $0x1, 0x18(%rsp)
jne 0x589a5
leaq 0x2de91(%rip), %rsi     # 0x86806
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x515e0
movq 0x8(%rsp), %rax
movl 0x28(%rax), %edx
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0x50e20
leaq 0x50(%rsp), %rdi
callq 0x4e020
jmp 0x589ae
jle 0x589ae
cmpl 0x14(%rsp), %r14d
jne 0x589c0
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x4e180
movq %rax, %r14
leaq 0x2de40(%rip), %rsi     # 0x86812
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x515e0
movb $0x1, %bpl
leaq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x4ddf0
xorl %ebp, %ebp
movq 0x564a6(%rip), %rsi     # 0xaeea0
movq 0x56237(%rip), %rdx     # 0xaec38
movq %r14, %rdi
callq 0x51630
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x4e020
testb %bpl, %bpl
jne 0x58a20
jmp 0x58a60
movq %rax, %rbx
movq %r14, %rdi
callq 0x4ea60
jmp 0x58a60
jmp 0x58a2e
jmp 0x58a3d
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x4e020
jmp 0x58a60
movq %rax, %rbx
jmp 0x58a60
jmp 0x58a53
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4e020
jmp 0x58a56
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x4d7c0
movq %rbx, %rdi
callq 0x518c0