// File: /workspace/github_cpp_makefile_star2_O3/0asa[P]TTree-source/ClassicTree.cpp
// Function: ClassicTree::learnfbf()
double ClassicTree::learnfbf() {
	clock_t clock_start = clock();
	Scorer s(db);
	std::vector<unsigned int> lsleft;
	std::vector<unsigned int> lsright;
	BestFirstStack stack(db);
	root = new Node();	root->setLS((*ls));	stack.push(root);
	while (!stack.empty() && complexity < maxcomplexity) {
		Node *n = stack.pop();
		std::vector<unsigned int> set = n->getLS();
		if (set.size() >= nmin) {
			std::vector<unsigned int> kcand;
			if (k > 0)
				kcand = Sampler::random((*cand),k);
			else
				kcand = (*cand); 
			ScoreInfo si = s.getBestScore(set,kcand);
			if (si.score > 0) {
				db->getLRSet(si,set,lsleft,lsright);
				n->setTest(si);
				Node *left  = new Node();	left->setParent(n);
				left->setDepth(n->getDepth()+1); // 09-07-2012
				left->setLS(lsleft);	n->setLeft(left);	stack.push(left);
				Node *right = new Node();	right->setParent(n);
				right->setDepth(n->getDepth()+1); // 09-07-2012
				right->setLS(lsright);	n->setRight(right);	stack.push(right);
				if (maxdepth < n->getDepth()+1) { maxdepth = n->getDepth()+1; }
				complexity++;
			}
		}
	}	
	createProbsInLeaf();
	return (clock() - clock_start);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rdi, %r14
callq 0x3130
movq %rax, 0x18(%rsp)
movq 0x8(%r14), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x1354c
xorl %eax, %eax
movq %rax, 0x50(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x40(%rsp)
movq %rax, 0x30(%rsp)
movapd %xmm0, 0x20(%rsp)
movq 0x8(%r14), %rsi
leaq 0x120(%rsp), %rdi
callq 0x7988
movl $0x60, %edi
callq 0x3200
movq %rax, %r15
movq %rax, %rdi
callq 0x11008
movq %r15, 0x50(%r14)
movq 0x20(%r14), %rsi
leaq 0xa8(%rsp), %rdi
callq 0x7b86
leaq 0xa8(%rsp), %rsi
movq %r15, %rdi
callq 0x73dc
movq 0x8(%r15), %rax
subq (%r15), %rax
sarq $0x2, %rax
movl 0x58(%r15), %ecx
cmpq %rcx, %rax
jbe 0xaa24
movl %eax, 0x58(%r15)
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0xaa41
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
movq 0x50(%r14), %rsi
leaq 0x120(%rsp), %rdi
callq 0x79ec
leaq 0x120(%rsp), %r12
leaq 0x60(%rsp), %r13
leaq 0xc0(%rsp), %rbx
movq %r12, %rdi
callq 0x155be
testb %al, %al
jne 0xad32
movl 0x14(%r14), %eax
cmpl 0x18(%r14), %eax
jge 0xad32
movq %r12, %rdi
callq 0x79d6
movq %rax, %r15
movq %r13, %rdi
movq %rax, %rsi
callq 0x7b86
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rax
subq %rdi, %rax
sarq $0x2, %rax
movslq 0x10(%r14), %rcx
cmpq %rcx, %rax
jb 0xad17
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movl 0x58(%r14), %edx
testl %edx, %edx
je 0xab48
movq 0x30(%r14), %rsi
movq %rbx, %rdi
callq 0x9cca
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
movapd 0xc0(%rsp), %xmm0
movapd %xmm0, (%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x10(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xc0(%rsp)
movq $0x0, 0xd0(%rsp)
testq %rdi, %rdi
je 0xab54
subq %rdi, %rsi
callq 0x3210
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0xab54
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
jmp 0xab54
movq 0x30(%r14), %rsi
movq %rsp, %rdi
callq 0x73dc
movq 0x100(%rsp), %rax
movq 0x108(%rsp), %rsi
leaq 0xf8(%rsp), %rcx
addq %rcx, %rsi
testb $0x1, %al
je 0xab7b
movq (%rsi), %rcx
movq -0x1(%rcx,%rax), %rax
movq %rbx, %rdi
movq %r13, %rdx
movq %rsp, %rcx
callq *%rax
movsd 0xe8(%rsp), %xmm0
ucomisd 0xbb69(%rip), %xmm0     # 0x16700
jbe 0xacfc
movq 0x8(%r14), %rdi
movq %rbx, %rsi
movq %r13, %rdx
leaq 0x40(%rsp), %rcx
leaq 0x20(%rsp), %r8
callq 0xd636
movq %r15, %rdi
movq %rbx, %rsi
callq 0x110e4
movl $0x60, %edi
callq 0x3200
movq %rax, %rbp
movq %rax, %rdi
callq 0x11008
movq %rbp, %rdi
movq %r15, %rsi
callq 0x111a8
movl 0x54(%r15), %eax
incl %eax
movl %eax, 0x54(%rbp)
leaq 0x90(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x7b86
movq %rbp, %rdi
leaq 0x90(%rsp), %rsi
callq 0x73dc
movq 0x8(%rbp), %rax
subq (%rbp), %rax
sarq $0x2, %rax
movl 0x58(%rbp), %ecx
cmpq %rcx, %rax
jbe 0xac23
movl %eax, 0x58(%rbp)
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xac40
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
movq %r15, %rdi
movq %rbp, %rsi
callq 0x111ae
movq %r12, %rdi
movq %rbp, %rsi
callq 0x79ec
movl $0x60, %edi
callq 0x3200
movq %rax, %rbp
movq %rax, %rdi
callq 0x11008
movq %rbp, %rdi
movq %r15, %rsi
callq 0x111a8
movl 0x54(%r15), %eax
incl %eax
movl %eax, 0x54(%rbp)
leaq 0x78(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x7b86
movq %rbp, %rdi
leaq 0x78(%rsp), %rsi
callq 0x73dc
movq 0x8(%rbp), %rax
subq (%rbp), %rax
sarq $0x2, %rax
movl 0x58(%rbp), %ecx
cmpq %rcx, %rax
jbe 0xacb2
movl %eax, 0x58(%rbp)
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0xaccc
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
movq %r15, %rdi
movq %rbp, %rsi
callq 0x111b4
movq %r12, %rdi
movq %rbp, %rsi
callq 0x79ec
movl 0x54(%r15), %eax
incl %eax
cmpl %eax, 0x15c(%r14)
jae 0xacf8
movl %eax, 0x15c(%r14)
incl 0x14(%r14)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xad12
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0xaa67
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
jmp 0xaa67
movq %r14, %rdi
callq 0xa750
callq 0x3130
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0x79b4
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xad66
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xad7d
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
subq 0x18(%rsp), %rbx
xorps %xmm0, %xmm0
cvtsi2sd %rbx, %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x13590
movsd 0x18(%rsp), %xmm0
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0xae7b
movq 0xb8(%rsp), %rsi
jmp 0xae73
movq %rax, %rbx
movl $0x60, %esi
movq %r15, %rdi
jmp 0xae76
movq %rax, %rbx
jmp 0xae9f
jmp 0xae4b
movq %rax, %rbx
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0xae4e
movq 0x88(%rsp), %rsi
jmp 0xae21
jmp 0xae26
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xae4e
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
jmp 0xae31
movq %rax, %rbx
movl $0x60, %esi
movq %rbp, %rdi
callq 0x3210
jmp 0xae4e
jmp 0xae44
jmp 0xae4b
jmp 0xae4b
jmp 0xae4b
jmp 0xae44
jmp 0xae44
movq %rax, %rbx
jmp 0xae7b
jmp 0xae4b
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xae64
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0xae7b
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
leaq 0x120(%rsp), %rdi
callq 0x79b4
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xae9f
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xaeb6
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
leaq 0xf8(%rsp), %rdi
callq 0x13590
movq %rbx, %rdi
callq 0x3320
nop