// File: /workspace/github_cpp_makefile_star2_O1/0asa[P]TTree-source/ClassicTree.cpp
// Function: ClassicTree::createProbsInLeaf()
void ClassicTree::createProbsInLeaf() {
	Node* n = root;
	Stack stack;
	stack.push(n);
	while (!stack.empty()) {
		n = stack.pop();
		if (!n->isLeaf()) {
			stack.push(n->getLeft());
			stack.push(n->getRight());
		} else {
			// create vote and add it to corresponding to the leaf
			std::vector<double> vote(2,0.0);
			std::vector<unsigned int> list = n->getLS();
			for (int i = 0 ; i < list.size() ; ++i)
				vote[db->getOutput(list[i])] += db->getWeight(list[i]);
			for (int i = 0 ; i < vote.size() ; ++i) 
				vote[i] /= list.size();

			n->setVote(vote);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movq 0x50(%rdi), %r14
leaq 0x38(%rsp), %r15
movq %r15, %rdi
callq 0x155dc
movq %r15, %rdi
movq %r14, %rsi
callq 0x15604
leaq 0x38(%rsp), %r14
leaq 0x20(%rsp), %r15
movq %rsp, %r12
movq %r14, %rdi
callq 0x1564e
testb %al, %al
jne 0xa908
movq %r14, %rdi
callq 0x1563c
movq %rax, %r13
movq %rax, %rdi
callq 0x110f6
testb %al, %al
je 0xa8dd
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movl $0x10, %edi
callq 0x3200
movq %rax, (%rsp)
movq %rax, 0x8(%rsp)
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x10(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq %rcx, 0x8(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x7b1c
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rdx
movq %rdx, %rax
subq %rcx, %rax
sarq $0x2, %rax
cmpq %rcx, %rdx
je 0xa849
movq 0x8(%rbx), %rsi
movq 0x8(%rsi), %rdx
movq 0x28(%rsi), %rsi
movq (%rsp), %rdi
cmpq $0x1, %rax
movq %rax, %r8
adcq $0x0, %r8
xorl %r9d, %r9d
movl (%rcx,%r9,4), %r10d
movsd (%rdx,%r10,8), %xmm0
movswq (%rsi,%r10,2), %r10
addsd (%rdi,%r10,8), %xmm0
movsd %xmm0, (%rdi,%r10,8)
incq %r9
cmpq %r9, %r8
jne 0xa826
movq (%rsp), %rcx
movq 0x8(%rsp), %rdx
subq %rcx, %rdx
je 0xa89c
sarq $0x3, %rdx
movq %rax, %xmm1
punpckldq 0xbe78(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xbe80(%rip), %xmm1     # 0x166f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
cmpq $0x1, %rdx
adcq $0x0, %rdx
xorl %eax, %eax
movsd (%rcx,%rax,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rcx,%rax,8)
incq %rax
cmpq %rax, %rdx
jne 0xa886
movq %r13, %rdi
movq %r12, %rsi
callq 0x11244
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa8be
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xa77b
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
jmp 0xa77b
movq %r13, %rdi
callq 0x11108
movq %r14, %rdi
movq %rax, %rsi
callq 0x15604
movq %r13, %rdi
callq 0x1110e
movq %r14, %rdi
movq %rax, %rsi
callq 0x15604
jmp 0xa77b
leaq 0x38(%rsp), %rdi
callq 0x155ec
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0xa95b
movq %rax, %rbx
jmp 0xa943
jmp 0xa95b
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa943
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xa95e
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3210
jmp 0xa95e
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x155ec
movq %rbx, %rdi
callq 0x3320