// File: /workspace/github_cpp_makefile_star2_O3/abaheti95[P]HMM-LDA/cpp_hmm_lda_trainer.cpp
// Function: load_documents_to_model(HMMLDA&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void load_documents_to_model(HMMLDA &model, string &documents_filename) {
	ifstream file(documents_filename, ios::in);
	string str;
	int counter = 0;
	while(getline(file, str)) {
		stringstream ss(str);
		int num;
		vector<int> document;
		while(ss >> num) {
			document.push_back(num);
		}
		model.add_document(document);
		counter ++;
		// if(counter == 10000) break;
		if(counter%1000000 == 0) {
			cout << counter << endl;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f8, %rsp            # imm = 0x3F8
movq %rdi, -0x58(%rbp)
leaq -0x420(%rbp), %rdi
movl $0x8, %edx
callq 0x2340
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %r12d, %r12d
leaq -0x218(%rbp), %rbx
leaq -0x2c(%rbp), %r14
leaq -0x50(%rbp), %r15
movq -0x420(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x420(%rbp), %r13
addq %r13, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %edx
movq %r13, %rdi
leaq -0x78(%rbp), %rsi
callq 0x23b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7800
movq %rbx, %rdi
leaq -0x78(%rbp), %rsi
movl $0x18, %edx
callq 0x2320
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2130
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7755
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x7748
movl -0x2c(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x7716
movq %r15, %rdi
movq %r14, %rdx
callq 0x7b1e
jmp 0x7716
leaq -0x90(%rbp), %rdi
movq %r15, %rsi
callq 0x6ae6
movq -0x58(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x2bec
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x7785
callq 0x2210
incl %r12d
imull $0x68c26139, %r12d, %eax # imm = 0x68C26139
rorl $0x6, %eax
cmpl $0x10c6, %eax           # imm = 0x10C6
ja 0x77d2
movq 0x3838(%rip), %rdi      # 0xafd8
movl %r12d, %esi
callq 0x2380
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x77e0
callq 0x2210
movq %rbx, %rdi
movq 0x37ce(%rip), %rsi      # 0xafb8
callq 0x21a0
leaq -0x198(%rbp), %rdi
callq 0x20b0
jmp 0x76b6
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x7812
callq 0x2210
leaq -0x420(%rbp), %rdi
callq 0x2080
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x7852
callq 0x2210
jmp 0x7852
jmp 0x7848
movq %rax, %rbx
jmp 0x787f
jmp 0x784f
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x7860
callq 0x2210
movq 0x3751(%rip), %rsi      # 0xafb8
leaq -0x218(%rbp), %rdi
callq 0x21a0
leaq -0x198(%rbp), %rdi
callq 0x20b0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x7891
callq 0x2210
leaq -0x420(%rbp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x2390