// File: 0asa[P]TTree-source/Scorer.cpp
// Function: Scorer::getGroupScore(Learner*, std::vector<unsigned int, std::allocator<unsigned int>>&, std::vector<unsigned int, std::allocator<unsigned int>>&, ScoreInfo&, int)
void Scorer::getGroupScore(Learner* weak,std::vector<unsigned int> &ind, std::vector<unsigned int> &cand, ScoreInfo &si, int treeType) {
	Score score;
	weak->setLS(&ind);
	if (treeType == RANDOMTTSTUMP || treeType == EXTRATTSTUMP)
		((GStump*)weak)->setAttCand(&cand);
	else 
		weak->setAttCand(&cand);
	weak->learn();

	Result result = weak->test(&ind);
	result.shrink();
	
	ContingencyTable ctable = result.getContingencyTable();	
	std::vector<double> th = result.getPossibleProbTh();

	if (treeType == EXTRATREE || treeType == EXTRATTSTUMP)
		th = Sampler::random(th, 1);
	
	for (int t = 0 ; t < th.size() ; ++t) {
		ctable = result.getContingencyTable(th[t]);
		ctable.compact(th[t]);
		si.update(weak,th[t],score.getScore(ctable));
	}
	
}

// Assembly:
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rdi, 0x1e0(%rsp)
movq %rsi, 0x1d8(%rsp)
movq %rdx, 0x1d0(%rsp)
movq %rcx, 0x1c8(%rsp)
movq %r8, 0x1c0(%rsp)
movl %r9d, 0x1bc(%rsp)
leaq 0x1b8(%rsp), %rdi
callq 0xcdf0
movq 0x1d8(%rsp), %rdi
movq 0x1d0(%rsp), %rsi
callq 0x204d0
jmp 0x2727b
cmpl $0x5, 0x1bc(%rsp)
je 0x2728f
cmpl $0x6, 0x1bc(%rsp)
jne 0x272c1
movq 0x1d8(%rsp), %rdi
movq 0x1c8(%rsp), %rsi
callq 0x1c680
jmp 0x272a6
jmp 0x272da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
jmp 0x275ac
movq 0x1d8(%rsp), %rdi
movq 0x1c8(%rsp), %rsi
callq 0x20510
jmp 0x272d8
jmp 0x272da
movq 0x1d8(%rsp), %rdi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
jmp 0x272ec
movq 0x1d8(%rsp), %rsi
movq 0x1d0(%rsp), %rdx
movq (%rsi), %rax
movq 0x20(%rax), %rax
leaq 0x150(%rsp), %rdi
callq *%rax
jmp 0x2730f
leaq 0x150(%rsp), %rdi
callq 0x293e0
jmp 0x2731e
leaq 0xd8(%rsp), %rdi
leaq 0x150(%rsp), %rsi
movsd 0x8cda(%rip), %xmm0     # 0x30010
callq 0x24e90
jmp 0x2733d
leaq 0xc0(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x24cb0
jmp 0x27354
cmpl $0x3, 0x1bc(%rsp)
je 0x2736c
cmpl $0x6, 0x1bc(%rsp)
jne 0x273f7
leaq 0xa8(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
movl $0x1, %edx
callq 0x29400
jmp 0x27388
leaq 0xc0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x295c0
leaq 0xa8(%rsp), %rdi
callq 0xcaa0
jmp 0x273f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
jmp 0x2759f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
jmp 0x27592
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
jmp 0x27585
movl $0x0, 0xa4(%rsp)
movslq 0xa4(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0xab40
movq %rax, %rcx
movq 0x20(%rsp), %rax
cmpq %rcx, %rax
jae 0x27549
movslq 0xa4(%rsp), %rsi
leaq 0xc0(%rsp), %rdi
callq 0xcda0
movsd (%rax), %xmm0
leaq 0x28(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x24e90
jmp 0x2745a
leaq 0xd8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x29600
jmp 0x2746e
leaq 0x28(%rsp), %rdi
callq 0x16d70
movslq 0xa4(%rsp), %rsi
leaq 0xc0(%rsp), %rdi
callq 0xcda0
movsd (%rax), %xmm0
leaq 0xd8(%rsp), %rdi
callq 0x16f90
jmp 0x274a0
movq 0x1c0(%rsp), %rax
movq %rax, (%rsp)
movq 0x1d8(%rsp), %rax
movq %rax, 0x8(%rsp)
movslq 0xa4(%rsp), %rsi
leaq 0xc0(%rsp), %rdi
callq 0xcda0
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x1b8(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x26490
movsd %xmm0, 0x18(%rsp)
jmp 0x274f5
movsd 0x18(%rsp), %xmm1
movsd 0x10(%rsp), %xmm0
movq 0x8(%rsp), %rsi
movq (%rsp), %rdi
callq 0x26d00
jmp 0x27511
jmp 0x27513
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x27402
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x16d70
jmp 0x27585
leaq 0xc0(%rsp), %rdi
callq 0xcaa0
leaq 0xd8(%rsp), %rdi
callq 0x16d70
leaq 0x150(%rsp), %rdi
callq 0x24b00
leaq 0x1b8(%rsp), %rdi
callq 0xd410
addq $0x1e8, %rsp            # imm = 0x1E8
retq
leaq 0xc0(%rsp), %rdi
callq 0xcaa0
leaq 0xd8(%rsp), %rdi
callq 0x16d70
leaq 0x150(%rsp), %rdi
callq 0x24b00
leaq 0x1b8(%rsp), %rdi
callq 0xd410
movq 0x1b0(%rsp), %rdi
callq 0x33e0
nopw %cs:(%rax,%rax)