// File: /workspace/github_cpp_makefile_star2_O2/j-faria[P]kima/DNest4/code/RJObject/RJObjectImpl.h
// Function: DNest4::RJObject<RVConditionalPrior>::perturb_components(DNest4::RNG&)
double RJObject<ConditionalPrior>::perturb_components(RNG& rng)
{
	if(num_components == 0)
		return 0.;

    double chance = pow(10.0, -3*std::abs(rng.randt2()));

	// A flag for whether each component gets changed or not
	std::vector<bool> change(num_components, false);
	int count = 0;
	for(int i=0; i<num_components; i++)
	{
		if(rng.rand() <= chance)
		{
			change[i] = true;
			count++;
		}
	}
	// At least do one...
	if(count == 0)
		change[rng.rand_int(num_components)] = true;

	for(int i=0; i<num_components; i++)
	{
		if(change[i])
		{
			// Accumulate added/removed component info
			removed.push_back(components[i]);

			// Perturb
			for(int j=0; j<num_dimensions; j++)
			{
				u_components[i][j] += rng.randh();
				u_components[i][j] = DNest4::mod(
							u_components[i][j], 1.0);
				components[i][j] = u_components[i][j];
			}
			conditional_prior.from_uniform(components[i]);

			// Accumulate added/removed component info
			added.push_back(components[i]);
		}
	}

	return 0.;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
cmpl $0x0, 0xb4(%rdi)
je 0x15912
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x38b90
movapd %xmm0, %xmm1
andpd 0x269d3(%rip), %xmm1    # 0x3c160
mulsd 0x26f63(%rip), %xmm1    # 0x3c6f8
movsd 0x26ec3(%rip), %xmm0    # 0x3c660
callq 0x66c0
movsd %xmm0, 0x10(%rsp)
movslq 0xb4(%r14), %rsi
leaq 0xf(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x20(%rsp), %r15
leaq 0xe(%rsp), %rcx
movq %r15, %rdi
callq 0x15c56
xorl %r12d, %r12d
xorl %ebp, %ebp
movslq 0xb4(%r14), %rsi
cmpq %rsi, %r12
jge 0x15803
movq %rbx, %rdi
callq 0x38b70
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x157fe
movq %r15, %rdi
movq %r12, %rsi
callq 0x15cba
orq %rdx, (%rax)
incl %ebp
incq %r12
jmp 0x157ce
testl %ebp, %ebp
jne 0x1581f
movq %rbx, %rdi
callq 0x38cc4
movslq %eax, %rsi
leaq 0x20(%rsp), %rdi
callq 0x15cba
orq %rdx, (%rax)
leaq 0x100(%r14), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%r14), %rax
movq %rax, 0x18(%rsp)
leaq 0xe8(%r14), %r13
xorl %ebp, %ebp
movslq 0xb4(%r14), %rax
cmpq %rax, %rbp
jge 0x15908
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x15cba
testq %rdx, (%rax)
je 0x15900
imulq $0x18, %rbp, %r15
movq 0xb8(%r14), %rsi
addq %r15, %rsi
movq 0x10(%rsp), %rdi
callq 0xb142
xorl %r12d, %r12d
movslq 0x4(%r14), %rax
cmpq %rax, %r12
jge 0x158da
movq %rbx, %rdi
callq 0x38bee
movq 0xd0(%r14), %rax
movq (%rax,%r15), %rax
addsd (%rax,%r12,8), %xmm0
movsd %xmm0, (%rax,%r12,8)
movsd 0x26782(%rip), %xmm1    # 0x3c030
callq 0x390e8
movq 0xd0(%r14), %rax
movq (%rax,%r15), %rax
movsd %xmm0, (%rax,%r12,8)
movq 0xb8(%r14), %rax
movq (%rax,%r15), %rax
movsd %xmm0, (%rax,%r12,8)
incq %r12
jmp 0x1587e
movq 0xb8(%r14), %rsi
addq %r15, %rsi
movq 0x18(%rsp), %rdi
callq 0x83be
addq 0xb8(%r14), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0xb142
incq %rbp
jmp 0x1583d
leaq 0x20(%rsp), %rdi
callq 0x15cd8
xorpd %xmm0, %xmm0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1592f
jmp 0x1592f
jmp 0x1592f
jmp 0x1592f
jmp 0x1592f
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x15cd8
movq %rbx, %rdi
callq 0x66e0