// File: /workspace/github_cpp_makefile_star2_O3/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 0xba5f
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 0xbacf
movq %r12, 0xa8(%rsp)
movq %r13, %rdi
leaq 0x3b95d(%rip), %rsi     # 0x471fd
leaq 0x3b957(%rip), %rdx     # 0x471fe
callq 0x1453a
movq %r14, %rdi
movq %rbx, %rdx
movq %r13, %rcx
callq 0xb07c
movq %r15, %rbp
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0xb8cf
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 0x267f6
cmpq %r15, %r12
je 0xb990
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 0xb94f
movq 0x48(%rsp), %rax
movl $0x3f800000, (%rax,%r15,4) # imm = 0x3F800000
incq %r13
addq $0x20, %r12
cmpq %r13, %rbx
jne 0xb90a
jmp 0xb990
movq %r14, %rdi
leaq 0x3c216(%rip), %rsi     # 0x47b6f
movl $0x50, %edx
movl $0x3, %ecx
callq 0x457ae
movl $0x1f, %edx
leaq 0xa8(%rsp), %rdi
leaq 0x3c20c(%rip), %rsi     # 0x47b88
callq 0xa4d0
leaq 0xa8(%rsp), %rdi
callq 0x459d6
jmp 0xb934
leaq 0x98(%rsp), %rdi
callq 0xd788
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 0x2261e
movq %rbp, %r15
movl 0xc(%rsp), %ebp
leaq 0xb8(%rsp), %r12
movq %r14, %r13
movq %rbx, %rdi
callq 0x26a2e
testl %ebp, %ebp
leaq 0x60(%rsp), %rbx
leaq 0x18(%rsp), %r14
jle 0xba48
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
shrq $0x3, %rax
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
cmpl %ebp, %eax
jge 0xbabb
leaq 0x38(%rsp), %rdi
callq 0x26a2e
movq %r14, %rdi
callq 0x122b4
jmp 0xb855
leaq 0x3b76a(%rip), %rsi     # 0x471d0
leaq 0xa8(%rsp), %rdi
movl $0x56, %edx
movl $0x3, %ecx
callq 0x457ae
leaq 0x3b77b(%rip), %rsi     # 0x471ff
leaq 0xa8(%rsp), %rdi
movl $0x11, %edx
callq 0xa4d0
movq (%rbx), %rbx
testq %rbx, %rbx
je 0xbaf2
movq %rbx, %rdi
callq 0xa1b0
leaq 0xa8(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0xa4d0
jmp 0xbb14
leaq 0x38(%rsp), %rdi
callq 0x26a2e
leaq 0x18(%rsp), %rdi
callq 0x122b4
leaq 0x230(%rsp), %rdi
callq 0xa0b0
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xbb21
callq 0xa440
jmp 0xbb21
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 0x459d6
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 0x459d6
jmp 0xbba6
jmp 0xbba3
jmp 0xbbbc
jmp 0xbb5c
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x459d6
jmp 0xbbd3
movq %rax, %rbx
jmp 0xbbd3
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0xbbbf
callq 0xa440
jmp 0xbbbf
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x26a2e
jmp 0xbba6
movq %rax, %rbx
jmp 0xbbb0
jmp 0xbbbc
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x26a2e
leaq 0x18(%rsp), %rdi
callq 0x122b4
jmp 0xbbbf
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xbbd3
callq 0xa440
leaq 0x230(%rsp), %rdi
callq 0xa0e0
movq %rbx, %rdi
callq 0xa780