// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movq %rdx, %rsi
callq 0x41410
movq %rax, 0x8(%rsp)
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x35281(%rip), %rsi     # 0x7fb1d
leaq 0x3527f(%rip), %rdx     # 0x7fb22
leaq 0x50(%rsp), %rdi
callq 0x3f8a0
leaq 0x18(%rsp), %rsi
movb $0x20, (%rsi)
movl $0x1, %edx
movq %r15, %rdi
callq 0x40b80
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %rax, %rdi
callq 0x40b80
leaq 0x36e7d(%rip), %rsi     # 0x81758
movl $0x2, %edx
movq %rax, %rdi
callq 0x40b80
movq 0x38(%rbx), %rsi
movq %r15, %rdi
callq 0x3f3d0
leaq 0x36cec(%rip), %rsi     # 0x815e7
movl $0x1, %edx
movq %r15, %rdi
callq 0x40b80
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x4a91f
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x40870
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rcx
testl %ecx, %ecx
movl %ebp, 0x14(%rsp)
movq %r15, 0x38(%rsp)
movq %rcx, 0x40(%rsp)
jle 0x4aad5
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq %rcx, 0x48(%rsp)
xorl %ebp, %ebp
movl $0x10, %r14d
leaq 0x50(%rsp), %rbx
leaq 0x18(%rsp), %r13
xorl %r12d, %r12d
movq 0x8(%rsp), %rax
movq (%rax), %r15
movq %rbx, %rdi
callq 0x41110
movl $0x6, %edx
movq %rbx, %rdi
leaq 0x34e69(%rip), %rsi     # 0x7f7fb
callq 0x40b80
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x68(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x68(%rsp,%rax)
incq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x41da0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x36d8e(%rip), %rsi     # 0x81758
callq 0x40b80
movq -0x10(%r15,%r14), %rax
movq 0x38(%rax), %rsi
movq 0x40(%rax), %rdx
movq %rbx, %rdi
callq 0x40b80
movl $0x3, %edx
movq %rax, %rdi
leaq 0x34e0f(%rip), %rsi     # 0x7f802
callq 0x40b80
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(%r15,%r14), %rsi
movq %rbx, %rdi
callq 0x3ffb0
movb $0x3a, 0x18(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x40b80
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
movl (%r15,%r14), %esi
movq %rax, %rdi
callq 0x3ffb0
movb $0x22, 0x18(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x40b80
addl (%r15,%r14), %r12d
movq %r13, %rdi
leaq 0x58(%rsp), %rsi
callq 0x418b0
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x38(%rsp), %rdi
callq 0x40b80
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x4aaa8
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x40870
movq %rbx, %rdi
movq 0x582ce(%rip), %rsi     # 0xa2d80
callq 0x3fc30
leaq 0xc0(%rsp), %rdi
callq 0x3f730
addq $0x18, %r14
cmpq %rbp, 0x48(%rsp)
jne 0x4a973
jmp 0x4aad8
xorl %r12d, %r12d
movq 0x40(%rsp), %r13
cmpl $0x1, %r13d
leaq 0x60(%rsp), %r15
jne 0x4ab9c
leaq 0x50(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x34d0b(%rip), %rsi     # 0x7f806
leaq 0x34d0f(%rip), %rdx     # 0x7f811
callq 0x3f8a0
movq 0x8(%rsp), %rax
movl 0x28(%rax), %ebx
leaq 0x18(%rsp), %rsi
movb $0x20, (%rsi)
movl $0x1, %edx
movq 0x38(%rsp), %rdi
callq 0x40b80
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %rax, %rdi
callq 0x40b80
movq %rax, %r14
leaq 0x36c16(%rip), %rsi     # 0x81758
movl $0x2, %edx
movq %rax, %rdi
callq 0x40b80
movq (%r14), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%r14,%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x406f0
leaq 0x36a6f(%rip), %rsi     # 0x815e7
movl $0x1, %edx
movq %rax, %rdi
callq 0x40b80
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0x4ab9c
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x40870
cmpl $0x2, %r13d
jl 0x4aba9
cmpl 0x14(%rsp), %r12d
jne 0x4abbb
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x3fb00
movq %rax, %r14
leaq 0x50(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x34c3b(%rip), %rsi     # 0x7f812
leaq 0x34c6c(%rip), %rdx     # 0x7f84a
callq 0x3f8a0
movb $0x1, %bpl
leaq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x582ac(%rip), %rsi     # 0xa2ea8
movq 0x58035(%rip), %rdx     # 0xa2c38
movq %r14, %rdi
callq 0x41d60
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x4ac32
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x40870
jmp 0x4ac32
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x4acbb
movq %r14, %rdi
callq 0x40080
jmp 0x4acbb
jmp 0x4ac47
movq %rax, %rbx
jmp 0x4acbb
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
jne 0x4ac68
jmp 0x4acbb
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x4acbb
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x40870
jmp 0x4acbb
jmp 0x4ac9a
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x4ac9d
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x40870
jmp 0x4ac9d
movq %rax, %rbx
movq 0x580dc(%rip), %rsi     # 0xa2d80
leaq 0x50(%rsp), %rdi
callq 0x3fc30
leaq 0xc0(%rsp), %rdi
callq 0x3f730
movq %rbx, %rdi
callq 0x41f00
nop