// File: /workspace/github_cpp_makefile_star2_O2/CK7[P]abawaca/src/ClusterSeparatorBySensitivitySpecificity.cpp
// Function: ClusterSeparatorBySensitivitySpecificity::separate_specific(ClusterSeparatorBySensitivitySpecificity::ClusterStats&, ClusterSeparatorBySensitivitySpecificity::ClusterStats&, unsigned long, double, ClusterSeparatorBySensitivitySpecificity::ClusteringResult&)
void ClusterSeparatorBySensitivitySpecificity::separate_specific(ClusterStats& curr_cluster1, ClusterStats& curr_cluster2, size_t dimension_index, double tested_value,
	ClusterSeparatorBySensitivitySpecificity::ClusteringResult& best_dimension_separation)
{
	// Which one is smaller in terms of the number of datapoints that will be considered 
	// for the clustering?
	if((curr_cluster1.num_useful_ndps() < this->cluster_ndps_threshold) || (curr_cluster2.num_useful_ndps() < this->cluster_ndps_threshold))
		return;

	// Now pick the smaller cluster, we will compute sensitivity and specificity on that one
	const ClusterStats& small_cluster = (curr_cluster1.num_useful_ndps() < curr_cluster2.num_useful_ndps())? curr_cluster1 : curr_cluster2;
	const ClusterStats& large_cluster = (curr_cluster1.num_useful_ndps() >= curr_cluster2.num_useful_ndps())? curr_cluster1 : curr_cluster2;

	ClusterSeparatorBySensitivitySpecificity::ClusteringResult	cr(dimension_index, tested_value, small_cluster.get_sensitivity(), small_cluster.get_specificity());
	if(cr.is_better(best_dimension_separation) && cq.is_split_better(small_cluster.get_cluster(), large_cluster.get_cluster()))
		best_dimension_separation.copy(cr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, %rbx
movsd %xmm0, -0x40(%rbp)
movq %rcx, %r13
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x20(%rax)
cltq
cmpq %rax, 0xb0(%r12)
ja 0xffa5
movq (%r15), %rax
movq %r15, %rdi
callq *0x20(%rax)
cltq
cmpq %rax, 0xb0(%r12)
ja 0xffa5
movq (%r14), %rax
movq %r14, %rdi
callq *0x20(%rax)
movq %rbx, -0x38(%rbp)
movl %eax, %ebx
movq (%r15), %rax
movq %r15, %rdi
callq *0x20(%rax)
cmpl %eax, %ebx
movq %r15, %rbx
cmovlq %r14, %rbx
movq (%r14), %rax
movq %r14, %rdi
callq *0x20(%rax)
movl %eax, -0x30(%rbp)
movq (%r15), %rax
movq %r15, %rdi
callq *0x20(%rax)
movl %eax, -0x2c(%rbp)
movl 0x18(%rbx), %eax
cvtsi2sd %eax, %xmm0
cvtsi2sdl 0x1c(%rbx), %xmm1
movapd %xmm0, %xmm2
divsd %xmm1, %xmm2
addl 0x20(%rbx), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
leaq -0x88(%rbp), %rdi
movq %r13, 0x8(%rdi)
movsd -0x40(%rbp), %xmm1
movsd %xmm1, 0x10(%rdi)
leaq 0xe8fd(%rip), %rax      # 0x1e830
movq %rax, (%rdi)
movsd %xmm2, 0x18(%rdi)
movsd %xmm0, 0x20(%rdi)
movabsq $0x3fe999999999999a, %rax # imm = 0x3FE999999999999A
movq %rax, 0x28(%rdi)
movq %rax, 0x30(%rdi)
movq %rax, 0x38(%rdi)
movabsq $0x3ff999999999999a, %rax # imm = 0x3FF999999999999A
movq %rax, 0x40(%rdi)
movq -0x38(%rbp), %rsi
movq %rsi, %r13
callq 0x749a
testb %al, %al
je 0xffa5
movl -0x2c(%rbp), %eax
cmpl %eax, -0x30(%rbp)
cmovlq %r15, %r14
movq 0x20(%r12), %rdi
movq 0x10(%rbx), %rsi
movq 0x10(%r14), %rdx
callq 0x13d9c
testb %al, %al
je 0xffa5
movq %r13, %rdi
movq (%r13), %rax
leaq -0x88(%rbp), %rsi
callq *0x8(%rax)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq