// File: ticky[P]ps2iconsys/src/iconsys_builder.cpp
// Function: ParseCommandLine_1Arg(int, char**)
bool ParseCommandLine_1Arg(int i, char* argv[])
{
	//Parameters with 1 argument
	if( (strcmp( argv[i], "-f" ) == 0) || (strcmp( argv[i], "--input-file" ) == 0) ) {
		input_file = argv[++i];
	} else if( (strcmp( argv[i], "-o" ) == 0) || (strcmp( argv[i], "--output-file" ) == 0) ) {
		output_file = argv[++i];
	} else if(strcmp( argv[i], "--set-title" ) == 0) {
		title_string = new char[strlen(argv[i+1]) + 1];
		strcpy(title_string, argv[i+1]);
		i++;
	} else if(strcmp( argv[i], "--title-linebreak" ) == 0) {
		title_linebreak = atoi(argv[++i]);
	} else if(strcmp( argv[i], "--set-icon" ) == 0) {
		icon_string = new char[strlen(argv[i+1]) + 1];
		strcpy(icon_string, argv[i+1]);
		i++;
	} else if(strcmp( argv[i], "--set-copy-icon" ) == 0) {
		icon_copy_string = new char[strlen(argv[i+1]) + 1];
		strcpy(icon_copy_string, argv[i+1]);
		i++;
	} else if(strcmp( argv[i], "--set-delete-icon" ) == 0) {
		icon_delete_string = new char[strlen(argv[i+1]) + 1];
		strcpy(icon_delete_string, argv[i+1]);
		i++;
	} else if(strcmp( argv[i], "--set-opacity" ) == 0) {
		bg_opacity = atoi(argv[++i]);
	} else {
		return false;
	}
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x45ca(%rip), %rsi      # 0x1406c
callq 0x22c0
cmpl $0x0, %eax
je 0xfac9
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x45b0(%rip), %rsi      # 0x1406f
callq 0x22c0
cmpl $0x0, %eax
jne 0xfae9
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x8(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0xb7ac(%rip)      # 0x1b290
jmp 0xfd97
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x4580(%rip), %rsi      # 0x1407c
callq 0x22c0
cmpl $0x0, %eax
je 0xfb23
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x4566(%rip), %rsi      # 0x1407f
callq 0x22c0
cmpl $0x0, %eax
jne 0xfb43
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x8(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0xb75a(%rip)      # 0x1b298
jmp 0xfd95
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x4537(%rip), %rsi      # 0x1408d
callq 0x22c0
cmpl $0x0, %eax
jne 0xfbb4
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x20e0
movq %rax, %rdi
addq $0x1, %rdi
callq 0x2040
movq %rax, 0xb71f(%rip)      # 0x1b2a8
movq 0xb718(%rip), %rdi      # 0x1b2a8
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x21a0
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xfd93
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x44d2(%rip), %rsi      # 0x14099
callq 0x22c0
cmpl $0x0, %eax
jne 0xfbf5
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x8(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2320
movl %eax, 0xb638(%rip)      # 0x1b228
jmp 0xfd91
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x44a3(%rip), %rsi      # 0x140ab
callq 0x22c0
cmpl $0x0, %eax
jne 0xfc66
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x20e0
movq %rax, %rdi
addq $0x1, %rdi
callq 0x2040
movq %rax, 0xb675(%rip)      # 0x1b2b0
movq 0xb66e(%rip), %rdi      # 0x1b2b0
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x21a0
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xfd8f
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x443d(%rip), %rsi      # 0x140b6
callq 0x22c0
cmpl $0x0, %eax
jne 0xfcd7
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x20e0
movq %rax, %rdi
addq $0x1, %rdi
callq 0x2040
movq %rax, 0xb60c(%rip)      # 0x1b2b8
movq 0xb605(%rip), %rdi      # 0x1b2b8
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x21a0
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xfd8d
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x43dc(%rip), %rsi      # 0x140c6
callq 0x22c0
cmpl $0x0, %eax
jne 0xfd45
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x20e0
movq %rax, %rdi
addq $0x1, %rdi
callq 0x2040
movq %rax, 0xb5a3(%rip)      # 0x1b2c0
movq 0xb59c(%rip), %rdi      # 0x1b2c0
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x21a0
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xfd8b
movq -0x10(%rbp), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x4380(%rip), %rsi      # 0x140d8
callq 0x22c0
cmpl $0x0, %eax
jne 0xfd83
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x8(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2320
movl %eax, 0xb547(%rip)      # 0x1b2c8
jmp 0xfd89
movb $0x0, -0x1(%rbp)
jmp 0xfd9b
jmp 0xfd8b
jmp 0xfd8d
jmp 0xfd8f
jmp 0xfd91
jmp 0xfd93
jmp 0xfd95
jmp 0xfd97
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)