// File: /workspace/github_cpp_makefile_star2_O3/abaheti95[P]HMM-LDA/Models/cpp_hmm_lda/model.cpp
// Function: HMMLDA::load_topic_assignments(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void HMMLDA::load_topic_assignments(string &topic_file) {
	cout << "Loading topic assingments from " << topic_file << endl;string str;
	ifstream file(topic_file, ios::in);
	// Check if file is open
	if(!file.is_open()) {
		cout << "Couldn't open file: " << topic_file << endl;
		exit(1);
	}
	getline(file, str);			// remove first line
	int n_documents = documents.size();
	for(int i = 0; i < n_documents; i++) {
		getline(file, str);
		stringstream ss(str);
		int doc_size = topic_assignments[i].size();
		for(int j = 0; j < doc_size; j++) {
			int num;
			ss >> num;
			topic_assignments[i][j] = num;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3c8, %rsp            # imm = 0x3C8
movq %rsi, %r14
movq %rdi, %rbx
movq 0x7fb7(%rip), %r15      # 0xafd8
leaq 0x506d(%rip), %rsi      # 0x8095
movl $0x1f, %edx
movq %r15, %rdi
callq 0x2270
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x2270
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
leaq -0x50(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x268(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x2340
leaq -0x1f0(%rbp), %rdi
callq 0x2070
testb %al, %al
je 0x320c
movq -0x268(%rbp), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %edx
leaq -0x268(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x23b0
movq 0xb0(%rbx), %rax
subq 0xa8(%rbx), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rcx
movq %rcx, -0x30(%rbp)
testl %ecx, %ecx
jle 0x31dc
movq -0x30(%rbp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, -0x30(%rbp)
xorl %r15d, %r15d
leaq -0x60(%rbp), %r12
leaq -0x3f0(%rbp), %r13
movq -0x268(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x268(%rbp), %r14
addq %r14, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x23b0
movq %r13, %rdi
movq %r12, %rsi
movl $0x18, %edx
callq 0x2320
movq 0xc0(%rbx), %rax
movq %r15, -0x40(%rbp)
leaq (%r15,%r15,2), %r14
movq 0x8(%rax,%r14,8), %r12
subq (%rax,%r14,8), %r12
shrq $0x2, %r12
testl %r12d, %r12d
jle 0x31ac
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
movq %r13, %rdi
leaq -0x34(%rbp), %rsi
callq 0x2130
movl -0x34(%rbp), %eax
movq 0xc0(%rbx), %rcx
movq (%rcx,%r14,8), %rcx
movl %eax, (%rcx,%r15,4)
incq %r15
cmpq %r15, %r12
jne 0x3186
movq %r13, %rdi
movq 0x7e02(%rip), %rsi      # 0xafb8
callq 0x21a0
leaq -0x370(%rbp), %rdi
callq 0x20b0
movq -0x40(%rbp), %r15
incq %r15
cmpq -0x30(%rbp), %r15
leaq -0x60(%rbp), %r12
jne 0x311e
leaq -0x268(%rbp), %rdi
callq 0x2080
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x31fa
callq 0x2210
addq $0x3c8, %rsp            # imm = 0x3C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7dc5(%rip), %rdi      # 0xafd8
leaq 0x4e66(%rip), %rsi      # 0x8080
movl $0x14, %edx
callq 0x2270
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x7da6(%rip), %rdi      # 0xafd8
callq 0x2270
movq %rax, %rdi
callq 0x20f0
movl $0x1, %edi
callq 0x2290
movq %rax, %rbx
jmp 0x3285
jmp 0x3252
jmp 0x3252
movq %rax, %rbx
jmp 0x3279
movq %rax, %rbx
movq 0x7d57(%rip), %rsi      # 0xafb8
leaq -0x3f0(%rbp), %rdi
callq 0x21a0
leaq -0x370(%rbp), %rdi
callq 0x20b0
leaq -0x268(%rbp), %rdi
callq 0x2080
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x3297
callq 0x2210
movq %rbx, %rdi
callq 0x2390
nop