// File: /workspace/github_cpp_makefile_star2_O3/Chrom3D[P]Chrom3D/src/Model.cpp
// Function: Model::resetAllChromosomes(unsigned int)
void Model::resetAllChromosomes(uint maxAttempts /*=1000*/) { //, bool updateClash /*=false*/) {
  vector<Chromosome>::iterator chriter;
  boost::container::static_vector<Bead,MAXSIZE>::iterator beaditer;  
  double L = (this->getTotalChrLength() / this->numberOfChromosomes()) * 0.1;
  for(chriter = chromosomes.begin(); chriter != chromosomes.end(); chriter++) {
    vector<double> radii;
    Move mov(*chriter);
    boost::container::static_vector<Bead,MAXSIZE>::iterator beaditer;
    for(beaditer=chriter->begin(); beaditer!=chriter->end(); beaditer++) {
      radii.push_back(beaditer->getRadius());
    }
    mov.start = 0;
    mov.stop = chriter->size()-1;
    for(uint i=0; i!=maxAttempts; i++) {
      CoordinateVector origin(3);
      origin(0) = util::unif_real(-L, L, randEngine);
      origin(1) = util::unif_real(-L, L, randEngine);
      origin(2) = util::unif_real(-L, L, randEngine);
      CoordinateMatrix mat = util::createSelfAvoidingWalk(radii, origin, randEngine);
      
      if(mat.size1()!=0){
        mov.mat = mat;
        mov.validate();
        if (not isClashing(mov)) {
	  //cerr << "# " << chriter->getName() << " done!" << endl;
	  Move old = this->accept(mov); //, updateClash);
	  break;
        }
      }
    }
  }  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movl %esi, 0x1c(%rsp)
movq %rdi, %rbx
callq 0x15dea
movq 0xa78(%rbx), %r15
movq %rbx, 0x10(%rsp)
movq 0xa80(%rbx), %rax
subq %r15, %rax
je 0x15ccc
shrq $0x4, %rax
imull $0x45008dfb, %eax, %eax # imm = 0x45008DFB
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
mulsd 0x149ce(%rip), %xmm0    # 0x2a318
movapd 0x136ee(%rip), %xmm1    # 0x29040
movapd %xmm0, 0x90(%rsp)
xorpd %xmm0, %xmm1
movapd %xmm1, 0x80(%rsp)
movq 0x10(%rsp), %rax
leaq 0x20(%rax), %r12
leaq 0x110(%rsp), %rbx
leaq 0x40(%rsp), %r13
leaq 0xf8(%rsp), %r14
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0xc0(%rsp), %rdi
movq %r15, %rsi
callq 0xcd38
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb164
movq 0x110(%rsp), %rbp
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb170
cmpq 0x110(%rsp), %rbp
je 0x15a10
movq %rbp, %rdi
callq 0xad7e
movsd %xmm0, 0x110(%rsp)
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x159fd
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x15a0a
leaq 0x20(%rsp), %rdi
movq %rbx, %rdx
callq 0xa598
addq $0x60, %rbp
jmp 0x159bc
movl $0x0, 0xc8(%rsp)
movq %r15, %rdi
callq 0xb138
decl %eax
movl %eax, 0xcc(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, %ebp
testl %eax, %eax
je 0x15c7e
movq $0x3, 0x48(%rsp)
movl $0x18, %edi
callq 0x6300
movq %rax, 0x50(%rsp)
movapd 0x80(%rsp), %xmm0
movapd 0x90(%rsp), %xmm1
movq %r12, %rdi
callq 0x72c4
movsd %xmm0, 0x8(%rsp)
movq %r13, %rdi
xorl %esi, %esi
callq 0x8fe2
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movapd 0x80(%rsp), %xmm0
movapd 0x90(%rsp), %xmm1
movq %r12, %rdi
callq 0x72c4
movsd %xmm0, 0x8(%rsp)
movl $0x1, %esi
movq %r13, %rdi
callq 0x8fe2
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movapd 0x80(%rsp), %xmm0
movapd 0x90(%rsp), %xmm1
movq %r12, %rdi
callq 0x72c4
movsd %xmm0, 0x8(%rsp)
movl $0x2, %esi
movq %r13, %rdi
callq 0x8fe2
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0xa8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x87a2
movq %r14, %rdi
movq %r13, %rsi
callq 0x9478
leaq 0x58(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
movq %r14, %rdx
movq %r12, %rcx
movl $0x3e8, %r8d            # imm = 0x3E8
callq 0x756a
movq 0x100(%rsp), %rsi
testq %rsi, %rsi
je 0x15b4d
movq 0x108(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x15b6a
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x15be6
movq %rax, 0xd0(%rsp)
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rsi
movq %rax, 0xd8(%rsp)
xorpd %xmm0, %xmm0
leaq 0xe0(%rsp), %rdi
xorl %edx, %edx
callq 0xcbba
movq 0x70(%rsp), %rdx
testq %rdx, %rdx
je 0x15bc1
movq 0x78(%rsp), %rsi
shlq $0x3, %rdx
movq 0xf0(%rsp), %rdi
callq 0x64e0
leaq 0xc0(%rsp), %rdi
callq 0xce9a
movq 0x10(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
xorl %edx, %edx
callq 0xfe56
testb %al, %al
je 0x15c20
movq 0x70(%rsp), %rsi
testq %rsi, %rsi
je 0x15bfe
movq 0x78(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0x15c16
movq 0x50(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
decl %ebp
jne 0x15a3a
jmp 0x15c7e
movq %rbx, %rdi
leaq 0xc0(%rsp), %rdx
callq 0x10420
movq 0x138(%rsp), %rsi
testq %rsi, %rsi
je 0x15c4e
movq 0x140(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x70(%rsp), %rsi
testq %rsi, %rsi
je 0x15c66
movq 0x78(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0x15c7e
movq 0x50(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0xe8(%rsp), %rsi
testq %rsi, %rsi
je 0x15c9c
movq 0xf0(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x15cb3
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
addq $0x75330, %r15          # imm = 0x75330
movq 0x10(%rsp), %rax
cmpq 0xa80(%rax), %r15
jne 0x15986
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x15d30
jmp 0x15d4f
jmp 0x15d4f
movq %rax, %rbx
jmp 0x15d8d
jmp 0x15d54
movq %rax, %rbx
jmp 0x15d14
movq %rax, %rbx
movq 0x100(%rsp), %rsi
testq %rsi, %rsi
je 0x15d14
movq 0x108(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x15d57
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
jmp 0x15d46
jmp 0x15d4f
movq %rax, %rbx
movq 0x70(%rsp), %rsi
testq %rsi, %rsi
je 0x15d57
movq 0x78(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
jmp 0x15d57
jmp 0x15d4f
movq %rax, %rbx
jmp 0x15d6f
movq %rax, %rbx
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0x15d6f
movq 0x50(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0xe8(%rsp), %rsi
testq %rsi, %rsi
je 0x15d8d
movq 0xf0(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x15da4
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
movq %rbx, %rdi
callq 0x65b0