// File: /workspace/github_cpp_makefile_star2_O3/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 0x125fe
cmpl $0x0, 0x48(%r14)
jle 0x11a38
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 0xe36c
movq 0x40(%r14), %rax
cmpl $0x0, 0x18(%rax,%r15)
movq 0x10(%rsp), %rbp
jle 0x11a03
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 0x12d4c
movq %r13, %rdi
leaq 0xb657(%rip), %rsi      # 0x1ceca
callq 0x23a0
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 0xe36c
movq 0x38(%rsp), %rcx
movl $0xf, %edi
leaq 0x48(%rsp), %rax
cmpq %rax, %rcx
je 0x118c0
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %r8
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
movq 0x10(%rsp), %rbp
jbe 0x118f6
movl $0xf, %edi
leaq 0x68(%rsp), %r9
cmpq %r9, %rsi
je 0x118f1
movq 0x68(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x11900
movq %r13, %rdi
callq 0x20c0
jmp 0x1190e
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2240
leaq 0x28(%rsp), %rsi
movq %rsi, 0x18(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x11933
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
jmp 0x11939
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 0x11972
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2220
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x1198e
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2220
movq 0x78(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x12de2
cmpq 0xa8(%rsp), %rax
je 0x119ac
movl 0x40(%rax), %eax
jmp 0x119b1
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 0x119dd
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2220
incq %r12
movq 0x40(%r14), %rax
movslq 0x18(%rax,%r15), %rax
addq $0x60, %rbx
cmpq %rax, %r12
jl 0x11844
addl %r12d, 0xc(%rsp)
movq 0xa0(%rsp), %r12
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x11a28
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2220
incq %r12
movslq 0x48(%r14), %rax
cmpq %rax, %r12
jl 0x117ca
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 0x11ae7
movq %rax, %r14
jmp 0x11a88
movq %rax, %r14
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x11a88
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x11a88
movq %rax, %r14
movq 0x10(%rsp), %rbp
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x11ac2
movq 0x48(%rsp), %rsi
jmp 0x11aba
movq %rax, %r14
jmp 0x11ac2
movq %rax, %r14
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x11ac2
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2220
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x11ae7
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2220
movq (%rbp), %rdi
testq %rdi, %rdi
je 0x11afc
movq 0x10(%rbp), %rsi
subq %rdi, %rsi
callq 0x2220
movq %r14, %rdi
callq 0x2380