// File: /workspace/github_cpp_makefile_star2_O3/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, 0x8(%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 0x5a9d4
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 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %r13, %rdi
leaq 0x88(%rsp), %rdx
callq 0xa160
testb $0x1, %r12b
je 0x5a678
movb $0x1, %r12b
leaq 0x3fe0d(%rip), %rdi     # 0x9a478
movq %r13, %rsi
callq 0x1e768
jmp 0x5a838
cmpq $0x2, 0x70(%rsp)
jb 0x5a819
movq 0x68(%rsp), %rax
cmpb $0x2d, (%rax)
jne 0x5a819
movl $0x1, %edx
leaq 0x88(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
movq $-0x1, %rcx
callq 0xa2f0
leaq 0x20(%rsp), %r12
movq %r14, %rdi
leaq 0x2060d(%rip), %rsi     # 0x7accd
callq 0xa0e0
testl %eax, %eax
je 0x5a85d
movq %r14, %rdi
leaq 0x21a5e(%rip), %rsi     # 0x7c135
callq 0xa0e0
testl %eax, %eax
je 0x5a85d
movq %r14, %rdi
leaq 0x1d4a9(%rip), %rsi     # 0x77b97
callq 0xa0e0
testl %eax, %eax
je 0x5a863
movq %r14, %rdi
leaq 0x21a36(%rip), %rsi     # 0x7c13b
callq 0xa0e0
testl %eax, %eax
je 0x5a863
movq %r14, %rdi
leaq 0x2034e(%rip), %rsi     # 0x7aa6a
callq 0xa0e0
testl %eax, %eax
je 0x5a869
movq %r14, %rdi
leaq 0x21a10(%rip), %rsi     # 0x7c143
callq 0xa0e0
testl %eax, %eax
je 0x5a869
movq %r14, %rdi
leaq 0x1d6a4(%rip), %rsi     # 0x77dee
callq 0xa0e0
testl %eax, %eax
je 0x5a88c
movq %r14, %rdi
leaq 0x219e7(%rip), %rsi     # 0x7c148
callq 0xa0e0
testl %eax, %eax
je 0x5a88c
movq %r14, %rdi
leaq 0x21956(%rip), %rsi     # 0x7c0ce
callq 0xa0e0
testl %eax, %eax
je 0x5a89c
movq %r14, %rdi
leaq 0x219e3(%rip), %rsi     # 0x7c172
callq 0xa0e0
testl %eax, %eax
je 0x5a8f9
movq %r14, %rdi
leaq 0x1ca76(%rip), %rsi     # 0x7721c
callq 0xa0e0
testl %eax, %eax
je 0x5a8ec
movq %r14, %rdi
leaq 0x219df(%rip), %rsi     # 0x7c19c
callq 0xa0e0
testl %eax, %eax
je 0x5a8ec
leaq 0x48(%rsp), %rdi
leaq 0x219ce(%rip), %rsi     # 0x7c1a4
movq %r14, %rdx
callq 0xdc11
leaq 0x48(%rsp), %rdi
leaq 0x21a80(%rip), %rsi     # 0x7c26a
callq 0xa560
movq %r12, 0x10(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5a967
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x5a96f
movq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0x1e768
leaq 0x3fc4b(%rip), %rdi     # 0x9a478
movq %r13, %rsi
callq 0x1e768
xorl %r12d, %r12d
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x5a84c
callq 0xa2b0
incl %r15d
cmpl %ebp, %r15d
jl 0x5a63f
jmp 0x5a9d4
movb $0x1, 0x38(%rbx)
jmp 0x5a86d
movb $0x1, 0x3a(%rbx)
jmp 0x5a86d
movb $0x1, 0x39(%rbx)
xorl %r12d, %r12d
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x5a838
callq 0xa2b0
jmp 0x5a838
movb $0x0, 0x80(%rbx)
movb $0x1, 0x3b(%rbx)
movb $0x1, %r12b
jmp 0x5a870
incl %r15d
cmpl %ebp, %r15d
jl 0x5a8c3
movl $0x25, %edx
movq 0x3f700(%rip), %rdi     # 0x99fb0
leaq 0x21895(%rip), %rsi     # 0x7c14c
callq 0xa320
movb $0x1, 0x81(%rbx)
movb $0x0, 0x3b(%rbx)
movslq %r15d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdi
leaq 0x48(%rsp), %rdx
callq 0xa160
movq 0x38(%rsp), %rdi
jmp 0x5a947
movb $0x1, 0x80(%rbx)
movb $0x0, 0x3b(%rbx)
jmp 0x5a897
incl %r15d
cmpl %ebp, %r15d
jl 0x5a920
movl $0x25, %edx
movq 0x3f6a3(%rip), %rdi     # 0x99fb0
leaq 0x21862(%rip), %rsi     # 0x7c176
callq 0xa320
movb $0x1, 0x81(%rbx)
movb $0x0, 0x3b(%rbx)
movslq %r15d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdi
leaq 0x48(%rsp), %rdx
callq 0xa160
movq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0xa370
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x5a86d
callq 0xa2b0
jmp 0x5a86d
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x3f618(%rip), %rdi     # 0x99fb0
callq 0xa320
movq %rax, %rdi
callq 0xa1a0
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x5a9b4
callq 0xa2b0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x5a9c8
callq 0xa2b0
movb $0x1, 0x81(%rbx)
jmp 0x5a86d
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x5aa06
jmp 0x5aa1c
jmp 0x5aa1c
jmp 0x5aa1c
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x5aa06
callq 0xa2b0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x5aa1f
callq 0xa2b0
jmp 0x5aa1f
movq %rax, %r14
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x5aa45
callq 0xa2b0
jmp 0x5aa45
jmp 0x5aa42
movq %rax, %r14
jmp 0x5aa59
movq %rax, %r14
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x5aa59
callq 0xa2b0
movq %rbx, %rdi
callq 0x5ab42
movq %r14, %rdi
callq 0xa510