// File: /workspace/github_cpp_makefile_star2_O1/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, 0x38(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdi, %r15
movslq 0x1b8(%rdi), %rsi
xorps %xmm0, %xmm0
leaq 0x180(%rsp), %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
leaq 0x78(%rsp), %rdi
leaq 0x120(%rsp), %rcx
callq 0x67eb0
movq 0x180(%rsp), %rdi
testq %rdi, %rdi
je 0x7e135
movq 0x190(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
movq 0x1d8(%r15), %rax
cmpq %rax, 0x1e0(%r15)
je 0x7e1ee
leaq 0x38(%r15), %rbx
xorl %r14d, %r14d
movq 0x40(%r15), %rdx
movq %rbx, %rcx
testq %rdx, %rdx
je 0x7e188
movq %rbx, %rcx
xorl %esi, %esi
cmpl %r14d, 0x20(%rdx)
setl %sil
cmovgeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x7e170
movq %rbx, %rdx
cmpq %rbx, %rcx
je 0x7e19b
cmpl 0x20(%rcx), %r14d
cmovlq %rbx, %rcx
movq %rcx, %rdx
movslq (%rax,%r14,4), %rax
leaq (%rax,%rax,2), %rdi
shlq $0x3, %rdi
addq 0x78(%rsp), %rdi
addq $0x24, %rdx
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x7e1c8
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x7e1cd
callq 0xf7b4
incl %r14d
movq 0x1d8(%r15), %rax
movq 0x1e0(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r14, %rcx
ja 0x7e161
xorps %xmm0, %xmm0
movaps %xmm0, 0x100(%rsp)
movaps %xmm0, 0xf0(%rsp)
movl $0x0, 0x110(%rsp)
movq %r15, 0x8(%rsp)
cmpl $0x0, 0x1b8(%r15)
jle 0x7e483
movq 0x8(%rsp), %rax
addq $0x220, %rax            # imm = 0x220
movq %rax, 0x90(%rsp)
leaq 0x120(%rsp), %r14
leaq 0x180(%rsp), %r12
xorl %r13d, %r13d
movq $0x0, (%rsp)
xorl %ebx, %ebx
movq %rbx, 0xa0(%rsp)
movq %r14, %rdi
callq 0x50e9e
movq 0x78(%rsp), %rsi
addq (%rsp), %rsi
leaq 0xd8(%rsp), %rbp
movq %rbp, %rdi
callq 0xe886
movq %rbp, %rdi
movq 0x98(%rsp), %rsi
movq %r14, %rdx
callq 0x51180
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x7e2a8
movq 0xe8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movq %rax, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x746d0
movq 0x40(%rsp), %rax
cmpq %rax, 0x48(%rsp)
je 0x7e364
movq %r13, %rbx
movq %r14, %r15
movl 0x108(%rax), %r14d
movq 0x78(%rsp), %rsi
addq (%rsp), %rsi
leaq 0xc0(%rsp), %r13
movq %r13, %rdi
callq 0xe886
movq 0x40(%rsp), %r8
movl $0x10c, %eax            # imm = 0x10C
addq %rax, %r8
movq %r12, %rdi
movq %r13, %rsi
movq 0x38(%rsp), %rdx
movl %r14d, %ecx
callq 0x7fcf6
leaq 0x60(%rsp), %rdi
movq %r12, %rsi
callq 0x80070
movq %r15, %r14
movq %rbx, %r13
movq %r12, %rdi
callq 0x7fdc6
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x7e3c9
movq 0xd0(%rsp), %rsi
jmp 0x7e3c1
movq 0x78(%rsp), %rsi
addq (%rsp), %rsi
leaq 0xa8(%rsp), %rbp
movq %rbp, %rdi
callq 0xe886
movq %r12, %rdi
movq %rbp, %rsi
movq 0x38(%rsp), %rdx
xorl %ecx, %ecx
leaq 0xf0(%rsp), %r8
callq 0x7fcf6
leaq 0x60(%rsp), %rdi
movq %r12, %rsi
callq 0x80070
movq %r12, %rdi
callq 0x7fdc6
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x7e3c9
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x60(%rsp), %rdi
addq %r13, %rdi
callq 0x79b3c
movsd %xmm0, 0x180(%rsp)
movq 0x8(%rsp), %rax
movq 0x228(%rax), %rsi
cmpq 0x230(%rax), %rsi
je 0x7e405
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x228(%rax)
jmp 0x7e415
movq 0x90(%rsp), %rdi
movq %r12, %rdx
callq 0x139c2
leaq 0x40(%rsp), %rdi
callq 0x494b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
movq 0xa0(%rsp), %rbx
je 0x7e457
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movq %r14, %rdi
callq 0xf07c
incq %rbx
movq 0x8(%rsp), %rax
movslq 0x1b8(%rax), %rax
addq $0x18, (%rsp)
addq $0x268, %r13            # imm = 0x268
cmpq %rax, %rbx
jl 0x7e24f
leaq 0x60(%rsp), %rdi
callq 0x7ff4a
leaq 0x78(%rsp), %rdi
callq 0xefda
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x180(%rsp), %rdi
testq %rdi, %rdi
je 0x7e5c7
movq 0x190(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x7e5c7
jmp 0x7e569
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x7fdc6
jmp 0x7e4ec
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x7e56c
movq 0xb8(%rsp), %rsi
jmp 0x7e531
jmp 0x7e53b
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x7fdc6
jmp 0x7e51c
jmp 0x7e569
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x7e56c
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x7e56c
movq %rax, %rbx
jmp 0x7e5b3
movq %rax, %rbx
jmp 0x7e5a6
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x7e5a6
movq 0xe8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
jmp 0x7e5a6
jmp 0x7e569
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x494b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x7e5a6
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
leaq 0x120(%rsp), %rdi
callq 0xf07c
leaq 0x60(%rsp), %rdi
callq 0x7ff4a
leaq 0x78(%rsp), %rdi
callq 0xefda
movq %rbx, %rdi
callq 0x4780
nop