// File: /workspace/github_cpp_makefile_star2_O3/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 $0x150, %rsp            # imm = 0x150
movq %rsi, %rbx
movl %edi, %ebp
xorl %eax, %eax
movq %rax, 0x80(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq %rax, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movq %rax, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x46d2
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
cmpl $0x3, %ebp
je 0x251a
movq 0x7afd(%rip), %r14      # 0x9fd8
leaq 0x4b3e(%rip), %rsi      # 0x7020
movl $0x22, %edx
movq %r14, %rdi
callq 0x2190
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq 0x7acb(%rip), %rdi      # 0x9fd8
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x10(%rbx), %rdx
leaq 0x130(%rsp), %rdi
leaq 0x24(%rsp), %rsi
callq 0x5150
movq 0x10(%rsp), %rax
leaq 0x130(%rsp), %r14
movaps (%r14), %xmm0
movq 0x10(%r14), %rcx
movq %rcx, 0x10(%rsp)
movaps (%rsp), %xmm1
movaps %xmm0, (%rsp)
leaq 0xa0(%rsp), %rdi
movaps %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
callq 0x28ec
movq %r14, %rdi
callq 0x28ec
movq 0x7a54(%rip), %rdi      # 0x9fd8
leaq 0x4ab8(%rip), %rsi      # 0x7043
movl $0x17, %edx
callq 0x2190
movq 0x8(%rbx), %rbx
leaq 0x24(%rsp), %rdi
callq 0x525e
movl %eax, %ebp
leaq 0x24(%rsp), %rdi
callq 0x5262
movl %eax, %r14d
leaq 0x118(%rsp), %rdi
movq %rsp, %rsi
callq 0x294a
leaq 0x70(%rsp), %rdi
leaq 0x118(%rsp), %r8
movq %rbx, %rsi
movl %ebp, %edx
movl %r14d, %ecx
callq 0x2ff6
leaq 0x118(%rsp), %rdi
callq 0x28ec
movq 0x79e8(%rip), %rbx      # 0x9fd8
leaq 0x4a64(%rip), %rsi      # 0x705b
movl $0x4, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq 0x79b6(%rip), %rdi      # 0x9fd8
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x79a2(%rip), %rdi      # 0x9fd8
leaq 0x4a23(%rip), %rsi      # 0x7060
movl $0xf, %edx
callq 0x2190
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x350a
movq 0x7976(%rip), %rbx      # 0x9fd8
leaq 0x49f2(%rip), %rsi      # 0x705b
movl $0x4, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq 0x7944(%rip), %rdi      # 0x9fd8
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x7930(%rip), %rbx      # 0x9fd8
leaq 0x49c1(%rip), %rsi      # 0x7070
movl $0x14, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq 0x78fe(%rip), %rdi      # 0x9fd8
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x100(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x29d4
leaq 0x88(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x471a
leaq 0x100(%rsp), %rdi
callq 0x2a6e
movq 0x78b6(%rip), %rbx      # 0x9fd8
leaq 0x4932(%rip), %rsi      # 0x705b
movl $0x4, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq 0x7884(%rip), %rdi      # 0x9fd8
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0xe8(%rsp), %rdi
movq %rsp, %rsi
callq 0x294a
leaq 0xa0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x4a8c
leaq 0xe8(%rsp), %rdi
callq 0x28ec
leaq 0xd0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x29d4
leaq 0xa0(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x4b3a
leaq 0xd0(%rsp), %rdi
callq 0x2a6e
leaq 0x24(%rsp), %rdi
callq 0x5266
leaq 0xa0(%rsp), %rdi
movl %eax, %esi
callq 0x4dea
leaq 0xb8(%rsp), %rdi
callq 0x28ec
leaq 0xa0(%rsp), %rdi
callq 0x2ac2
movq %rsp, %rdi
callq 0x28ec
leaq 0x88(%rsp), %rdi
callq 0x2b20
leaq 0x30(%rsp), %rdi
callq 0x2a6e
leaq 0x50(%rsp), %rdi
callq 0x2a6e
leaq 0x70(%rsp), %rdi
callq 0x2a6e
xorl %eax, %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x2a6e
jmp 0x2892
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
jmp 0x2881
jmp 0x28ae
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x2a6e
jmp 0x28b1
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x28ec
jmp 0x28b1
jmp 0x28ae
movq %rax, %rbx
jmp 0x28c6
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x28ec
leaq 0xa0(%rsp), %rdi
callq 0x2ac2
jmp 0x28b1
movq %rax, %rbx
movq %rsp, %rdi
callq 0x28ec
leaq 0x88(%rsp), %rdi
callq 0x2b20
leaq 0x30(%rsp), %rdi
callq 0x2a6e
leaq 0x50(%rsp), %rdi
callq 0x2a6e
leaq 0x70(%rsp), %rdi
callq 0x2a6e
movq %rbx, %rdi
callq 0x2240