// File: gjoni[P]iPot/src/Residue.cpp
// Function: Residue::operator=(Residue const&)
Residue & Residue::operator =(const Residue & source) {

	assert(this != &source); /* an attempt to assign Residue to itself */

	type = source.type;
	strcpy(name, source.name);
	seqNum = source.seqNum;
	insCode = source.insCode;
	nAtoms = source.nAtoms;
	chainId = source.chainId;

	delete[] atom;

	atom = new Atom[nAtoms];
	for (int i = 0; i < nAtoms; i++) {
		atom[i] = source.atom[i];
		atom[i].residue = this;
	}

	SetBBAtoms();

	memcpy(centroid, source.centroid, 3 * sizeof(double));

	return *this;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq -0x10(%rbp), %rax
je 0x29373
jmp 0x29392
leaq 0xdb26(%rip), %rdi      # 0x36ea0
leaq 0x11c02(%rip), %rsi     # 0x3af83
movl $0x9f, %edx
leaq 0x11cb1(%rip), %rcx     # 0x3b03e
callq 0x31b0
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movb (%rax), %al
movb %al, (%rdi)
addq $0x1, %rdi
movq -0x10(%rbp), %rsi
addq $0x1, %rsi
callq 0x3270
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movb 0xc(%rcx), %cl
movb %cl, 0xc(%rax)
movq -0x10(%rbp), %rcx
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rcx
movb 0x1c(%rcx), %cl
movb %cl, 0x1c(%rax)
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x2944a
movq -0x30(%rbp), %rcx
movq %rcx, %rax
addq $-0x8, %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rcx), %rax
movq %rax, -0x40(%rbp)
imulq $0x60, %rax, %rdx
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, -0x38(%rbp)
je 0x29435
movq -0x38(%rbp), %rdi
addq $-0x60, %rdi
movq %rdi, -0x50(%rbp)
callq 0x18e20
movq -0x30(%rbp), %rcx
movq -0x50(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x38(%rbp)
jne 0x29413
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rax
imulq $0x60, %rax, %rsi
addq $0x8, %rsi
callq 0x34a0
movq -0x28(%rbp), %rax
movslq 0x18(%rax), %rax
movq %rax, -0x68(%rbp)
movl $0x60, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x70(%rbp)
callq 0x3030
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, -0x60(%rbp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x58(%rbp)
cmpq $0x0, %rax
je 0x294e4
movq -0x58(%rbp), %rax
movq -0x68(%rbp), %rcx
imulq $0x60, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x80(%rbp)
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x18b10
jmp 0x294cc
movq -0x80(%rbp), %rcx
movq -0x88(%rbp), %rax
addq $0x60, %rax
cmpq %rcx, %rax
movq %rax, -0x78(%rbp)
jne 0x294ba
movq -0x28(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl $0x0, -0x20(%rbp)
movq -0x28(%rbp), %rcx
movl -0x20(%rbp), %eax
cmpl 0x18(%rcx), %eax
jge 0x295b2
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rsi
movslq -0x20(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rsi
movq 0x10(%rax), %rdi
movslq -0x20(%rbp), %rax
imulq $0x60, %rax, %rax
addq %rax, %rdi
callq 0x18e30
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rax
movslq -0x20(%rbp), %rdx
imulq $0x60, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x40(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x294f7
movq -0x58(%rbp), %rcx
movq %rax, %rsi
movq -0x88(%rbp), %rax
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpq %rax, %rcx
movq %rax, -0x90(%rbp)
je 0x295a3
movq -0x90(%rbp), %rdi
addq $-0x60, %rdi
movq %rdi, -0x98(%rbp)
callq 0x18e20
movq -0x58(%rbp), %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x90(%rbp)
jne 0x29575
movq -0x70(%rbp), %rsi
movq -0x60(%rbp), %rdi
callq 0x34a0
jmp 0x295e4
movq -0x28(%rbp), %rdi
callq 0x27e40
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rdx
movq %rdx, 0x20(%rax)
movq 0x28(%rcx), %rdx
movq %rdx, 0x28(%rax)
movq 0x30(%rcx), %rcx
movq %rcx, 0x30(%rax)
addq $0xa0, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x3460
nopl (%rax)