// File: /workspace/github_cpp_makefile_star2_O2/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 $0xb8, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rdi, 0x8(%rsp)
movq %rdx, %rdi
callq 0xa75e
leal -0x2(%rax), %esi
pushq $0x1
popq %rdi
movq %rbx, 0x20(%rsp)
movq %rbx, %rdx
callq 0x6ebd
movl %eax, %ebx
leaq 0x68(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x7d3c
movq %r15, %rdi
movl %ebx, 0x4(%rsp)
movl %ebx, %esi
callq 0xb174
movq %rax, %rdi
callq 0xa3d6
movsd %xmm0, 0x10(%rsp)
leaq 0x68(%rsp), %rdi
xorl %esi, %esi
callq 0x8638
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r15, %rdi
movl 0x4(%rsp), %esi
callq 0xb174
movq %rax, %rdi
callq 0xa3dc
movsd %xmm0, 0x10(%rsp)
leaq 0x68(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x8638
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r15, %rdi
movl 0x4(%rsp), %esi
callq 0xb174
movq %rax, %rdi
callq 0xa3e2
movsd %xmm0, 0x10(%rsp)
leaq 0x68(%rsp), %rdi
pushq $0x2
popq %rsi
callq 0x8638
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x8(%rsp), %rax
movq %r15, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x10(%rax)
pushq $0x1
popq %rsi
xorl %edi, %edi
movq 0x20(%rsp), %rdx
callq 0x6ebd
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
andq $0x0, 0x18(%rsp)
testl %eax, %eax
je 0xc245
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0xa778
movl 0x4(%rsp), %edx
leaq 0x18(%rsp), %r14
leaq 0x28(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb224
leaq 0x50(%rsp), %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa784
movq 0x18(%rsp), %rdi
cmpq 0x28(%rsp), %rdi
je 0xc223
callq 0xa3e8
movsd %xmm0, 0x28(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x97f6
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xb1ee
jmp 0xc1e7
movq 0x8(%rsp), %rax
movl 0x4(%rsp), %ecx
movl %ecx, 0x8(%rax)
movq %r15, %rdi
callq 0xa75e
movl %eax, 0x4(%rsp)
movq 0x8(%rsp), %rax
jmp 0xc2c9
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0xa778
leaq 0x28(%rsp), %r12
movq (%r12), %rax
leaq 0x18(%rsp), %r13
movq %rax, (%r13)
movl 0x4(%rsp), %r14d
leaq 0xb0(%rsp), %rbx
leaq 0x50(%rsp), %rbp
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa778
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xb224
movq 0x18(%rsp), %rdi
cmpq 0x28(%rsp), %rdi
je 0xc2c0
callq 0xa3e8
movsd %xmm0, 0x28(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
callq 0x97f6
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0xb1ee
jmp 0xc276
movq 0x8(%rsp), %rax
andl $0x0, 0x8(%rax)
movl 0x4(%rsp), %ecx
decl %ecx
movl %ecx, 0xc(%rax)
leaq 0x98(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x7e9c
leaq 0x80(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x8932
leaq 0x28(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x80(%rsp), %rdx
movq 0x20(%rsp), %rcx
movl $0x3e8, %r8d            # imm = 0x3E8
callq 0x70ea
movq 0x8(%rsp), %r14
leaq 0x10(%r14), %rbx
leaq 0x80(%rsp), %rdi
callq 0x8012
leaq 0x98(%rsp), %rdi
callq 0x92fe
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0xb528
leaq 0x38(%rsp), %rdi
callq 0x8012
leaq 0x50(%rsp), %rdi
callq 0x92fe
leaq 0x68(%rsp), %rdi
callq 0x8012
movq %r14, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc3c9
jmp 0xc3c9
jmp 0xc3c9
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x8012
jmp 0xc3cc
movq %rax, %r14
leaq 0x80(%rsp), %rdi
callq 0x8012
jmp 0xc3a8
movq %rax, %r14
leaq 0x98(%rsp), %rdi
callq 0x92fe
jmp 0xc3cc
jmp 0xc3c9
movq %rax, %r14
jmp 0xc3d6
movq %rax, %r14
jmp 0xc3e4
jmp 0xc3c9
jmp 0xc3c9
jmp 0xc3c9
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x92fe
movq 0x8(%rsp), %rdi
addq $0x20, %rdi
callq 0x8012
leaq 0x68(%rsp), %rdi
callq 0x8012
movq %r14, %rdi
callq 0x65d0