// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
andl $0x0, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
movl %edx, %ebp
andl $0x0, 0x38(%rdi)
andq $0x0, 0x40(%rdi)
movl %esi, %r12d
leaq 0x38(%rdi), %rax
movq %rax, 0x48(%rdi)
movq %rax, 0x50(%rdi)
xorps %xmm1, %xmm1
andq $0x0, 0x68(%rdi)
movups %xmm1, 0x58(%rdi)
movsd %xmm0, 0x70(%rdi)
leaq 0x88(%rdi), %rax
movq %rax, 0x78(%rdi)
andq $0x0, 0x80(%rdi)
movb $0x0, 0x88(%rdi)
leaq 0xa4d4(%rip), %rdi      # 0x1ad40
callq 0x2280
testq %rax, %rax
je 0x10951
decl %r12d
cmpl $0x5, %r12d
jae 0x1095a
movq %rax, %r15
leaq 0x78(%rbx), %rax
movq %rax, 0x8(%rsp)
movl %r12d, %eax
leaq 0x9d8b(%rip), %rcx      # 0x1a628
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq 0x9d91(%rip), %rcx      # 0x1a63c
movslq (%rcx,%rax,4), %r13
addq %rcx, %r13
leaq 0x9d97(%rip), %rcx      # 0x1a650
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
movq 0x8(%rsp), %r14
movl %ebp, %edx
movb $0x1, %al
callq 0x2080
movq %rbx, %rdi
movq %r12, %rsi
callq 0x10996
movl 0x58(%rbx), %esi
movq %rbx, %rdi
callq 0x105d6
leaq 0x400(%rsp), %rsi
movq %rbx, %rdi
callq 0x10b56
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x23d0
addq $0xbd8, %rsp            # imm = 0xBD8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa592(%rip), %rdi      # 0x1aeea
jmp 0x10961
leaq 0xa56b(%rip), %rdi      # 0x1aecc
callq 0x2330
pushq $0x1
popq %rdi
callq 0x2270
movq %rax, %r15
leaq 0x30(%rbx), %r12
movq %r14, %rdi
callq 0x2100
movq %r12, %rdi
callq 0x11922
movq %rbx, %rdi
callq 0x11922
movq %r15, %rdi
callq 0x23a0
nop