// File: /workspace/github_c_makefile_star2_O0/sguerrini97[P]ps3linux-ps3vuart-tools/ps3dm/ps3dm.c
// Function: parse_opts
static int
parse_opts(int argc, char **argv, struct opts *opts)
{
	int c;
	char *endptr;

	while ((c = getopt_long(argc, argv, "hVvd:l:p:", long_opts, NULL)) != -1) {
		switch (c) {
		case 'h':
		case '?':
			opts->do_help = 1;
			return (0);
		break;
		case 'V':
			opts->do_version = 1;
			return (0);
		break;
		case 'v':
			opts->do_verbose++;
		break;
		case 'd':
			opts->device = optarg;
		break;
		case 'l':
			opts->laid = strtoull(optarg, &endptr, 0);
			if (*endptr != '\0') {
				fprintf(stderr, "invalid LAID specified\n");
				return (-1);
			}

			opts->laid_valid = 1;
		break;
		case 'p':
			opts->paid = strtoull(optarg, &endptr, 0);
			if (*endptr != '\0') {
				fprintf(stderr, "invalid PAID specified\n");
				return (-1);
			}

			opts->paid_valid = 1;
		break;
		default:
			fprintf(stderr, "invalid option specified: %c\n", c);
			return (-1);
		break;
		}
	}

	if (optind >= argc) {
		fprintf(stderr, "no command specified\n");
		return (-1);
	}

	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x3dbb(%rip), %rdx      # 0x617c
leaq 0x6d88(%rip), %rcx      # 0x9150
xorl %eax, %eax
movl %eax, %r8d
callq 0x2060
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
je 0x253d
movl -0x1c(%rbp), %eax
addl $-0x3f, %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x37, %eax
ja 0x2514
movq -0x30(%rbp), %rax
leaq 0x3c1a(%rip), %rcx      # 0x6018
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x2573
movq -0x18(%rbp), %rax
movl $0x1, 0x4(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x2573
movq -0x18(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x2538
movq 0x6b8b(%rip), %rax      # 0x8fd8
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x2538
movq 0x6b74(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0x20a0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x24ad
movq 0x6b68(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x3cec(%rip), %rsi      # 0x6186
movb $0x0, %al
callq 0x20c0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2573
movq -0x18(%rbp), %rax
movl $0x1, 0x20(%rax)
jmp 0x2538
movq 0x6b17(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
leaq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0x20a0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x2507
movq 0x6b0b(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x3ca7(%rip), %rsi      # 0x619e
movb $0x0, %al
callq 0x20c0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2573
movq -0x18(%rbp), %rax
movl $0x1, 0x30(%rax)
jmp 0x2538
movq 0x6add(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
movl -0x1c(%rbp), %edx
leaq 0x3c8e(%rip), %rsi      # 0x61b6
movb $0x0, %al
callq 0x20c0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2573
jmp 0x23b3
movq 0x6a8c(%rip), %rax      # 0x8fd0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jl 0x256c
movq 0x6aa6(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x3c78(%rip), %rsi      # 0x61d4
movb $0x0, %al
callq 0x20c0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2573
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)