// File: /workspace/github_c_makefile_star2_O2/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, %r14
movq %rsi, -0x40(%rbp)
movq %rdi, -0x38(%rbp)
movq %rdx, %rdi
callq 0x10b0
addl $0x14, %eax
movslq %eax, %r15
pushq $0x1
popq %rdi
movq %r15, %rsi
callq 0x1140
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x1050
movq %rbx, %rdi
callq 0x10b0
movupd 0xadcc(%rip), %xmm0     # 0xd1b1
movupd %xmm0, (%rbx,%rax)
movb $0x0, 0x10(%rbx,%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11b0
cmpl $-0x1, %eax
je 0x269f
leaq 0xae32(%rip), %rsi      # 0xd23b
movq %rbx, %rdi
callq 0x11c0
movq %rax, -0x58(%rbp)
testq %rax, %rax
je 0x26a8
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1100
movq %rbx, %rdi
movq %r14, %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 0x11b0
cmpl $-0x1, %eax
je 0x269f
leaq 0xadce(%rip), %rsi      # 0xd23b
movq %rbx, %rdi
callq 0x11c0
movq %rax, -0x50(%rbp)
movq %rbx, %rdi
callq 0x1030
pushq $0x1
popq %rdi
pushq $0x14
popq %rsi
callq 0x1140
movq %rax, %r12
xorl %esi, %esi
movabsq $0x7ff0000000000000, %r13 # imm = 0x7FF0000000000000
movabsq $-0x4010000000000000, %rdi # imm = 0xBFF0000000000000
cmpq $0x5, %rsi
je 0x2663
movq -0x38(%rbp), %rbx
movq -0x40(%rbp), %rcx
movq %rcx, -0x48(%rbp)
xorl %r8d, %r8d
movq %rsi, -0x68(%rbp)
cmpq $0x5, %r8
je 0x264e
movq %rbx, -0x60(%rbp)
movq -0x48(%rbp), %r15
xorl %r11d, %r11d
movq %r8, -0x78(%rbp)
cmpq $0x5, %r11
je 0x2636
cmpq $0x4, %rsi
sete %cl
movq %r11, -0x70(%rbp)
cmpq $0x4, %r11
sete %r11b
orb %cl, %r11b
xorl %r14d, %r14d
movb %r11b, -0x29(%rbp)
cmpq $0x5, %r14
je 0x261e
testb %r11b, %r11b
je 0x251e
movq %r13, (%r15,%r14,8)
movq %rdi, (%rbx,%r14,8)
jmp 0x2616
cmpq $0x4, %r8
setne %sil
cmpq $0x4, %r14
setne %cl
testb %cl, %sil
jne 0x254a
movabsq $0x3da5fd7fe1796495, %rcx # imm = 0x3DA5FD7FE1796495
movq %rcx, (%rbx,%r14,8)
andq $0x0, (%r15,%r14,8)
jmp 0x2616
movq %r12, %rdi
pushq $0x14
popq %rsi
movq -0x58(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x268b
movq %r12, %rdi
leaq 0xabbc(%rip), %rsi      # 0xd128
pushq $0x3
popq %rdx
callq 0x1040
movsd 0xaaac(%rip), %xmm0     # 0xd028
testl %eax, %eax
je 0x2588
movq %r12, %rdi
callq 0x1090
movsd %xmm0, (%rbx,%r14,8)
movq %r12, %rdi
pushq $0x14
popq %rsi
movq -0x50(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x268b
movq %r12, %rdi
leaq 0xab78(%rip), %rsi      # 0xd128
pushq $0x3
popq %rdx
callq 0x1040
movsd 0xaa68(%rip), %xmm0     # 0xd028
testl %eax, %eax
je 0x25cc
movq %r12, %rdi
callq 0x1090
movsd %xmm0, (%r15,%r14,8)
movsd (%rbx,%r14,8), %xmm1
andpd 0xab00(%rip), %xmm1     # 0xd0e0
ucomisd 0xaa48(%rip), %xmm1     # 0xd030
movabsq $-0x4010000000000000, %rdi # imm = 0xBFF0000000000000
movq -0x78(%rbp), %r8
movb -0x29(%rbp), %r11b
ja 0x260e
andpd 0xaadc(%rip), %xmm0     # 0xd0e0
ucomisd 0xaa24(%rip), %xmm0     # 0xd030
jbe 0x2616
movq %rdi, (%rbx,%r14,8)
movq %r13, (%r15,%r14,8)
incq %r14
jmp 0x2502
movq -0x70(%rbp), %r11
incq %r11
addq $0x28, %r15
addq $0x28, %rbx
movq -0x68(%rbp), %rsi
jmp 0x24db
incq %r8
movl $0xc8, %ecx
addq %rcx, -0x48(%rbp)
movq -0x60(%rbp), %rbx
addq %rcx, %rbx
jmp 0x24c2
incq %rsi
movl $0x3e8, %ecx            # imm = 0x3E8
addq %rcx, -0x40(%rbp)
addq %rcx, -0x38(%rbp)
jmp 0x24a5
movq -0x58(%rbp), %rdi
callq 0x10a0
movq -0x50(%rbp), %rdi
callq 0x10a0
movq %r12, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
leaq 0xafe1(%rip), %rdi      # 0xd673
callq 0x1070
pushq $0x1
popq %rdi
callq 0x11f0
leaq 0xaa93(%rip), %rdi      # 0xd139
jmp 0x26af
leaq 0xaaa6(%rip), %rdi      # 0xd155
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
jmp 0x2697