// File: btbujiangjun[P]abcdl/include/utils/RNNHelper.h
// Function: abcdl::utils::RNNHelper::read_word2index(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, unsigned long>>>&)
bool RNNHelper::read_word2index(const std::string& data_file, std::map<std::string, size_t>& dict){
	std::ifstream in_file(data_file.data());;
	if(!in_file.is_open()){
		LOG(FATAL) << "Open file  failed:" << data_file.c_str();
		return false;
	}

    abcdl::utils::StringHelper helper;
	std::string data;
	while(getline(in_file, data)){
        auto line_data = helper.split(data, "\t");
        if(line_data.size() == 2){
			size_t value = helper.str2int(line_data[1]);
			if(value < _feature_dim){
				dict.insert(std::map<std::string, size_t>::value_type(line_data[0], value));
			}
        }
	}
	in_file.close();
	return true;
}

// Assembly:
subq $0x4c8, %rsp            # imm = 0x4C8
movq %rdi, 0x4b8(%rsp)
movq %rsi, 0x4b0(%rsp)
movq %rdx, 0x4a8(%rsp)
movq 0x4b8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x4b0(%rsp), %rdi
callq 0xb730
movq %rax, %rsi
leaq 0x2a0(%rsp), %rdi
movq %rdi, 0x48(%rsp)
movl $0x8, %edx
callq 0xba00
movq 0x48(%rsp), %rdi
callq 0xb870
movb %al, 0x57(%rsp)
jmp 0xc943
movb 0x57(%rsp), %al
testb $0x1, %al
jne 0xca19
jmp 0xc951
leaq 0xa88f4(%rip), %rsi     # 0xb524c
leaq 0x108(%rsp), %rdi
movl $0x36, %edx
movl $0x3, %ecx
callq 0xb0f80
jmp 0xc971
leaq 0xa88ee(%rip), %rsi     # 0xb5266
leaq 0x108(%rsp), %rdi
callq 0x19030
movq %rax, 0x38(%rsp)
jmp 0xc98c
movq 0x4b0(%rsp), %rdi
callq 0xb1f0
movq 0x38(%rsp), %rdi
movq %rax, 0x100(%rsp)
leaq 0x100(%rsp), %rsi
callq 0x19000
jmp 0xc9b5
leaq 0x108(%rsp), %rdi
callq 0xb1340
movb $0x0, 0x4c7(%rsp)
movl $0x1, 0xfc(%rsp)
jmp 0xcc9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x298(%rsp)
movl %eax, 0x294(%rsp)
jmp 0xccb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x298(%rsp)
movl %eax, 0x294(%rsp)
leaq 0x108(%rsp), %rdi
callq 0xb1340
jmp 0xccb9
leaq 0xd8(%rsp), %rdi
callq 0xb780
leaq 0x2a0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0xb0d0
movq %rax, 0x30(%rsp)
jmp 0xca42
movq 0x30(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0xb6d0
movb %al, 0x2f(%rsp)
jmp 0xca5c
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0xca69
jmp 0xcc5b
leaq 0x9f(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xb990
movq 0x20(%rsp), %rdx
leaq 0xa87f2(%rip), %rsi     # 0xb5279
leaq 0xa0(%rsp), %rdi
callq 0xb760
jmp 0xca96
leaq 0xc0(%rsp), %rdi
leaq 0xfb(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
leaq 0xa0(%rsp), %rcx
callq 0xc1d0
jmp 0xcabd
leaq 0xa0(%rsp), %rdi
callq 0xb330
leaq 0x9f(%rsp), %rdi
callq 0xb5f0
leaq 0xc0(%rsp), %rdi
callq 0x19060
cmpq $0x2, %rax
jne 0xcc3a
leaq 0xc0(%rsp), %rdi
movl $0x1, %esi
callq 0x19080
movq %rax, %rsi
leaq 0xfb(%rsp), %rdi
callq 0xc5a0
movq 0x40(%rsp), %rcx
cltq
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
cmpq (%rcx), %rax
jae 0xcc38
movq 0x4a8(%rsp), %rax
movq %rax, 0x18(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0xc0(%rsp), %rdi
callq 0x19080
movq %rax, %rsi
leaq 0x68(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x190f0
jmp 0xcb65
movq 0x18(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x190a0
movb %dl, 0xf(%rsp)
movq %rax, 0x10(%rsp)
jmp 0xcb7f
movb 0xf(%rsp), %al
movq 0x10(%rsp), %rcx
movq %rcx, 0x58(%rsp)
movb %al, 0x60(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x19130
jmp 0xcc38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x298(%rsp)
movl %eax, 0x294(%rsp)
jmp 0xcc8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x298(%rsp)
movl %eax, 0x294(%rsp)
jmp 0xcbf0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x298(%rsp)
movl %eax, 0x294(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0xb330
leaq 0x9f(%rsp), %rdi
callq 0xb5f0
jmp 0xcc8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x298(%rsp)
movl %eax, 0x294(%rsp)
jmp 0xcc4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x298(%rsp)
movl %eax, 0x294(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x19130
jmp 0xcc4c
jmp 0xcc3a
leaq 0xc0(%rsp), %rdi
callq 0x19140
jmp 0xca26
leaq 0xc0(%rsp), %rdi
callq 0x19140
jmp 0xcc8c
leaq 0x2a0(%rsp), %rdi
callq 0xb100
jmp 0xcc6a
movb $0x1, 0x4c7(%rsp)
movl $0x1, 0xfc(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0xb330
jmp 0xcc9b
leaq 0xd8(%rsp), %rdi
callq 0xb330
jmp 0xccb9
leaq 0x2a0(%rsp), %rdi
callq 0xb140
movb 0x4c7(%rsp), %al
andb $0x1, %al
addq $0x4c8, %rsp            # imm = 0x4C8
retq
leaq 0x2a0(%rsp), %rdi
callq 0xb140
movq 0x298(%rsp), %rdi
callq 0xb980
nopw %cs:(%rax,%rax)