// File: Chrom3D[P]Chrom3D/src/Model.cpp
// Function: Model::accept(Move&)
Move Model::accept(Move &mov) { // Accepts the coordinates of mov, returns the coordinates of the altered beads (as a new Move).
  Move oldStructure(mov.chr);
  oldStructure.start = mov.start;
  oldStructure.stop = mov.stop;
  
  uint movSize = (mov.stop-mov.start)+1;
  CoordinateMatrix oldMat(movSize,3);
  for(uint i=0; i!=movSize; i++) {
    // Store old coordinates:
    oldMat(i,0) = mov.chr[mov.start+i].getX();
    oldMat(i,1) = mov.chr[mov.start+i].getY();
    oldMat(i,2) = mov.chr[mov.start+i].getZ();
    // Set new coordinates:
    mov.chr[mov.start+i].setCoordinates(mov.mat(i,0), mov.mat(i,1), mov.mat(i,2));
  }
  oldStructure.mat = oldMat;
  
  return oldStructure;
}

// Assembly:
subq $0xe8, %rsp
movq %rdi, 0x88(%rsp)
movq %rdi, %rax
movq %rax, 0x80(%rsp)
movq %rdi, 0xe0(%rsp)
movq %rsi, 0xd8(%rsp)
movq %rdx, 0xd0(%rsp)
movb $0x0, 0xcf(%rsp)
movq 0xd0(%rsp), %rax
movq (%rax), %rsi
callq 0x192f0
movq 0x88(%rsp), %rdi
movq 0xd0(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x8(%rdi)
movq 0xd0(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, 0xc(%rdi)
movq 0xd0(%rsp), %rax
movl 0x8(%rax), %ecx
movl 0xc(%rax), %eax
subl %ecx, %eax
incl %eax
movl %eax, 0xc8(%rsp)
movl 0xc8(%rsp), %eax
movl %eax, %esi
leaq 0xa0(%rsp), %rdi
movl $0x3, %edx
callq 0xb1a0
jmp 0x1f044
movl $0x0, 0x90(%rsp)
movl 0x90(%rsp), %eax
cmpl 0xc8(%rsp), %eax
je 0x1f2b8
movq 0xd0(%rsp), %rax
movq (%rax), %rdi
movl 0x8(%rax), %esi
movl 0x90(%rsp), %eax
addl %eax, %esi
callq 0x16820
movq %rax, 0x78(%rsp)
jmp 0x1f086
movq 0x78(%rsp), %rdi
callq 0x14e30
movsd %xmm0, 0x70(%rsp)
jmp 0x1f098
movl 0x90(%rsp), %eax
movl %eax, %esi
xorl %eax, %eax
movl %eax, %edx
leaq 0xa0(%rsp), %rdi
callq 0xb2a0
movq %rax, 0x68(%rsp)
jmp 0x1f0b9
movq 0x68(%rsp), %rax
movsd 0x70(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0xd0(%rsp), %rax
movq (%rax), %rdi
movl 0x8(%rax), %esi
movl 0x90(%rsp), %eax
addl %eax, %esi
callq 0x16820
movq %rax, 0x60(%rsp)
jmp 0x1f0eb
movq 0x60(%rsp), %rdi
callq 0x14e40
movsd %xmm0, 0x58(%rsp)
jmp 0x1f0fd
movl 0x90(%rsp), %eax
movl %eax, %esi
leaq 0xa0(%rsp), %rdi
movl $0x1, %edx
callq 0xb2a0
movq %rax, 0x50(%rsp)
jmp 0x1f11f
movq 0x50(%rsp), %rax
movsd 0x58(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0xd0(%rsp), %rax
movq (%rax), %rdi
movl 0x8(%rax), %esi
movl 0x90(%rsp), %eax
addl %eax, %esi
callq 0x16820
movq %rax, 0x48(%rsp)
jmp 0x1f151
movq 0x48(%rsp), %rdi
callq 0x14e50
movsd %xmm0, 0x40(%rsp)
jmp 0x1f163
movl 0x90(%rsp), %eax
movl %eax, %esi
leaq 0xa0(%rsp), %rdi
movl $0x2, %edx
callq 0xb2a0
movq %rax, 0x38(%rsp)
jmp 0x1f185
movq 0x38(%rsp), %rax
movsd 0x40(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0xd0(%rsp), %rax
movq (%rax), %rdi
movl 0x8(%rax), %esi
movl 0x90(%rsp), %eax
addl %eax, %esi
callq 0x16820
movq %rax, 0x30(%rsp)
jmp 0x1f1b7
movq 0xd0(%rsp), %rdi
addq $0x10, %rdi
movl 0x90(%rsp), %eax
movl %eax, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xb2a0
movq %rax, 0x28(%rsp)
jmp 0x1f1dc
movq 0x28(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0xd0(%rsp), %rdi
addq $0x10, %rdi
movl 0x90(%rsp), %eax
movl %eax, %esi
movl $0x1, %edx
callq 0xb2a0
movq %rax, 0x20(%rsp)
jmp 0x1f211
movq 0x20(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0xd0(%rsp), %rdi
addq $0x10, %rdi
movl 0x90(%rsp), %eax
movl %eax, %esi
movl $0x2, %edx
callq 0xb2a0
movq %rax, 0x10(%rsp)
jmp 0x1f246
movsd 0x8(%rsp), %xmm1
movsd 0x18(%rsp), %xmm0
movq 0x30(%rsp), %rdi
movq 0x10(%rsp), %rax
movsd (%rax), %xmm2
callq 0x14dc0
jmp 0x1f267
jmp 0x1f269
movl 0x90(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x90(%rsp)
jmp 0x1f04f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x1f30f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0xb2d0
jmp 0x1f30f
movq 0x88(%rsp), %rdi
addq $0x10, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x17400
jmp 0x1f2d3
movb $0x1, 0xcf(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0xb2d0
testb $0x1, 0xcf(%rsp)
jne 0x1f2ff
movq 0x88(%rsp), %rdi
callq 0x1a560
movq 0x80(%rsp), %rax
addq $0xe8, %rsp
retq
movq 0x88(%rsp), %rdi
callq 0x1a560
movq 0x98(%rsp), %rdi
callq 0x8870
nopl (%rax)