// File: /workspace/github_cpp_makefile_star2_O3/abaheti95[P]HMM-LDA/cpp_hmm_lda_trainer.cpp
// Function: main
int main(int argc, char const *argv[]) {
	std::clock_t start;
	start = std::clock();
	// model parameter initializations
	int num_topics = 50;
	int num_classes = 17;
	// int num_classes = 3;			// topics only setting
	int start_word_id = 0;
	int end_word_id = 1;
	// double alpha = 50.0/num_topics;
	double alpha = 0.5;
	double beta = 0.3;			// topic words prior
	double gamma = 1;			// transition probabilities prior
	double delta = 0.1;		// Class words prior

	// your test
	string vocab_filename = "Data/20newsgroup/20news_vocab.txt";
	vector<string> vocab;
	HMMLDA model(vocab_filename, num_topics, num_classes, 
		start_word_id, end_word_id, alpha, beta, gamma, delta, "20news");
		// start_word_id, end_word_id, alpha, beta, gamma, delta, "20news-topics");
	string documents_filename = "Data/20newsgroup/20news_train_encoded.txt";
	load_documents_to_model(model, documents_filename);
	// string topic_assignments_file = "Results/20news-topics/500_results/topic_assignments.txt";
	// model.load_topic_assignments(topic_assignments_file);
	model.run_counts();
	cout << "Training Started" << endl;
	model.train(2500,100);
	std::cout << "Time: " << (std::clock() - start) / (double)(CLOCKS_PER_SEC) << " s" << std::endl;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x15a0, %rsp           # imm = 0x15A0
callq 0x2140
movq %rax, %rbx
leaq -0x70(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xa0a(%rip), %rsi       # 0x82d8
leaq 0xa24(%rip), %rdx       # 0x82f9
leaq -0x80(%rbp), %rdi
callq 0x6212
xorpd %xmm0, %xmm0
movapd %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
leaq -0x90(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x9f8(%rip), %rsi       # 0x82fa
leaq 0x9f7(%rip), %rdx       # 0x8300
leaq -0xa0(%rbp), %r14
movq %r14, %rdi
callq 0x6212
movq %r14, (%rsp)
leaq -0x15b8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movsd 0x991(%rip), %xmm0      # 0x82c0
movsd 0x991(%rip), %xmm1      # 0x82c8
movsd 0x6d1(%rip), %xmm2      # 0x8010
movsd 0x989(%rip), %xmm3      # 0x82d0
movl $0x32, %edx
movl $0x11, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x26e8
movq -0xa0(%rbp), %rdi
cmpq %r12, %rdi
je 0x7970
callq 0x2210
leaq -0x50(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x981(%rip), %rsi       # 0x8301
leaq 0x9a3(%rip), %rdx       # 0x832a
leaq -0x60(%rbp), %rdi
callq 0x6212
leaq -0x15b8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x7668
leaq -0x15b8(%rbp), %rdi
callq 0x32a0
movq 0x3625(%rip), %r14      # 0xafd8
leaq 0x971(%rip), %rsi       # 0x832b
movl $0x10, %edx
movq %r14, %rdi
callq 0x2270
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq 0x35f3(%rip), %rdi      # 0xafd8
callq 0x2030
movq %rax, %rdi
callq 0x2150
leaq -0x15b8(%rbp), %rdi
movl $0x9c4, %esi            # imm = 0x9C4
movl $0x64, %edx
callq 0x3596
movq 0x35c9(%rip), %rdi      # 0xafd8
leaq 0x926(%rip), %rsi       # 0x833c
movl $0x6, %edx
callq 0x2270
callq 0x2140
subq %rbx, %rax
cvtsi2sd %rax, %xmm0
divsd 0x5d3(%rip), %xmm0      # 0x8008
movq 0x359c(%rip), %rdi      # 0xafd8
callq 0x2330
movq %rax, %rbx
leaq 0x67e(%rip), %rsi       # 0x80c9
movl $0x2, %edx
movq %rax, %rdi
callq 0x2270
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x7a8d
callq 0x2210
leaq -0x15b8(%rbp), %rdi
callq 0x2a7e
leaq -0x40(%rbp), %rdi
callq 0x5ae8
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x7ab0
callq 0x2210
xorl %eax, %eax
addq $0x15a0, %rsp           # imm = 0x15A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x7af3
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r12, %rdi
je 0x7aff
callq 0x2210
jmp 0x7aff
movq %rax, %rbx
jmp 0x7aff
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x7af3
callq 0x2210
leaq -0x15b8(%rbp), %rdi
callq 0x2a7e
leaq -0x40(%rbp), %rdi
callq 0x5ae8
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x7b16
callq 0x2210
movq %rbx, %rdi
callq 0x2390