// File: /workspace/github_cpp_makefile_star2_O3/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 0x8c8a
movq %rsi, %rbx
movl %edi, %r14d
leal -0x1(%r14), %eax
movl %eax, 0x4(%rsp)
movl $0x1, %r13d
movslq %r13d, %r12
movq (%rbx,%r12,8), %rbp
movb (%rbp), %r15b
cmpb $0x2d, %r15b
jne 0x8a33
cmpb $0x68, 0x1(%rbp)
jne 0x89f4
cmpb $0x0, 0x2(%rbp)
je 0x8c99
movq %rbp, %rdi
leaq 0x2138(%rip), %rsi      # 0xab36
callq 0x2280
testl %eax, %eax
je 0x8c99
cmpb $0x6c, 0x1(%rbp)
jne 0x8a62
cmpb $0x0, 0x2(%rbp)
je 0x8b0a
movq %rbp, %rdi
leaq 0x2118(%rip), %rsi      # 0xab3d
callq 0x2280
testl %eax, %eax
jne 0x8a7f
jmp 0x8b0a
movq %rbp, %rdi
leaq 0x20f9(%rip), %rsi      # 0xab36
callq 0x2280
testl %eax, %eax
je 0x8c99
movq %rbp, %rdi
leaq 0x20e9(%rip), %rsi      # 0xab3d
callq 0x2280
testl %eax, %eax
jne 0x8a8f
jmp 0x8b0a
movq %rbp, %rdi
leaq 0x20d1(%rip), %rsi      # 0xab3d
callq 0x2280
testl %eax, %eax
je 0x8b0a
cmpb $0x2d, %r15b
jne 0x8a8f
cmpb $0x76, 0x1(%rbp)
jne 0x8a8f
cmpb $0x0, 0x2(%rbp)
je 0x8b16
movq %rbp, %rdi
leaq 0x20b4(%rip), %rsi      # 0xab4d
callq 0x2280
testl %eax, %eax
je 0x8b16
cmpl 0x4(%rsp), %r13d
jge 0x8ca8
cmpb $0x2d, %r15b
jne 0x8b22
cmpb $0x66, 0x1(%rbp)
jne 0x8ac3
cmpb $0x0, 0x2(%rbp)
je 0x8b85
movq %rbp, %rdi
leaq 0x208a(%rip), %rsi      # 0xab57
callq 0x2280
testl %eax, %eax
je 0x8b85
cmpb $0x74, 0x1(%rbp)
jne 0x8b99
cmpb $0x0, 0x2(%rbp)
je 0x8bf6
movq %rbp, %rdi
leaq 0x206c(%rip), %rsi      # 0xab64
callq 0x2280
testl %eax, %eax
jne 0x8bb2
jmp 0x8bf6
movb $0x1, 0x6770(%rip)      # 0xf281
jmp 0x8c7e
movb $0x1, 0x6763(%rip)      # 0xf280
jmp 0x8c7e
movq %rbp, %rdi
leaq 0x202b(%rip), %rsi      # 0xab57
callq 0x2280
testl %eax, %eax
je 0x8b85
movq %rbp, %rdi
leaq 0x2025(%rip), %rsi      # 0xab64
callq 0x2280
testl %eax, %eax
je 0x8bf6
movq %rbp, %rdi
leaq 0x201e(%rip), %rsi      # 0xab74
callq 0x2280
testl %eax, %eax
je 0x8c07
cmpb $0x2d, %r15b
je 0x8bd1
movq %rbp, %rdi
leaq 0x200f(%rip), %rsi      # 0xab82
callq 0x2280
testl %eax, %eax
jne 0x8c3d
jmp 0x8c6b
incl %r13d
movq 0x8(%rbx,%r12,8), %rax
movq %rax, 0x66cc(%rip)      # 0xf260
jmp 0x8c7e
movq %rbp, %rdi
leaq 0x1fc1(%rip), %rsi      # 0xab64
callq 0x2280
testl %eax, %eax
je 0x8bf6
cmpb $0x2d, %r15b
jne 0x8b4c
cmpb $0x6f, 0x1(%rbp)
jne 0x8bbe
cmpb $0x0, 0x2(%rbp)
je 0x8c07
movq %rbp, %rdi
leaq 0x1fac(%rip), %rsi      # 0xab74
callq 0x2280
testl %eax, %eax
je 0x8c07
cmpb $0x6d, 0x1(%rbp)
jne 0x8c18
cmpb $0x0, 0x2(%rbp)
je 0x8c6b
movq %rbp, %rdi
leaq 0x1f97(%rip), %rsi      # 0xab82
callq 0x2280
testl %eax, %eax
jne 0x8c31
jmp 0x8c6b
incl %r13d
movq 0x8(%rbx,%r12,8), %rax
movq %rax, 0x6673(%rip)      # 0xf278
jmp 0x8c7e
incl %r13d
movq 0x8(%rbx,%r12,8), %rax
movq %rax, 0x665a(%rip)      # 0xf270
jmp 0x8c7e
movq %rbp, %rdi
leaq 0x1f60(%rip), %rsi      # 0xab82
callq 0x2280
testl %eax, %eax
je 0x8c6b
cmpb $0x2d, %r15b
jne 0x8c3d
cmpb $0x73, 0x1(%rbp)
jne 0x8c3d
cmpb $0x0, 0x2(%rbp)
je 0x8c50
movq %rbp, %rdi
leaq 0x1f48(%rip), %rsi      # 0xab8f
callq 0x2280
testl %eax, %eax
jne 0x8ca8
incl %r13d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2220
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x661b(%rip)     # 0xf284
jmp 0x8c7e
incl %r13d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x22d0
movl %eax, 0x65ea(%rip)      # 0xf268
incl %r13d
cmpl %r14d, %r13d
jl 0x89d3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rdi
callq 0x8454
xorl %edi, %edi
callq 0x2210
movq 0x6329(%rip), %rdi      # 0xefd8
leaq 0x1ee8(%rip), %rsi      # 0xab9e
callq 0x21b0
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x20d0
movq (%rbx), %rdi
callq 0x8454
movl $0x1, %edi
callq 0x2210