// File: Chrom3D[P]Chrom3D/src/Model.cpp
// Function: Model::getCMM[abi:cxx11]()
string Model::getCMM() {
  stringstream res;

  vector<Chromosome>::iterator chriter;
  boost::container::static_vector<Bead,MAXSIZE>::iterator beaditer;
  double smallestBead = numeric_limits<double>::infinity();
  for(chriter = chromosomes.begin(); chriter != chromosomes.end(); chriter++) {
    for(beaditer = chriter->begin(); beaditer != chriter->end(); beaditer++) {
      if(beaditer->getRadius() < smallestBead) {
	smallestBead = beaditer->getRadius();
      }
    }
  }
  
  double linkRadius = smallestBead * 0.5;

  res << "<marker_set name=\"" <<  this->name << "\">" << endl;
  uint counter = 0;
  string prevChr;
  uint prevId=0;
  for(chriter = chromosomes.begin(); chriter != chromosomes.end(); chriter++) {
    for(beaditer = chriter->begin(); beaditer != chriter->end(); beaditer++) {
      res << "<marker id=\"" << counter << "\" x=\"" << beaditer->getX() << "\" y=\"" << beaditer->getY() << "\" z=\"" << beaditer->getZ() << "\" radius=\"" << beaditer->getRadius() << "\" r=\"" << beaditer->color[0] << "\" g=\"" << beaditer->color[1] << "\" b=\"" << beaditer->color[2] << "\" chrID=\"" << chriter->getName() << "\" beadID=\"" << beaditer->getID() << "\"/>" << endl;

      if(prevChr == chriter->getName()) {
	res << "<link id1=\"" << prevId << "\" id2=\"" << counter << "\" r=\"" << beaditer->color[0] << "\" g=\"" << beaditer->color[1] << "\" b=\"" << beaditer->color[2] << "\" radius=\"" << linkRadius << "\"/>" << endl;
      }
      prevChr = chriter->getName();
      prevId = counter;
      counter++;
    }    
  }
  res << "</marker_set>" << endl;
  return res.str();
}

