// File: /workspace/github_cpp_makefile_star2_O1/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 0x496e
movq 0x769f(%rip), %r12      # 0xbfd8
leaq 0x3b7f(%rip), %rsi      # 0x84bf
movl $0x13, %edx
movq %r12, %rdi
callq 0x2230
testq %r15, %r15
je 0x49b1
movq %r15, %rdi
callq 0x2100
movq 0x7677(%rip), %rdi      # 0xbfd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x2230
jmp 0x49ca
movq 0x7663(%rip), %rbx      # 0xbfd8
leaq 0x3b57(%rip), %rsi      # 0x84d3
movl $0xc, %edx
movq %rbx, %rdi
callq 0x2230
testq %r15, %r15
je 0x4c3e
movq %r15, %rdi
callq 0x2100
movq 0x7637(%rip), %rdi      # 0xbfd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x2230
jmp 0x4c55
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 0x75ef(%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 0x4a35
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 0x4a9c
cmpq $0x0, -0x60(%rbp)
je 0x4a9c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6654
jmp 0x4a6a
movq -0x298(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x278(%rbp,%rax)
jne 0x4c0f
leaq (%rax,%rbp), %rdi
addq $-0x298, %rdi           # imm = 0xFD68
leaq 0x18(%rbx), %rax
movq %rax, -0x88(%rbp)
addq $0x30, %rbx
leaq -0x5a8(%rbp), %r15
leaq -0x68(%rbp), %r12
leaq -0x80(%rbp), %r14
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), %rax
movq -0x40(%rbp), %rcx
cmpb $0xd, -0x1(%rax,%rcx)
jne 0x4b16
movb $0x0, -0x1(%rax,%rcx)
cmpq $0x0, -0x40(%rbp)
je 0x4c0f
movq %r15, %rdi
leaq -0x48(%rbp), %rsi
movl $0x18, %edx
callq 0x2310
movq %r15, %rdi
movq %r12, %rsi
movl $0x9, %edx
callq 0x23d0
movq -0x88(%rbp), %rdi
movq %r12, %rsi
callq 0x6654
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
movq $0x0, -0x70(%rbp)
movq %r15, %rdi
movq %r12, %rsi
movl $0x9, %edx
callq 0x23d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4bbb
cmpq $0x0, -0x60(%rbp)
je 0x4bbb
movq -0x68(%rbp), %rdi
callq 0x2260
movsd %xmm0, -0x90(%rbp)
movq -0x78(%rbp), %rsi
cmpq -0x70(%rbp), %rsi
je 0x4bae
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, -0x78(%rbp)
jmp 0x4b60
movq %r14, %rdi
movq %r13, %rdx
callq 0x6f78
jmp 0x4b60
movq %rbx, %rdi
movq %r14, %rsi
callq 0x66a0
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x4bd4
callq 0x21d0
movq %r15, %rdi
movq 0x73da(%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 0x4ae5
leaq -0x298(%rbp), %rdi
callq 0x2070
movq 0x7396(%rip), %rsi      # 0xbfb8
leaq -0x420(%rbp), %rdi
callq 0x2170
leaq -0x3a0(%rbp), %rdi
callq 0x20c0
xorl %ebx, %ebx
jmp 0x4ca0
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2360
movq 0x737c(%rip), %rbx      # 0xbfd8
leaq 0x387d(%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 0x734a(%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 0x4cb2
callq 0x21d0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4cc4
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 0x4cec
jmp 0x4cf8
jmp 0x4cff
jmp 0x4cf8
movq %rax, %rbx
jmp 0x4d4e
movq %rax, %rbx
jmp 0x4d10
jmp 0x4cf8
movq %rax, %rbx
jmp 0x4d2f
jmp 0x4cff
movq %rax, %rbx
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x4d10
callq 0x21d0
movq 0x72a1(%rip), %rsi      # 0xbfb8
leaq -0x5a8(%rbp), %rdi
callq 0x2170
leaq -0x528(%rbp), %rdi
callq 0x20c0
movq 0x7282(%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 0x4d60
callq 0x21d0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4d72
callq 0x21d0
leaq -0x298(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2380