// File: /workspace/github_cpp_makefile_star2_O1/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 0x463c
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 0x138(%rsp), %rdi
leaq 0x24(%rsp), %rsi
callq 0x50b8
xorps %xmm0, %xmm0
leaq 0xa0(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps (%rsp), %xmm0
movq 0x10(%rsp), %rax
leaq 0x138(%rsp), %r14
movups (%r14), %xmm1
movaps %xmm1, (%rsp)
movq 0x10(%r14), %rcx
movq %rcx, 0x10(%rsp)
movaps (%rdi), %xmm1
movaps %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
movups %xmm1, (%r14)
movq $0x0, 0x10(%r14)
callq 0x28f2
movq %r14, %rdi
callq 0x28f2
movq 0x7a4e(%rip), %rdi      # 0x9fd8
leaq 0x4ab2(%rip), %rsi      # 0x7043
movl $0x17, %edx
callq 0x2190
movq 0x8(%rbx), %rbx
leaq 0x24(%rsp), %rdi
callq 0x51c6
movl %eax, %ebp
leaq 0x24(%rsp), %rdi
callq 0x51ca
movl %eax, %r14d
leaq 0x120(%rsp), %rdi
movq %rsp, %rsi
callq 0x294e
leaq 0x70(%rsp), %rdi
leaq 0x120(%rsp), %r8
movq %rbx, %rsi
movl %ebp, %edx
movl %r14d, %ecx
callq 0x2f5e
leaq 0x120(%rsp), %rdi
callq 0x28f2
movq 0x79e2(%rip), %rbx      # 0x9fd8
leaq 0x4a5e(%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 0x79b0(%rip), %rdi      # 0x9fd8
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x799c(%rip), %rdi      # 0x9fd8
leaq 0x4a1d(%rip), %rsi      # 0x7060
movl $0xf, %edx
callq 0x2190
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x3472
movq 0x7970(%rip), %rbx      # 0x9fd8
leaq 0x49ec(%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 0x793e(%rip), %rdi      # 0x9fd8
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movq 0x792a(%rip), %rbx      # 0x9fd8
leaq 0x49bb(%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 0x78f8(%rip), %rdi      # 0x9fd8
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0x108(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x29d8
leaq 0x88(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x4688
leaq 0x108(%rsp), %rdi
callq 0x2a72
movq 0x78b0(%rip), %rbx      # 0x9fd8
leaq 0x492c(%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 0x787e(%rip), %rdi      # 0x9fd8
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq 0xf0(%rsp), %rdi
movq %rsp, %rsi
callq 0x294e
leaq 0xa0(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x49f4
leaq 0xf0(%rsp), %rdi
callq 0x28f2
leaq 0xd8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x29d8
leaq 0xa0(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
callq 0x4aa2
leaq 0xd8(%rsp), %rdi
callq 0x2a72
leaq 0x24(%rsp), %rdi
callq 0x51ce
leaq 0xa0(%rsp), %rdi
movl %eax, %esi
callq 0x4d52
leaq 0xb8(%rsp), %rdi
callq 0x28f2
leaq 0xa0(%rsp), %rdi
callq 0x2ac0
movq %rsp, %rdi
callq 0x28f2
leaq 0x88(%rsp), %rdi
callq 0x2b18
leaq 0x30(%rsp), %rdi
callq 0x2a72
leaq 0x50(%rsp), %rdi
callq 0x2a72
leaq 0x70(%rsp), %rdi
callq 0x2a72
xorl %eax, %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x2a72
jmp 0x2898
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
jmp 0x2887
jmp 0x28b4
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x2a72
jmp 0x28b7
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0x28f2
jmp 0x28b7
jmp 0x28b4
movq %rax, %rbx
jmp 0x28cc
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x28f2
leaq 0xa0(%rsp), %rdi
callq 0x2ac0
jmp 0x28b7
movq %rax, %rbx
movq %rsp, %rdi
callq 0x28f2
leaq 0x88(%rsp), %rdi
callq 0x2b18
leaq 0x30(%rsp), %rdi
callq 0x2a72
leaq 0x50(%rsp), %rdi
callq 0x2a72
leaq 0x70(%rsp), %rdi
callq 0x2a72
movq %rbx, %rdi
callq 0x2240