// File: /workspace/github_cpp_makefile_star2_O1/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 0xb1dc
leal -0x2(%rax), %esi
movl $0x1, %edi
movq %rbx, %rdx
callq 0x72ce
movl %eax, %ebp
movq $0x3, 0x60(%rsp)
movl $0x18, %edi
callq 0x6300
movq %rax, 0x68(%rsp)
movq %r15, %rdi
movl %ebp, %esi
callq 0xc0ae
movq %rax, %rdi
callq 0xae00
movsd %xmm0, 0x8(%rsp)
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
callq 0x901a
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r15, %rdi
movl %ebp, %esi
callq 0xc0ae
movq %rax, %rdi
callq 0xae06
movsd %xmm0, 0x8(%rsp)
leaq 0x58(%rsp), %rdi
movl $0x1, %esi
callq 0x901a
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r15, %rdi
movl %ebp, %esi
callq 0xc0ae
movq %rax, %rdi
callq 0xae0c
movsd %xmm0, 0x8(%rsp)
leaq 0x58(%rsp), %rdi
movl $0x2, %esi
callq 0x901a
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 0x72ce
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testl %eax, %eax
movq %rbx, 0x70(%rsp)
je 0xd4bc
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0xb208
movq 0x30(%rsp), %r12
testq %r12, %r12
setne %al
testl %ebp, %ebp
sete %cl
orb %al, %cl
je 0xd671
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 0xb214
cmpq 0x30(%rsp), %r12
je 0xd4a2
movq %r12, %rdi
callq 0xae12
movsd %xmm0, 0x30(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xd491
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x18(%rsp)
jmp 0xd49c
movq %r13, %rdi
movq %r14, %rdx
callq 0xa62a
addq $0x60, %r12
jmp 0xd456
movq (%rsp), %rax
movl %ebp, 0x8(%rax)
movq %r15, %rdi
callq 0xb1dc
movl %eax, %ebp
movq (%rsp), %rbx
jmp 0xd551
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0xb208
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 0xb208
testl %ebp, %ebp
sete %cl
movq 0x30(%rsp), %rax
testq %rax, %rax
setne %dl
orb %cl, %dl
je 0xd671
addq %rbx, %rax
cmpq %rax, %r13
je 0xd546
movq %r13, %rdi
callq 0xae12
movsd %xmm0, 0x30(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xd535
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x18(%rsp)
jmp 0xd540
movq %r14, %rdi
movq %r12, %rdx
callq 0xa62a
addq $0x60, %r13
jmp 0xd4e1
movq (%rsp), %rbx
movl $0x0, 0x8(%rbx)
decl %ebp
movl %ebp, 0xc(%rbx)
leaq 0x90(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x87e0
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x94b0
leaq 0x30(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rcx
movl $0x3e8, %r8d            # imm = 0x3E8
callq 0x7551
movq 0x80(%rsp), %rsi
testq %rsi, %rsi
je 0xd5b7
movq 0x88(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xd5d4
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 0xd615
movq 0x48(%rsp), %rsi
xorps %xmm0, %xmm0
xorl %edx, %edx
callq 0xcc46
movq 0x48(%rsp), %rdx
testq %rdx, %rdx
je 0xd615
movq 0x50(%rsp), %rsi
shlq $0x3, %rdx
movq 0x30(%rbx), %rdi
callq 0x64e0
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0xd62d
movq 0x50(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xd644
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
movq 0x60(%rsp), %rsi
testq %rsi, %rsi
je 0xd65c
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 0x1ca5e(%rip), %rdi     # 0x2a0d6
leaq 0x1c18c(%rip), %rsi     # 0x2980b
leaq 0x1ca60(%rip), %rcx     # 0x2a0e6
movl $0xab, %edx
callq 0x6210
jmp 0xd705
movq %rax, %r14
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0xd708
movq 0x50(%rsp), %rdi
shlq $0x3, %rsi
jmp 0xd6ec
jmp 0xd705
jmp 0xd705
movq %rax, %r14
movq 0x80(%rsp), %rsi
testq %rsi, %rsi
je 0xd6d4
movq 0x88(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
jmp 0xd6d4
movq %rax, %r14
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xd708
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
jmp 0xd708
jmp 0xd705
movq %rax, %r14
jmp 0xd71f
movq %rax, %r14
jmp 0xd740
jmp 0xd705
jmp 0xd705
jmp 0xd705
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xd71f
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6310
movq (%rsp), %rax
addq $0x28, %rax
movq (%rax), %rsi
testq %rsi, %rsi
je 0xd740
movq (%rsp), %rax
movq 0x30(%rax), %rdi
shlq $0x3, %rsi
callq 0x6310
movq 0x60(%rsp), %rsi
testq %rsi, %rsi
je 0xd758
movq 0x68(%rsp), %rdi
shlq $0x3, %rsi
callq 0x6310
movq %r14, %rdi
callq 0x65b0