// File: /workspace/github_cpp_makefile_star2_O1/CK7[P]abawaca/src/ClusterSeparatorSplitScafs.cpp
// Function: ClusterSeparatorSplitScafs::ClusterStats::operator+=(unsigned long)
const ClusterSeparatorSplitScafs::ClusterStats& ClusterSeparatorSplitScafs::ClusterStats::operator += (size_t dp)
{
	auto	mit = cluster.scafs_find(this->scaf_db.dp2scaf(dp));
	size_t	ndps_in_cluster = (mit != cluster.scafs_end())? mit->second : 0;
	size_t	ndps_in_scaf = scaf_db.ndps(this->scaf_db.dp2scaf(dp));

	if(ndps_in_scaf > 1) {
		this->cluster_useful_ndps++;
		// Is this scaf part of the cluster after the addition of the dp?
		if(is_scaf_part_of(ndps_in_cluster+1, ndps_in_scaf)) {
			// Is this scaf part of the cluster before the addition of the dp?
			if(!is_scaf_part_of(ndps_in_cluster, ndps_in_scaf)) {
				ndps_in_scafs_that_belong += ndps_in_cluster;
				scafs_in++;
			}
			ndps_in_scafs_that_belong++;
		}
	}

	cluster += dp;

	if(ndps_in_scafs_that_belong < 0 || ndps_in_scafs_that_belong > cluster.ndps()) {
		cerr << "Fatal error (1): illegal number of dps in scafs that belong: " << ndps_in_scafs_that_belong << endl;
		throw exception();
	}

	return *this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x8(%rbx), %r15
callq 0xcd08
movq 0x18(%r15), %rdx
addq $0x10, %r15
movq %r15, %rcx
testq %rdx, %rdx
je 0x14838
movq %r15, %rcx
xorl %esi, %esi
cmpq %rax, 0x20(%rdx)
setb %sil
cmovaeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x14820
cmpq %r15, %rcx
je 0x14845
cmpq %rax, 0x20(%rcx)
cmovbeq %rcx, %r15
movq 0x8(%rbx), %rax
addq $0x10, %rax
cmpq %rax, %r15
je 0x14858
movq 0x28(%r15), %r12
jmp 0x1485b
xorl %r12d, %r12d
movq (%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xcd08
movq %r15, %rdi
movq %rax, %rsi
callq 0xcdbe
cmpq $0x2, %rax
jb 0x14907
incl 0x10(%rbx)
movq 0x20(%rbx), %rcx
leaq 0x1(%r12), %rdx
movq %rdx, %xmm0
movq 0x6909(%rip), %xmm1     # 0x1b1a0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x690d(%rip), %xmm2     # 0x1b1b0
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movq %rax, %xmm4
punpckldq %xmm1, %xmm4    # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
subpd %xmm2, %xmm4
movapd %xmm4, %xmm0
unpckhpd %xmm4, %xmm0            # xmm0 = xmm0[1],xmm4[1]
addsd %xmm4, %xmm0
mulsd (%rcx), %xmm0
ucomisd %xmm0, %xmm3
jb 0x14907
movq %r12, %xmm1
punpckldq 0x68bd(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x68c5(%rip), %xmm1     # 0x1b1b0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
jae 0x14904
addl %r12d, 0x14(%rbx)
incl 0x18(%rbx)
incl 0x14(%rbx)
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x12330
movslq 0x14(%rbx), %rax
testq %rax, %rax
js 0x14932
movq 0x8(%rbx), %rcx
cmpq %rax, 0x50(%rcx)
jb 0x14932
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0xe6af(%rip), %rdi      # 0x22fe8
leaq 0x69d5(%rip), %rsi      # 0x1b315
callq 0x5380
movl 0x14(%rbx), %esi
movq %rax, %rdi
callq 0x5670
movq %rax, %rdi
callq 0x51a0
movl $0x8, %edi
callq 0x51b0
movq 0xe63f(%rip), %rcx      # 0x22fa8
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0xe659(%rip), %rsi      # 0x22fd0
movq 0xe672(%rip), %rdx      # 0x22ff0
movq %rax, %rdi
callq 0x5660