// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/obj_to_ps2icon.cpp
// Function: ParseCommandLine(int, char**)
void ParseCommandLine(int argc, char* argv[])
{
	for(int i=1; i<argc; i++) {
		//Flag parameters:
		if( (strcmp( argv[i], "-h" ) == 0) || (strcmp( argv[i], "--help" ) == 0) ) {
			PrintHelp(argv[0]);
			exit(0);
		} else if( (strcmp( argv[i], "-l" ) == 0) || (strcmp( argv[i], "--list-obj-file" ) == 0) ) {
			list_obj_file = true;
		} else if( (strcmp( argv[i], "-v" ) == 0) || (strcmp( argv[i], "--verbose" ) == 0) ) {
			verbose_output = true;
		} else if(i < argc-1) {
		//Parameters with 1 argument
			if( (strcmp( argv[i], "-f" ) == 0) || (strcmp( argv[i], "--input-file" ) == 0) ) {
				obj_input_file = argv[++i];
			} else if( (strcmp( argv[i], "-t" ) == 0) || (strcmp( argv[i], "--input-texture" ) == 0) ) {
				texture_input_file = argv[++i];
			} else if( (strcmp( argv[i], "-o" ) == 0) || (strcmp( argv[i], "--output-file" ) == 0) ) {
				ps2_output_file = argv[++i];
			} else if( (strcmp( argv[i], "-m" ) == 0) || (strcmp( argv[i], "--mesh-index" ) == 0) ) {
				obj_mesh_index = atoi(argv[++i]);
			} else if( (strcmp( argv[i], "-s" ) == 0) || (strcmp( argv[i], "--scale-factor" ) == 0) ) {
				obj_scale_factor = static_cast<float>(atof(argv[++i]));
			} else {
				std::cout << "Invalid argument." << std::endl << std::endl;
				PrintHelp(argv[0]);
				exit(1);
			}
		} else {
			std::cout << "Invalid argument." << std::endl << std::endl;
			PrintHelp(argv[0]);
			exit(1);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jl 0x8e9b
movq %rsi, %rbx
movl %edi, %r14d
leal -0x1(%r14), %eax
movl %eax, 0x4(%rsp)
movl $0x1, %r15d
leaq 0x1e03(%rip), %r13      # 0xaaa5
movslq %r15d, %r12
movq (%rbx,%r12,8), %rbp
movq %rbp, %rdi
leaq 0x1e33(%rip), %rsi      # 0xaae6
callq 0x2280
testl %eax, %eax
je 0x8eaa
movq %rbp, %rdi
leaq 0x1e1f(%rip), %rsi      # 0xaae9
callq 0x2280
testl %eax, %eax
je 0x8eaa
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2280
testl %eax, %eax
je 0x8e37
movq %rbp, %rdi
leaq 0x1dfc(%rip), %rsi      # 0xaaf0
callq 0x2280
testl %eax, %eax
je 0x8e37
movq %rbp, %rdi
leaq 0x1df5(%rip), %rsi      # 0xab00
callq 0x2280
testl %eax, %eax
je 0x8e40
movq %rbp, %rdi
leaq 0x1de1(%rip), %rsi      # 0xab03
callq 0x2280
testl %eax, %eax
je 0x8e40
cmpl 0x4(%rsp), %r15d
jge 0x8eb9
movq %rbp, %rdi
leaq 0x1dc9(%rip), %rsi      # 0xab0d
callq 0x2280
testl %eax, %eax
je 0x8e49
movq %rbp, %rdi
leaq 0x1db5(%rip), %rsi      # 0xab10
callq 0x2280
testl %eax, %eax
je 0x8e49
movq %rbp, %rdi
leaq 0x1dab(%rip), %rsi      # 0xab1d
callq 0x2280
testl %eax, %eax
je 0x8e5a
movq %rbp, %rdi
leaq 0x1d97(%rip), %rsi      # 0xab20
callq 0x2280
testl %eax, %eax
je 0x8e5a
movq %rbp, %rdi
leaq 0x1d90(%rip), %rsi      # 0xab30
callq 0x2280
testl %eax, %eax
je 0x8e6b
movq %rbp, %rdi
leaq 0x1d7c(%rip), %rsi      # 0xab33
callq 0x2280
testl %eax, %eax
je 0x8e6b
movq %rbp, %rdi
leaq 0x1d73(%rip), %rsi      # 0xab41
callq 0x2280
testl %eax, %eax
je 0x8e7c
movq %rbp, %rdi
leaq 0x1d5f(%rip), %rsi      # 0xab44
callq 0x2280
testl %eax, %eax
je 0x8e7c
movq %rbp, %rdi
leaq 0x1d55(%rip), %rsi      # 0xab51
callq 0x2280
testl %eax, %eax
je 0x8e1c
movq %rbp, %rdi
leaq 0x1d45(%rip), %rsi      # 0xab54
callq 0x2280
testl %eax, %eax
jne 0x8eb9
incl %r15d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2220
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x644f(%rip)     # 0xf284
jmp 0x8e8f
movb $0x1, 0x6443(%rip)      # 0xf281
jmp 0x8e8f
movb $0x1, 0x6439(%rip)      # 0xf280
jmp 0x8e8f
incl %r15d
movq 0x8(%rbx,%r12,8), %rax
movq %rax, 0x6408(%rip)      # 0xf260
jmp 0x8e8f
incl %r15d
movq 0x8(%rbx,%r12,8), %rax
movq %rax, 0x640f(%rip)      # 0xf278
jmp 0x8e8f
incl %r15d
movq 0x8(%rbx,%r12,8), %rax
movq %rax, 0x63f6(%rip)      # 0xf270
jmp 0x8e8f
incl %r15d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x22d0
movl %eax, 0x63d9(%rip)      # 0xf268
incl %r15d
cmpl %r14d, %r15d
jl 0x8ca2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rdi
callq 0x871c
xorl %edi, %edi
callq 0x2210
movq 0x6118(%rip), %rdi      # 0xefd8
leaq 0x1c9c(%rip), %rsi      # 0xab63
callq 0x21b0
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x20d0
movq (%rbx), %rdi
callq 0x871c
movl $0x1, %edi
callq 0x2210