// File: /workspace/github_c_makefile_star2_O3/jiqingxiaoxi[P]RPA/RPA.c
// Function: getDangle
void getDangle(double dangleEntropies3[],double dangleEnthalpies3[],double dangleEntropies5[],double dangleEnthalpies5[],char *path)
{
        int i, j, k;
        FILE *sFile, *hFile;
        char *line;
        
        i=strlen(path)+20;
        line=(char *)malloc(i);
        memset(line,'\0',i);
        strcpy(line,path);
        strcat(line,"dangle.ds");
        if(access(line,0)==-1)
        {
                printf("Error! Don't have %s file!\n",line);
                exit(1);
        }
        sFile=fopen(line,"r");
        if(sFile==NULL)
        {
                printf("Error! Can't open the %s file!\n",line);
                exit(1);
        }

        memset(line,'\0',i);
        strcpy(line,path);
        strcat(line,"dangle.dh");
        if(access(line,0)==-1)
        {
                printf("Error! Don't have %s file!\n",line);
                exit(1);
        }
        hFile=fopen(line,"r");
        if(hFile==NULL)
        {
                printf("Error! Can't open the %s file!\n",line);
                exit(1);
        }
        free(line);

        line=(char *)malloc(20);
        memset(line,'\0',20);
        for (i = 0; i < 5; ++i)
                for (j = 0; j < 5; ++j)
                        for (k = 0; k < 5; ++k) 
                        {
                                if (i == 4 || j == 4) 
                                {
                                        dangleEntropies3[i*25+k*5+j] = -1.0;
                                        dangleEnthalpies3[i*25+k*5+j] =1.0*INFINITY;
                                }
                                else if (k == 4)
                                {
                                        dangleEntropies3[i*25+k*5+j] = -1.0;
                                        dangleEnthalpies3[i*25+k*5+j] =1.0*INFINITY;
                                } 
                                else
                                {
                                        if(fgets(line,20,sFile)==NULL)
                                        {
                                                printf("Error! When read parameters in getDangle function!\n");
                                                exit(1);
                                        }
                                        if(strncmp(line, "inf", 3)==0)
                                                dangleEntropies3[i*25+k*5+j]=1.0*INFINITY;
                                        else
                                                dangleEntropies3[i*25+k*5+j]=atof(line);

                                        if(fgets(line,20,hFile)==NULL)
                                        {
                                                printf("Error! When read parameters in getDangle function!\n");        
                                                exit(1);        
                                        }
                                        if(strncmp(line, "inf", 3)==0)        
                                                dangleEnthalpies3[i*25+k*5+j]=1.0*INFINITY;           
                                        else        
                                                dangleEnthalpies3[i*25+k*5+j]=atof(line);

                                        if(fabs(dangleEntropies3[i*25+k*5+j])>999999999||fabs(dangleEnthalpies3[i*25+k*5+j])>999999999) 
                                        {
                                                dangleEntropies3[i*25+k*5+j] = -1.0;
                                                dangleEnthalpies3[i*25+k*5+j] =1.0*INFINITY;
                                        }
                                }
                        }

        for (i = 0; i < 5; ++i)
                for (j = 0; j < 5; ++j)
                        for (k = 0; k < 5; ++k) 
                        {
                                if (i == 4 || j == 4)
                                {
                                        dangleEntropies5[i*25+j*5+k] = -1.0;
                                        dangleEnthalpies5[i*25+j*5+k] =1.0*INFINITY;
                                } 
                                else if (k == 4) 
                                {
                                        dangleEntropies5[i*25+j*5+k] = -1.0;
                                        dangleEnthalpies5[i*25+j*5+k] =1.0*INFINITY;
                                }
                                else
                                {
                                        if(fgets(line,20,sFile)==NULL)
                                        {
                                                printf("Error! When read parameters in getDangle function!\n");
                                                exit(1);
                                        }
                                        if(strncmp(line, "inf", 3)==0)
                                                dangleEntropies5[i*25+j*5+k]=1.0*INFINITY;
                                        else
                                                dangleEntropies5[i*25+j*5+k]=atof(line);

                                        if(fgets(line,20,hFile)==NULL)
                                        {
                                                printf("Error! When read parameters in getDangle function!\n");        
                                                exit(1);        
                                        }
                                        if(strncmp(line, "inf", 3)==0)        
                                                dangleEnthalpies5[i*25+j*5+k]=1.0*INFINITY;           
                                        else        
                                                dangleEnthalpies5[i*25+j*5+k]=atof(line);

                                        if(fabs(dangleEntropies5[i*25+j*5+k])>999999999||fabs(dangleEnthalpies5[i*25+j*5+k])>999999999)
                                        {
                                                dangleEntropies5[i*25+j*5+k] = -1.0;
                                                dangleEnthalpies5[i*25+j*5+k] =1.0*INFINITY;
                                        }
                                }
                        }
        fclose(sFile);
        fclose(hFile);
        free(line);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r8, %r12
movq %rcx, -0x90(%rbp)
movq %rdx, -0x88(%rbp)
movq %rsi, -0x40(%rbp)
movq %rdi, -0x30(%rbp)
movq %r8, %rdi
callq 0x10b0
addl $0x14, %eax
movslq %eax, %r13
movl $0x1, %edi
movq %r13, %rsi
callq 0x1140
movq %rax, %rbx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1050
movq %rbx, %rdi
callq 0x10b0
movabsq $0x642e656c676e6164, %r14 # imm = 0x642E656C676E6164
movq %r14, (%rbx,%rax)
movw $0x73, 0x8(%rbx,%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11c0
cmpl $-0x1, %eax
je 0x2276
leaq 0xc4ec(%rip), %rsi      # 0xe21b
movq %rbx, %rdi
callq 0x11d0
movq %rax, -0xa0(%rbp)
testq %rax, %rax
je 0x227f
movq %rbx, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x1100
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1050
movq %rbx, %rdi
callq 0x10b0
movq %r14, (%rbx,%rax)
movw $0x68, 0x8(%rbx,%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11c0
cmpl $-0x1, %eax
je 0x2276
leaq 0xc48f(%rip), %rsi      # 0xe21b
movq %rbx, %rdi
callq 0x11d0
movq %rax, -0x98(%rbp)
testq %rax, %rax
je 0x227f
movq %rbx, %rdi
callq 0x1030
movl $0x1, %edi
movl $0x14, %esi
callq 0x1140
movq %rax, -0xa8(%rbp)
xorl %ecx, %ecx
movq -0x40(%rbp), %rdx
movq -0x30(%rbp), %rsi
xorl %edi, %edi
movq -0xa8(%rbp), %r14
leaq (%rdi,%rdi,4), %rax
leaq (%rax,%rax,4), %r8
movq %r8, -0x70(%rbp)
leaq (%rax,%rax,4), %rax
addq $0x14, %rax
movq %rax, -0x68(%rbp)
movq %rdx, -0xb8(%rbp)
movq %rdx, -0x38(%rbp)
movq %rsi, -0xb0(%rbp)
movq %rcx, -0xc0(%rbp)
movq %rcx, -0x50(%rbp)
xorl %ecx, %ecx
movq %rdi, -0x60(%rbp)
cmpq $0x4, %rdi
sete %al
cmpq $0x4, %rcx
sete %r13b
orb %al, %r13b
movq -0x70(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x68(%rbp), %rax
movq %rcx, -0x80(%rbp)
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq %rsi, %r12
xorl %ebx, %ebx
xorl %r15d, %r15d
movb %r13b, -0x48(%rbp)
testb %r13b, %r13b
je 0x1e81
leaq (%r15,%r15,4), %rax
addq -0x58(%rbp), %rax
movq -0x30(%rbp), %rcx
leaq (%rcx,%rax,8), %rcx
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
movq %rdx, (%rcx)
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
movq -0x40(%rbp), %rdx
movq %rcx, (%rdx,%rax,8)
jmp 0x1f68
cmpq $0x14, %rbx
je 0x1f8b
movq %rsi, %r13
movq %r14, %rdi
movl $0x14, %esi
movq -0xa0(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x2260
movl $0x3, %edx
movq %r14, %rdi
leaq 0xc24e(%rip), %rsi      # 0xe108
callq 0x1040
movsd 0xc151(%rip), %xmm0     # 0xe018
testl %eax, %eax
je 0x1ed3
movq %r14, %rdi
callq 0x1090
movsd %xmm0, (%r13,%rbx,8)
movq %r14, %rdi
movl $0x14, %esi
movq -0x98(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x2260
movl $0x3, %edx
movq %r14, %rdi
leaq 0xc202(%rip), %rsi      # 0xe108
callq 0x1040
movsd 0xc105(%rip), %xmm0     # 0xe018
testl %eax, %eax
je 0x1f1f
movq %r14, %rdi
callq 0x1090
movq -0x50(%rbp), %rax
addq %rbx, %rax
movq -0x38(%rbp), %rcx
movsd %xmm0, (%rcx,%rbx,8)
movq %r13, %rsi
movsd (%r13,%rbx,8), %xmm1
movapd 0xc17f(%rip), %xmm2     # 0xe0c0
andpd %xmm2, %xmm1
movsd 0xc0d3(%rip), %xmm3     # 0xe020
ucomisd %xmm3, %xmm1
ja 0x1f7f
andpd %xmm2, %xmm0
ucomisd %xmm3, %xmm0
movq %r12, %rcx
movb -0x48(%rbp), %r13b
ja 0x1e5d
incq %r15
addq $0x5, %rbx
addq $0x28, %r12
cmpq $0x19, %rbx
jne 0x1e48
jmp 0x1fb3
movq %r12, %rcx
movb -0x48(%rbp), %r13b
jmp 0x1e5d
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq -0x30(%rbp), %rcx
movq -0x78(%rbp), %rdx
movq %rax, (%rcx,%rdx,8)
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
movq -0x40(%rbp), %rcx
movq %rax, (%rcx,%rdx,8)
movq -0x80(%rbp), %rcx
incq %rcx
incq -0x50(%rbp)
addq $0x8, %rsi
addq $0x8, -0x38(%rbp)
cmpq $0x5, %rcx
movq -0x60(%rbp), %rdi
jne 0x1e10
incq %rdi
movq -0xc0(%rbp), %rcx
addq $0x19, %rcx
movl $0xc8, %eax
movq -0xb0(%rbp), %rsi
addq %rax, %rsi
movq -0xb8(%rbp), %rdx
addq %rax, %rdx
cmpq $0x5, %rdi
jne 0x1dd5
xorl %ecx, %ecx
movq -0x90(%rbp), %rdx
movq -0x88(%rbp), %r14
xorl %esi, %esi
movq -0xa8(%rbp), %r13
leaq (%rsi,%rsi,4), %rax
leaq (%rax,%rax,4), %rdi
movq %rdi, -0x30(%rbp)
leaq (%rax,%rax,4), %rax
addq $0x4, %rax
movq %rax, -0x80(%rbp)
movq %rdx, -0x68(%rbp)
movq %rdx, -0x58(%rbp)
movq %r14, -0x60(%rbp)
movq %rcx, -0x70(%rbp)
movq %rcx, -0x38(%rbp)
xorl %ecx, %ecx
movq %rsi, -0x78(%rbp)
cmpq $0x4, %rsi
sete %al
cmpq $0x4, %rcx
sete %bl
orb %al, %bl
movq %rcx, -0x50(%rbp)
leaq (%rcx,%rcx,4), %rcx
movq -0x80(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x48(%rbp)
addq -0x30(%rbp), %rcx
movq %rcx, -0x40(%rbp)
movq %r14, %r12
xorl %r15d, %r15d
testb %bl, %bl
je 0x20bf
movq -0x40(%rbp), %rax
addq %r15, %rax
movq -0x88(%rbp), %rcx
leaq (%rcx,%rax,8), %rcx
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
movq %rdx, (%rcx)
movq -0x90(%rbp), %rcx
movabsq $0x7ff0000000000000, %rdx # imm = 0x7FF0000000000000
movq %rdx, (%rcx,%rax,8)
jmp 0x219b
cmpq $0x4, %r15
je 0x21b6
movq %r13, %rdi
movl $0x14, %esi
movq -0xa0(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x2260
movl $0x3, %edx
movq %r13, %rdi
leaq 0xc013(%rip), %rsi      # 0xe108
callq 0x1040
movsd 0xbf16(%rip), %xmm0     # 0xe018
testl %eax, %eax
je 0x210e
movq %r13, %rdi
callq 0x1090
movsd %xmm0, (%r14,%r15,8)
movq %r13, %rdi
movl $0x14, %esi
movq -0x98(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x2260
movl $0x3, %edx
movq %r13, %rdi
leaq 0xbfc8(%rip), %rsi      # 0xe108
callq 0x1040
movsd 0xbecb(%rip), %xmm0     # 0xe018
testl %eax, %eax
je 0x2159
movq %r13, %rdi
callq 0x1090
movq -0x38(%rbp), %rax
addq %r15, %rax
movq -0x58(%rbp), %rcx
movsd %xmm0, (%rcx,%r15,8)
movsd (%r14,%r15,8), %xmm1
movapd 0xbf48(%rip), %xmm2     # 0xe0c0
andpd %xmm2, %xmm1
movsd 0xbe9c(%rip), %xmm3     # 0xe020
ucomisd %xmm3, %xmm1
ja 0x21ae
andpd %xmm2, %xmm0
ucomisd %xmm3, %xmm0
movq %r12, %rcx
ja 0x2098
incq %r15
addq $0x8, %r12
cmpq $0x5, %r15
jne 0x2082
jmp 0x21e4
movq %r12, %rcx
jmp 0x2098
movq -0x88(%rbp), %rax
movabsq $-0x4010000000000000, %rcx # imm = 0xBFF0000000000000
movq -0x48(%rbp), %rdx
movq %rcx, (%rax,%rdx,8)
movq -0x90(%rbp), %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
movq %rcx, (%rax,%rdx,8)
movq -0x50(%rbp), %rcx
incq %rcx
addq $0x5, -0x38(%rbp)
addq $0x28, %r14
addq $0x28, -0x58(%rbp)
cmpq $0x5, %rcx
movq -0x78(%rbp), %rsi
jne 0x2051
incq %rsi
movq -0x70(%rbp), %rcx
addq $0x19, %rcx
movl $0xc8, %eax
movq -0x60(%rbp), %r14
addq %rax, %r14
movq -0x68(%rbp), %rdx
addq %rax, %rdx
cmpq $0x5, %rsi
jne 0x201f
movq -0xa0(%rbp), %rdi
callq 0x10a0
movq -0x98(%rbp), %rdi
callq 0x10a0
movq %r13, %rdi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
leaq 0xc3b9(%rip), %rdi      # 0xe620
callq 0x1070
movl $0x1, %edi
callq 0x1200
leaq 0xbe9c(%rip), %rdi      # 0xe119
jmp 0x2286
leaq 0xbeaf(%rip), %rdi      # 0xe135
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
jmp 0x226c