// File: /workspace/github_c_makefile_star2_O1/jiqingxiaoxi[P]RPA/RPA.c
// Function: getStack
void getStack(double stackEntropies[],double stackEnthalpies[], char *path)
{
        int i, j, ii, jj;
        FILE *sFile, *hFile;
        char *line;

        i=strlen(path)+20;
        line=(char *)malloc(i);
        memset(line,'\0',i);
        strcpy(line,path);
        strcat(line,"stack.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,"stack.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 (ii = 0; ii < 5; ++ii)
                {
                        for (j = 0; j < 5; ++j)
                        {
                                for (jj = 0; jj < 5; ++jj)
                                {
                                        if (i == 4 || j == 4 || ii == 4 || jj == 4) //N 
                                        {
                                                stackEntropies[i*125+ii*25+j*5+jj] = -1.0;
                                                stackEnthalpies[i*125+ii*25+j*5+jj]=1.0*INFINITY;
                                        }
                                        else 
                                        {
                                                if(fgets(line,20,sFile)==NULL)
                                                {
                                                        printf("Error! When read parameters in getStack function!\n");
                                                        exit(1);
                                                }
                                                if(strncmp(line, "inf", 3)==0)
                                                        stackEntropies[i*125+ii*25+j*5+jj]=1.0*INFINITY;
                                                else
                                                        stackEntropies[i*125+ii*25+j*5+jj] = atof(line);

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

                                                if (fabs(stackEntropies[i*125+ii*25+j*5+jj])>999999999 ||fabs(stackEnthalpies[i*125+ii*25+j*5+jj])>999999999) 
                                                {
                                                        stackEntropies[i*125+ii*25+j*5+jj] = -1.0;
                                                        stackEnthalpies[i*125+ii*25+j*5+jj] =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 %rdx, %r12
movq %rsi, -0x58(%rbp)
movq %rdi, -0x50(%rbp)
movq %rdx, %rdi
callq 0x10b0
addl $0x14, %eax
movslq %eax, %r13
movq %r13, %rdi
callq 0x1190
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x1100
movq %r14, %rdi
movq %r12, %rsi
callq 0x1050
movq %r14, %rdi
callq 0x10b0
movabsq $0x73642e6b63617473, %rcx # imm = 0x73642E6B63617473
movq %rcx, (%r14,%rax)
movb $0x0, 0x8(%r14,%rax)
movq %r14, %rdi
xorl %esi, %esi
callq 0x11b0
cmpl $-0x1, %eax
je 0x1907
leaq 0xcc60(%rip), %rsi      # 0xe20e
movq %r14, %rdi
callq 0x11c0
movq %rax, -0x48(%rbp)
testq %rax, %rax
je 0x1910
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x1100
movq %r14, %rdi
movq %r12, %rsi
callq 0x1050
movq %r14, %rdi
callq 0x10b0
movabsq $0x68642e6b63617473, %rcx # imm = 0x68642E6B63617473
movq %rcx, (%r14,%rax)
movb $0x0, 0x8(%r14,%rax)
movq %r14, %rdi
xorl %esi, %esi
callq 0x11b0
cmpl $-0x1, %eax
je 0x1907
leaq 0xcbfd(%rip), %rsi      # 0xe20e
movq %r14, %rdi
callq 0x11c0
movq %rax, -0x40(%rbp)
testq %rax, %rax
je 0x1910
movq %r14, %rdi
callq 0x1030
movl $0x14, %edi
callq 0x1190
movq %rax, %r8
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movl $0x0, 0x10(%rax)
xorl %ebx, %ebx
movq -0x50(%rbp), %rcx
movq -0x58(%rbp), %rdx
xorl %esi, %esi
imulq $0x7d, %rsi, %rdi
movq %rdi, -0x78(%rbp)
movq %rbx, -0x70(%rbp)
movq %rcx, -0x68(%rbp)
movq %rcx, %r15
movq %rdx, -0x60(%rbp)
xorl %ecx, %ecx
movq %rsi, -0x98(%rbp)
leaq (%rcx,%rcx,4), %rax
leaq (%rax,%rax,4), %rax
addq -0x78(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq %rbx, -0x90(%rbp)
movq %r15, -0x88(%rbp)
movq %r15, -0x38(%rbp)
movq %rdx, -0x80(%rbp)
movq %rdx, %rdi
xorl %edx, %edx
movq %rcx, -0xa0(%rbp)
cmpq $0x4, %rcx
sete %al
cmpq $0x4, %rsi
sete %cl
cmpq $0x4, %rdx
sete %r13b
orb %cl, %r13b
orb %al, %r13b
movq %rdx, -0xb0(%rbp)
leaq (%rdx,%rdx,4), %rax
addq -0xa8(%rbp), %rax
movq %rax, -0xc0(%rbp)
notb %r13b
movq %rbx, -0xb8(%rbp)
xorl %r12d, %r12d
xorl %r14d, %r14d
movb %r13b, -0x29(%rbp)
cmpq $0x20, %r12
setne %al
testb %al, %r13b
jne 0x170f
movq -0x38(%rbp), %rax
addq %r12, %rax
movq %rbx, %rcx
jmp 0x1804
movq %rdi, %r13
movq %r8, %rdi
movl $0x14, %esi
movq -0x48(%rbp), %rdx
movq %r8, %r15
callq 0x1130
testq %rax, %rax
je 0x18f1
movl $0x3, %edx
movq %r15, %rdi
leaq 0xc9ba(%rip), %rsi      # 0xe0f8
callq 0x1040
movsd 0xc8dd(%rip), %xmm0     # 0xe028
testl %eax, %eax
je 0x1757
movq %r15, %rdi
callq 0x1090
movq -0x38(%rbp), %rax
movsd %xmm0, (%rax,%r12)
movq %r15, %rdi
movl $0x14, %esi
movq -0x40(%rbp), %rdx
callq 0x1130
testq %rax, %rax
je 0x18f1
movl $0x3, %edx
movq %r15, %rdi
leaq 0xc96e(%rip), %rsi      # 0xe0f8
callq 0x1040
movsd 0xc891(%rip), %xmm0     # 0xe028
testl %eax, %eax
je 0x17a3
movq %r15, %rdi
callq 0x1090
movq %r13, %rdi
movsd %xmm0, (%r13,%r12)
movq -0xc0(%rbp), %rax
leaq (%rax,%r14), %rcx
movq -0x50(%rbp), %rax
leaq (%rax,%rcx,8), %rax
movq -0x38(%rbp), %rdx
movsd (%rdx,%r12), %xmm0
movapd 0xc8de(%rip), %xmm1     # 0xe0b0
andpd %xmm1, %xmm0
movsd 0xc852(%rip), %xmm2     # 0xe030
ucomisd %xmm2, %xmm0
jbe 0x17ed
movb -0x29(%rbp), %r13b
movq %r15, %r8
jmp 0x1804
movsd (%rdi,%r12), %xmm0
andpd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
movb -0x29(%rbp), %r13b
movq %r15, %r8
jbe 0x1823
movabsq $-0x4010000000000000, %rdx # imm = 0xBFF0000000000000
movq %rdx, (%rax)
movq -0x58(%rbp), %rax
movabsq $0x7ff0000000000000, %rdx # imm = 0x7FF0000000000000
movq %rdx, (%rax,%rcx,8)
incq %r14
addq $0x8, %r12
incq %rbx
cmpq $0x28, %r12
jne 0x16f4
movq -0xb0(%rbp), %rdx
incq %rdx
addq $0x28, %rdi
addq $0x28, -0x38(%rbp)
movq -0xb8(%rbp), %rbx
addq $0x5, %rbx
cmpq $0x5, %rdx
movq -0x98(%rbp), %rsi
movq -0xa0(%rbp), %rcx
jne 0x16ab
incq %rcx
movl $0xc8, %eax
movq -0x80(%rbp), %rdx
addq %rax, %rdx
movq -0x88(%rbp), %r15
addq %rax, %r15
movq -0x90(%rbp), %rbx
addq $0x19, %rbx
cmpq $0x5, %rcx
jne 0x1676
incq %rsi
movl $0x3e8, %eax            # imm = 0x3E8
movq -0x60(%rbp), %rdx
addq %rax, %rdx
movq -0x68(%rbp), %rcx
addq %rax, %rcx
movq -0x70(%rbp), %rbx
addq $0x7d, %rbx
cmpq $0x5, %rsi
jne 0x1656
movq -0x48(%rbp), %rdi
movq %r8, %rbx
callq 0x10a0
movq -0x40(%rbp), %rdi
callq 0x10a0
movq %rbx, %rdi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
leaq 0xccb3(%rip), %rdi      # 0xe5ab
callq 0x1070
movl $0x1, %edi
callq 0x11f0
leaq 0xc7fb(%rip), %rdi      # 0xe109
jmp 0x1917
leaq 0xc80e(%rip), %rdi      # 0xe125
movq %r14, %rsi
xorl %eax, %eax
callq 0x10c0
jmp 0x18fd