// File: /workspace/github_cpp_makefile_star2_O3/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 $0x58, %rsp
cmpl $0x0, 0xb4(%rdi)
je 0x18fdd
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x39a88
movapd %xmm0, %xmm1
andpd 0x2438f(%rip), %xmm1    # 0x3d160
mulsd 0x24977(%rip), %xmm1    # 0x3d750
movsd 0x248d7(%rip), %xmm0    # 0x3d6b8
callq 0x66f0
movsd %xmm0, 0x10(%rsp)
movslq 0xb4(%r14), %rsi
leaq 0xf(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rcx
callq 0x192a0
movl 0xb4(%r14), %esi
testl %esi, %esi
jle 0x18e5b
xorl %ebp, %ebp
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x39a4e
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x18e49
movq 0x30(%rsp), %rax
movl %ebp, %edx
shrl $0x6, %edx
movl $0x1, %esi
movl %ebp, %ecx
shlq %cl, %rsi
orq %rsi, (%rax,%rdx,8)
incl %r15d
incl %ebp
movl 0xb4(%r14), %esi
cmpl %esi, %ebp
jl 0x18e1a
testl %r15d, %r15d
jne 0x18eae
movq %rbx, %rdi
callq 0x39bf8
movslq %eax, %rcx
leal 0x3f(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
sarl $0x6, %edx
movslq %edx, %rdx
shlq $0x3, %rdx
addq 0x30(%rsp), %rdx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
leaq 0x3f(%rsi), %rdi
andq %rcx, %rdi
xorl %r8d, %r8d
cmpq %rsi, %rdi
setbe %r8b
movl $0x1, %esi
movl %eax, %ecx
shlq %cl, %rsi
orq %rsi, -0x8(%rdx,%r8,8)
movl 0xb4(%r14), %esi
testl %esi, %esi
jle 0x18fc6
leaq 0x100(%r14), %rax
movq %rax, 0x28(%rsp)
leaq 0x10(%r14), %rax
movq %rax, 0x20(%rsp)
leaq 0xe8(%r14), %rax
movq %rax, 0x18(%rsp)
xorl %r15d, %r15d
movq 0x30(%rsp), %rax
movl %r15d, %ecx
shrl $0x6, %ecx
movq (%rax,%rcx,8), %rax
btq %r15, %rax
jae 0x18fb7
leaq (%r15,%r15,2), %r12
leaq (,%r12,8), %rax
movq 0xb8(%r14), %rsi
movq %rax, 0x10(%rsp)
addq %rax, %rsi
movq 0x28(%rsp), %rdi
callq 0xb98a
cmpl $0x0, 0x4(%r14)
jle 0x18f85
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %r13
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x39b0e
movq 0xd0(%r14), %rax
movq (%rax,%r12,8), %rax
addsd (%rax,%rbp,8), %xmm0
movsd %xmm0, (%rax,%rbp,8)
movsd 0x240de(%rip), %xmm1    # 0x3d030
callq 0x39fec
movq 0xd0(%r14), %rax
movq (%rax,%r13), %rax
movsd %xmm0, (%rax,%rbp,8)
movq 0xb8(%r14), %rax
movq (%rax,%r13), %rcx
movsd %xmm0, (%rcx,%rbp,8)
incq %rbp
movslq 0x4(%r14), %rcx
cmpq %rcx, %rbp
jl 0x18f2d
jmp 0x18f8c
movq 0xb8(%r14), %rax
leaq (%rax,%r12,8), %rsi
movq 0x20(%rsp), %rdi
callq 0x8792
movq 0x10(%rsp), %rsi
addq 0xb8(%r14), %rsi
movq 0x18(%rsp), %rdi
callq 0xb98a
movl 0xb4(%r14), %esi
incq %r15
movslq %esi, %rax
cmpq %rax, %r15
jl 0x18eda
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x18fdd
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x6460
xorpd %xmm0, %xmm0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x18ff6
jmp 0x18ff6
jmp 0x18ff6
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x19010
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x6460
movq %rbx, %rdi
callq 0x6710