// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/utils/RNNHelper.h
// Function: abcdl::utils::RNNHelper::read_data(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, abcdl::algebra::MatrixSet<float>&, int)
bool RNNHelper::read_data(const std::string& data_file,
                          abcdl::algebra::MatSet& matset,
                          int limit){
	std::ifstream in_file(data_file.c_str());
	if(!in_file.is_open()){
		LOG(FATAL) << "Open file failed:" << data_file.c_str();
		return false;
	}
		
	std::string data;
    abcdl::utils::StringHelper helper;
	while(getline(in_file, data)){
		auto line_data = helper.split(data, "\t");
        size_t rows = line_data.size();
        abcdl::algebra::Mat mat(rows, _feature_dim);
        for(size_t i = 0; i != rows ; i++){
            mat.set_data(1, i, helper.str2int(line_data[i]));
        }
        matset.push_back(mat);
        if(limit > 0 && (int)matset.size() >= limit){
            break;
        }
	}
	in_file.close();
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movl %ecx, %ebp
movq %rdx, 0x10(%rsp)
movq %rsi, %rbx
movq %rdi, 0x30(%rsp)
movq (%rsi), %rsi
leaq 0x230(%rsp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0xa7e0
leaq 0x2a8(%rsp), %rdi
callq 0xa0d0
movb %al, 0xb(%rsp)
testb %al, %al
je 0xba8f
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xb8(%rsp), %r12
leaq 0x60(%rsp), %rbx
leaq 0xa8(%rsp), %r13
leaq 0x18(%rsp), %r14
movl %ebp, 0xc(%rsp)
movq 0x230(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0xa450
movsbl %al, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xa7f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xbaff
movq %r12, 0xa8(%rsp)
movq %r13, %rdi
leaq 0x3b92d(%rip), %rsi     # 0x471fd
leaq 0x3b927(%rip), %rdx     # 0x471fe
callq 0x14914
movq %r14, %rdi
movq %rbx, %rdx
movq %r13, %rcx
callq 0xb0ac
movq %r15, %rbp
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0xb8ff
callq 0xa440
movq %r13, %r14
movq 0x18(%rsp), %r15
movq 0x20(%rsp), %r12
movq %r12, %rbx
subq %r15, %rbx
sarq $0x5, %rbx
movq 0x30(%rsp), %rax
movq (%rax), %rdx
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
callq 0x26b8a
cmpq %r15, %r12
je 0xb9c0
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x18(%rsp), %rax
movq (%rax,%r12), %rdi
callq 0xa680
cltq
movq 0x40(%rsp), %rcx
movq %rcx, %r15
imulq %r13, %r15
addq %rax, %r15
imulq 0x38(%rsp), %rcx
cmpq %rcx, %r15
jae 0xb97f
movq 0x48(%rsp), %rax
movl $0x3f800000, (%rax,%r15,4) # imm = 0x3F800000
incq %r13
addq $0x20, %r12
cmpq %r13, %rbx
jne 0xb93a
jmp 0xb9c0
movq %r14, %rdi
leaq 0x3c1e6(%rip), %rsi     # 0x47b6f
movl $0x50, %edx
movl $0x3, %ecx
callq 0x45a82
movl $0x1f, %edx
leaq 0xa8(%rsp), %rdi
leaq 0x3c1dc(%rip), %rsi     # 0x47b88
callq 0xa4d0
leaq 0xa8(%rsp), %rdi
callq 0x45caa
jmp 0xb964
leaq 0x98(%rsp), %rdi
callq 0xd874
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rbx
movq %rax, 0x80(%rsp)
movq %rbx, 0x88(%rsp)
imulq %rax, %rbx
movq %rbx, %rax
shrq $0x3e, %rax
shlq $0x2, %rbx
negq %rax
movl $0x0, %edi
sbbq %rdi, %rdi
orq %rbx, %rdi
callq 0xa030
movq %rax, 0x90(%rsp)
movq 0x48(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xa3a0
movq 0x10(%rsp), %rdi
leaq 0x80(%rsp), %rbx
movq %rbx, %rsi
callq 0x229be
movq %rbp, %r15
movl 0xc(%rsp), %ebp
leaq 0xb8(%rsp), %r12
movq %r14, %r13
movq %rbx, %rdi
callq 0x26dc2
testl %ebp, %ebp
leaq 0x60(%rsp), %rbx
leaq 0x18(%rsp), %r14
jle 0xba78
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
shrq $0x3, %rax
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
cmpl %ebp, %eax
jge 0xbaeb
leaq 0x38(%rsp), %rdi
callq 0x26dc2
movq %r14, %rdi
callq 0x125ba
jmp 0xb885
leaq 0x3b73a(%rip), %rsi     # 0x471d0
leaq 0xa8(%rsp), %rdi
movl $0x56, %edx
movl $0x3, %ecx
callq 0x45a82
leaq 0x3b74b(%rip), %rsi     # 0x471ff
leaq 0xa8(%rsp), %rdi
movl $0x11, %edx
callq 0xa4d0
movq (%rbx), %rbx
testq %rbx, %rbx
je 0xbb22
movq %rbx, %rdi
callq 0xa1b0
leaq 0xa8(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0xa4d0
jmp 0xbb44
leaq 0x38(%rsp), %rdi
callq 0x26dc2
leaq 0x18(%rsp), %rdi
callq 0x125ba
leaq 0x230(%rsp), %rdi
callq 0xa0b0
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xbb51
callq 0xa440
jmp 0xbb51
movq 0xa8(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rdi
addq $0xa8, %rdi
movl 0x20(%rdi), %esi
orl $0x1, %esi
callq 0xa730
leaq 0xa8(%rsp), %rdi
callq 0x45caa
leaq 0x230(%rsp), %rdi
callq 0xa0e0
movb 0xb(%rsp), %al
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x45caa
jmp 0xbbd6
jmp 0xbbd3
jmp 0xbbec
jmp 0xbb8c
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x45caa
jmp 0xbc03
movq %rax, %rbx
jmp 0xbc03
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0xbbef
callq 0xa440
jmp 0xbbef
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x26dc2
jmp 0xbbd6
movq %rax, %rbx
jmp 0xbbe0
jmp 0xbbec
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x26dc2
leaq 0x18(%rsp), %rdi
callq 0x125ba
jmp 0xbbef
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xbc03
callq 0xa440
leaq 0x230(%rsp), %rdi
callq 0xa0e0
movq %rbx, %rdi
callq 0xa780