// File: /workspace/github_cpp_makefile_star2_O1/0asa[P]TTree-source/ClassicNodeTree.cpp
// Function: ClassicNodeTree::computeGroupVimp()
void ClassicNodeTree::computeGroupVimp() {
	resetGroupVimp();
	Node* n = root;
	Score sc;
	//Scorer s(db);
	//ScoreInfo si;
	//std::vector<unsigned int> left;
	//std::vector<unsigned int> right;
	Stack stack;
	stack.push(n);
	while (!stack.empty()) {
		n = stack.pop();
		if (!n->isLeaf()) {
			std::vector<unsigned int> set = n->getLS();
			ContingencyTable ctable = ((TreeNodeTest*)n->getTest())->weak->test(&set).getContingencyTable(((TreeNodeTest*)n->getTest())->getTh());
			//ctable.print();
			ctable.compact(((TreeNodeTest*)n->getTest())->getTh()); // inappropié !
			int group = ((TreeNodeTest*)n->getTest())->getGroup();
			groupVimp[group] += sc.getMutualInfo(ctable)*set.size();
			//printf("setsize=%03d\tGroup\t%d\t%0.6f th=%0.6f\n",set.size(),group,sc.getMutualInfo(ctable)*set.size(),((TreeNodeTest*)n->getTest())->getTh());
			//printf("Score = %0.6f\n",sc.getScore(ctable));
			stack.push(n->getLeft());
			stack.push(n->getRight());
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
callq 0xf008
movq 0x50(%rbx), %r14
movl $0x1, 0x4(%rsp)
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x155dc
movq %r15, %rdi
movq %r14, %rsi
callq 0x15604
leaq 0x20(%rsp), %r14
leaq 0x38(%rsp), %r12
leaq 0x90(%rsp), %r13
movq %r14, %rdi
callq 0x1564e
testb %al, %al
jne 0x8e6c
movq %r14, %rdi
callq 0x1563c
movq %rax, %rbp
movq %rax, %rdi
callq 0x110f6
testb %al, %al
jne 0x8d49
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
callq 0x7b1c
movq 0x30(%rbp), %rax
movq 0x18(%rax), %rsi
movq (%rsi), %rax
movq %r12, %rdi
movq %r15, %rdx
callq *0x20(%rax)
movq 0x30(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq %r13, %rdi
movq %r12, %rsi
callq 0x12abe
movq %r12, %rdi
callq 0x1288e
movq 0x30(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq %r13, %rdi
callq 0xc58e
movq 0x30(%rbp), %rdi
callq 0x15732
movl %eax, %r15d
leaq 0x4(%rsp), %rdi
movq %r13, %rsi
callq 0x1346c
movq 0x10(%rsp), %rax
subq 0x8(%rsp), %rax
sarq $0x2, %rax
movq %rax, %xmm1
punpckldq 0xd8eb(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xd8f3(%rip), %xmm1     # 0x166f0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
movslq %r15d, %rax
movq 0x68(%rbx), %rcx
mulsd %xmm2, %xmm0
addsd (%rcx,%rax,8), %xmm0
movsd %xmm0, (%rcx,%rax,8)
movq %rbp, %rdi
callq 0x11108
movq %r14, %rdi
movq %rax, %rsi
callq 0x15604
movq %rbp, %rdi
callq 0x1110e
movq %r14, %rdi
movq %rax, %rsi
callq 0x15604
movq %r13, %rdi
callq 0xc428
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x8d49
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
jmp 0x8d49
leaq 0x20(%rsp), %rdi
callq 0x155ec
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8ecb
jmp 0x8ecb
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x1288e
jmp 0x8eb2
movq %rax, %rbx
jmp 0x8eb2
jmp 0x8ea2
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0xc428
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x8ece
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
jmp 0x8ece
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x155ec
movq %rbx, %rdi
callq 0x3320