// File: /workspace/github_cpp_makefile_star2_O1/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 0x196a8
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x3c066
movapd %xmm0, %xmm1
andpd 0x25ce7(%rip), %xmm1    # 0x3f160
mulsd 0x262af(%rip), %xmm1    # 0x3f730
movsd 0x26207(%rip), %xmm0    # 0x3f690
callq 0x66f0
movsd %xmm0, 0x10(%rsp)
movslq 0xb4(%r14), %rsi
leaq 0xf(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x18(%rsp), %rdi
leaq 0xe(%rsp), %rcx
callq 0x1998a
movl 0xb4(%r14), %esi
testl %esi, %esi
jle 0x19509
xorl %r15d, %r15d
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x3c02c
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x194f3
movq 0x18(%rsp), %rax
movq %r15, %rdx
shrq $0x6, %rdx
movl $0x1, %esi
movl %r15d, %ecx
shlq %cl, %rsi
orq %rsi, (%rax,%rdx,8)
incl %ebp
incq %r15
movslq 0xb4(%r14), %rsi
cmpq %rsi, %r15
jl 0x194c2
testl %ebp, %ebp
sete %al
jmp 0x1950b
movb $0x1, %al
testb %al, %al
je 0x1955c
movq %rbx, %rdi
callq 0x3c1d6
movslq %eax, %rcx
leaq 0x3f(%rcx), %rdx
testq %rcx, %rcx
cmovnsq %rcx, %rdx
sarq $0x6, %rdx
shlq $0x3, %rdx
addq 0x18(%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)
cmpl $0x0, 0xb4(%r14)
jle 0x19678
leaq 0x100(%r14), %rax
movq %rax, 0x50(%rsp)
leaq 0x10(%r14), %rax
movq %rax, 0x48(%rsp)
leaq 0xe8(%r14), %rax
movq %rax, 0x40(%rsp)
xorl %r15d, %r15d
movq 0x18(%rsp), %rax
movq %r15, %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rax
btq %r15, %rax
jae 0x19665
leaq (%r15,%r15,2), %r12
leaq (,%r12,8), %r13
movq 0xb8(%r14), %rsi
addq %r13, %rsi
movq 0x50(%rsp), %rdi
callq 0xb8ea
movq %r13, 0x10(%rsp)
cmpl $0x0, 0x4(%r14)
jle 0x19638
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %r13
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x3c0ec
movq 0xd0(%r14), %rax
movq (%rax,%r12,8), %rax
addsd (%rax,%rbp,8), %xmm0
movsd %xmm0, (%rax,%rbp,8)
movsd 0x25a29(%rip), %xmm1    # 0x3f030
callq 0x3c5a0
movq 0xd0(%r14), %rax
movq (%rax,%r13), %rax
movsd %xmm0, (%rax,%rbp,8)
movq 0xb8(%r14), %rax
movq (%rax,%r13), %rax
movsd %xmm0, (%rax,%rbp,8)
incq %rbp
movslq 0x4(%r14), %rax
cmpq %rax, %rbp
jl 0x195e2
movq 0xb8(%r14), %rsi
movq 0x10(%rsp), %r12
addq %r12, %rsi
movq 0x48(%rsp), %rdi
callq 0x8782
addq 0xb8(%r14), %r12
movq 0x40(%rsp), %rdi
movq %r12, %rsi
callq 0xb8ea
incq %r15
movslq 0xb4(%r14), %rax
cmpq %rax, %r15
jl 0x1958e
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x196a8
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x6460
xorl %eax, %eax
movq %rax, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movl %eax, 0x30(%rsp)
movq %rax, 0x38(%rsp)
xorpd %xmm0, %xmm0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x196c1
jmp 0x196c1
jmp 0x196c1
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x196f4
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x6460
xorl %eax, %eax
movq %rax, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movl %eax, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movq %rbx, %rdi
callq 0x6710