// File: /workspace/github_cpp_makefile_star2_O1/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 0x9e6(%rip), %rsi       # 0x82d8
leaq 0xa00(%rip), %rdx       # 0x82f9
leaq -0x80(%rbp), %rdi
callq 0x620a
xorpd %xmm0, %xmm0
movapd %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
leaq -0x90(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x9d4(%rip), %rsi       # 0x82fa
leaq 0x9d3(%rip), %rdx       # 0x8300
leaq -0xa0(%rbp), %r14
movq %r14, %rdi
callq 0x620a
movq %r14, (%rsp)
leaq -0x15b8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movsd 0x96d(%rip), %xmm0      # 0x82c0
movsd 0x96d(%rip), %xmm1      # 0x82c8
movsd 0x6ad(%rip), %xmm2      # 0x8010
movsd 0x965(%rip), %xmm3      # 0x82d0
movl $0x32, %edx
movl $0x11, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x26e6
movq -0xa0(%rbp), %rdi
cmpq %r12, %rdi
je 0x7994
callq 0x2210
leaq -0x50(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x95d(%rip), %rsi       # 0x8301
leaq 0x97f(%rip), %rdx       # 0x832a
leaq -0x60(%rbp), %rdi
callq 0x620a
leaq -0x15b8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x768c
leaq -0x15b8(%rbp), %rdi
callq 0x329e
movq 0x3601(%rip), %r14      # 0xafd8
leaq 0x94d(%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 0x35cf(%rip), %rdi      # 0xafd8
callq 0x2030
movq %rax, %rdi
callq 0x2150
leaq -0x15b8(%rbp), %rdi
movl $0x9c4, %esi            # imm = 0x9C4
movl $0x64, %edx
callq 0x3590
movq 0x35a5(%rip), %rdi      # 0xafd8
leaq 0x902(%rip), %rsi       # 0x833c
movl $0x6, %edx
callq 0x2270
callq 0x2140
subq %rbx, %rax
cvtsi2sd %rax, %xmm0
divsd 0x5af(%rip), %xmm0      # 0x8008
movq 0x3578(%rip), %rdi      # 0xafd8
callq 0x2330
movq %rax, %rbx
leaq 0x64a(%rip), %rsi       # 0x80b9
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 0x7ab1
callq 0x2210
leaq -0x15b8(%rbp), %rdi
callq 0x2a7c
leaq -0x40(%rbp), %rdi
callq 0x5aee
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x7ad4
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 0x7b17
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r12, %rdi
je 0x7b23
callq 0x2210
jmp 0x7b23
movq %rax, %rbx
jmp 0x7b23
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x7b17
callq 0x2210
leaq -0x15b8(%rbp), %rdi
callq 0x2a7c
leaq -0x40(%rbp), %rdi
callq 0x5aee
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x7b3a
callq 0x2210
movq %rbx, %rdi
callq 0x2390