// File: /workspace/github_cpp_makefile_star2_O3/Chrom3D[P]Chrom3D/src/Model.cpp
// Function: Model::calculateScorePerConstraint(Chromosome&, unsigned int, unsigned int)
std::vector<double> Model::calculateScorePerConstraint(Chromosome& chr, uint startPos, uint endPos){
  
  std::vector<double> myScore(C_T_COUNT,0.0);
  
  boost::container::static_vector<Bead,MAXSIZE>::iterator it;
  vector<Constraint>::iterator it2;
  for(it = chr.begin() + startPos; it != chr.begin() + endPos+1; it++) {
    for(it2 = constraints[it->getID()].begin(); it2 != constraints[it->getID()].end(); it2++) {
      if ((find(chr.begin()+startPos, chr.begin()+endPos+1, *(it2->bead1)) != chr.begin()+endPos+1) and (find(chr.begin()+startPos, chr.begin()+endPos+1, *(it2->bead2)) != chr.begin()+endPos+1) ) {
        myScore[it2->getConstraintTypeID()] += it2->eval()/2;
      }
      else {
        myScore[it2->getConstraintTypeID()] += it2->eval();
      }
    }
   }
  
  return myScore;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %r8d, %ebp
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, 0x30(%rsp)
movq %rdi, %r14
movl $0x30, %edi
callq 0x6300
movq %rax, (%r14)
leaq 0x30(%rax), %rcx
movq %rcx, 0x10(%r14)
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movupd %xmm0, 0x10(%rax)
movq %rax, 0x50(%rsp)
movupd %xmm0, 0x20(%rax)
movq %r14, 0x60(%rsp)
movq %rcx, 0x8(%r14)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0xb164
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
setne %al
testl %ebx, %ebx
sete %cl
orb %al, %cl
je 0x16427
movl %ebx, 0xc(%rsp)
movl %ebx, %eax
leaq (%rax,%rax,2), %rax
shlq $0x5, %rax
movq %rax, 0x58(%rsp)
addq %rax, %rdx
movq %rdx, 0x38(%rsp)
movl %ebp, %eax
addq $0x9e8, 0x30(%rsp)      # imm = 0x9E8
leaq 0x10(%rsp), %r13
leaq (%rax,%rax,2), %r14
shlq $0x5, %r14
movq %r13, %rdi
movq %r15, %rsi
callq 0xb164
testl %ebp, %ebp
sete %cl
movq 0x10(%rsp), %rax
testq %rax, %rax
setne %dl
orb %cl, %dl
je 0x16427
testq %rax, %rax
je 0x16427
addq %r14, %rax
addq $0x60, %rax
movq 0x38(%rsp), %rsi
cmpq %rax, %rsi
je 0x16410
movq %r13, %rdi
callq 0xad90
movq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x16876
movq (%rax), %r12
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x163c2
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6310
jmp 0x163c2
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
callq 0xb164
cmpl $0x0, 0xc(%rsp)
sete %al
movq 0x98(%rsp), %rbx
testq %rbx, %rbx
setne %cl
orb %al, %cl
je 0x16427
leaq 0x90(%rsp), %rdi
movq %r15, %rsi
callq 0xb164
testl %ebp, %ebp
sete %cl
movq 0x90(%rsp), %rax
testq %rax, %rax
setne %dl
orb %cl, %dl
je 0x16427
testq %rax, %rax
je 0x16427
addq 0x58(%rsp), %rbx
addq %r14, %rax
addq $0x60, %rax
movq (%r12), %rcx
movq %rbx, 0x10(%rsp)
movq %rax, 0x48(%rsp)
leaq 0xa0(%rsp), %rdi
movq %r13, %rsi
leaq 0x48(%rsp), %rdx
callq 0x1834a
leaq 0x88(%rsp), %rdi
movq %r15, %rsi
callq 0xb164
testl %ebp, %ebp
sete %cl
movq 0x88(%rsp), %rax
testq %rax, %rax
setne %dl
orb %cl, %dl
je 0x16427
testq %rax, %rax
je 0x16427
addq %r14, %rax
addq $0x60, %rax
cmpq %rax, 0xa0(%rsp)
je 0x16391
leaq 0x78(%rsp), %rdi
movq %r15, %rsi
callq 0xb164
cmpl $0x0, 0xc(%rsp)
sete %al
movq 0x78(%rsp), %rbx
testq %rbx, %rbx
setne %cl
orb %al, %cl
je 0x16427
leaq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0xb164
testl %ebp, %ebp
sete %cl
movq 0x70(%rsp), %rax
testq %rax, %rax
setne %dl
orb %cl, %dl
je 0x16427
testq %rax, %rax
je 0x16427
addq 0x58(%rsp), %rbx
addq %r14, %rax
addq $0x60, %rax
movq 0x8(%r12), %rcx
movq %rbx, 0x10(%rsp)
movq %rax, 0x48(%rsp)
leaq 0x80(%rsp), %rdi
movq %r13, %rsi
leaq 0x48(%rsp), %rdx
callq 0x1834a
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0xb164
testl %ebp, %ebp
sete %cl
movq 0x68(%rsp), %rax
testq %rax, %rax
setne %dl
orb %cl, %dl
je 0x16427
testq %rax, %rax
je 0x16427
addq %r14, %rax
addq $0x60, %rax
cmpq %rax, 0x80(%rsp)
je 0x16391
movq %r12, %rdi
callq 0xde80
movsd %xmm0, 0x40(%rsp)
movq %r12, %rdi
callq 0xdf90
movsd 0x40(%rsp), %xmm0
mulsd 0x12c99(%rip), %xmm0    # 0x29028
jmp 0x163ad
movq %r12, %rdi
callq 0xde80
movsd %xmm0, 0x40(%rsp)
movq %r12, %rdi
callq 0xdf90
movsd 0x40(%rsp), %xmm0
cltq
movq 0x50(%rsp), %rcx
addsd (%rcx,%rax,8), %xmm0
movsd %xmm0, (%rcx,%rax,8)
addq $0x38, %r12
movq %r13, %rdi
movq 0x38(%rsp), %rsi
callq 0xad90
movq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x16876
movq 0x8(%rax), %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x163fc
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6310
cmpq %rbx, %r12
jne 0x161cc
addq $0x60, 0x38(%rsp)
jmp 0x1614e
movq 0x60(%rsp), %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13ca8(%rip), %rdi     # 0x2a0d6
leaq 0x133d6(%rip), %rsi     # 0x2980b
leaq 0x13caa(%rip), %rcx     # 0x2a0e6
movl $0xab, %edx
callq 0x6210
jmp 0x1647d
jmp 0x1647d
jmp 0x16456
jmp 0x1647d
jmp 0x1647d
jmp 0x1647d
jmp 0x1647d
jmp 0x1647d
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x16480
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6310
jmp 0x16480
jmp 0x1647d
jmp 0x1647d
jmp 0x1647d
movq %rax, %r14
movl $0x30, %esi
movq 0x50(%rsp), %rdi
callq 0x6310
movq %r14, %rdi
callq 0x65b0
nop