// File: /workspace/github_cpp_makefile_star2_O3/mirkat1206[P]Quine-McCluskey-Petrick-Method/main.cpp
// Function: main
int main(int argc, char *argv[])
{
	if( argc!=3 ) {
		cerr<<"Wrong number of arguments. Please execute as follow : \n"
			<<"./hw1.o <input_file name> <output_file name>"<< endl;
		exit(-1);
	}

	ifstream fin( argv[1] );
	ofstream fout( argv[2] );			

	cout<<"\n***** Quine-McCluskey Algorithm *****"<< endl;
	Quine_McCluskey QM;
	Init( fin , QM );
	QM.Solve();
	QM.Print_Prime_Impli();

	cout<<"\n***** Petrick's Method *****"<< endl;
	Petrick_Method PM( QM.Get_Prime_Impli() , QM.Get_On_Set() );
	PM.Solve();
	PM.Print_POS();
//	PM.Print_SOP();

	cout<<"\n***** All possible fewest-terms results *****"<< endl;
	PM.Print_FewestTerm_P();
	
	cout<<"\n***** Final Answer *****"<< endl;
	Output( fout , QM , PM );
	
	fin.close();
	fout.close();

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x548, %rsp            # imm = 0x548
cmpl $0x3, %edi
jne 0x2866
movq %rsi, %rbx
movq 0x8(%rsi), %rsi
leaq -0x550(%rbp), %rdi
movl $0x8, %edx
callq 0x2300
movq 0x10(%rbx), %rsi
leaq -0x348(%rbp), %rdi
movl $0x10, %edx
callq 0x2200
movq 0xa9bb(%rip), %rbx      # 0xcfd0
leaq 0x6a4d(%rip), %rsi      # 0x9069
movl $0x26, %edx
movq %rbx, %rdi
callq 0x2210
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0xa989(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %rax, %rdi
callq 0x2100
leaq -0xa0(%rbp), %rdi
callq 0x2db2
leaq -0x550(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x28e8
leaq -0x20(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x2eb0
leaq -0x20(%rbp), %rdi
callq 0x2c02
leaq -0xa0(%rbp), %rdi
callq 0x383e
movq 0xa931(%rip), %rbx      # 0xcfd0
leaq 0x69ea(%rip), %rsi      # 0x9090
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2210
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0xa8ff(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %rax, %rdi
callq 0x2100
leaq -0xa0(%rbp), %rdi
callq 0x35e8
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x35de
leaq -0x118(%rbp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x5c82
leaq -0x148(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x5f86
leaq -0x148(%rbp), %rdi
callq 0x2c70
leaq -0x118(%rbp), %rdi
callq 0x6458
movq 0xa893(%rip), %rbx      # 0xcfd0
leaq 0x696a(%rip), %rsi      # 0x90ae
movl $0x2e, %edx
movq %rbx, %rdi
callq 0x2210
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0xa861(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %rax, %rdi
callq 0x2100
leaq -0x118(%rbp), %rdi
callq 0x67ae
movq 0xa841(%rip), %rbx      # 0xcfd0
leaq 0x6947(%rip), %rsi      # 0x90dd
movl $0x19, %edx
movq %rbx, %rdi
callq 0x2210
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0xa80f(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %rax, %rdi
callq 0x2100
leaq -0x348(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x118(%rbp), %rdx
callq 0x2b90
leaq -0x550(%rbp), %rdi
callq 0x2060
leaq -0x348(%rbp), %rdi
callq 0x2270
leaq -0x118(%rbp), %rdi
callq 0x5f48
leaq -0xa0(%rbp), %rdi
callq 0x2de0
movq 0xa7a9(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x340(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x348(%rbp,%rcx)
callq 0x2170
leaq -0x250(%rbp), %rdi
callq 0x2090
leaq -0x550(%rbp), %rdi
callq 0x2070
xorl %eax, %eax
addq $0x548, %rsp            # imm = 0x548
popq %rbx
popq %rbp
retq
movq 0xa783(%rip), %rdi      # 0xcff0
leaq 0x6790(%rip), %rsi      # 0x9004
callq 0x21b0
leaq 0x67bc(%rip), %rsi      # 0x903c
movq %rax, %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x20c0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2230
jmp 0x28a3
movq %rax, %rbx
jmp 0x28d4
jmp 0x28a8
movq %rax, %rbx
jmp 0x28c8
movq %rax, %rbx
jmp 0x28bc
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x5f48
leaq -0xa0(%rbp), %rdi
callq 0x2de0
leaq -0x348(%rbp), %rdi
callq 0x2290
leaq -0x550(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x22e0