// File: /workspace/github_cpp_makefile_star2_O1/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 $0x98, %rsp
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, 0x30(%rsp)
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl $0x30, %edi
callq 0x6300
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
leaq 0x30(%rax), %rcx
movq %rcx, 0x10(%rbx)
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, 0x20(%rax)
movq %rbx, 0x28(%rsp)
movq %rcx, 0x8(%rbx)
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0xb208
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
setne %al
testl %r14d, %r14d
sete %cl
orb %al, %cl
je 0x167bd
movl %r14d, 0x4(%rsp)
movl %r14d, %eax
leaq (%rax,%rax,2), %rax
shlq $0x5, %rax
movq %rax, 0x50(%rsp)
addq %rax, %rdx
movq %rdx, 0x38(%rsp)
movl %ebp, %eax
addq $0x9e8, 0x30(%rsp)      # imm = 0x9E8
leaq 0x8(%rsp), %rbx
leaq (%rax,%rax,2), %r14
shlq $0x5, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb208
testl %ebp, %ebp
sete %cl
movq 0x8(%rsp), %rax
testq %rax, %rax
setne %dl
orb %cl, %dl
je 0x167bd
testq %rax, %rax
je 0x167bd
addq %r14, %rax
addq $0x60, %rax
movq 0x38(%rsp), %rsi
cmpq %rax, %rsi
je 0x167a6
movq %rbx, %rdi
callq 0xae24
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x16bf2
movq (%rax), %r12
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x16758
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6310
jmp 0x16758
leaq 0x88(%rsp), %rdi
movq %r15, %rsi
callq 0xb208
cmpl $0x0, 0x4(%rsp)
sete %al
movq 0x88(%rsp), %r13
testq %r13, %r13
setne %cl
orb %al, %cl
je 0x167bd
leaq 0x80(%rsp), %rdi
movq %r15, %rsi
callq 0xb208
testl %ebp, %ebp
sete %cl
movq 0x80(%rsp), %rax
testq %rax, %rax
setne %dl
orb %cl, %dl
je 0x167bd
testq %rax, %rax
je 0x167bd
addq 0x50(%rsp), %r13
addq %r14, %rax
addq $0x60, %rax
movq (%r12), %rcx
movq %r13, 0x8(%rsp)
movq %rax, 0x48(%rsp)
leaq 0x90(%rsp), %rdi
movq %rbx, %rsi
leaq 0x48(%rsp), %rdx
callq 0x18698
leaq 0x78(%rsp), %rdi
movq %r15, %rsi
callq 0xb208
testl %ebp, %ebp
sete %cl
movq 0x78(%rsp), %rax
testq %rax, %rax
setne %dl
orb %cl, %dl
je 0x167bd
testq %rax, %rax
je 0x167bd
addq %r14, %rax
addq $0x60, %rax
cmpq %rax, 0x90(%rsp)
je 0x16724
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0xb208
cmpl $0x0, 0x4(%rsp)
sete %al
movq 0x68(%rsp), %r13
testq %r13, %r13
setne %cl
orb %al, %cl
je 0x167bd
leaq 0x60(%rsp), %rdi
movq %r15, %rsi
callq 0xb208
testl %ebp, %ebp
sete %cl
movq 0x60(%rsp), %rax
testq %rax, %rax
setne %dl
orb %cl, %dl
je 0x167bd
testq %rax, %rax
je 0x167bd
addq 0x50(%rsp), %r13
addq %r14, %rax
addq $0x60, %rax
movq 0x8(%r12), %rcx
movq %r13, 0x8(%rsp)
movq %rax, 0x48(%rsp)
leaq 0x70(%rsp), %rdi
movq %rbx, %rsi
leaq 0x48(%rsp), %rdx
callq 0x18698
leaq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0xb208
testl %ebp, %ebp
sete %cl
movq 0x58(%rsp), %rax
testq %rax, %rax
setne %dl
orb %cl, %dl
je 0x167bd
testq %rax, %rax
je 0x167bd
addq %r14, %rax
addq $0x60, %rax
cmpq %rax, 0x70(%rsp)
je 0x16724
movq %r12, %rdi
callq 0xdf26
movsd %xmm0, 0x40(%rsp)
movq %r12, %rdi
callq 0xe036
movsd 0x40(%rsp), %xmm0
mulsd 0x12906(%rip), %xmm0    # 0x29028
jmp 0x16740
movq %r12, %rdi
callq 0xdf26
movsd %xmm0, 0x40(%rsp)
movq %r12, %rdi
callq 0xe036
movsd 0x40(%rsp), %xmm0
cltq
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
addsd (%rcx,%rax,8), %xmm0
movsd %xmm0, (%rcx,%rax,8)
addq $0x38, %r12
movq %rbx, %rdi
movq 0x38(%rsp), %rsi
callq 0xae24
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x16bf2
movq 0x8(%rax), %r13
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x16792
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6310
cmpq %r13, %r12
jne 0x1656b
addq $0x60, 0x38(%rsp)
jmp 0x164ed
movq 0x28(%rsp), %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13912(%rip), %rdi     # 0x2a0d6
leaq 0x13040(%rip), %rsi     # 0x2980b
leaq 0x13914(%rip), %rcx     # 0x2a0e6
movl $0xab, %edx
callq 0x6210
jmp 0x16813
jmp 0x16813
jmp 0x167ec
jmp 0x16813
jmp 0x16813
jmp 0x16813
jmp 0x16813
jmp 0x16813
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x16816
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6310
jmp 0x16816
jmp 0x16813
jmp 0x16813
jmp 0x16813
movq %rax, %rbx
movq 0x28(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x1682f
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x6310
movq %rbx, %rdi
callq 0x65b0
nop