// File: /workspace/github_cpp_makefile_star2_O2/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 0x3140
movq %rax, 0x8(%rsp)
movq 0x8(%r14), %rsi
leaq 0xc8(%rsp), %rdi
callq 0x10648
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
movapd %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
movq 0x8(%r14), %rsi
leaq 0xf0(%rsp), %rdi
callq 0x6ac0
pushq $0x60
popq %rdi
callq 0x3200
movq %rax, %r15
movq %rax, %rdi
callq 0xe460
movq %r15, 0x50(%r14)
movq 0x20(%r14), %rsi
leaq 0x80(%rsp), %rdi
callq 0x6c64
leaq 0x80(%rsp), %rsi
movq %r15, %rdi
callq 0x8884
leaq 0x80(%rsp), %rdi
callq 0x6886
movq 0x50(%r14), %rsi
leaq 0xf0(%rsp), %rdi
callq 0x6b14
leaq 0xf0(%rsp), %r15
leaq 0x68(%rsp), %r12
movq %r15, %rdi
callq 0x12460
testb %al, %al
jne 0x9612
movl 0x14(%r14), %eax
cmpl 0x18(%r14), %eax
jge 0x9612
movq %r15, %rdi
callq 0x6afe
movq %rax, %rbx
movq %r12, %rdi
movq %rax, %rsi
callq 0x6c64
movq 0x70(%rsp), %rax
subq 0x68(%rsp), %rax
sarq $0x2, %rax
movslq 0x10(%r14), %rcx
cmpq %rcx, %rax
jb 0x9605
andq $0x0, 0x20(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movl 0x58(%r14), %edx
testl %edx, %edx
je 0x949c
movq 0x30(%r14), %rsi
leaq 0x128(%rsp), %rbp
movq %rbp, %rdi
callq 0x88a6
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x68a8
movq %rbp, %rdi
callq 0x6886
jmp 0x94b5
movq 0x30(%r14), %rsi
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0x634c
leaq 0x128(%rsp), %rbp
movq %rbp, %rdi
leaq 0xc8(%rsp), %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0xa79a
movsd 0x150(%rsp), %xmm0
ucomisd 0xa224(%rip), %xmm0     # 0x13700
jbe 0x95fb
movq 0x8(%r14), %rdi
leaq 0x128(%rsp), %r13
movq %r13, %rsi
movq %r12, %rdx
leaq 0x50(%rsp), %rcx
leaq 0x30(%rsp), %r8
callq 0xb54c
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe518
pushq $0x60
popq %rdi
callq 0x3200
movq %rax, %r13
movq %rax, %rdi
callq 0xe460
movq %r13, %rdi
movq %rbx, %rsi
callq 0xe5d4
movl 0x54(%rbx), %eax
incl %eax
movl %eax, 0x54(%r13)
leaq 0xb0(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x6c64
movq %r13, %rdi
leaq 0xb0(%rsp), %rbp
movq %rbp, %rsi
callq 0x8884
movq %rbp, %rdi
callq 0x6886
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe5da
movq %r15, %rdi
movq %r13, %rsi
callq 0x6b14
pushq $0x60
popq %rdi
callq 0x3200
movq %rax, %r13
movq %rax, %rdi
callq 0xe460
movq %r13, %rdi
movq %rbx, %rsi
callq 0xe5d4
movl 0x54(%rbx), %eax
incl %eax
movl %eax, 0x54(%r13)
leaq 0x98(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x6c64
movq %r13, %rdi
leaq 0x98(%rsp), %rbp
movq %rbp, %rsi
callq 0x8884
movq %rbp, %rdi
callq 0x6886
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe5e0
movq %r15, %rdi
movq %r13, %rsi
callq 0x6b14
movl 0x54(%rbx), %eax
incl %eax
cmpl %eax, 0x15c(%r14)
jae 0x95f7
movl %eax, 0x15c(%r14)
incl 0x14(%r14)
leaq 0x10(%rsp), %rdi
callq 0x6886
movq %r12, %rdi
callq 0x6886
jmp 0x9407
movq %r14, %rdi
callq 0x918e
callq 0x3140
subq 0x8(%rsp), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x6ae8
leaq 0x30(%rsp), %rdi
callq 0x6886
leaq 0x50(%rsp), %rdi
callq 0x6886
leaq 0xc8(%rsp), %rdi
callq 0x1068c
movsd 0x8(%rsp), %xmm0
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
jmp 0x96ef
movq %rax, %rbx
pushq $0x60
popq %rsi
movq %r15, %rdi
callq 0x3210
jmp 0x96f4
movq %rax, %rbx
jmp 0x9701
jmp 0x96dd
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
jmp 0x96b3
jmp 0x96ba
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x6886
jmp 0x96e0
movq %rax, %rbx
pushq $0x60
popq %rsi
movq %r13, %rdi
callq 0x3210
jmp 0x96e0
jmp 0x96d6
jmp 0x96dd
jmp 0x96dd
jmp 0x96dd
jmp 0x96d6
jmp 0x96d6
movq %rax, %rbx
jmp 0x96f4
jmp 0x96dd
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x6886
leaq 0x68(%rsp), %rdi
callq 0x6886
leaq 0xf0(%rsp), %rdi
callq 0x6ae8
leaq 0x30(%rsp), %rdi
callq 0x6886
leaq 0x50(%rsp), %rdi
callq 0x6886
leaq 0xc8(%rsp), %rdi
callq 0x1068c
movq %rbx, %rdi
callq 0x3330