// File: /workspace/github_cpp_makefile_star2_O3/Chrom3D[P]Chrom3D/src/Randomizer.cpp
// Function: ArmWiggleRandomizer::randomize(Chromosome&, boost::random::mersenne_twister_engine<unsigned int, 32ul, 624ul, 397ul, 31ul, 2567483615u, 11ul, 4294967295u, 7ul, 2636928640u, 15ul, 4022730752u, 18ul, 1812433253u>&)
Move ArmWiggleRandomizer::randomize(Chromosome &chr, ENG &eng) { 
  uint r1 = util::unif_int(1, chr.size()-2, eng);

  CoordinateVector origin(3);
  origin(0) = chr[r1].getX();
  origin(1) = chr[r1].getY();
  origin(2) = chr[r1].getZ();

  Move mov(chr);
  
  bool goRight = util::unif_int(0,1, eng);
  vector<double> radii;

  boost::container::static_vector<Bead,MAXSIZE>::iterator beaditer;
  if(goRight) {
    for(beaditer=chr.begin()+r1; beaditer!=chr.end(); beaditer++) {
      radii.push_back(beaditer->getRadius());
    }
    mov.start = r1;
    mov.stop = chr.size()-1;
      
  }
  else {
    for(beaditer=chr.begin(); beaditer!=chr.begin()+r1; beaditer++) {
      radii.push_back(beaditer->getRadius());
    }
    mov.start = 0;
    mov.stop = r1-1;            
  }

  CoordinateMatrix mat = util::createSelfAvoidingWalk(radii, origin, eng);
  mov.mat = mat;
  return mov;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rdi, (%rsp)
movq %rdx, %rdi
callq 0xb138
leal -0x2(%rax), %esi
movl $0x1, %edi
movq %rbx, %rdx
callq 0x72ee
movl %eax, %ebp
movq $0x3, 0x60(%rsp)
movl $0x18, %edi
callq 0x6300
movq %rax, 0x68(%rsp)
movq %r15, %rdi
movl %ebp, %esi
callq 0xc00a
movq %rax, %rdi
callq 0xad6c
movsd %xmm0, 0x8(%rsp)
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
callq 0x8fe2
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r15, %rdi
movl %ebp, %esi
callq 0xc00a
movq %rax, %rdi
callq 0xad72
movsd %xmm0, 0x8(%rsp)
leaq 0x58(%rsp), %rdi
movl $0x1, %esi
callq 0x8fe2
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r15, %rdi
movl %ebp, %esi
callq 0xc00a
movq %rax, %rdi
callq 0xad78
movsd %xmm0, 0x8(%rsp)
leaq 0x58(%rsp), %rdi
movl $0x2, %esi
callq 0x8fe2
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq (%rsp), %rax
movq %r15, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x10(%rax)
xorl %edi, %edi
movl $0x1, %esi
movq %rbx, %rdx
callq 0x72ee
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testl %eax, %eax
movq %rbx, 0x70(%rsp)
je 0xd43c
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0xb164
movq 0x30(%rsp), %r12
testq %r12, %r12
setne %al
testl %ebp, %ebp
sete %cl
orb %al, %cl
je 0xd5f1
movl %ebp, %eax
leaq (%rax,%rax,2), %rax
shlq $0x5, %rax
addq %rax, %r12
leaq 0x30(%rsp), %r14
leaq 0x10(%rsp), %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0xb170
cmpq 0x30(%rsp), %r12
je 0xd422
movq %r12, %rdi
callq 0xad7e
movsd %xmm0, 0x30(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xd411
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x18(%rsp)
jmp 0xd41c
movq %r13, %rdi
movq %r14, %rdx
callq 0xa598
addq $0x60, %r12
jmp 0xd3d6
movq (%rsp), %rax
movl %ebp, 0x8(%rax)
movq %r15, %rdi
callq 0xb138
movl %eax, %ebp
movq (%rsp), %rbx
jmp 0xd4d1
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0xb164
leaq 0x30(%rsp), %r12
movq (%r12), %r13
movl %ebp, %eax
leaq (%rax,%rax,2), %rbx
shlq $0x5, %rbx
leaq 0x10(%rsp), %r14
movq %r12, %rdi
movq %r15, %rsi
callq 0xb164
testl %ebp, %ebp
sete %cl
movq 0x30(%rsp), %rax
testq %rax, %rax
setne %dl
orb %cl, %dl
je 0xd5f1
addq %rbx, %rax
cmpq %rax, %r13
je 0xd4c6
movq %r13, %rdi
callq 0xad7e
movsd %xmm0, 0x30(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xd4b5
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x18(%rsp)
jmp 0xd4c0
movq %r14, %rdi
movq %r12, %rdx
callq 0xa598
addq $0x60, %r13
jmp 0xd461
movq (%rsp), %rbx
movl $0x0, 0x8(%rbx)
decl %ebp
movl %ebp, 0xc(%rbx)
leaq 0x90(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x87a2
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x9478
leaq 0x30(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rcx
movl $0x3e8, %r8d            # imm = 0x3E8
callq 0x756a
movq 0x80(%rsp), %rsi
testq %rsi, %rsi
je 0xd537
movq 0x88(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xd554
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
leaq 0x40(%rsp), %rax
movaps -0x10(%rax), %xmm0
movups %xmm0, 0x10(%rbx)
leaq 0x20(%rbx), %rdi
cmpq %rax, %rdi
je 0xd595
movq 0x48(%rsp), %rsi
xorps %xmm0, %xmm0
xorl %edx, %edx
callq 0xcbba
movq 0x48(%rsp), %rdx
testq %rdx, %rdx
je 0xd595
movq 0x50(%rsp), %rsi
shlq $0x3, %rdx
movq 0x30(%rbx), %rdi
callq 0x64e0
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0xd5ad
movq 0x50(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xd5c4
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
movq 0x60(%rsp), %rsi
testq %rsi, %rsi
je 0xd5dc
movq 0x68(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1cade(%rip), %rdi     # 0x2a0d6
leaq 0x1c20c(%rip), %rsi     # 0x2980b
leaq 0x1cae0(%rip), %rcx     # 0x2a0e6
movl $0xab, %edx
callq 0x6210
jmp 0xd682
movq %rax, %r14
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0xd685
movq 0x50(%rsp), %rdi
shlq $0x3, %rsi
jmp 0xd66c
jmp 0xd682
jmp 0xd682
movq %rax, %r14
movq 0x80(%rsp), %rsi
testq %rsi, %rsi
je 0xd654
movq 0x88(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
jmp 0xd654
movq %rax, %r14
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xd685
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
jmp 0xd685
jmp 0xd682
jmp 0xd677
movq %rax, %r14
jmp 0xd6bd
jmp 0xd682
jmp 0xd682
jmp 0xd682
movq %rax, %r14
movq (%rsp), %rax
leaq 0x28(%rax), %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xd6a4
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
movq (%rbx), %rsi
testq %rsi, %rsi
je 0xd6bd
movq (%rsp), %rax
movq 0x30(%rax), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x60(%rsp), %rsi
testq %rsi, %rsi
je 0xd6d5
movq 0x68(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq %r14, %rdi
callq 0x65b0
nop