// File: /workspace/github_cpp_makefile_star2_O2/Luthaf[P]zeopp/feature.cc
// Function: FEATURE::calculateVolumeForAllFeatures(VORONOI_NETWORK*, DIJKSTRA_NETWORK*)
void FEATURE::calculateVolumeForAllFeatures(VORONOI_NETWORK *origVNet,DIJKSTRA_NETWORK *origDNet){

    vector< vector<int> > nodesForFeatures = vector < vector<int> > (nfeatures, vector<int> ());
    vector<FEATURE> featChannels = vector<FEATURE> ();

    for(unsigned int i = 0; i < feature_node_mapping.size(); i++){
      nodesForFeatures[feature_node_mapping[i]].push_back(reverseIDMappings.find(i)->second);
    }

    int zeroVecs [3][3] = {{0, 0, 0},{ 0, 0, 0}, {0, 0, 0}};

    for(int i = 0; i < nfeatures; i++){
       DIJKSTRA_NETWORK featNet;
       DIJKSTRA_NETWORK::filterDnetEdges(nodesForFeatures[i], origVNet, &featNet);
       vector<bool> infoStorage; vector<CHANNEL> channels;
       findChannels(&featNet, &infoStorage, &channels);
       int dim;
       if(channels.size() != 0){
         dim = channels[0].dimensionality;
         featChannels.push_back(FEATURE(nodesForFeatures[i], origDNet, dim, channels[0].basis));
       }
       else{
         dim = 0;
         featChannels.push_back(FEATURE(nodesForFeatures[i], origDNet, 0, zeroVecs));
       }
//       featChannels[i].writeToVMD("feature", initIndex + i, output);
       feature_volume.push_back(featChannels[i].calculateVolume());
//       cout << "Feature volume = " << featChannels[i].calculateVolume() << "\n";
    };

  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movq %rdx, 0x8(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdi, %r15
movslq 0x1b8(%rdi), %rsi
xorps %xmm0, %xmm0
leaq 0x180(%rsp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
leaq 0x58(%rsp), %rdi
leaq 0x120(%rsp), %rcx
callq 0x4b956
leaq 0x180(%rsp), %rbx
movq %rbx, %rdi
callq 0xb290
leaq 0x30(%r15), %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
andq $0x0, 0x50(%rsp)
xorl %ebp, %ebp
movq %r15, 0x18(%rsp)
movl %ebp, %eax
movq 0x1d8(%r15), %rcx
movq 0x1e0(%r15), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rax, %rdx
jbe 0x5dbc7
movslq (%rcx,%rax,4), %r13
movq 0x58(%rsp), %r12
movl %ebp, 0x180(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10996
imulq $0x18, %r13, %rcx
addq %rcx, %r12
addq $0x24, %rax
movq %r12, %rdi
movq %rax, %rsi
callq 0x9434
incl %ebp
movq 0x18(%rsp), %r15
jmp 0x5db71
xorps %xmm0, %xmm0
leaq 0xf0(%rsp), %rax
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
andl $0x0, 0x20(%rax)
leaq 0x220(%r15), %rax
movq %rax, 0x70(%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x120(%rsp), %rbx
leaq 0x180(%rsp), %r14
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x18(%rsp), %rax
movslq 0x1b8(%rax), %rax
cmpq %rax, %rbp
jge 0x5ddbd
movq %rbx, %rdi
callq 0x3d70e
movq 0x58(%rsp), %rsi
addq %r12, %rsi
leaq 0xd8(%rsp), %r13
movq %r13, %rdi
callq 0xa6ce
movq %r13, %rdi
movq 0x78(%rsp), %rsi
movq %rbx, %rdx
callq 0x3d90c
movq %r13, %rdi
callq 0xb290
andq $0x0, 0x80(%rsp)
andl $0x0, 0x88(%rsp)
andq $0x0, 0x90(%rsp)
andl $0x0, 0x98(%rsp)
andq $0x0, 0xa0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
movq %rbx, %rdi
leaq 0x80(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x55ab0
movq 0x20(%rsp), %rax
cmpq %rax, 0x28(%rsp)
leaq 0xc0(%rsp), %r13
je 0x5dd10
movq %rbx, %r15
movl 0x108(%rax), %ebx
movq 0x58(%rsp), %rsi
addq %r12, %rsi
movq %r13, %rdi
callq 0xa6ce
movq 0x20(%rsp), %r8
movl $0x10c, %eax            # imm = 0x10C
addq %rax, %r8
movq %r14, %rdi
movq %r13, %rsi
movq 0x8(%rsp), %rdx
movl %ebx, %ecx
callq 0x5f0b4
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x5f3c8
movq %r15, %rbx
movq %r14, %rdi
callq 0x5f166
leaq 0xc0(%rsp), %rdi
jmp 0x5dd5f
movq 0x58(%rsp), %rsi
addq %r12, %rsi
leaq 0xa8(%rsp), %r13
movq %r13, %rdi
callq 0xa6ce
movq %r14, %rdi
movq %r13, %rsi
movq 0x8(%rsp), %rdx
xorl %ecx, %ecx
leaq 0xf0(%rsp), %r8
callq 0x5f0b4
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x5f3c8
movq %r14, %rdi
callq 0x5f166
leaq 0xa8(%rsp), %rdi
callq 0xb290
movq 0x40(%rsp), %rdi
addq 0x10(%rsp), %rdi
callq 0x5a5d4
movsd %xmm0, 0x180(%rsp)
movq 0x70(%rsp), %rdi
movq %r14, %rsi
callq 0xf9fe
leaq 0x20(%rsp), %rdi
callq 0x37062
leaq 0x80(%rsp), %rdi
callq 0xa976
movq %rbx, %rdi
callq 0xae22
incq %rbp
addq $0x18, %r12
addq $0x268, 0x10(%rsp)      # imm = 0x268
jmp 0x5dc07
leaq 0x40(%rsp), %rdi
callq 0x5f204
leaq 0x58(%rsp), %rdi
callq 0xad7e
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0xb290
jmp 0x5de9a
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x5f166
jmp 0x5de0d
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
jmp 0x5de36
jmp 0x5de5a
movq %rax, %rbx
jmp 0x5de2e
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x5f166
leaq 0xc0(%rsp), %rdi
callq 0xb290
jmp 0x5de5d
jmp 0x5de5a
jmp 0x5de83
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0xb290
jmp 0x5de74
jmp 0x5de5a
movq %rax, %rbx
jmp 0x5de74
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x37062
leaq 0x80(%rsp), %rdi
callq 0xa976
leaq 0x120(%rsp), %rdi
callq 0xae22
jmp 0x5de86
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x5f204
leaq 0x58(%rsp), %rdi
callq 0xad7e
movq %rbx, %rdi
callq 0x4780