// File: /workspace/github_c_makefile_star2_O1/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, %r12
movq %rcx, -0x68(%rbp)
movq %rdx, -0x98(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdi, -0x40(%rbp)
movq %r8, %rdi
callq 0x10b0
addl $0x14, %eax
movslq %eax, %r13
movq %r13, %rdi
callq 0x1190
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x1100
movq %rbx, %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 0x11b0
cmpl $-0x1, %eax
je 0x229d
leaq 0xc462(%rip), %rsi      # 0xe20e
movq %rbx, %rdi
callq 0x11c0
movq %rax, -0x90(%rbp)
testq %rax, %rax
je 0x22a6
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 0x11b0
cmpl $-0x1, %eax
je 0x229d
leaq 0xc405(%rip), %rsi      # 0xe20e
movq %rbx, %rdi
callq 0x11c0
movq %rax, -0x88(%rbp)
testq %rax, %rax
je 0x22a6
movq %rbx, %rdi
callq 0x1030
movl $0x14, %edi
callq 0x1190
movq %rax, %r9
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movl $0x0, 0x10(%rax)
xorl %ecx, %ecx
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
movabsq $0x7ff0000000000000, %rsi # imm = 0x7FF0000000000000
movq -0x40(%rbp), %r14
movq -0x38(%rbp), %rdi
leaq (%rcx,%rcx,4), %rax
leaq (%rax,%rax,4), %r8
movq %r8, -0x58(%rbp)
leaq (%rax,%rax,4), %rax
addq $0x14, %rax
movq %rax, -0x50(%rbp)
movq %r14, -0xa8(%rbp)
movq %rdi, -0xa0(%rbp)
xorl %r8d, %r8d
movq %rcx, -0x48(%rbp)
cmpq $0x4, %rcx
sete %al
cmpq $0x4, %r8
sete %r12b
orb %al, %r12b
movq -0x58(%rbp), %rax
addq %r8, %rax
movq %rax, -0x70(%rbp)
movq -0x50(%rbp), %rax
movq %r8, -0x60(%rbp)
leaq (%rax,%r8), %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0x80(%rbp)
leaq (%rax,%rcx,8), %rax
movq %rax, -0x78(%rbp)
xorl %r15d, %r15d
xorl %ebx, %ebx
movb %r12b, -0x29(%rbp)
testb %r12b, %r12b
je 0x1ee4
movq %rdx, (%r14,%r15)
leaq (%rdi,%r15), %rax
jmp 0x2000
cmpq $0xa0, %r15
jne 0x1f02
movq -0x40(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x78(%rbp), %rax
jmp 0x2000
movq %r9, %r13
movq %rdi, %r12
movq %r9, %rdi
movl $0x14, %esi
movq -0x90(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x2287
movl $0x3, %edx
movq %r13, %rdi
leaq 0xc1c4(%rip), %rsi      # 0xe0f8
callq 0x1040
movsd 0xc0e7(%rip), %xmm0     # 0xe028
testl %eax, %eax
je 0x1f4d
movq %r13, %rdi
callq 0x1090
movsd %xmm0, (%r14,%r15)
movq %r13, %rdi
movl $0x14, %esi
movq -0x88(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x2287
movl $0x3, %edx
movq %r13, %rdi
leaq 0xc179(%rip), %rsi      # 0xe0f8
callq 0x1040
movsd 0xc09c(%rip), %xmm0     # 0xe028
testl %eax, %eax
je 0x1f98
movq %r13, %rdi
callq 0x1090
movq %r12, %rdi
movsd %xmm0, (%r12,%r15)
movsd (%r14,%r15), %xmm0
andpd 0xc101(%rip), %xmm0     # 0xe0b0
ucomisd 0xc079(%rip), %xmm0     # 0xe030
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
movabsq $0x7ff0000000000000, %rsi # imm = 0x7FF0000000000000
movq %r13, %r9
movb -0x29(%rbp), %r12b
ja 0x1fec
movsd (%rdi,%r15), %xmm0
andpd 0xc0ce(%rip), %xmm0     # 0xe0b0
ucomisd 0xc046(%rip), %xmm0     # 0xe030
jbe 0x2003
leaq (%rbx,%rbx,4), %rax
addq -0x70(%rbp), %rax
movq %rdx, (%r14,%r15)
movq -0x38(%rbp), %rcx
leaq (%rcx,%rax,8), %rax
movq %rsi, (%rax)
incq %rbx
addq $0x28, %r15
cmpq $0xc8, %r15
jne 0x1ed2
movq -0x60(%rbp), %r8
incq %r8
addq $0x8, %rdi
addq $0x8, %r14
cmpq $0x5, %r8
movq -0x48(%rbp), %rcx
jne 0x1e90
incq %rcx
movl $0xc8, %eax
movq -0xa0(%rbp), %rdi
addq %rax, %rdi
movq -0xa8(%rbp), %r14
addq %rax, %r14
cmpq $0x5, %rcx
jne 0x1e63
xorl %ecx, %ecx
movq -0x98(%rbp), %r13
movq -0x68(%rbp), %rdi
leaq (%rcx,%rcx,4), %rax
leaq (%rax,%rax,4), %r8
movq %r8, -0x70(%rbp)
leaq (%rax,%rax,4), %rax
addq $0x4, %rax
movq %rax, -0x60(%rbp)
movq %r13, -0x50(%rbp)
movq %rdi, -0x48(%rbp)
xorl %r8d, %r8d
movq %rcx, -0x58(%rbp)
cmpq $0x4, %rcx
sete %al
cmpq $0x4, %r8
sete %r12b
orb %al, %r12b
movq %r8, -0x38(%rbp)
leaq (%r8,%r8,4), %rcx
movq -0x60(%rbp), %rax
leaq (%rax,%rcx), %r8
addq -0x70(%rbp), %rcx
movq %rcx, -0x40(%rbp)
movq -0x68(%rbp), %rax
movq %r8, -0x80(%rbp)
leaq (%rax,%r8,8), %rax
movq %rax, -0x78(%rbp)
xorl %r15d, %r15d
xorl %ebx, %ebx
movb %r12b, -0x29(%rbp)
testb %r12b, %r12b
je 0x20e4
movq %rdx, (%r13,%r15)
leaq (%rdi,%r15), %rax
jmp 0x2202
cmpq $0x20, %r15
jne 0x2102
movq -0x98(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x78(%rbp), %rax
jmp 0x2202
movq %rdi, %r12
movq %r9, %rdi
movl $0x14, %esi
movq -0x90(%rbp), %rdx
movq %r9, %r14
callq 0x1130
testq %rax, %rax
je 0x2287
movl $0x3, %edx
movq %r14, %rdi
leaq 0xbfc4(%rip), %rsi      # 0xe0f8
callq 0x1040
movsd 0xbee7(%rip), %xmm0     # 0xe028
testl %eax, %eax
je 0x214d
movq %r14, %rdi
callq 0x1090
movsd %xmm0, (%r13,%r15)
movq %r14, %rdi
movl $0x14, %esi
movq -0x88(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x2287
movl $0x3, %edx
movq %r14, %rdi
leaq 0xbf78(%rip), %rsi      # 0xe0f8
callq 0x1040
movsd 0xbe9b(%rip), %xmm0     # 0xe028
testl %eax, %eax
je 0x2199
movq %r14, %rdi
callq 0x1090
movq %r12, %rdi
movsd %xmm0, (%r12,%r15)
movsd (%r13,%r15), %xmm0
andpd 0xbeff(%rip), %xmm0     # 0xe0b0
ucomisd 0xbe77(%rip), %xmm0     # 0xe030
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
movabsq $0x7ff0000000000000, %rsi # imm = 0x7FF0000000000000
movq %r14, %r9
movb -0x29(%rbp), %r12b
ja 0x21ee
movsd (%rdi,%r15), %xmm0
andpd 0xbecc(%rip), %xmm0     # 0xe0b0
ucomisd 0xbe44(%rip), %xmm0     # 0xe030
jbe 0x2205
movq -0x40(%rbp), %rax
addq %rbx, %rax
movq %rdx, (%r13,%r15)
movq -0x68(%rbp), %rcx
leaq (%rcx,%rax,8), %rax
movq %rsi, (%rax)
incq %rbx
addq $0x8, %r15
cmpq $0x28, %r15
jne 0x20d1
movq -0x38(%rbp), %r8
incq %r8
addq $0x28, %rdi
addq $0x28, %r13
cmpq $0x5, %r8
movq -0x58(%rbp), %rcx
jne 0x208e
incq %rcx
movl $0xc8, %eax
movq -0x48(%rbp), %rdi
addq %rax, %rdi
movq -0x50(%rbp), %r13
addq %rax, %r13
cmpq $0x5, %rcx
jne 0x2067
movq -0x90(%rbp), %rdi
movq %r9, %rbx
callq 0x10a0
movq -0x88(%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 0xc385(%rip), %rdi      # 0xe613
callq 0x1070
movl $0x1, %edi
callq 0x11f0
leaq 0xbe65(%rip), %rdi      # 0xe109
jmp 0x22ad
leaq 0xbe78(%rip), %rdi      # 0xe125
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
jmp 0x2293