// File: /workspace/github_cpp_makefile_star2_O1/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 0x97c3(%rip), %rsi      # 0x1ab4d
movq %rbx, %rdi
callq 0x2260
testq %rax, %rax
je 0x1156a
movq %rax, %r14
leaq 0x60(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %rax, %rdx
callq 0x2360
testq %rax, %rax
je 0x11548
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 0x1146d
movq %r12, %rdi
leaq 0xbace(%rip), %rsi      # 0x1cec4
leaq 0x4e(%rsp), %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x2200
cmpl $0x2, %eax
jne 0x1146d
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 0xe47c
movq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x12fd2
movq %rax, %r15
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1145b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
cmpq 0x58(%rsp), %r15
je 0x11496
movl %ebp, %r13d
movl 0x40(%r15), %eax
movl %eax, %ebp
jmp 0x114ea
movl %ebp, %r13d
movq %r12, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %r14, %rdx
callq 0x2360
movl %r13d, %ebp
testq %rax, %rax
leaq 0x36(%rsp), %r13
jne 0x113e1
jmp 0x11548
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 0xe47c
movq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x1269a
movl %ebp, (%rax)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x114e6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
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 0xe47c
movq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x1269a
movl %ebp, (%rax)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x11470
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x11470
movq %r14, %rdi
callq 0x2210
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 0xb937(%rip), %rdi      # 0x1cea8
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2050
movl $0x1, %edi
callq 0x2280
jmp 0x11592
jmp 0x1158d
jmp 0x1158d
jmp 0x11592
movq %rax, %rbx
jmp 0x115b1
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x115b1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x2390
nop