// File: /workspace/github_cpp_makefile_star2_O1/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 0x16176
movq 0xa78(%rbx), %r15
movq %rbx, 0x10(%rsp)
movq 0xa80(%rbx), %rax
subq %r15, %rax
je 0x16058
shrq $0x4, %rax
imull $0x45008dfb, %eax, %eax # imm = 0x45008DFB
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
mulsd 0x14642(%rip), %xmm0    # 0x2a318
movapd 0x13362(%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 0xcdbc
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb208
movq 0x110(%rsp), %rbp
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb214
cmpq 0x110(%rsp), %rbp
je 0x15d9c
movq %rbp, %rdi
callq 0xae12
movsd %xmm0, 0x110(%rsp)
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x15d89
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x15d96
leaq 0x20(%rsp), %rdi
movq %rbx, %rdx
callq 0xa62a
addq $0x60, %rbp
jmp 0x15d48
movl $0x0, 0xc8(%rsp)
movq %r15, %rdi
callq 0xb1dc
decl %eax
movl %eax, 0xcc(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, %ebp
testl %eax, %eax
je 0x1600a
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 0x72a4
movsd %xmm0, 0x8(%rsp)
movq %r13, %rdi
xorl %esi, %esi
callq 0x901a
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movapd 0x80(%rsp), %xmm0
movapd 0x90(%rsp), %xmm1
movq %r12, %rdi
callq 0x72a4
movsd %xmm0, 0x8(%rsp)
movl $0x1, %esi
movq %r13, %rdi
callq 0x901a
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movapd 0x80(%rsp), %xmm0
movapd 0x90(%rsp), %xmm1
movq %r12, %rdi
callq 0x72a4
movsd %xmm0, 0x8(%rsp)
movl $0x2, %esi
movq %r13, %rdi
callq 0x901a
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0xa8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x87e0
movq %r14, %rdi
movq %r13, %rsi
callq 0x94b0
leaq 0x58(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
movq %r14, %rdx
movq %r12, %rcx
movl $0x3e8, %r8d            # imm = 0x3E8
callq 0x7551
movq 0x100(%rsp), %rsi
testq %rsi, %rsi
je 0x15ed9
movq 0x108(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x15ef6
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x15f72
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 0xcc46
movq 0x70(%rsp), %rdx
testq %rdx, %rdx
je 0x15f4d
movq 0x78(%rsp), %rsi
shlq $0x3, %rdx
movq 0xf0(%rsp), %rdi
callq 0x64e0
leaq 0xc0(%rsp), %rdi
callq 0xcf1e
movq 0x10(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
xorl %edx, %edx
callq 0xfef6
testb %al, %al
je 0x15fac
movq 0x70(%rsp), %rsi
testq %rsi, %rsi
je 0x15f8a
movq 0x78(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0x15fa2
movq 0x50(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
decl %ebp
jne 0x15dc6
jmp 0x1600a
movq %rbx, %rdi
leaq 0xc0(%rsp), %rdx
callq 0x10518
movq 0x138(%rsp), %rsi
testq %rsi, %rsi
je 0x15fda
movq 0x140(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x70(%rsp), %rsi
testq %rsi, %rsi
je 0x15ff2
movq 0x78(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0x1600a
movq 0x50(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0xe8(%rsp), %rsi
testq %rsi, %rsi
je 0x16028
movq 0xf0(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1603f
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
addq $0x75330, %r15          # imm = 0x75330
movq 0x10(%rsp), %rax
cmpq 0xa80(%rax), %r15
jne 0x15d12
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x160bc
jmp 0x160db
jmp 0x160db
movq %rax, %rbx
jmp 0x16119
jmp 0x160e0
movq %rax, %rbx
jmp 0x160a0
movq %rax, %rbx
movq 0x100(%rsp), %rsi
testq %rsi, %rsi
je 0x160a0
movq 0x108(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x160e3
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
jmp 0x160d2
jmp 0x160db
movq %rax, %rbx
movq 0x70(%rsp), %rsi
testq %rsi, %rsi
je 0x160e3
movq 0x78(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
jmp 0x160e3
jmp 0x160db
movq %rax, %rbx
jmp 0x160fb
movq %rax, %rbx
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0x160fb
movq 0x50(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0xe8(%rsp), %rsi
testq %rsi, %rsi
je 0x16119
movq 0xf0(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x16130
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
movq %rbx, %rdi
callq 0x65b0