// File: /workspace/github_c_makefile_star2_O2/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 $0x88, %rsp
movq %r8, %r15
movq %rcx, -0x90(%rbp)
movq %rdx, -0xa0(%rbp)
movq %rsi, -0x48(%rbp)
movq %rdi, -0x50(%rbp)
movq %r8, %rdi
callq 0x10b0
addl $0x14, %eax
movslq %eax, %r12
pushq $0x1
popq %rdi
movq %r12, %rsi
callq 0x1140
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %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 0x11b0
cmpl $-0x1, %eax
je 0x21e5
leaq 0xb532(%rip), %rsi      # 0xd23b
movq %rbx, %rdi
callq 0x11c0
movq %rax, -0x88(%rbp)
testq %rax, %rax
je 0x21ee
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x1100
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1050
movq %rbx, %rdi
callq 0x10b0
movq %r14, (%rbx,%rax)
movw $0x68, 0x8(%rbx,%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11b0
cmpl $-0x1, %eax
je 0x21e5
leaq 0xb4d5(%rip), %rsi      # 0xd23b
movq %rbx, %rdi
callq 0x11c0
movq %rax, -0x80(%rbp)
testq %rax, %rax
je 0x21ee
movq %rbx, %rdi
callq 0x1030
pushq $0x1
popq %rdi
pushq $0x14
popq %rsi
callq 0x1140
movq %rax, %r9
xorl %eax, %eax
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
movabsq $0x7ff0000000000000, %rsi # imm = 0x7FF0000000000000
movq -0x50(%rbp), %rbx
movq -0x48(%rbp), %rcx
movq %rcx, -0x98(%rbp)
movq %r9, -0xa8(%rbp)
movq -0xa8(%rbp), %r12
cmpq $0x5, %rax
je 0x1fac
imulq $0x19, %rax, %r8
movq %r8, -0x60(%rbp)
leaq 0x14(%r8), %rdi
movq %rdi, -0x40(%rbp)
movq %rbx, -0xb0(%rbp)
movq -0x98(%rbp), %rdi
movq %rdi, -0x38(%rbp)
xorl %edi, %edi
movq %rax, -0x58(%rbp)
cmpq $0x5, %rdi
je 0x1f8e
cmpq $0x4, %rax
sete %al
cmpq $0x4, %rdi
sete %r8b
orb %al, %r8b
movq -0x60(%rbp), %rax
leaq (%rdi,%rax), %r13
movq -0x40(%rbp), %rax
movq %rdi, -0x68(%rbp)
addq %rdi, %rax
movq %rax, -0x78(%rbp)
leaq (%rcx,%rax,8), %rax
movq %rax, -0x70(%rbp)
xorl %r14d, %r14d
xorl %r15d, %r15d
movb %r8b, -0x29(%rbp)
cmpq $0xc8, %r14
je 0x1f6e
testb %r8b, %r8b
je 0x1e61
leaq (%r15,%r15,4), %rax
addq %r13, %rax
movq %rdx, (%rbx,%r14)
leaq (%rcx,%rax,8), %rax
jmp 0x1f5f
cmpq $0xa0, %r14
jne 0x1e7f
movq -0x50(%rbp), %rax
movq -0x78(%rbp), %rdi
movq %rdx, (%rax,%rdi,8)
movq -0x70(%rbp), %rax
jmp 0x1f5f
movq %r12, %rdi
pushq $0x14
popq %rsi
movq -0x88(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x21d1
movq %r12, %rdi
leaq 0xb284(%rip), %rsi      # 0xd128
pushq $0x3
popq %rdx
callq 0x1040
movsd 0xb174(%rip), %xmm0     # 0xd028
testl %eax, %eax
je 0x1ec0
movq %r12, %rdi
callq 0x1090
movsd %xmm0, (%rbx,%r14)
movq %r12, %rdi
pushq $0x14
popq %rsi
movq -0x80(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x21d1
movq %r12, %rdi
leaq 0xb240(%rip), %rsi      # 0xd128
pushq $0x3
popq %rdx
callq 0x1040
movsd 0xb130(%rip), %xmm0     # 0xd028
testl %eax, %eax
je 0x1f04
movq %r12, %rdi
callq 0x1090
movq -0x38(%rbp), %rax
movsd %xmm0, (%rax,%r14)
movsd (%rbx,%r14), %xmm1
andpd 0xb1c4(%rip), %xmm1     # 0xd0e0
ucomisd 0xb10c(%rip), %xmm1     # 0xd030
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
movabsq $0x7ff0000000000000, %rsi # imm = 0x7FF0000000000000
movq -0x48(%rbp), %rcx
movb -0x29(%rbp), %r8b
ja 0x1f54
andpd 0xb196(%rip), %xmm0     # 0xd0e0
ucomisd 0xb0de(%rip), %xmm0     # 0xd030
jbe 0x1f62
movq %rdx, (%rbx,%r14)
movq -0x38(%rbp), %rax
addq %r14, %rax
movq %rsi, (%rax)
incq %r15
addq $0x28, %r14
jmp 0x1e3b
movq -0x68(%rbp), %rdi
incq %rdi
addq $0x8, -0x38(%rbp)
addq $0x8, %rbx
movq -0x58(%rbp), %rax
movq -0xa8(%rbp), %r9
jmp 0x1df6
incq %rax
movl $0xc8, %edi
addq %rdi, -0x98(%rbp)
movq -0xb0(%rbp), %rbx
addq %rdi, %rbx
jmp 0x1dc4
xorl %eax, %eax
movq -0xa0(%rbp), %rbx
movq -0x90(%rbp), %rcx
movq %rcx, -0x40(%rbp)
cmpq $0x5, %rax
je 0x21a0
imulq $0x19, %rax, %rcx
movq %rcx, -0x48(%rbp)
addq $0x4, %rcx
movq %rcx, -0x68(%rbp)
movq %rbx, -0x58(%rbp)
movq -0x40(%rbp), %rcx
movq %rcx, -0x38(%rbp)
xorl %ecx, %ecx
movq %rax, -0x60(%rbp)
cmpq $0x5, %rcx
je 0x2188
cmpq $0x4, %rax
sete %al
cmpq $0x4, %rcx
sete %r8b
orb %al, %r8b
movq %rcx, -0x50(%rbp)
leaq (%rcx,%rcx,4), %r13
movq -0x68(%rbp), %rax
leaq (%rax,%r13), %rcx
addq -0x48(%rbp), %r13
movq -0x90(%rbp), %rax
movq %rcx, -0x78(%rbp)
leaq (%rax,%rcx,8), %rax
movq %rax, -0x70(%rbp)
xorl %r12d, %r12d
xorl %r15d, %r15d
movb %r8b, -0x29(%rbp)
cmpq $0x28, %r12
je 0x216f
testb %r8b, %r8b
je 0x2060
leaq (%r15,%r13), %rax
movq %rdx, (%rbx,%r12)
movq -0x90(%rbp), %rcx
leaq (%rcx,%rax,8), %rax
jmp 0x2160
cmpq $0x20, %r12
jne 0x207e
movq -0xa0(%rbp), %rax
movq -0x78(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x70(%rbp), %rax
jmp 0x2160
movq %r9, %rdi
pushq $0x14
popq %rsi
movq -0x88(%rbp), %rdx
movq %r9, %r14
callq 0x1130
testq %rax, %rax
je 0x21d1
movq %r14, %rdi
leaq 0xb082(%rip), %rsi      # 0xd128
pushq $0x3
popq %rdx
callq 0x1040
movsd 0xaf72(%rip), %xmm0     # 0xd028
testl %eax, %eax
je 0x20c2
movq %r14, %rdi
callq 0x1090
movsd %xmm0, (%rbx,%r12)
movq %r14, %rdi
pushq $0x14
popq %rsi
movq -0x80(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x21d1
movq %r14, %rdi
leaq 0xb03e(%rip), %rsi      # 0xd128
pushq $0x3
popq %rdx
callq 0x1040
movsd 0xaf2e(%rip), %xmm0     # 0xd028
testl %eax, %eax
je 0x2106
movq %r14, %rdi
callq 0x1090
movq -0x38(%rbp), %rax
movsd %xmm0, (%rax,%r12)
movsd (%rbx,%r12), %xmm1
andpd 0xafc2(%rip), %xmm1     # 0xd0e0
ucomisd 0xaf0a(%rip), %xmm1     # 0xd030
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
movabsq $0x7ff0000000000000, %rsi # imm = 0x7FF0000000000000
movq %r14, %r9
movb -0x29(%rbp), %r8b
ja 0x2155
andpd 0xaf95(%rip), %xmm0     # 0xd0e0
ucomisd 0xaedd(%rip), %xmm0     # 0xd030
jbe 0x2163
movq %rdx, (%rbx,%r12)
movq -0x38(%rbp), %rax
addq %r12, %rax
movq %rsi, (%rax)
incq %r15
addq $0x8, %r12
jmp 0x2039
movq -0x50(%rbp), %rcx
incq %rcx
addq $0x28, -0x38(%rbp)
addq $0x28, %rbx
movq -0x60(%rbp), %rax
jmp 0x1fec
incq %rax
movl $0xc8, %ecx
addq %rcx, -0x40(%rbp)
movq -0x58(%rbp), %rbx
addq %rcx, %rbx
jmp 0x1fc0
movq -0x88(%rbp), %rdi
movq %r9, %rbx
callq 0x10a0
movq -0x80(%rbp), %rdi
callq 0x10a0
movq %rbx, %rdi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
leaq 0xb468(%rip), %rdi      # 0xd640
callq 0x1070
pushq $0x1
popq %rdi
callq 0x11f0
leaq 0xaf4d(%rip), %rdi      # 0xd139
jmp 0x21f5
leaq 0xaf60(%rip), %rdi      # 0xd155
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
jmp 0x21dd