// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rsi, %rbx
movl %edi, %r14d
leal -0x1(%r14), %eax
movl %eax, 0x4(%rsp)
pushq $0x1
popq %r13
cmpl %r14d, %r13d
jge 0x7c4d
movslq %r13d, %r12
movq (%rbx,%r12,8), %rbp
movb (%rbp), %r15b
cmpb $0x2d, %r15b
jne 0x7a79
cmpb $0x68, 0x1(%rbp)
jne 0x7a79
cmpb $0x0, 0x2(%rbp)
je 0x7c5c
movq %rbp, %rdi
leaq 0x20b3(%rip), %rsi      # 0x9b36
callq 0x2260
testl %eax, %eax
je 0x7c5c
cmpb $0x2d, %r15b
jne 0x7aa6
cmpb $0x6c, 0x1(%rbp)
jne 0x7aa6
cmpb $0x0, 0x2(%rbp)
je 0x7bed
movq %rbp, %rdi
leaq 0x208d(%rip), %rsi      # 0x9b3d
callq 0x2260
testl %eax, %eax
je 0x7bed
cmpb $0x2d, %r15b
jne 0x7ad3
cmpb $0x76, 0x1(%rbp)
jne 0x7ad3
cmpb $0x0, 0x2(%rbp)
je 0x7bf6
movq %rbp, %rdi
leaq 0x2070(%rip), %rsi      # 0x9b4d
callq 0x2260
testl %eax, %eax
je 0x7bf6
cmpl 0x4(%rsp), %r13d
jge 0x7c6b
cmpb $0x2d, %r15b
jne 0x7b0b
cmpb $0x66, 0x1(%rbp)
jne 0x7b0b
cmpb $0x0, 0x2(%rbp)
je 0x7bff
movq %rbp, %rdi
leaq 0x2042(%rip), %rsi      # 0x9b57
callq 0x2260
testl %eax, %eax
je 0x7bff
cmpb $0x2d, %r15b
jne 0x7b38
cmpb $0x74, 0x1(%rbp)
jne 0x7b38
cmpb $0x0, 0x2(%rbp)
je 0x7c10
movq %rbp, %rdi
leaq 0x2022(%rip), %rsi      # 0x9b64
callq 0x2260
testl %eax, %eax
je 0x7c10
cmpb $0x2d, %r15b
jne 0x7b65
cmpb $0x6f, 0x1(%rbp)
jne 0x7b65
cmpb $0x0, 0x2(%rbp)
je 0x7c21
movq %rbp, %rdi
leaq 0x2005(%rip), %rsi      # 0x9b74
callq 0x2260
testl %eax, %eax
je 0x7c21
cmpb $0x2d, %r15b
jne 0x7b92
cmpb $0x6d, 0x1(%rbp)
jne 0x7b92
cmpb $0x0, 0x2(%rbp)
je 0x7c32
movq %rbp, %rdi
leaq 0x1fe6(%rip), %rsi      # 0x9b82
callq 0x2260
testl %eax, %eax
je 0x7c32
cmpb $0x2d, %r15b
jne 0x7bbb
cmpb $0x73, 0x1(%rbp)
jne 0x7bbb
cmpb $0x0, 0x2(%rbp)
je 0x7bd2
movq %rbp, %rdi
leaq 0x1fca(%rip), %rsi      # 0x9b8f
callq 0x2260
testl %eax, %eax
jne 0x7c6b
incl %r13d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2200
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x7679(%rip)     # 0xf264
jmp 0x7c45
movb $0x1, 0x766d(%rip)      # 0xf261
jmp 0x7c45
movb $0x1, 0x7663(%rip)      # 0xf260
jmp 0x7c45
incl %r13d
movq 0x8(%rbx,%r12,8), %rax
movq %rax, 0x7632(%rip)      # 0xf240
jmp 0x7c45
incl %r13d
movq 0x8(%rbx,%r12,8), %rax
movq %rax, 0x7639(%rip)      # 0xf258
jmp 0x7c45
incl %r13d
movq 0x8(%rbx,%r12,8), %rax
movq %rax, 0x7620(%rip)      # 0xf250
jmp 0x7c45
incl %r13d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x22b0
movl %eax, 0x7603(%rip)      # 0xf248
incl %r13d
jmp 0x7a4f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rdi
callq 0x7708
xorl %edi, %edi
callq 0x21f0
movq 0x7366(%rip), %rdi      # 0xefd8
leaq 0x1f25(%rip), %rsi      # 0x9b9e
callq 0x2190
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x20d0
movq (%rbx), %rdi
callq 0x7708
pushq $0x1
popq %rdi
callq 0x21f0