// File: /workspace/github_cpp_makefile_star2_O3/akinanop[P]mvl-solver/src/Global.cc
// Function: ParseCommandLine(CommandLine*, int, char**)
void ParseCommandLine(CommandLine * cline, int argc, char ** argv)
{
	//local variables
	int current = 1;

	//Default Initialization
	cline->NUM_VAR = -1;
	cline->NUM_CLAUSE = -1;
	cline->CLAUSE_SIZE = 3;
	cline->SAT_UNSAT = true;
	cline->DOMAIN_SIZE = 10;
	cline->DRAND = false;
	cline->BOOL_FINITE = false;
	cline->FILE = NULL;
	cline->MODEL_FILE = NULL;
	cline->TIME = 3600000; //1000 hours = 1000 * 60mins * 60secs
	cline -> RESTARTS = 0;
	cline->MODEL = true;
	cline -> WATCH = false;
	cline -> heuristic = Heuristic::BK;
	cline -> LOG = false;


	//Check if enough arguments supplied
	if(argc < 2)
	{
		PrintHelp();
	}

	else
	{
		//If Menu/Help option selected
		if(!strcmp(argv[1], "-help"))
		{
			PrintHelp();
		}

		//If option is for generating benchmark problems
		else if(!strcmp(argv[1],"-genben"))
		{
			for(current = 2; current < argc; current++)
			{
				if(!strcmp(argv[current], "-var"))
					cline->NUM_VAR = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-clause"))
					cline->NUM_CLAUSE = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-clausesize"))
					cline->CLAUSE_SIZE = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-sat"))
					cline->SAT_UNSAT = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-domain"))
					cline->DOMAIN_SIZE = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-drand"))
					cline->DRAND = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-bool"))
					cline->BOOL_FINITE = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-file"))
					cline->FILE = argv[++current];
				else
					;
			}
		}

		//If option is for converting boolean to finite domain
		else if(!strcmp(argv[1], "-b2f"))
		{
			for(current = 2; current < argc; current++)
			{
				if(!strcmp(argv[current], "-file"))
					cline->FILE = argv[++current];
				else if(!strcmp(argv[current], "-model"))
					cline->MODEL_FILE = argv[++current];
				else
					;
			}
		}

		//If option if for converting finite domain to boolean : Linear Encoding
		else if(!strcmp(argv[1], "-linenc"))
		{
			for(current = 2; current < argc; current++)
			{
				if(!strcmp(argv[current], "-file"))
					cline->FILE = argv[++current];
				else if(!strcmp(argv[current], "-model"))
					cline->MODEL_FILE = argv[++current];
				else
					;
			}
		}

		//If option if for converting finite domain to boolean : Quadratic Encoding
		else if(!strcmp(argv[1], "-quadenc"))
		{
			for(current = 2; current < argc; current++)
			{
				if(!strcmp(argv[current], "-file"))
					cline->FILE = argv[++current];
				else if(!strcmp(argv[current], "-model"))
					cline->MODEL_FILE = argv[++current];
				else
					;
			}
		}

		//If option is for solving a domain problem : Chronological Backtracking
		else if(!strcmp(argv[1],"-solvech"))
		{
			for(current = 2; current < argc; current++)
			{
				if(!strcmp(argv[current], "-var"))
					cline->NUM_VAR = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-clause"))
					cline->NUM_CLAUSE = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-clausesize"))
					cline->CLAUSE_SIZE = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-file"))
					cline->FILE = argv[++current];
				else if(!strcmp(argv[current], "-model"))
					cline->MODEL_FILE = argv[++current];
				else if(!strcmp(argv[current], "-time"))
					cline->TIME = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-lazy"))
					cline -> heuristic = Heuristic::lazy;
				else if(!strcmp(argv[current], "-verbose"))
					cline->LOG = true;
				else
					;
			}

		}

		//If option is for solving a domain problem : Non Chronological Backtracking
		else if(!strcmp(argv[1],"-solvenc"))
		{
			for(current = 2; current < argc; current++)
			{
				if (!strcmp(argv[current], "-restart"))
					cline->RESTARTS = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-verbose"))
					cline->LOG = true;
				else if(!strcmp(argv[current], "-wl")) {
					cline -> WATCH = true;
					if (cline->heuristic == Heuristic::BK)
						cline->heuristic = Heuristic::VSIDS;
				}
				else if(!strcmp(argv[current], "-vsids"))
					cline -> heuristic = Heuristic::VSIDS;
				else if(!strcmp(argv[current], "-vsids_pos"))
					cline -> heuristic = Heuristic::VSIDS_pos;
				else if(!strcmp(argv[current], "-lazy"))
					cline -> heuristic = Heuristic::lazy;
				else if(!strcmp(argv[current], "-model"))
					cline->MODEL = true;
				else if(!strcmp(argv[current], "-var"))
					cline->NUM_VAR = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-clause"))
					cline->NUM_CLAUSE = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-clausesize"))
					cline->CLAUSE_SIZE = atoi(argv[++current]);
				else if(!strcmp(argv[current], "-file"))
					cline->FILE = argv[++current];
				else if(!strcmp(argv[current], "-time"))
					cline->TIME = atoi(argv[++current]);
				else
					;
			}

		}

		else
		{
			//nothing
			;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq $-0x1, 0x4(%rdi)
movl $0x3, 0xc(%rdi)
movb $0x1, 0x10(%rdi)
movl $0xa, 0x14(%rdi)
movw $0x0, 0x18(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movq $0x36ee80, 0x30(%rdi)   # imm = 0x36EE80
movw $0x1, (%rdi)
movl $0x0, 0x38(%rdi)
movb $0x0, 0x2(%rdi)
cmpl $0x2, %esi
jl 0x3e3e
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq 0x8(%rdx), %r15
leaq 0x9ede(%rip), %rsi      # 0xda5a
movq %r15, %rdi
callq 0x22e0
testl %eax, %eax
je 0x3e3e
leaq 0x20(%r14), %rax
movq %rax, 0x10(%rsp)
leaq 0x94ca(%rip), %rsi      # 0xd066
movq %r15, %rdi
callq 0x22e0
testl %eax, %eax
je 0x3e51
leaq 0x28(%r14), %rax
movq %rax, 0x8(%rsp)
leaq 0x94b2(%rip), %rsi      # 0xd06e
movq %r15, %rdi
callq 0x22e0
testl %eax, %eax
je 0x3fd9
leaq 0x94a0(%rip), %rsi      # 0xd073
movq %r15, %rdi
callq 0x22e0
testl %eax, %eax
je 0x403b
leaq 0x9491(%rip), %rsi      # 0xd07b
movq %r15, %rdi
callq 0x22e0
testl %eax, %eax
je 0x409a
leaq 0x9483(%rip), %rsi      # 0xd084
movq %r15, %rdi
callq 0x22e0
testl %eax, %eax
je 0x40f5
leaq 0x9475(%rip), %rsi      # 0xd08d
movq %r15, %rdi
callq 0x22e0
testl %eax, %eax
setne %al
cmpl $0x2, %ebp
sete %cl
orb %al, %cl
jne 0x40fa
movl $0x2, %r12d
movl $0x0, 0x8(%rsp)
movslq %r12d, %r15
movq (%rbx,%r15,8), %r13
movq %r13, %rdi
leaq 0x9e63(%rip), %rsi      # 0xdab5
callq 0x22e0
testl %eax, %eax
je 0x3d73
movq %r13, %rdi
leaq 0x9e43(%rip), %rsi      # 0xdaac
callq 0x22e0
testl %eax, %eax
je 0x3d8a
movq %r13, %rdi
leaq 0x9e3e(%rip), %rsi      # 0xdabe
callq 0x22e0
testl %eax, %eax
je 0x3d94
movq %r13, %rdi
leaq 0x9e2b(%rip), %rsi      # 0xdac2
callq 0x22e0
testl %eax, %eax
je 0x3da4
movq %r13, %rdi
leaq 0x9e1b(%rip), %rsi      # 0xdac9
callq 0x22e0
testl %eax, %eax
je 0x3db6
movq %r13, %rdi
leaq 0x9de1(%rip), %rsi      # 0xdaa6
callq 0x22e0
testl %eax, %eax
je 0x3dc8
movq %r13, %rdi
leaq 0x9dbd(%rip), %rsi      # 0xda99
callq 0x22e0
testl %eax, %eax
je 0x3dda
movq %r13, %rdi
leaq 0x9d6d(%rip), %rsi      # 0xda60
callq 0x22e0
testl %eax, %eax
je 0x3de0
movq %r13, %rdi
leaq 0x9d5b(%rip), %rsi      # 0xda65
callq 0x22e0
testl %eax, %eax
je 0x3df4
movq %r13, %rdi
leaq 0x9d4c(%rip), %rsi      # 0xda6d
callq 0x22e0
testl %eax, %eax
je 0x3e08
movq %r13, %rdi
leaq 0x9d5b(%rip), %rsi      # 0xda93
callq 0x22e0
testl %eax, %eax
je 0x3e1c
movq %r13, %rdi
leaq 0x9d51(%rip), %rsi      # 0xdaa0
callq 0x22e0
testl %eax, %eax
jne 0x3e2d
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
movl %eax, 0x30(%r14)
jmp 0x3e2d
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
movl %eax, 0x34(%r14)
jmp 0x3e2d
movb $0x1, 0x2(%r14)
jmp 0x3e2d
movb $0x1, 0x1(%r14)
cmpl $0x0, 0x8(%rsp)
jne 0x3e2d
movl $0x1, 0x38(%r14)
movl $0x1, 0x8(%rsp)
jmp 0x3e2d
movl $0x3, 0x38(%r14)
movl $0x3, 0x8(%rsp)
jmp 0x3e2d
movl $0x2, 0x38(%r14)
movl $0x2, 0x8(%rsp)
jmp 0x3e2d
movb $0x1, (%r14)
jmp 0x3e2d
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
movl %eax, 0x4(%r14)
jmp 0x3e2d
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
movl %eax, 0x8(%r14)
jmp 0x3e2d
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
movl %eax, 0xc(%r14)
jmp 0x3e2d
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rax
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
incl %r12d
cmpl %ebp, %r12d
jl 0x3c41
jmp 0x40fa
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2bc1
cmpl $0x2, %ebp
je 0x40fa
movl $0x2, %r12d
movslq %r12d, %r15
movq (%rbx,%r15,8), %r13
movq %r13, %rdi
leaq 0x9bef(%rip), %rsi      # 0xda60
callq 0x22e0
testl %eax, %eax
je 0x3f35
movq %r13, %rdi
leaq 0x9bdd(%rip), %rsi      # 0xda65
callq 0x22e0
testl %eax, %eax
je 0x3f49
movq %r13, %rdi
leaq 0x9bce(%rip), %rsi      # 0xda6d
callq 0x22e0
testl %eax, %eax
je 0x3f5d
movq %r13, %rdi
leaq 0x9bc3(%rip), %rsi      # 0xda79
callq 0x22e0
testl %eax, %eax
je 0x3f71
movq %r13, %rdi
leaq 0x9bb1(%rip), %rsi      # 0xda7e
callq 0x22e0
testl %eax, %eax
je 0x3f88
movq %r13, %rdi
leaq 0x9ba2(%rip), %rsi      # 0xda86
callq 0x22e0
testl %eax, %eax
je 0x3f9c
movq %r13, %rdi
leaq 0x9b92(%rip), %rsi      # 0xda8d
callq 0x22e0
testl %eax, %eax
je 0x3fb3
movq %r13, %rdi
leaq 0x9b81(%rip), %rsi      # 0xda93
callq 0x22e0
testl %eax, %eax
jne 0x3fc8
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rax
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
jmp 0x3fc8
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
movl %eax, 0x4(%r14)
jmp 0x3fc8
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
movl %eax, 0x8(%r14)
jmp 0x3fc8
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
movl %eax, 0xc(%r14)
jmp 0x3fc8
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
testl %eax, %eax
setne 0x10(%r14)
jmp 0x3fc8
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
movl %eax, 0x14(%r14)
jmp 0x3fc8
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
testl %eax, %eax
setne 0x18(%r14)
jmp 0x3fc8
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
testl %eax, %eax
setne 0x19(%r14)
incl %r12d
cmpl %ebp, %r12d
jl 0x3e60
jmp 0x40fa
cmpl $0x2, %ebp
je 0x40fa
movl $0x2, %r13d
leaq 0x9aa4(%rip), %r14      # 0xda93
movslq %r13d, %r15
movq (%rbx,%r15,8), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x22e0
movq 0x10(%rsp), %rcx
testl %eax, %eax
je 0x4022
movq %r12, %rdi
leaq 0x9a85(%rip), %rsi      # 0xda99
callq 0x22e0
movq 0x8(%rsp), %rcx
testl %eax, %eax
jne 0x402e
leal 0x1(%r15), %r13d
movq 0x8(%rbx,%r15,8), %rax
movq %rax, (%rcx)
incl %r13d
cmpl %ebp, %r13d
jl 0x3fef
jmp 0x40fa
cmpl $0x2, %ebp
je 0x40fa
movl $0x2, %r13d
leaq 0x9a42(%rip), %r14      # 0xda93
movslq %r13d, %r15
movq (%rbx,%r15,8), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x22e0
movq 0x10(%rsp), %rcx
testl %eax, %eax
je 0x4084
movq %r12, %rdi
leaq 0x9a23(%rip), %rsi      # 0xda99
callq 0x22e0
movq 0x8(%rsp), %rcx
testl %eax, %eax
jne 0x4090
leal 0x1(%r15), %r13d
movq 0x8(%rbx,%r15,8), %rax
movq %rax, (%rcx)
incl %r13d
cmpl %ebp, %r13d
jl 0x4051
jmp 0x40fa
cmpl $0x2, %ebp
je 0x40fa
movl $0x2, %r13d
leaq 0x99e7(%rip), %r14      # 0xda93
movslq %r13d, %r15
movq (%rbx,%r15,8), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x22e0
movq 0x10(%rsp), %rcx
testl %eax, %eax
je 0x40df
movq %r12, %rdi
leaq 0x99c8(%rip), %rsi      # 0xda99
callq 0x22e0
movq 0x8(%rsp), %rcx
testl %eax, %eax
jne 0x40eb
leal 0x1(%r15), %r13d
movq 0x8(%rbx,%r15,8), %rax
movq %rax, (%rcx)
incl %r13d
cmpl %ebp, %r13d
jl 0x40ac
jmp 0x40fa
cmpl $0x2, %ebp
jne 0x4109
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x2, %r12d
movslq %r12d, %r15
movq (%rbx,%r15,8), %r13
movq %r13, %rdi
leaq 0x9940(%rip), %rsi      # 0xda60
callq 0x22e0
testl %eax, %eax
je 0x41d1
movq %r13, %rdi
leaq 0x992e(%rip), %rsi      # 0xda65
callq 0x22e0
testl %eax, %eax
je 0x41e5
movq %r13, %rdi
leaq 0x991f(%rip), %rsi      # 0xda6d
callq 0x22e0
testl %eax, %eax
je 0x41f9
movq %r13, %rdi
leaq 0x992e(%rip), %rsi      # 0xda93
callq 0x22e0
testl %eax, %eax
je 0x420d
movq %r13, %rdi
leaq 0x991d(%rip), %rsi      # 0xda99
callq 0x22e0
testl %eax, %eax
je 0x421d
movq %r13, %rdi
leaq 0x990d(%rip), %rsi      # 0xdaa0
callq 0x22e0
testl %eax, %eax
je 0x423f
movq %r13, %rdi
leaq 0x98fc(%rip), %rsi      # 0xdaa6
callq 0x22e0
testl %eax, %eax
je 0x4253
movq %r13, %rdi
leaq 0x98eb(%rip), %rsi      # 0xdaac
callq 0x22e0
testl %eax, %eax
jne 0x422e
movb $0x1, 0x2(%r14)
jmp 0x422e
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
movl %eax, 0x4(%r14)
jmp 0x422e
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
movl %eax, 0x8(%r14)
jmp 0x422e
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
movl %eax, 0xc(%r14)
jmp 0x422e
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rax
movq 0x10(%rsp), %rcx
jmp 0x422b
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
incl %r12d
cmpl %ebp, %r12d
jl 0x410f
jmp 0x40fa
leal 0x1(%r15), %r12d
movq 0x8(%rbx,%r15,8), %rdi
callq 0x2330
movl %eax, 0x30(%r14)
jmp 0x422e
movl $0x2, 0x38(%r14)
jmp 0x422e
nopl (%rax)