// File: 0asa[P]TTree-source/BestFirstStack.cpp
// Function: BestFirstStack::push(Node*)
void BestFirstStack::push(Node* n) {
	n->setId(nbpush++);
	std::vector<unsigned int> set = n->getLS();
	//printf("Node Size : %d\n",set.size());
	double total = 0.0;
	std::vector<double> sum(2,0.0);
	for (int i = 0 ; i < set.size() ; ++i) {
		total += db->getWeight(set[i]);
		sum[db->getOutput(set[i])] += db->getWeight(set[i]);
	}
	Score score;
	double hc = score.getShannonEntropy(sum,total) * total;
	if (hc > 0.0) {
	std::vector<double>::iterator it;
	std::vector< Node* >::iterator itn;
	for( it = values.begin(), itn = s.begin() ; it != values.end(); it++, itn++ )    {
		if (hc <= *it) 
			break;
	}
	values.insert(it,hc);
	
	s.insert(itn,n);
	}
}

// Assembly:
subq $0x148, %rsp            # imm = 0x148
movq %rdi, 0x140(%rsp)
movq %rsi, 0x138(%rsp)
movq 0x140(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x138(%rsp), %rdi
leaq 0x34c21(%rip), %rax     # 0x41254
movl (%rax), %esi
movl %esi, %ecx
incl %ecx
movl %ecx, (%rax)
callq 0xcb80
movq 0x138(%rsp), %rdi
callq 0xcba0
movq %rax, %rsi
leaq 0x120(%rsp), %rdi
callq 0xcbb0
movq $0x0, 0x118(%rsp)
movq $0x0, 0xf8(%rsp)
leaq 0xf7(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0xccb0
movq 0x70(%rsp), %rcx
leaq 0x100(%rsp), %rdi
movl $0x2, %esi
leaq 0xf8(%rsp), %rdx
callq 0xccc0
jmp 0xc6a8
leaq 0xf7(%rsp), %rdi
callq 0xcd40
movl $0x0, 0xe0(%rsp)
movslq 0xe0(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x120(%rsp), %rdi
callq 0x8bf0
movq %rax, %rcx
movq 0x60(%rsp), %rax
cmpq %rcx, %rax
jae 0xc824
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x50(%rsp)
movslq 0xe0(%rsp), %rsi
leaq 0x120(%rsp), %rdi
callq 0xcd80
movq 0x50(%rsp), %rdi
movl (%rax), %esi
callq 0xcd50
movsd %xmm0, 0x58(%rsp)
jmp 0xc722
movq 0x68(%rsp), %rax
movsd 0x58(%rsp), %xmm1
movsd 0x118(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x118(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x40(%rsp)
movslq 0xe0(%rsp), %rsi
leaq 0x120(%rsp), %rdi
callq 0xcd80
movq 0x40(%rsp), %rdi
movl (%rax), %esi
callq 0xcd50
movsd %xmm0, 0x48(%rsp)
jmp 0xc775
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x30(%rsp)
movslq 0xe0(%rsp), %rsi
leaq 0x120(%rsp), %rdi
callq 0xcd80
movq 0x30(%rsp), %rdi
movl (%rax), %esi
callq 0xcdc0
movw %ax, 0x3e(%rsp)
jmp 0xc7ab
movw 0x3e(%rsp), %ax
movswq %ax, %rsi
leaq 0x100(%rsp), %rdi
callq 0xcda0
movsd 0x48(%rsp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movl 0xe0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xe0(%rsp)
jmp 0xc6c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
leaq 0xf7(%rsp), %rdi
callq 0xcd40
jmp 0xca73
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
jmp 0xca66
leaq 0xdc(%rsp), %rdi
callq 0xcdf0
jmp 0xc833
movsd 0x118(%rsp), %xmm0
leaq 0xdc(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x26800
movsd %xmm0, 0x28(%rsp)
jmp 0xc859
movsd 0x28(%rsp), %xmm0
mulsd 0x118(%rsp), %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xd0(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xca37
leaq 0xc8(%rsp), %rdi
callq 0xce10
leaq 0xc0(%rsp), %rdi
callq 0xce30
movq 0x68(%rsp), %rdi
addq $0x20, %rdi
callq 0xade0
movq 0x68(%rsp), %rdi
movq %rax, 0xb8(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0xc8(%rsp)
callq 0xce50
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0x68(%rsp), %rdi
addq $0x20, %rdi
callq 0xae10
movq %rax, 0xa8(%rsp)
leaq 0xc8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xce80
testb $0x1, %al
jne 0xc91d
jmp 0xc9a6
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0xcec0
movsd 0x20(%rsp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0xc971
jmp 0xc9a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
leaq 0xdc(%rsp), %rdi
callq 0xd410
jmp 0xca66
jmp 0xc973
leaq 0xc8(%rsp), %rdi
xorl %esi, %esi
callq 0xced0
movq %rax, 0xa0(%rsp)
leaq 0xc0(%rsp), %rdi
xorl %esi, %esi
callq 0xcf10
movq %rax, 0x98(%rsp)
jmp 0xc8e9
movq 0x68(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x10(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0xd170
movq 0x10(%rsp), %rdi
movq 0x90(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0xcf50
movq %rax, 0x18(%rsp)
jmp 0xc9ea
movq 0x18(%rsp), %rax
movq %rax, 0x88(%rsp)
leaq 0x80(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0xd3d0
movq 0x68(%rsp), %rdi
movq 0x80(%rsp), %rsi
leaq 0x138(%rsp), %rdx
callq 0xd1b0
movq %rax, 0x8(%rsp)
jmp 0xca2d
movq 0x8(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0xdc(%rsp), %rdi
callq 0xd410
leaq 0x100(%rsp), %rdi
callq 0xcaa0
leaq 0x120(%rsp), %rdi
callq 0x6830
addq $0x148, %rsp            # imm = 0x148
retq
leaq 0x100(%rsp), %rdi
callq 0xcaa0
leaq 0x120(%rsp), %rdi
callq 0x6830
movq 0xe8(%rsp), %rdi
callq 0x33e0
nopl (%rax)