// File: /workspace/github_c_makefile_star2_O2/jiqingxiaoxi[P]RPA/RPA.c
// Function: getTetraloop
void getTetraloop(char *tetraloopEntropies1,char *tetraloopEnthalpies1,double *tetraloopEntropies2,double *tetraloopEnthalpies2,char *path)
{
        FILE *sFile, *hFile;
        int i, turn;
        char *line,seq[10],value[10];

        i=strlen(path)+20;
        line=(char *)malloc(i);
        memset(line,'\0',i);
        strcpy(line,path);
        strcat(line,"tetraloop.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);
        }

	turn=0;
        while(fscanf(sFile,"%s\t%s\n",seq,value)!=EOF)
        {
		for(i=0;i<6;i++)
			tetraloopEntropies1[turn*6+i]=str2int(seq[i]);
		if(value[0]=='i')
			tetraloopEntropies2[turn]=1.0*INFINITY;
		else
			tetraloopEntropies2[turn]=atof(value);
		turn++;
        }
        fclose(sFile);

        memset(line,'\0',i);
        strcpy(line,path);
        strcat(line,"tetraloop.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);
        
	turn=0;
        while(fscanf(hFile,"%s\t%s\n",seq,value)!=EOF)
        {
		for(i=0;i<6;i++)
			tetraloopEnthalpies1[6*turn+i]=str2int(seq[i]);
		if(value[0]=='i')
			tetraloopEnthalpies2[turn]=1.0*INFINITY;
		else
			tetraloopEnthalpies2[turn]=atof(value);
		turn++;
        }
        fclose(hFile);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r13
movq %rcx, -0x58(%rbp)
movq %rdx, -0x60(%rbp)
movq %rsi, %r14
movq %rdi, %r12
movq %r8, %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 %r13, %rsi
callq 0x1050
movq %rbx, %rdi
callq 0x10b0
movabsq $0x6f6f6c6172746574, %rcx # imm = 0x6F6F6C6172746574
movq %rcx, (%rbx,%rax)
movabsq $0x73642e706f6f6c, %rcx # imm = 0x73642E706F6F6C
movq %rcx, 0x5(%rbx,%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11b0
cmpl $-0x1, %eax
je 0x2f19
movq %r13, -0x50(%rbp)
leaq 0xa4a7(%rip), %rsi      # 0xd23b
movq %rbx, -0x48(%rbp)
movq %rbx, %rdi
callq 0x11c0
testq %rax, %rax
je 0x2f25
movq %rax, %rbx
xorl %r13d, %r13d
movq %rbx, %rdi
leaq 0xa441(%rip), %rsi      # 0xd1fa
leaq -0x3c(%rbp), %rdx
leaq -0x32(%rbp), %rcx
xorl %eax, %eax
callq 0x1060
cmpl $-0x1, %eax
je 0x2e18
xorl %r15d, %r15d
cmpq $0x6, %r15
je 0x2dea
movsbl -0x3c(%rbp,%r15), %edi
callq 0x130c
movb %al, (%r12,%r15)
incq %r15
jmp 0x2dd0
cmpb $0x69, -0x32(%rbp)
movsd 0xa232(%rip), %xmm0     # 0xd028
je 0x2e01
leaq -0x32(%rbp), %rdi
callq 0x1090
movq -0x60(%rbp), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
addq $0x6, %r12
pushq $0x6
popq %r15
jmp 0x2daf
movq %rbx, %rdi
callq 0x10a0
movq -0x48(%rbp), %r12
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1100
movq %r12, %rdi
movq -0x50(%rbp), %rsi
callq 0x1050
movq %r12, %rdi
callq 0x10b0
movabsq $0x6f6f6c6172746574, %rcx # imm = 0x6F6F6C6172746574
movq %rcx, (%r12,%rax)
movabsq $0x68642e706f6f6c, %rcx # imm = 0x68642E706F6F6C
movq %rcx, 0x5(%r12,%rax)
movq %r12, %rdi
xorl %esi, %esi
callq 0x11b0
cmpl $-0x1, %eax
je 0x2f32
leaq 0xa3bf(%rip), %rsi      # 0xd23b
movq %r12, %rdi
callq 0x11c0
testq %rax, %rax
je 0x2f3b
movq %rax, %rbx
movq %r12, %rdi
callq 0x1030
leaq -0x32(%rbp), %r13
xorl %r15d, %r15d
movq %rbx, %rdi
leaq 0xa351(%rip), %rsi      # 0xd1fa
leaq -0x3c(%rbp), %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x1060
cmpl $-0x1, %eax
je 0x2f02
xorl %r12d, %r12d
cmpq $0x6, %r12
je 0x2ed9
movsbl -0x3c(%rbp,%r12), %edi
callq 0x130c
movb %al, (%r14,%r12)
incq %r12
jmp 0x2ebf
cmpb $0x69, -0x32(%rbp)
movsd 0xa143(%rip), %xmm0     # 0xd028
je 0x2eef
movq %r13, %rdi
callq 0x1090
movq -0x58(%rbp), %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
addq $0x6, %r14
jmp 0x2e9f
movq %rbx, %rdi
callq 0x10a0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa219(%rip), %rdi      # 0xd139
movq %rbx, %rsi
jmp 0x2f45
leaq 0xa229(%rip), %rdi      # 0xd155
movq -0x48(%rbp), %rsi
jmp 0x2f45
leaq 0xa200(%rip), %rdi      # 0xd139
jmp 0x2f42
leaq 0xa213(%rip), %rdi      # 0xd155
movq %r12, %rsi
xorl %eax, %eax
callq 0x10c0
pushq $0x1
popq %rdi
callq 0x11f0