// File: /workspace/github_cpp_makefile_star2_O3/gjoni[P]iPot/src/AACE.cpp
// Function: AACE::AACE(AACE::AACE_TYPE, double, int)
AACE::AACE(AACE_TYPE type, double d, int k) :
		h(NULL), J(NULL), dmax(d) {

	char *DATADIR = getenv("TMDOCKDAT");
	if (DATADIR == NULL) {
		printf("Error: environment variable 'TMDOCKDAT' not set\n");
		exit(1);
	}

	const int STRMAX = 1000;
	char gname[STRMAX], tname[STRMAX], aace_name[STRMAX];

	switch (type) {

	case AACE18:
		sprintf(gname, "%s/groups18.dat", DATADIR);
		sprintf(tname, "%s/AACE18/table.%.1fA_k%d", DATADIR, dmax, k);
		sprintf(aace_name, "AACE18_%.1fA_k%d", dmax, k);
		break;

	case AACE167:
		sprintf(gname, "%s/groups167.dat", DATADIR);
		sprintf(tname, "%s/AACE167/table.%.1fA_k%d", DATADIR, dmax, k);
		sprintf(aace_name, "AACE167_%.1fA_k%d", dmax, k);
		break;

	case AACE20:
		sprintf(gname, "%s/groups20.dat", DATADIR);
		sprintf(tname, "%s/AACE20/table.%.1fA_k%d", DATADIR, dmax, k);
		sprintf(aace_name, "AACE20_%.1fA_k%d", dmax, k);
		break;

	case AACE24:
		sprintf(gname, "%s/groups24.dat", DATADIR);
		sprintf(tname, "%s/AACE24/table.%.1fA_k%d", DATADIR, dmax, k);
		sprintf(aace_name, "AACE24_%.1fA_k%d", dmax, k);
		break;

	case AACE33:
		sprintf(gname, "%s/groups33.dat", DATADIR);
		sprintf(tname, "%s/AACE33/table.%.1fA_k%d", DATADIR, dmax, k);
		sprintf(aace_name, "AACE33_%.1fA_k%d", dmax, k);
		break;

	default:
		printf("Error: wrong AACE groups file\n");
		exit(1);
		break;

	}

	ReadGroups(gname);

	Allocate(TYPE_IDX.size());

	ReadCouplings(tname);

	name = aace_name;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xbd8, %rsp            # imm = 0xBD8
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
xorl %ecx, %ecx
movl %ecx, 0x8(%rdi)
movq %rcx, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rcx, 0x28(%rdi)
leaq 0x38(%rdi), %rax
movl %ecx, 0x38(%rdi)
movq %rcx, 0x40(%rdi)
movq %rax, 0x48(%rdi)
movq %rax, 0x50(%rdi)
xorps %xmm1, %xmm1
movups %xmm1, 0x58(%rdi)
movq %rcx, 0x68(%rdi)
movsd %xmm0, 0x70(%rdi)
leaq 0x88(%rdi), %rax
movq %rax, (%rsp)
movq %rax, 0x78(%rdi)
movq %rcx, 0x80(%rdi)
movb $0x0, 0x88(%rdi)
leaq 0xbd27(%rip), %rdi      # 0x1cd40
callq 0x2280
testq %rax, %rax
je 0x11118
decl %r12d
cmpl $0x5, %r12d
jae 0x11121
movq %rax, %r15
leaq 0x78(%rbx), %rax
movq %rax, 0x8(%rsp)
movl %r12d, %eax
leaq 0xb5de(%rip), %rcx      # 0x1c628
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq 0xb5e4(%rip), %rcx      # 0x1c63c
movslq (%rcx,%rax,4), %r13
addq %rcx, %r13
leaq 0xb5ea(%rip), %rcx      # 0x1c650
movslq (%rcx,%rax,4), %r14
addq %rcx, %r14
leaq 0x7f0(%rsp), %r12
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2080
movsd 0x70(%rbx), %xmm0
leaq 0x400(%rsp), %rdi
movq %r13, %rsi
movq %r15, %rdx
movl %ebp, %ecx
movb $0x1, %al
callq 0x2080
movsd 0x70(%rbx), %xmm0
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
movl %ebp, %edx
movb $0x1, %al
callq 0x2080
movq %rbx, %rdi
movq %r12, %rsi
movq 0x8(%rsp), %r12
callq 0x1116c
movl 0x58(%rbx), %esi
movq %rbx, %rdi
callq 0x10d66
leaq 0x400(%rsp), %rsi
movq %rbx, %rdi
callq 0x113bc
movq 0x80(%rbx), %r14
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x2100
movq %r12, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x2320
addq $0xbd8, %rsp            # imm = 0xBD8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbdcb(%rip), %rdi      # 0x1ceea
jmp 0x11128
leaq 0xbda4(%rip), %rdi      # 0x1cecc
callq 0x2310
movl $0x1, %edi
callq 0x2270
movq %rax, %r15
movq (%r12), %rdi
cmpq (%rsp), %rdi
je 0x11153
movq (%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2220
leaq 0x30(%rbx), %rdi
callq 0x1268a
movq %rbx, %rdi
callq 0x1268a
movq %r15, %rdi
callq 0x2380