// File: /workspace/github_c_makefile_star2_O3/jiqingxiaoxi[P]RPA/RPA.c
// Function: getTstack
void getTstack(double tstackEntropies[],double tstackEnthalpies[],char *path)
{
        int i1, j1, i2, j2;
        FILE *sFile, *hFile;
        char *line;

        i1=strlen(path)+20;
        line=(char *)malloc(i1);
        memset(line,'\0',i1);
        strcpy(line,path);
        strcat(line,"tstack_tm_inf.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',i1);
        strcpy(line,path);      
        strcat(line,"tstack.dh");
        if(access(line,0)==-1)
        {
                printf("Error! Don't have %s file!\n",line);
                exit(1);
        }             
        hFile=fopen(line,"r");
        if(sFile==NULL)
        {
                printf("Error! Can't open the %s file!\n",line);
                exit(1);   
        }
        free(line);

        line=(char *)malloc(20);
        memset(line,'\0',20);
        for (i1 = 0; i1 < 5; ++i1)
                for (i2 = 0; i2 < 5; ++i2)
                        for (j1 = 0; j1 < 5; ++j1)
                                for (j2 = 0; j2 < 5; ++j2)
                                        if (i1 == 4 || j1 == 4)
                                        {
                                                tstackEnthalpies[i1*125+i2*25+j1*5+j2]=1.0*INFINITY;
                                                tstackEntropies[i1*125+i2*25+j1*5+j2] = -1.0;
                                        }
                                        else if (i2 == 4 || j2 == 4)
                                        {
                                                tstackEntropies[i1*125+i2*25+j1*5+j2] = 0.00000000001;
                                                tstackEnthalpies[i1*125+i2*25+j1*5+j2] = 0.0;
                                        }
                                        else
                                        {
                                                if(fgets(line,20,sFile)==NULL)
                                                {
                                                        printf("Error! When read parameters in getTstack function!\n");
                                                        exit(1);
                                                }
                                                if(strncmp(line, "inf", 3)==0)
                                                        tstackEntropies[i1*125+i2*25+j1*5+j2]=1.0*INFINITY;
                                                else
                                                        tstackEntropies[i1*125+i2*25+j1*5+j2]=atof(line);

                                                if(fgets(line,20,hFile)==NULL)
                                                {
                                                        printf("Error! When read parameters in getTstack function!\n");
                                                        exit(1);
                                                }
                                                if(strncmp(line, "inf", 3)==0)
                                                        tstackEnthalpies[i1*125+i2*25+j1*5+j2]=1.0*INFINITY;
                                                else
                                                        tstackEnthalpies[i1*125+i2*25+j1*5+j2]=atof(line);

                                                if (fabs(tstackEntropies[i1*125+i2*25+j1*5+j2])>999999999||fabs(tstackEnthalpies[i1*125+i2*25+j1*5+j2])>999999999)
                                                {
                                                        tstackEntropies[i1*125+i2*25+j1*5+j2] = -1.0;
                                                        tstackEnthalpies[i1*125+i2*25+j1*5+j2] =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 $0x58, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %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
movupd 0xbd02(%rip), %xmm0     # 0xe191
movupd %xmm0, (%rbx,%rax)
movb $0x0, 0x10(%rbx,%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11c0
cmpl $-0x1, %eax
je 0x275b
leaq 0xbd68(%rip), %rsi      # 0xe21b
movq %rbx, %rdi
callq 0x11d0
movq %rax, -0x48(%rbp)
testq %rax, %rax
je 0x2764
movq %rbx, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x1100
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1050
movq %rbx, %rdi
callq 0x10b0
movabsq $0x642e6b6361747374, %rcx # imm = 0x642E6B6361747374
movq %rcx, (%rbx,%rax)
movw $0x68, 0x8(%rbx,%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11c0
cmpl $-0x1, %eax
je 0x275b
leaq 0xbd04(%rip), %rsi      # 0xe21b
movq %rbx, %rdi
callq 0x11d0
movq %rax, -0x40(%rbp)
movq %rbx, %rdi
callq 0x1030
movl $0x1, %edi
movl $0x14, %esi
callq 0x1140
movq %rax, %rsi
movq $0x0, -0x38(%rbp)
movabsq $0x7ff0000000000000, %r13 # imm = 0x7FF0000000000000
movabsq $-0x4010000000000000, %rdi # imm = 0xBFF0000000000000
movq %r15, -0x50(%rbp)
movq %r15, %rbx
movq %r14, -0x58(%rbp)
xorl %r8d, %r8d
movq %rbx, -0x68(%rbp)
movq %r14, -0x60(%rbp)
xorl %ecx, %ecx
movq %r8, -0x78(%rbp)
cmpq $0x4, -0x38(%rbp)
sete %al
movq %rcx, -0x70(%rbp)
cmpq $0x4, %rcx
sete %r11b
orb %al, %r11b
xorl %r12d, %r12d
movb %r11b, -0x29(%rbp)
testb %r11b, %r11b
je 0x25a5
movq %r13, (%r14,%r12,8)
movq %rdi, (%rbx,%r12,8)
jmp 0x26ac
cmpq $0x4, %r8
setne %al
cmpq $0x4, %r12
setne %cl
testb %cl, %al
jne 0x25d2
movabsq $0x3da5fd7fe1796495, %rax # imm = 0x3DA5FD7FE1796495
movq %rax, (%rbx,%r12,8)
movq $0x0, (%r14,%r12,8)
jmp 0x26ac
movq %rsi, %r15
movq %rsi, %rdi
movl $0x14, %esi
movq -0x48(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x2745
movl $0x3, %edx
movq %r15, %rdi
leaq 0xbb0a(%rip), %rsi      # 0xe108
callq 0x1040
movsd 0xba0d(%rip), %xmm0     # 0xe018
testl %eax, %eax
je 0x2617
movq %r15, %rdi
callq 0x1090
movsd %xmm0, (%rbx,%r12,8)
movq %r15, %rdi
movl $0x14, %esi
movq -0x40(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x2745
movl $0x3, %edx
movq %r15, %rdi
leaq 0xbac2(%rip), %rsi      # 0xe108
callq 0x1040
movsd 0xb9c5(%rip), %xmm0     # 0xe018
testl %eax, %eax
je 0x265f
movq %r15, %rdi
callq 0x1090
movsd %xmm0, (%r14,%r12,8)
movsd (%rbx,%r12,8), %xmm1
andpd 0xba4d(%rip), %xmm1     # 0xe0c0
ucomisd 0xb9a5(%rip), %xmm1     # 0xe020
movq %r15, %rsi
movabsq $-0x4010000000000000, %rdi # imm = 0xBFF0000000000000
movq -0x78(%rbp), %r8
movb -0x29(%rbp), %r11b
ja 0x26a4
andpd 0xba26(%rip), %xmm0     # 0xe0c0
ucomisd 0xb97e(%rip), %xmm0     # 0xe020
jbe 0x26ac
movq %rdi, (%rbx,%r12,8)
movq %r13, (%r14,%r12,8)
incq %r12
cmpq $0x5, %r12
jne 0x2593
movq -0x70(%rbp), %rcx
incq %rcx
addq $0x28, %r14
addq $0x28, %rbx
cmpq $0x5, %rcx
jne 0x2575
incq %r8
movl $0xc8, %eax
movq -0x60(%rbp), %r14
addq %rax, %r14
movq -0x68(%rbp), %rbx
addq %rax, %rbx
cmpq $0x5, %r8
jne 0x2567
movq -0x38(%rbp), %rcx
incq %rcx
movq -0x58(%rbp), %r14
movl $0x3e8, %eax            # imm = 0x3E8
addq %rax, %r14
movq -0x50(%rbp), %r15
addq %rax, %r15
movq %rcx, -0x38(%rbp)
cmpq $0x5, %rcx
jne 0x2559
movq %rsi, %rbx
movq -0x48(%rbp), %rdi
callq 0x10a0
movq -0x40(%rbp), %rdi
callq 0x10a0
movq %rbx, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
leaq 0xbf07(%rip), %rdi      # 0xe653
callq 0x1070
movl $0x1, %edi
callq 0x1200
leaq 0xb9b7(%rip), %rdi      # 0xe119
jmp 0x276b
leaq 0xb9ca(%rip), %rdi      # 0xe135
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
jmp 0x2751