// File: Chrom3D[P]Chrom3D/src/Model.cpp
// Function: Model::proposeMove(unsigned int)
Move Model::proposeMove(uint maxAttempts/*=10000*/) {
  assert(this->randomizers.size() > 0);
  uint iRand = weightedSamplePos(randomizerWeights, randEngine);
  uint iChr = util::unif_int(0, chromosomes.size()-1, randEngine);
  for(uint i=0; i!=maxAttempts; i++) {
    Move mov = randomizers[iRand].randomize(chromosomes[iChr], randEngine);
    if(mov.mat.size1()!=0) {
      mov.validate();
      if (not isClashing(mov)) {
        return mov;
      }
    }
  }
  throw util::MoveException();

}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x30(%rsp)
movq %rdi, %rax
movq %rax, 0x38(%rsp)
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movl %edx, 0x84(%rsp)
movq 0x88(%rsp), %rdi
movq %rdi, 0x40(%rsp)
addq $0xa48, %rdi            # imm = 0xA48
callq 0x28880
cmpq $0x0, %rax
jbe 0x1dfec
jmp 0x1e00b
leaq 0x32a8f(%rip), %rdi     # 0x50a82
leaq 0x326d5(%rip), %rsi     # 0x506cf
movl $0x110, %edx            # imm = 0x110
leaq 0x32a99(%rip), %rcx     # 0x50a9f
callq 0x8340
movq 0x40(%rsp), %rsi
addq $0xa60, %rsi            # imm = 0xA60
leaq 0x68(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xc2c0
movq 0x40(%rsp), %rsi
movq 0x20(%rsp), %rdi
addq $0x20, %rsi
callq 0x1e230
movl %eax, 0x2c(%rsp)
jmp 0x1e03f
leaq 0x68(%rsp), %rdi
callq 0xc3c0
movl 0x2c(%rsp), %eax
movq 0x40(%rsp), %rdi
movl %eax, 0x80(%rsp)
addq $0xa78, %rdi            # imm = 0xA78
callq 0x28890
movq 0x40(%rsp), %rdx
subq $0x1, %rax
movl %eax, %esi
addq $0x20, %rdx
xorl %edi, %edi
callq 0x9980
movl %eax, 0x58(%rsp)
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
cmpl 0x84(%rsp), %eax
je 0x1e1c0
movq 0x40(%rsp), %rdi
movb $0x0, 0x53(%rsp)
addq $0xa48, %rdi            # imm = 0xA48
movl 0x80(%rsp), %eax
movl %eax, %esi
callq 0x288b0
movq 0x40(%rsp), %rdi
movq %rax, 0x10(%rsp)
addq $0xa78, %rdi            # imm = 0xA78
movl 0x58(%rsp), %eax
movl %eax, %esi
callq 0x28960
movq 0x40(%rsp), %rcx
movq 0x10(%rsp), %rsi
movq 0x30(%rsp), %rdi
movq %rax, %rdx
addq $0x20, %rcx
movq (%rsi), %rax
movq (%rax), %rax
callq *%rax
movq 0x30(%rsp), %rdi
addq $0x10, %rdi
callq 0xb5e0
movq %rax, 0x18(%rsp)
jmp 0x1e106
movq 0x18(%rsp), %rax
cmpq $0x0, %rax
je 0x1e189
movq 0x30(%rsp), %rdi
callq 0x194e0
jmp 0x1e11d
movq 0x30(%rsp), %rsi
movq 0x40(%rsp), %rdi
xorl %edx, %edx
callq 0x1e470
movb %al, 0xf(%rsp)
jmp 0x1e134
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x1e187
jmp 0x1e13e
movb $0x1, 0x53(%rsp)
movl $0x1, 0x4c(%rsp)
jmp 0x1e191
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0xc3c0
jmp 0x1e218
movq 0x30(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
callq 0x1a560
jmp 0x1e218
jmp 0x1e189
movl $0x0, 0x4c(%rsp)
testb $0x1, 0x53(%rsp)
jne 0x1e1a2
movq 0x30(%rsp), %rdi
callq 0x1a560
movl 0x4c(%rsp), %eax
testl %eax, %eax
je 0x1e1ae
jmp 0x1e1ac
jmp 0x1e20b
jmp 0x1e1b0
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x1e087
movl $0x8, %edi
callq 0x8280
movq %rax, %rdi
movq %rdi, %rax
movq %rax, (%rsp)
callq 0xb010
jmp 0x1e1db
movq (%rsp), %rdi
leaq 0x4ac32(%rip), %rsi     # 0x68e18
leaq -0x119dd(%rip), %rdx    # 0xc810
callq 0x8820
movq (%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
callq 0x83a0
jmp 0x1e218
movq 0x38(%rsp), %rax
addq $0x98, %rsp
retq
movq 0x60(%rsp), %rdi
callq 0x8870
nopw %cs:(%rax,%rax)