// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/AACE.cpp
// Function: AACE::ReadGroups(char const*)
int AACE::ReadGroups(const char *name) {

	FILE *F = fopen(name, "r");
	if (F == NULL) {
		printf("Error: cannot open %s file\n", name);
		exit(1);
	}

	const int STRMAX = 1000;
	char atom[10], type[10], buf[STRMAX];
	int n = 0;

	while (fgets(buf, STRMAX, F)) {
		if (buf[0] != '#') {
			if (sscanf(buf, "%s %s", atom, type) == 2) {
				std::map<std::string, int>::const_iterator it;
				it = TYPE_IDX.find(type);
				int t;
				if (it == TYPE_IDX.end()) {
					TYPE_IDX[type] = n;
					//printf("%s %d\n", type, n);
					t = n++;
				} else {
					t = it->second;
				}
				ATOM_IDX[atom] = t;
			}
		}
	}
	fclose(F);

	return TYPE_IDX.size();

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movq %rsi, %rbx
movq %rdi, 0x28(%rsp)
leaq 0x99c1(%rip), %rsi      # 0x1ab4d
movq %rbx, %rdi
callq 0x2250
testq %rax, %rax
je 0x1136c
movq %rax, %r14
leaq 0x60(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %rax, %rdx
callq 0x2350
testq %rax, %rax
je 0x1134a
movq 0x28(%rsp), %rax
leaq 0x30(%rax), %rcx
movq %rcx, 0x40(%rsp)
addq $0x38, %rax
movq %rax, 0x58(%rsp)
leaq 0x60(%rsp), %r12
leaq 0x36(%rsp), %r13
leaq 0x8(%rsp), %rbx
xorl %ebp, %ebp
cmpb $0x23, 0x60(%rsp)
je 0x1126f
movq %r12, %rdi
leaq 0xbccc(%rip), %rsi      # 0x1cec4
leaq 0x4e(%rsp), %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x21f0
cmpl $0x2, %eax
jne 0x1126f
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r13, %rdi
callq 0x2100
leaq (%rsp,%rax), %rdx
addq $0x36, %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe36c
movq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x12de2
movq %rax, %r15
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1125d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2220
cmpq 0x58(%rsp), %r15
je 0x11298
movl %ebp, %r13d
movl 0x40(%r15), %eax
movl %eax, %ebp
jmp 0x112ec
movl %ebp, %r13d
movq %r12, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %r14, %rdx
callq 0x2350
movl %r13d, %ebp
testq %rax, %rax
leaq 0x36(%rsp), %r13
jne 0x111e3
jmp 0x1134a
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r13, %rdi
callq 0x2100
leaq (%rsp,%rax), %rdx
addq $0x36, %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe36c
movq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x124a4
movl %ebp, (%rax)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x112e8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2220
leal 0x1(%rbp), %r13d
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x4e(%rsp), %r15
movq %r15, %rdi
callq 0x2100
leaq (%rsp,%rax), %rdx
addq $0x4e, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe36c
movq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x124a4
movl %ebp, (%rax)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x11272
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x11272
movq %r14, %rdi
callq 0x2200
movq 0x28(%rsp), %rax
movl 0x58(%rax), %eax
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbb35(%rip), %rdi      # 0x1cea8
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2050
movl $0x1, %edi
callq 0x2270
jmp 0x11394
jmp 0x1138f
jmp 0x1138f
jmp 0x11394
movq %rax, %rbx
jmp 0x113b3
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x113b3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2220
movq %rbx, %rdi
callq 0x2380
nop