// File: /workspace/github_cpp_makefile_star2_O3/WeiqiangZhou[P]BIRD/source/predict_function.cpp
// Function: ReadinExon(char*, Exondata*)
int ReadinExon(char filename[255], Exondata *indata)  
{
	std::ifstream infile(filename);
	std::string line_temp;
	std::string line_token;

	if (infile.is_open())
	{
		std::cout << "Reading input file " << filename << std::endl;
		std::getline(infile, line_temp);
                if(line_temp[line_temp.length()-1]=='\r') {line_temp[line_temp.length()-1] = '\0';}     //handle windows file
		std::stringstream each_line(line_temp);
		std::getline(each_line, line_token, '\t');          //ignore the first string 'TranscriptCluster'
		while (std::getline(each_line, line_token, '\t'))
		{
			if (line_token.empty()){ break;}
			indata->sample_name.push_back(line_token);
		}

		while (!infile.eof())
		{
			std::getline(infile, line_temp);
                        if(line_temp[line_temp.length()-1]=='\r') {line_temp[line_temp.length()-1] = '\0';}
			if (line_temp.empty()){ break; }
			std::stringstream each_line(line_temp);
			std::getline(each_line, line_token, '\t');
			indata->TC_name.push_back(line_token);
			std::vector<double> data_temp;
			while (std::getline(each_line, line_token, '\t'))
			{
				if (line_token.empty()){ break;}
				data_temp.push_back(atof(line_token.c_str()));
			}
			indata->data.push_back(data_temp);
		}

		infile.close();
	}
	else
	{
		std::cout << "Error! File " << filename << " not found!" << std::endl;
		return 1;
	}

	return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x588, %rsp            # imm = 0x588
movq %rsi, %rbx
movq %rdi, %r15
leaq -0x298(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x23c0
leaq -0x38(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x58(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x220(%rbp), %rdi
callq 0x2090
testb %al, %al
je 0x494a
movq 0x76c3(%rip), %r12      # 0xbfd8
leaq 0x3ba3(%rip), %rsi      # 0x84bf
movl $0x13, %edx
movq %r12, %rdi
callq 0x2230
testq %r15, %r15
je 0x498d
movq %r15, %rdi
callq 0x2100
movq 0x769b(%rip), %rdi      # 0xbfd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x2230
jmp 0x49a6
movq 0x7687(%rip), %rbx      # 0xbfd8
leaq 0x3b7b(%rip), %rsi      # 0x84d3
movl $0xc, %edx
movq %rbx, %rdi
callq 0x2230
testq %r15, %r15
je 0x4c1c
movq %r15, %rdi
callq 0x2100
movq 0x765b(%rip), %rdi      # 0xbfd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x2230
jmp 0x4c33
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x2360
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq 0x7613(%rip), %rdi      # 0xbfd8
callq 0x2040
movq %rax, %rdi
callq 0x2150
movq -0x298(%rbp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %edx
leaq -0x298(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x23d0
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
cmpb $0xd, -0x1(%rax,%rcx)
jne 0x4a11
movb $0x0, -0x1(%rax,%rcx)
leaq -0x420(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movl $0x18, %edx
callq 0x2310
leaq -0x420(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movl $0x9, %edx
callq 0x23d0
leaq -0x420(%rbp), %r14
leaq -0x68(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0x9, %edx
callq 0x23d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4a78
cmpq $0x0, -0x60(%rbp)
je 0x4a78
movq %rbx, %rdi
movq %r15, %rsi
callq 0x666c
jmp 0x4a46
movq -0x298(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x278(%rbp,%rax)
jne 0x4bed
leaq (%rax,%rbp), %rdi
addq $-0x298, %rdi           # imm = 0xFD68
leaq 0x18(%rbx), %rax
movq %rax, -0x88(%rbp)
addq $0x30, %rbx
leaq -0x5a8(%rbp), %r14
leaq -0x68(%rbp), %r12
leaq -0x80(%rbp), %r15
leaq -0x90(%rbp), %r13
movl $0xa, %esi
callq 0x21e0
movsbl %al, %edx
leaq -0x298(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x23d0
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rax
cmpb $0xd, -0x1(%rcx,%rax)
jne 0x4af6
movb $0x0, -0x1(%rcx,%rax)
movq -0x40(%rbp), %rax
testq %rax, %rax
je 0x4bed
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
movl $0x18, %edx
callq 0x2310
movq %r14, %rdi
movq %r12, %rsi
movl $0x9, %edx
callq 0x23d0
movq -0x88(%rbp), %rdi
movq %r12, %rsi
callq 0x666c
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
movq $0x0, -0x70(%rbp)
movq %r14, %rdi
movq %r12, %rsi
movl $0x9, %edx
callq 0x23d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4b99
cmpq $0x0, -0x60(%rbp)
je 0x4b99
movq -0x68(%rbp), %rdi
callq 0x2260
movsd %xmm0, -0x90(%rbp)
movq -0x78(%rbp), %rsi
cmpq -0x70(%rbp), %rsi
je 0x4b8c
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, -0x78(%rbp)
jmp 0x4b3e
movq %r15, %rdi
movq %r13, %rdx
callq 0x6f58
jmp 0x4b3e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x66b8
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x4bb2
callq 0x21d0
movq %r14, %rdi
movq 0x73fc(%rip), %rsi      # 0xbfb8
callq 0x2170
leaq -0x528(%rbp), %rdi
callq 0x20c0
movq -0x298(%rbp), %rax
movq -0x18(%rax), %rax
leaq (%rax,%rbp), %rdi
addq $-0x298, %rdi           # imm = 0xFD68
testb $0x2, 0x20(%rdi)
je 0x4ac1
leaq -0x298(%rbp), %rdi
callq 0x2070
movq 0x73b8(%rip), %rsi      # 0xbfb8
leaq -0x420(%rbp), %rdi
callq 0x2170
leaq -0x3a0(%rbp), %rdi
callq 0x20c0
xorl %ebx, %ebx
jmp 0x4c7e
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2360
movq 0x739e(%rip), %rbx      # 0xbfd8
leaq 0x389f(%rip), %rsi      # 0x84e0
movl $0xb, %edx
movq %rbx, %rdi
callq 0x2230
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq 0x736c(%rip), %rdi      # 0xbfd8
callq 0x2040
movl $0x1, %ebx
movq %rax, %rdi
callq 0x2150
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x4c90
callq 0x21d0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4ca2
callq 0x21d0
leaq -0x298(%rbp), %rdi
callq 0x20a0
movl %ebx, %eax
addq $0x588, %rsp            # imm = 0x588
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4cca
jmp 0x4cd6
jmp 0x4cdd
jmp 0x4cd6
movq %rax, %rbx
jmp 0x4d2c
movq %rax, %rbx
jmp 0x4cee
jmp 0x4cd6
movq %rax, %rbx
jmp 0x4d0d
jmp 0x4cdd
movq %rax, %rbx
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x4cee
callq 0x21d0
movq 0x72c3(%rip), %rsi      # 0xbfb8
leaq -0x5a8(%rbp), %rdi
callq 0x2170
leaq -0x528(%rbp), %rdi
callq 0x20c0
movq 0x72a4(%rip), %rsi      # 0xbfb8
leaq -0x420(%rbp), %rdi
callq 0x2170
leaq -0x3a0(%rbp), %rdi
callq 0x20c0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x4d3e
callq 0x21d0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4d50
callq 0x21d0
leaq -0x298(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2380