// File: /workspace/github_cpp_makefile_star2_O1/GAStudyGroup[P]GPX2/src/cross/AntColony/Constants.cpp
// Function: AntMap::updatePheromoneMap(std::vector<int, std::allocator<int>> const&)
void AntMap::updatePheromoneMap(const vector<int>& path){
    for(unsigned i=1;i<=Globals::TOUR_SIZE;i++){
        for(unsigned j=1;j<=Globals::TOUR_SIZE;j++){
            if(i!=j){
                double decay{((1-AntConstants::rho)*AntMap::getPheromoneLevel(i,j))},
                    add{(constainsEdge(path,i,j)?(AntConstants::Q/getFitness(path)):(0.0))},
                    max{maxPheromoneLevel()},
                    min{minPheromoneLevel()},
                    newValue{decay+add};
                
                if(min>max){
                    min = max;
                }
                
                if(newValue > max){
                    newValue = max;
                }else if(newValue < min){
                    newValue = min;
                }
                // cout<<"maxPheromoneLevel: "<<max<<" minPheromoneLevel: "<<min<<endl;
                AntMap::setPheromoneLevel(i,j,newValue);
                //because assymetric TSP
                AntMap::setPheromoneLevel(j,i,newValue);
            }
            
        }   
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x21371(%rip), %r15     # 0x43c88
cmpl $0x0, (%r15)
je 0x22ab0
movq %rdi, %rbx
movl $0x1, 0x4(%rsp)
xorl %r12d, %r12d
cmpl $0x0, (%r15)
je 0x22a9a
movslq 0x4(%rsp), %r13
movl $0x1, %r14d
leal (%r12,%r14), %eax
cmpl $0x1, %eax
je 0x22a8e
movsd 0xe9bf(%rip), %xmm0     # 0x31318
subsd 0x1fe97(%rip), %xmm0    # 0x427f8
movq 0x21330(%rip), %rax     # 0x43c98
movq -0x8(%rax,%r13,8), %rax
movslq %r14d, %rbp
mulsd -0x8(%rax,%rbp,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movl %r13d, 0x14(%rsp)
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
leaq 0x14(%rsp), %rdx
callq 0x22e08
movq (%rbx), %rcx
subq %rcx, %rax
sarq $0x2, %rax
incq %rax
movl (%r15), %esi
cqto
idivq %rsi
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
cmpl (%rcx,%rdx,4), %ebp
jne 0x229e3
movsd 0x1fe32(%rip), %xmm0    # 0x427f0
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0xf1c0
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x1fe05(%rip), %xmm3    # 0x427f0
xorps %xmm2, %xmm2
cvtsi2sdl 0x212aa(%rip), %xmm2 # 0x43ca0
mulsd 0x1fdfa(%rip), %xmm2    # 0x427f8
movsd 0x1fdfa(%rip), %xmm0    # 0x42800
cmpl $0x1, (%r15)
movsd 0xe906(%rip), %xmm1     # 0x31318
je 0x22a18
xorpd %xmm1, %xmm1
divsd %xmm2, %xmm3
movsd %xmm3, 0x18(%rsp)
callq 0x5660
movsd 0x18(%rsp), %xmm3
movsd 0x20(%rsp), %xmm2
addsd 0x8(%rsp), %xmm2
ucomisd %xmm3, %xmm2
ja 0x22a6c
movsd 0xe8d1(%rip), %xmm1     # 0x31318
subsd %xmm0, %xmm1
mulsd %xmm3, %xmm1
movl (%r15), %eax
shrl %eax
decl %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd %xmm0, %xmm1
minsd %xmm1, %xmm3
ucomisd %xmm2, %xmm3
jbe 0x22a70
movapd %xmm3, %xmm2
movq 0x21221(%rip), %rax     # 0x43c98
movq -0x8(%rax,%r13,8), %rcx
movsd %xmm2, -0x8(%rcx,%rbp,8)
movq -0x8(%rax,%rbp,8), %rax
movsd %xmm2, -0x8(%rax,%r13,8)
incl %r14d
cmpl (%r15), %r14d
jbe 0x22944
movl 0x4(%rsp), %eax
incl %eax
decl %r12d
movl %eax, 0x4(%rsp)
cmpl (%r15), %eax
jbe 0x2292f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq