// File: /workspace/github_cpp_makefile_star2_O1/gjoni[P]iPot/src/AACE.cpp
// Function: AACE::GetTypes(Chain const&)
std::vector<int> AACE::GetTypes(const Chain &C) {

	int n = 0;

	std::map<std::string, int>::iterator it;
	std::vector<int> types(C.nAtoms);

	for (int i = 0; i < C.nRes; i++) {

		std::string rname(C.residue[i].name);

		for (int j = 0; j < C.residue[i].nAtoms; j++) {

			/* ACE atom type */
			std::string name = rname + "_"
					+ std::string(C.residue[i].atom[j].name);

			it = ATOM_IDX.find(name);
			if (it != ATOM_IDX.end()) {
				types[n] = it->second;
			} else {
				types[n] = -1;
			}
			n++;
		}
	}

	return types;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdx, %r14
movq %rsi, 0x78(%rsp)
movq %rdi, %rbp
movslq 0x38(%rdx), %rsi
leaq 0x80(%rsp), %rdx
callq 0x127f4
cmpl $0x0, 0x48(%r14)
jle 0x11c36
movq 0x78(%rsp), %rax
addq $0x8, %rax
movq %rax, 0xa8(%rsp)
xorl %r12d, %r12d
leaq 0x38(%rsp), %r13
movl $0x0, 0xc(%rsp)
movq %rbp, 0x10(%rsp)
movq 0x40(%r14), %rbx
imulq $0x188, %r12, %r15      # imm = 0x188
leaq (%rbx,%r15), %rbp
incq %rbp
addq %r15, %rbx
leaq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
movq %rbp, %rdi
callq 0x2100
leaq (%rax,%rbx), %rdx
incq %rdx
leaq 0x80(%rsp), %rdi
movq %rbp, %rsi
callq 0xe47c
movq 0x40(%r14), %rax
cmpl $0x0, 0x18(%rax,%r15)
movq 0x10(%rsp), %rbp
jle 0x11c01
movq %r12, 0xa0(%rsp)
movslq 0xc(%rsp), %rax
shlq $0x2, %rax
movq %rax, 0xb0(%rsp)
movl $0x4, %ebx
xorl %r12d, %r12d
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x12f42
movq %r13, %rdi
leaq 0xb45b(%rip), %rsi      # 0x1ceca
callq 0x23b0
movq 0x40(%r14), %rax
movq 0x10(%rax,%r15), %rbp
addq %rbx, %rbp
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq %rbp, %rdi
callq 0x2100
leaq (%rax,%rbp), %rdx
leaq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0xe47c
movq 0x38(%rsp), %rcx
movl $0xf, %esi
leaq 0x48(%rsp), %rax
cmpq %rax, %rcx
je 0x11abc
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %r8
movq 0x60(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
movq 0x10(%rsp), %rbp
jbe 0x11aef
movl $0xf, %esi
leaq 0x68(%rsp), %rdi
cmpq %rdi, 0x58(%rsp)
je 0x11aea
movq 0x68(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x11afe
movq 0x58(%rsp), %rsi
movq %r13, %rdi
callq 0x20c0
jmp 0x11b0c
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2250
leaq 0x28(%rsp), %rsi
movq %rsi, 0x18(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x11b31
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
jmp 0x11b37
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x20(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x11b70
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x11b8c
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x78(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x12fd2
cmpq 0xa8(%rsp), %rax
je 0x11baa
movl 0x40(%rax), %eax
jmp 0x11baf
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq (%rbp), %rcx
addq 0xb0(%rsp), %rcx
movl %eax, (%rcx,%r12,4)
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x11bdb
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2230
incq %r12
movq 0x40(%r14), %rax
movslq 0x18(%rax,%r15), %rax
addq $0x60, %rbx
cmpq %rax, %r12
jl 0x11a40
addl %r12d, 0xc(%rsp)
movq 0xa0(%rsp), %r12
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x11c26
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2230
incq %r12
movslq 0x48(%r14), %rax
cmpq %rax, %r12
jl 0x119c6
movq %rbp, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x10(%rsp), %rbp
jmp 0x11ce5
movq %rax, %r14
jmp 0x11c86
movq %rax, %r14
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x11c86
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x11c86
movq %rax, %r14
movq 0x10(%rsp), %rbp
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x11cc0
movq 0x48(%rsp), %rsi
jmp 0x11cb8
movq %rax, %r14
jmp 0x11cc0
movq %rax, %r14
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x11cc0
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x11ce5
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2230
movq (%rbp), %rdi
testq %rdi, %rdi
je 0x11cfa
movq 0x10(%rbp), %rsi
subq %rdi, %rsi
callq 0x2230
movq %r14, %rdi
callq 0x2390