// Assembly:
subq $0x458, %rsp            # imm = 0x458
movq %rdi, 0x168(%rsp)
movq %rdi, %rax
movq %rax, 0x170(%rsp)
movq %rdi, 0x450(%rsp)
movq %rsi, 0x448(%rsp)
movq 0x448(%rsp), %rax
movq %rax, 0x178(%rsp)
leaq 0x2c0(%rsp), %rdi
callq 0x8380
leaq 0x2b8(%rsp), %rdi
callq 0x27c50
leaq 0x2b0(%rsp), %rdi
callq 0x16890
callq 0x28210
movq 0x178(%rsp), %rdi
movsd %xmm0, 0x2a8(%rsp)
addq $0xa78, %rdi            # imm = 0xA78
callq 0x27be0
movq %rax, 0x2a0(%rsp)
movq 0x2a0(%rsp), %rax
movq %rax, 0x2b8(%rsp)
movq 0x178(%rsp), %rdi
addq $0xa78, %rdi            # imm = 0xA78
callq 0x27c10
movq %rax, 0x298(%rsp)
leaq 0x2b8(%rsp), %rdi
leaq 0x298(%rsp), %rsi
callq 0x27c70
testb $0x1, %al
jne 0x1feb5
jmp 0x1ffe7
leaq 0x2b8(%rsp), %rdi
callq 0x27cb0
movq %rax, %rsi
leaq 0x290(%rsp), %rdi
callq 0x15540
jmp 0x1fed4
leaq 0x2b0(%rsp), %rdi
leaq 0x290(%rsp), %rsi
callq 0x16a00
leaq 0x2b8(%rsp), %rdi
callq 0x27cb0
movq %rax, %rsi
leaq 0x278(%rsp), %rdi
callq 0x15570
jmp 0x1ff08
leaq 0x2b0(%rsp), %rdi
leaq 0x278(%rsp), %rsi
callq 0x16b40
testb $0x1, %al
jne 0x1ff26
jmp 0x1ffc9
leaq 0x2b0(%rsp), %rdi
callq 0x16ca0
movq %rax, %rdi
callq 0x14e60
movsd %xmm0, 0x160(%rsp)
jmp 0x1ff46
movsd 0x160(%rsp), %xmm1
movsd 0x2a8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1ffab
leaq 0x2b0(%rsp), %rdi
callq 0x16ca0
movq %rax, %rdi
callq 0x14e60
movsd %xmm0, 0x158(%rsp)
jmp 0x1ff7e
movsd 0x158(%rsp), %xmm0
movsd %xmm0, 0x2a8(%rsp)
jmp 0x1ffab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x20832
jmp 0x1ffad
leaq 0x270(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
xorl %edx, %edx
callq 0x16b60
jmp 0x1fee9
jmp 0x1ffcb
leaq 0x2b8(%rsp), %rdi
xorl %esi, %esi
callq 0x27db0
movq %rax, 0x268(%rsp)
jmp 0x1fe7b
movsd 0x2a8(%rsp), %xmm0
movsd 0x305d0(%rip), %xmm1    # 0x505c8
mulsd %xmm1, %xmm0
movsd %xmm0, 0x260(%rsp)
leaq 0x2d0(%rsp), %rdi
leaq 0x30ad3(%rip), %rsi     # 0x50ae7
callq 0x8480
movq %rax, 0x150(%rsp)
jmp 0x20023
movq 0x178(%rsp), %rsi
movq 0x150(%rsp), %rdi
callq 0x8450
movq %rax, 0x148(%rsp)
jmp 0x20042
movq 0x148(%rsp), %rdi
leaq 0x30aa9(%rip), %rsi     # 0x50afa
callq 0x8480
movq %rax, 0x140(%rsp)
jmp 0x20060
movq 0x140(%rsp), %rdi
movq 0x49ec1(%rip), %rsi     # 0x69f30
callq 0x84e0
jmp 0x20076
movl $0x0, 0x25c(%rsp)
leaq 0x238(%rsp), %rdi
callq 0x8670
movq 0x178(%rsp), %rdi
movl $0x0, 0x234(%rsp)
addq $0xa78, %rdi            # imm = 0xA78
callq 0x27be0
movq %rax, 0x228(%rsp)
movq 0x228(%rsp), %rax
movq %rax, 0x2b8(%rsp)
movq 0x178(%rsp), %rdi
addq $0xa78, %rdi            # imm = 0xA78
callq 0x27c10
movq %rax, 0x220(%rsp)
leaq 0x2b8(%rsp), %rdi
leaq 0x220(%rsp), %rsi
callq 0x27c70
testb $0x1, %al
jne 0x200ff
jmp 0x207b8
leaq 0x2b8(%rsp), %rdi
callq 0x27cb0
movq %rax, %rsi
leaq 0x218(%rsp), %rdi
callq 0x15540
jmp 0x2011e
leaq 0x2b0(%rsp), %rdi
leaq 0x218(%rsp), %rsi
callq 0x16a00
leaq 0x2b8(%rsp), %rdi
callq 0x27cb0
movq %rax, %rsi
leaq 0x210(%rsp), %rdi
callq 0x15570
jmp 0x20152
leaq 0x2b0(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0x16b40
testb $0x1, %al
jne 0x20170
jmp 0x2079a
leaq 0x2d0(%rsp), %rdi
leaq 0x3097e(%rip), %rsi     # 0x50afd
callq 0x8480
movq %rax, 0x138(%rsp)
jmp 0x2018e
movq 0x138(%rsp), %rdi
movl 0x25c(%rsp), %esi
callq 0x8630
movq %rax, 0x130(%rsp)
jmp 0x201ac
movq 0x130(%rsp), %rdi
leaq 0x3094f(%rip), %rsi     # 0x50b0a
callq 0x8480
movq %rax, 0x128(%rsp)
jmp 0x201ca
leaq 0x2b0(%rsp), %rdi
callq 0x16ca0
movq %rax, %rdi
callq 0x14e30
movsd %xmm0, 0x120(%rsp)
jmp 0x201ea
movsd 0x120(%rsp), %xmm0
movq 0x128(%rsp), %rdi
callq 0x8910
movq %rax, 0x118(%rsp)
jmp 0x2020a
movq 0x118(%rsp), %rdi
leaq 0x308f7(%rip), %rsi     # 0x50b10
callq 0x8480
movq %rax, 0x110(%rsp)
jmp 0x20228
leaq 0x2b0(%rsp), %rdi
callq 0x16ca0
movq %rax, %rdi
callq 0x14e40
movsd %xmm0, 0x108(%rsp)
jmp 0x20248
movsd 0x108(%rsp), %xmm0
movq 0x110(%rsp), %rdi
callq 0x8910
movq %rax, 0x100(%rsp)
jmp 0x20268
movq 0x100(%rsp), %rdi
leaq 0x3089f(%rip), %rsi     # 0x50b16
callq 0x8480
movq %rax, 0xf8(%rsp)
jmp 0x20286
leaq 0x2b0(%rsp), %rdi
callq 0x16ca0
movq %rax, %rdi
callq 0x14e50
movsd %xmm0, 0xf0(%rsp)
jmp 0x202a6
movsd 0xf0(%rsp), %xmm0
movq 0xf8(%rsp), %rdi
callq 0x8910
movq %rax, 0xe8(%rsp)
jmp 0x202c6
movq 0xe8(%rsp), %rdi
leaq 0x30847(%rip), %rsi     # 0x50b1c
callq 0x8480
movq %rax, 0xe0(%rsp)
jmp 0x202e4
leaq 0x2b0(%rsp), %rdi
callq 0x16ca0
movq %rax, %rdi
callq 0x14e60
movsd %xmm0, 0xd8(%rsp)
jmp 0x20304
movsd 0xd8(%rsp), %xmm0
movq 0xe0(%rsp), %rdi
callq 0x8910
movq %rax, 0xd0(%rsp)
jmp 0x20324
movq 0xd0(%rsp), %rdi
leaq 0x307f4(%rip), %rsi     # 0x50b27
callq 0x8480
movq %rax, 0xc8(%rsp)
jmp 0x20342
leaq 0x2b0(%rsp), %rdi
callq 0x16ca0
movq 0xc8(%rsp), %rdi
movss (%rax), %xmm0
callq 0x83b0
movq %rax, 0xc0(%rsp)
jmp 0x2036a
movq 0xc0(%rsp), %rdi
leaq 0x307b4(%rip), %rsi     # 0x50b2d
callq 0x8480
movq %rax, 0xb8(%rsp)
jmp 0x20388
leaq 0x2b0(%rsp), %rdi
callq 0x16ca0
movq 0xb8(%rsp), %rdi
movss 0x4(%rax), %xmm0
callq 0x83b0
movq %rax, 0xb0(%rsp)
jmp 0x203b1
movq 0xb0(%rsp), %rdi
leaq 0x30773(%rip), %rsi     # 0x50b33
callq 0x8480
movq %rax, 0xa8(%rsp)
jmp 0x203cf
leaq 0x2b0(%rsp), %rdi
callq 0x16ca0
movq 0xa8(%rsp), %rdi
movss 0x8(%rax), %xmm0
callq 0x83b0
movq %rax, 0xa0(%rsp)
jmp 0x203f8
movq 0xa0(%rsp), %rdi
leaq 0x30732(%rip), %rsi     # 0x50b39
callq 0x8480
movq %rax, 0x98(%rsp)
jmp 0x20416
leaq 0x2b8(%rsp), %rdi
callq 0x27cb0
movq %rax, %rsi
leaq 0x1f0(%rsp), %rdi
callq 0x15510
jmp 0x20435
movq 0x98(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x8450
movq %rax, 0x90(%rsp)
jmp 0x20454
movq 0x90(%rsp), %rdi
leaq 0x306e0(%rip), %rsi     # 0x50b43
callq 0x8480
movq %rax, 0x88(%rsp)
jmp 0x20472
leaq 0x2b0(%rsp), %rdi
callq 0x16ca0
movq %rax, %rsi
leaq 0x1d0(%rsp), %rdi
callq 0x14ea0
jmp 0x20491
movq 0x88(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x8450
movq %rax, 0x80(%rsp)
jmp 0x204b0
movq 0x80(%rsp), %rdi
leaq 0x3068f(%rip), %rsi     # 0x50b4e
callq 0x8480
movq %rax, 0x78(%rsp)
jmp 0x204cb
movq 0x78(%rsp), %rdi
movq 0x49a59(%rip), %rsi     # 0x69f30
callq 0x84e0
jmp 0x204de
leaq 0x1d0(%rsp), %rdi
callq 0x8998
leaq 0x1f0(%rsp), %rdi
callq 0x8998
leaq 0x2b8(%rsp), %rdi
callq 0x27cb0
movq %rax, %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x15510
jmp 0x20517
leaq 0x238(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x15060
movb %al, 0x77(%rsp)
leaq 0x1b0(%rsp), %rdi
callq 0x8998
movb 0x77(%rsp), %al
testb $0x1, %al
jne 0x2054a
jmp 0x2071e
leaq 0x2d0(%rsp), %rdi
leaq 0x305f9(%rip), %rsi     # 0x50b52
callq 0x8480
movq %rax, 0x68(%rsp)
jmp 0x20565
movq 0x68(%rsp), %rdi
movl 0x234(%rsp), %esi
callq 0x8630
movq %rax, 0x60(%rsp)
jmp 0x2057d
movq 0x60(%rsp), %rdi
leaq 0x305d5(%rip), %rsi     # 0x50b5e
callq 0x8480
movq %rax, 0x58(%rsp)
jmp 0x20595
movq 0x58(%rsp), %rdi
movl 0x25c(%rsp), %esi
callq 0x8630
movq %rax, 0x50(%rsp)
jmp 0x205ad
movq 0x50(%rsp), %rdi
leaq 0x3056e(%rip), %rsi     # 0x50b27
callq 0x8480
movq %rax, 0x48(%rsp)
jmp 0x205c5
leaq 0x2b0(%rsp), %rdi
callq 0x16ca0
movq 0x48(%rsp), %rdi
movss (%rax), %xmm0
callq 0x83b0
movq %rax, 0x40(%rsp)
jmp 0x205e7
movq 0x40(%rsp), %rdi
leaq 0x3053a(%rip), %rsi     # 0x50b2d
callq 0x8480
movq %rax, 0x38(%rsp)
jmp 0x205ff
leaq 0x2b0(%rsp), %rdi
callq 0x16ca0
movq 0x38(%rsp), %rdi
movss 0x4(%rax), %xmm0
callq 0x83b0
movq %rax, 0x30(%rsp)
jmp 0x20622
movq 0x30(%rsp), %rdi
leaq 0x30505(%rip), %rsi     # 0x50b33
callq 0x8480
movq %rax, 0x28(%rsp)
jmp 0x2063a
leaq 0x2b0(%rsp), %rdi
callq 0x16ca0
movq 0x28(%rsp), %rdi
movss 0x8(%rax), %xmm0
callq 0x83b0
movq %rax, 0x20(%rsp)
jmp 0x2065d
movq 0x20(%rsp), %rdi
leaq 0x304b3(%rip), %rsi     # 0x50b1c
callq 0x8480
movq %rax, 0x18(%rsp)
jmp 0x20675
movq 0x18(%rsp), %rdi
movsd 0x260(%rsp), %xmm0
callq 0x8910
movq %rax, 0x10(%rsp)
jmp 0x2068f
movq 0x10(%rsp), %rdi
leaq 0x304b3(%rip), %rsi     # 0x50b4e
callq 0x8480
movq %rax, 0x8(%rsp)
jmp 0x206a7
movq 0x8(%rsp), %rdi
movq 0x4987d(%rip), %rsi     # 0x69f30
callq 0x84e0
jmp 0x206ba
jmp 0x2071e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x20825
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x2070c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
leaq 0x1d0(%rsp), %rdi
callq 0x8998
leaq 0x1f0(%rsp), %rdi
callq 0x8998
jmp 0x20825
leaq 0x2b8(%rsp), %rdi
callq 0x27cb0
movq %rax, %rsi
leaq 0x190(%rsp), %rdi
callq 0x15510
jmp 0x2073d
leaq 0x238(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x85b0
leaq 0x190(%rsp), %rdi
callq 0x8998
movl 0x25c(%rsp), %eax
movl %eax, 0x234(%rsp)
movl 0x25c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x25c(%rsp)
leaq 0x188(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
xorl %edx, %edx
callq 0x16b60
jmp 0x20133
jmp 0x2079c
leaq 0x2b8(%rsp), %rdi
xorl %esi, %esi
callq 0x27db0
movq %rax, 0x180(%rsp)
jmp 0x200c5
leaq 0x2d0(%rsp), %rdi
leaq 0x3039f(%rip), %rsi     # 0x50b66
callq 0x8480
movq %rax, (%rsp)
jmp 0x207d2
movq (%rsp), %rdi
movq 0x49753(%rip), %rsi     # 0x69f30
callq 0x84e0
jmp 0x207e4
movq 0x168(%rsp), %rdi
leaq 0x2c0(%rsp), %rsi
callq 0x8470
jmp 0x207fb
leaq 0x238(%rsp), %rdi
callq 0x8998
leaq 0x2c0(%rsp), %rdi
callq 0x83c0
movq 0x170(%rsp), %rax
addq $0x458, %rsp            # imm = 0x458
retq
leaq 0x238(%rsp), %rdi
callq 0x8998
leaq 0x2c0(%rsp), %rdi
callq 0x83c0
movq 0x288(%rsp), %rdi
callq 0x8870
nopl (%rax)