// File: /workspace/github_cpp_makefile_star2_O2/8igMac[P]random-forest/src/main.cpp
// Function: main
int main(int argc, char** argv)
{
	formatHandler fmhdlr;
	dataSet data_set;
	vector<data_inst> TrainSet, ValiSet;
	random_forest Forest;
	vector<string> formatTb;

	if (argc != 3)
		cout << "usage: ./main data-set data-format" << endl;

	// handle data format
	formatTb = fmhdlr.handle_format(argv[2]);

	cout << "get data from file ... ";
	// extract data from file
	data_set.get_data_from_file(argv[1], fmhdlr.get_num_attr(), fmhdlr.get_num_cls(), formatTb);
	cout << "done" << endl;

	cout << "split data ... ";
	// split data into training subset and
	// validation subset
	data_set.split_data(TrainSet, ValiSet);
	cout << "done" << endl;

	cout << "building forest ... " << endl;
	// build forest
	Forest.build_forest(TrainSet);
	cout << "done" << endl;
	
	// validate and analyse accuracy
	analyser alyzr(formatTb);
	alyzr.analyse(Forest, ValiSet);
	alyzr.print_result(fmhdlr.get_num_inst());
	
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movq %rsi, %rbx
movl %edi, %ebp
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
andq $0x0, 0x80(%rsp)
movaps %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x3e44
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
cmpl $0x3, %ebp
je 0x241e
movq 0x7bce(%rip), %rdi      # 0x9fd8
leaq 0x3c0f(%rip), %rsi      # 0x6020
callq 0x2150
movq %rax, %rdi
callq 0x20b0
movq 0x10(%rbx), %rdx
leaq 0x100(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x4512
leaq 0x10(%rsp), %rdi
leaq 0x100(%rsp), %r14
movq %r14, %rsi
callq 0x29fa
movq %r14, %rdi
callq 0x26f8
movq 0x7b80(%rip), %rdi      # 0x9fd8
leaq 0x3be4(%rip), %rsi      # 0x6043
callq 0x2150
movq 0x8(%rbx), %rbx
leaq 0x4(%rsp), %rdi
callq 0x4602
movl %eax, %ebp
leaq 0x4(%rsp), %rdi
callq 0x4606
movl %eax, %r14d
leaq 0xe8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x271a
leaq 0x70(%rsp), %rdi
leaq 0xe8(%rsp), %r8
movq %rbx, %rsi
movl %ebp, %edx
movl %r14d, %ecx
callq 0x2dc2
leaq 0xe8(%rsp), %rdi
callq 0x26f8
movq 0x7b17(%rip), %rdi      # 0x9fd8
leaq 0x3b93(%rip), %rsi      # 0x605b
callq 0x2150
movq %rax, %rdi
callq 0x20b0
movq 0x7afc(%rip), %rdi      # 0x9fd8
leaq 0x3b7d(%rip), %rsi      # 0x6060
callq 0x2150
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x3150
movq 0x7ad5(%rip), %rdi      # 0x9fd8
leaq 0x3b51(%rip), %rsi      # 0x605b
callq 0x2150
movq %rax, %rdi
callq 0x20b0
movq 0x7aba(%rip), %rdi      # 0x9fd8
leaq 0x3b4b(%rip), %rsi      # 0x6070
callq 0x2150
movq %rax, %rdi
callq 0x20b0
leaq 0xd0(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x276e
leaq 0x88(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x3e54
leaq 0xd0(%rsp), %rdi
callq 0x27c8
movq 0x7a6b(%rip), %rdi      # 0x9fd8
leaq 0x3ae7(%rip), %rsi      # 0x605b
callq 0x2150
movq %rax, %rdi
callq 0x20b0
leaq 0xb8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x271a
leaq 0x100(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x40c6
leaq 0xb8(%rsp), %rdi
callq 0x26f8
leaq 0xa0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x276e
leaq 0x100(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
callq 0x4156
leaq 0xa0(%rsp), %rdi
callq 0x27c8
leaq 0x4(%rsp), %rdi
callq 0x460a
leaq 0x100(%rsp), %rdi
movl %eax, %esi
callq 0x4344
leaq 0x100(%rsp), %rdi
callq 0x27ea
leaq 0x10(%rsp), %rdi
callq 0x26f8
leaq 0x88(%rsp), %rdi
callq 0x28c2
leaq 0x30(%rsp), %rdi
callq 0x27c8
leaq 0x50(%rsp), %rdi
callq 0x27c8
leaq 0x70(%rsp), %rdi
callq 0x27c8
xorl %eax, %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x27c8
jmp 0x26a9
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0x2698
jmp 0x26b8
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x27c8
jmp 0x26bb
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x26f8
jmp 0x26bb
jmp 0x26b8
movq %rax, %rbx
jmp 0x26d2
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x27ea
jmp 0x26bb
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x26f8
leaq 0x88(%rsp), %rdi
callq 0x28c2
leaq 0x30(%rsp), %rdi
callq 0x27c8
leaq 0x50(%rsp), %rdi
callq 0x27c8
leaq 0x70(%rsp), %rdi
callq 0x27c8
movq %rbx, %rdi
callq 0x2230