// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x15a0, %rsp           # imm = 0x15A0
callq 0x2150
movq %rax, %rbx
leaq 0x604(%rip), %rsi       # 0x72a8
leaq -0x70(%rbp), %rdi
leaq -0x15a8(%rbp), %rdx
callq 0x20c0
xorpd %xmm0, %xmm0
movapd %xmm0, -0x30(%rbp)
andq $0x0, -0x20(%rbp)
leaq 0x601(%rip), %rsi       # 0x72ca
leaq -0x90(%rbp), %r14
leaq -0x50(%rbp), %rdx
movq %r14, %rdi
callq 0x20c0
movq %r14, (%rsp)
leaq -0x15a8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
pushq $0x32
popq %rdx
pushq $0x11
popq %rcx
pushq $0x1
popq %r9
movsd 0x593(%rip), %xmm0      # 0x7290
movsd 0x593(%rip), %xmm1      # 0x7298
movsd 0x303(%rip), %xmm2      # 0x7010
movsd 0x58b(%rip), %xmm3      # 0x72a0
xorl %r8d, %r8d
callq 0x2608
leaq -0x90(%rbp), %rdi
callq 0x20f0
leaq 0x5a1(%rip), %rsi       # 0x72d1
leaq -0x50(%rbp), %rdi
leaq -0x11(%rbp), %rdx
callq 0x20c0
leaq -0x15a8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x6b00
leaq -0x15a8(%rbp), %rdi
callq 0x2f28
movq 0x4278(%rip), %rdi      # 0xafd8
leaq 0x594(%rip), %rsi       # 0x72fb
callq 0x2200
movq %rax, %rdi
callq 0x2100
leaq -0x15a8(%rbp), %rdi
pushq $0x64
popq %rdx
movl $0x9c4, %esi            # imm = 0x9C4
callq 0x31e6
movq 0x4249(%rip), %rdi      # 0xafd8
leaq 0x576(%rip), %rsi       # 0x730c
callq 0x2200
movq %rax, %r14
callq 0x2150
subq %rbx, %rax
cvtsi2sd %rax, %xmm0
divsd 0x255(%rip), %xmm0      # 0x7008
movq %r14, %rdi
callq 0x2320
leaq 0x2f7(%rip), %rsi       # 0x70b9
movq %rax, %rdi
callq 0x2200
movq %rax, %rdi
callq 0x2100
leaq -0x50(%rbp), %rdi
callq 0x20f0
leaq -0x15a8(%rbp), %rdi
callq 0x28d8
leaq -0x30(%rbp), %rdi
callq 0x4e36
leaq -0x70(%rbp), %rdi
callq 0x20f0
xorl %eax, %eax
addq $0x15a0, %rsp           # imm = 0x15A0
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
jmp 0x6e2e
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x20f0
jmp 0x6e3a
movq %rax, %rbx
jmp 0x6e3a
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x20f0
leaq -0x15a8(%rbp), %rdi
callq 0x28d8
leaq -0x30(%rbp), %rdi
callq 0x4e36
leaq -0x70(%rbp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2380