// File: /workspace/github_cpp_makefile_star2_O3/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 0xefcc
movq 0x50(%rbx), %r14
movl $0x1, 0x4(%rsp)
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x1554c
movq %r15, %rdi
movq %r14, %rsi
callq 0x15574
leaq 0x20(%rsp), %r14
leaq 0x38(%rsp), %r12
leaq 0x90(%rsp), %r13
movq %r14, %rdi
callq 0x155be
testb %al, %al
jne 0x8e96
movq %r14, %rdi
callq 0x155ac
movq %rax, %rbp
movq %rax, %rdi
callq 0x110c6
testb %al, %al
jne 0x8d73
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
callq 0x7b86
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 0x12a64
movq %r12, %rdi
callq 0x12826
movq 0x30(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq %r13, %rdi
callq 0xc596
movq 0x30(%rbp), %rdi
callq 0x156a0
movl %eax, %r15d
leaq 0x4(%rsp), %rdi
movq %r13, %rsi
callq 0x133ee
movq 0x10(%rsp), %rax
subq 0x8(%rsp), %rax
sarq $0x2, %rax
movq %rax, %xmm1
punpckldq 0xd8c1(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xd8c9(%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 0x110d8
movq %r14, %rdi
movq %rax, %rsi
callq 0x15574
movq %rbp, %rdi
callq 0x110de
movq %r14, %rdi
movq %rax, %rsi
callq 0x15574
movq %r13, %rdi
callq 0xc430
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x8d73
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
jmp 0x8d73
leaq 0x20(%rsp), %rdi
callq 0x1555c
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8ef5
jmp 0x8ef5
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x12826
jmp 0x8edc
movq %rax, %rbx
jmp 0x8edc
jmp 0x8ecc
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0xc430
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x8ef8
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
jmp 0x8ef8
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x1555c
movq %rbx, %rdi
callq 0x3320