// File: gjoni[P]iPot/src/RRCE.cpp
// Function: RRCE::RRCE(RRCE::RRCE_TYPE, double, int)
RRCE::RRCE(RRCE_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 tname[STRMAX], rrce_name[STRMAX];

	switch (type) {

	case RRCE20RC:
		sprintf(tname, "%s/RRCE20RC/table.%.1fA_k%d", DATADIR, dmax, k);
		sprintf(rrce_name, "RRCE20RC_%.1fA_k%d", dmax, k);
		break;

	case RRCE20SCC:
		sprintf(tname, "%s/RRCE20SCC/table.%.1fA_k%d", DATADIR, dmax, k);
		sprintf(rrce_name, "RRCE20SCC_%.1fA_k%d", dmax, k);
		break;

	case RRCE20CB:
		sprintf(tname, "%s/RRCE20CB/table.%.1fA_k%d", DATADIR, dmax, k);
		sprintf(rrce_name, "RRCE20CB_%.1fA_k%d", dmax, k);
		break;

	default:
		printf("Error: wrong RRCE type (%d)\n", type);
		exit(1);
		break;

	}

	Allocate(20);

	ReadCouplings(tname);

	name = rrce_name;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x830, %rsp            # imm = 0x830
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movsd %xmm0, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x820(%rbp)
movq $0x0, (%rdi)
movq $0x0, 0x8(%rdi)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, 0x10(%rdi)
addq $0x18, %rdi
movq %rdi, -0x818(%rbp)
callq 0x33b0
leaq 0x101a7(%rip), %rdi     # 0x36d1c
callq 0x3340
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x26bbc
leaq 0x1019a(%rip), %rdi     # 0x36d26
xorl %eax, %eax
callq 0x3070
jmp 0x26b95
movl $0x1, %edi
callq 0x3330
movq -0x818(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x3190
jmp 0x26d48
movl $0x3e8, -0x38(%rbp)     # imm = 0x3E8
movl -0xc(%rbp), %eax
movl %eax, -0x824(%rbp)
subl $0x1, %eax
je 0x26bf4
jmp 0x26bd3
movl -0x824(%rbp), %eax
subl $0x2, %eax
je 0x26c45
jmp 0x26be0
movl -0x824(%rbp), %eax
subl $0x3, %eax
je 0x26c93
jmp 0x26ce1
movq -0x820(%rbp), %rax
leaq -0x420(%rbp), %rdi
movq -0x28(%rbp), %rdx
movsd 0x10(%rax), %xmm0
movl -0x1c(%rbp), %ecx
leaq 0x1290b(%rip), %rsi     # 0x39520
movb $0x1, %al
callq 0x30b0
movq -0x820(%rbp), %rax
leaq -0x810(%rbp), %rdi
movsd 0x10(%rax), %xmm0
movl -0x1c(%rbp), %edx
leaq 0x12903(%rip), %rsi     # 0x3953c
movb $0x1, %al
callq 0x30b0
jmp 0x26cfe
movq -0x820(%rbp), %rax
leaq -0x420(%rbp), %rdi
movq -0x28(%rbp), %rdx
movsd 0x10(%rax), %xmm0
movl -0x1c(%rbp), %ecx
leaq 0x128e9(%rip), %rsi     # 0x3954f
movb $0x1, %al
callq 0x30b0
movq -0x820(%rbp), %rax
leaq -0x810(%rbp), %rdi
movsd 0x10(%rax), %xmm0
movl -0x1c(%rbp), %edx
leaq 0x128e2(%rip), %rsi     # 0x3956c
movb $0x1, %al
callq 0x30b0
jmp 0x26cfe
movq -0x820(%rbp), %rax
leaq -0x420(%rbp), %rdi
movq -0x28(%rbp), %rdx
movsd 0x10(%rax), %xmm0
movl -0x1c(%rbp), %ecx
leaq 0x128cc(%rip), %rsi     # 0x39580
movb $0x1, %al
callq 0x30b0
movq -0x820(%rbp), %rax
leaq -0x810(%rbp), %rdi
movsd 0x10(%rax), %xmm0
movl -0x1c(%rbp), %edx
leaq 0x128c4(%rip), %rsi     # 0x3959c
movb $0x1, %al
callq 0x30b0
jmp 0x26cfe
movl -0xc(%rbp), %esi
leaq 0x128c4(%rip), %rdi     # 0x395af
xorl %eax, %eax
callq 0x3070
jmp 0x26cf4
movl $0x1, %edi
callq 0x3330
movq -0x820(%rbp), %rdi
movl $0x14, %esi
callq 0x26d60
jmp 0x26d11
movq -0x820(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x26df0
jmp 0x26d26
movq -0x820(%rbp), %rdi
addq $0x18, %rdi
leaq -0x810(%rbp), %rsi
callq 0x33a0
jmp 0x26d3f
addq $0x830, %rsp            # imm = 0x830
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x3460
nopw %cs:(%rax,%rax)