// File: /workspace/github_cpp_makefile_star2_O1/menhits[P]phplus/src/main.cpp
// Function: getFlags(int, char**)
Flags getFlags(int argc, char ** argv)
{
	bool after = false;
	Flags flags;
	
	for (int i=1; i<argc; i++)
	{
		string arg(argv[i]);
		if (!after)
		{
			if (arg.size()>1 && arg[0]=='-')
			{
				string flag=arg.substr(1, string::npos);

				if (flag=="d" || flag=="debug")
				{
					flags.debug=true;
				}
				else if (flag=="v" || flag=="version")
				{
					flags.version=true;
				}
				else if (flag=="h" || flag=="help")
				{
					flags.help=true;
				}
				else if (flag=="r" || flag=="run")
				{
					flags.runCompiled=false;
					flags.runInterpreted=true;
					after = true;
				}
				else if (flag=="cpp")
				{
					if (i+1>=argc)
					{
						cout << "output file harus diikuti '-cpp' flag";
						flags.flagError=true;
					}

					flags.runInterpreted=false;

					flags.cppOutFile=string(argv[i+1]);

					i++;
				}
				else if (flag=="bin")
				{
					if (i+1>=argc)
					{
						cout << "output file harus diikuti '-bin' flag";
						flags.flagError=true;
					}

					flags.runInterpreted=false;

					flags.binOutFile=string(argv[i+1]);

					i++;
				}
				else if (flag=="e" || flag=="execute")
				{
					flags.runCompiled=true;
					flags.runInterpreted=false;
					after = true;
				}
				else
				{
					cout << "flag tidak diketahui '"+flag+"'" << endl;
					flags.flagError=true;
				}
			}
			else
			{
				flags.inFiles.push_back(arg);
				cmdLineArgs.push_back(arg);
			}
		}
		else
		{
			cmdLineArgs.push_back(arg);
		}
	}
	
	return flags;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, 0x28(%rsp)
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
xorl %eax, %eax
movq %rax, 0x8(%rdi)
movb %al, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x2b(%rdi)
movb $0x1, 0x3b(%rdi)
leaq 0x50(%rdi), %rcx
movq %rcx, 0x40(%rdi)
movq %rax, 0x48(%rdi)
movb %al, 0x50(%rdi)
leaq 0x70(%rdi), %rcx
movq %rcx, 0x60(%rdi)
movq %rax, 0x68(%rdi)
movb %al, 0x70(%rdi)
movw $0x0, 0x80(%rdi)
cmpl $0x2, %esi
jl 0x59cba
movl %esi, %ebp
leaq 0x20(%rbx), %rax
movq %rax, 0x40(%rsp)
leaq 0x40(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x60(%rbx), %rax
movq %rax, 0x30(%rsp)
movl $0x1, %r15d
xorl %r12d, %r12d
leaq 0x68(%rsp), %r13
movslq %r15d, %rax
movq 0x28(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %r13, %rdi
leaq 0x88(%rsp), %rdx
callq 0xa160
testb $0x1, %r12b
jne 0x59b0a
cmpq $0x2, 0x70(%rsp)
jb 0x59afd
movq 0x68(%rsp), %rax
cmpb $0x2d, (%rax)
jne 0x59afd
movl $0x1, %edx
leaq 0x88(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
movq $-0x1, %rcx
callq 0xa2f0
movq %r14, %rdi
leaq 0x2036e(%rip), %rsi     # 0x79d0d
callq 0xa0e0
testl %eax, %eax
je 0x59b3e
movq %r14, %rdi
leaq 0x217bf(%rip), %rsi     # 0x7b175
callq 0xa0e0
testl %eax, %eax
je 0x59b3e
movq %r14, %rdi
leaq 0x1d1ca(%rip), %rsi     # 0x76b97
callq 0xa0e0
testl %eax, %eax
je 0x59b44
movq %r14, %rdi
leaq 0x21797(%rip), %rsi     # 0x7b17b
callq 0xa0e0
testl %eax, %eax
je 0x59b44
movq %r14, %rdi
leaq 0x200af(%rip), %rsi     # 0x79aaa
callq 0xa0e0
testl %eax, %eax
je 0x59b4a
movq %r14, %rdi
leaq 0x21771(%rip), %rsi     # 0x7b183
callq 0xa0e0
testl %eax, %eax
je 0x59b4a
movq %r14, %rdi
leaq 0x1d3c5(%rip), %rsi     # 0x76dee
callq 0xa0e0
testl %eax, %eax
je 0x59b50
movq %r14, %rdi
leaq 0x21748(%rip), %rsi     # 0x7b188
callq 0xa0e0
testl %eax, %eax
je 0x59b50
movq %r14, %rdi
leaq 0x216b7(%rip), %rsi     # 0x7b10e
callq 0xa0e0
testl %eax, %eax
je 0x59b7a
movq %r14, %rdi
leaq 0x21744(%rip), %rsi     # 0x7b1b2
callq 0xa0e0
testl %eax, %eax
je 0x59bd7
movq %r14, %rdi
leaq 0x1c797(%rip), %rsi     # 0x7621c
callq 0xa0e0
testl %eax, %eax
je 0x59bca
movq %r14, %rdi
leaq 0x21740(%rip), %rsi     # 0x7b1dc
callq 0xa0e0
testl %eax, %eax
je 0x59bca
leaq 0x48(%rsp), %rdi
leaq 0x2172f(%rip), %rsi     # 0x7b1e4
movq %r14, %rdx
callq 0xdbef
leaq 0x48(%rsp), %rdi
leaq 0x217e1(%rip), %rsi     # 0x7b2aa
callq 0xa560
leaq 0x18(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x59c4a
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x59c50
movq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0x1e3f6
leaq 0x3f967(%rip), %rdi     # 0x99478
movq %r13, %rsi
callq 0x1e3f6
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x59b2d
callq 0xa2b0
incl %r15d
cmpl %ebp, %r15d
jl 0x59936
jmp 0x59cba
movb $0x1, 0x38(%rbx)
jmp 0x59b5e
movb $0x1, 0x3a(%rbx)
jmp 0x59b5e
movb $0x1, 0x39(%rbx)
jmp 0x59b5e
movb $0x0, 0x80(%rbx)
movb $0x1, 0x3b(%rbx)
movb $0x1, %r12b
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x59b19
callq 0xa2b0
jmp 0x59b19
incl %r15d
cmpl %ebp, %r15d
jl 0x59ba1
movl $0x25, %edx
movq 0x3f422(%rip), %rdi     # 0x98fb0
leaq 0x215f7(%rip), %rsi     # 0x7b18c
callq 0xa320
movb $0x1, 0x81(%rbx)
movb $0x0, 0x3b(%rbx)
movslq %r15d, %rax
movq 0x28(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
leaq 0x48(%rsp), %rdx
callq 0xa160
movq 0x38(%rsp), %rdi
jmp 0x59c25
movb $0x1, 0x80(%rbx)
movb $0x0, 0x3b(%rbx)
jmp 0x59b5b
incl %r15d
cmpl %ebp, %r15d
jl 0x59bfe
movl $0x25, %edx
movq 0x3f3c5(%rip), %rdi     # 0x98fb0
leaq 0x215c4(%rip), %rsi     # 0x7b1b6
callq 0xa320
movb $0x1, 0x81(%rbx)
movb $0x0, 0x3b(%rbx)
movslq %r15d, %rax
movq 0x28(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
leaq 0x48(%rsp), %rdx
callq 0xa160
movq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0xa370
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x59b5e
callq 0xa2b0
jmp 0x59b5e
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x3f337(%rip), %rdi     # 0x98fb0
callq 0xa320
movq %rax, %rdi
callq 0xa1a0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x59c9a
callq 0xa2b0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x59cae
callq 0xa2b0
movb $0x1, 0x81(%rbx)
jmp 0x59b5e
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x59cf1
jmp 0x59d07
jmp 0x59d07
jmp 0x59d07
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x59cf1
callq 0xa2b0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x59d0a
callq 0xa2b0
jmp 0x59d0a
movq %rax, %r14
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x59d30
callq 0xa2b0
jmp 0x59d30
jmp 0x59d2d
movq %rax, %r14
jmp 0x59d44
movq %rax, %r14
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x59d44
callq 0xa2b0
movq %rbx, %rdi
callq 0x59e2c
movq %r14, %rdi
callq 0xa510