// File: /workspace/github_c_makefile_star2_O2/sguerrini97[P]ps3linux-ps3vuart-tools/ps3dm/ps3dm.c
// Function: main
int
main(int argc, char **argv)
{
	int ret;

	ret = parse_opts(argc, argv, &opts);
	if (ret)
		exit(255);

	if (opts.do_help)
		usage();
	else if (opts.do_version)
		version();

	ret = dev_open(opts.device);
	if (ret) {
		perror("open device");
		exit(254);
	}

	ret = cmd_exec(sizeof(cmdv) / sizeof(cmdv[0]), cmdv,
	    argc - optind, &argv[optind]);
	switch (ret) {
	case CMD_EOK:
	break;
	case CMD_EBADCMD:
		fprintf(stderr, "invalid command specified\n");
	break;
	case CMD_EINVAL:
		fprintf(stderr, "invalid command argument(s) specified\n");
	break;
	case CMD_EIO:
		fprintf(stderr, "device error\n");
	break;
	case CMD_EUNKNOWN:
		fprintf(stderr, "unknown command error\n");
	break;
	}

	dev_close();

	exit(ret);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
leaq 0x1e15(%rip), %r15      # 0x4088
leaq 0x4ed6(%rip), %r12      # 0x7150
movq 0x4d57(%rip), %rbp      # 0x6fd8
movq %rsp, %r13
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x2060
cmpl $0x64, %eax
je 0x22b3
cmpl $0x6c, %eax
je 0x22ee
cmpl $0x70, %eax
je 0x22c0
cmpl $0x76, %eax
jne 0x231b
incl 0x4e17(%rip)            # 0x70c8
jmp 0x2284
movq (%rbp), %rax
movq %rax, 0x4e12(%rip)      # 0x70d0
jmp 0x2284
movq (%rbp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x20b0
movq %rax, 0x4e13(%rip)      # 0x70e8
movq (%rsp), %rax
cmpb $0x0, (%rax)
jne 0x2373
movl $0x1, 0x4e04(%rip)      # 0x70f0
jmp 0x2284
movq (%rbp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x20b0
movq %rax, 0x4dd5(%rip)      # 0x70d8
movq (%rsp), %rax
cmpb $0x0, (%rax)
jne 0x2386
movl $0x1, 0x4dca(%rip)      # 0x70e0
jmp 0x2284
cmpl $-0x1, %eax
je 0x2353
cmpl $0x68, %eax
je 0x23ac
cmpl $0x56, %eax
je 0x23bb
cmpl $0x3f, %eax
je 0x23ac
movq 0x4cba(%rip), %rcx      # 0x6ff8
movq (%rcx), %rdi
leaq 0x1d7a(%rip), %rsi      # 0x40c2
movl %eax, %edx
xorl %eax, %eax
callq 0x20d0
jmp 0x23a2
movq 0x4c76(%rip), %rax      # 0x6fd0
cmpl %ebx, (%rax)
jl 0x23c5
movq 0x4c93(%rip), %rax      # 0x6ff8
movq (%rax), %rcx
leaq 0x1d71(%rip), %rdi      # 0x40e0
pushq $0x15
jmp 0x2399
movq 0x4c7e(%rip), %rax      # 0x6ff8
movq (%rax), %rcx
leaq 0x1d26(%rip), %rdi      # 0x40aa
jmp 0x2397
movq 0x4c6b(%rip), %rax      # 0x6ff8
movq (%rax), %rcx
leaq 0x1cfb(%rip), %rdi      # 0x4092
pushq $0x17
popq %rsi
pushq $0x1
popq %rdx
callq 0x2130
movl $0xff, %edi
callq 0x2120
movl $0x1, 0x4d0a(%rip)      # 0x70c0
jmp 0x244a
movl $0x1, 0x4cff(%rip)      # 0x70c4
cmpl $0x0, 0x4cf4(%rip)      # 0x70c0
jne 0x244a
cmpl $0x0, 0x4cef(%rip)      # 0x70c4
jne 0x244a
movq 0x4cf2(%rip), %rdi      # 0x70d0
callq 0x2468
testl %eax, %eax
jne 0x2451
movq 0x4be2(%rip), %rax      # 0x6fd0
movslq (%rax), %rax
subl %eax, %ebx
leaq (%r14,%rax,8), %rcx
leaq 0x4d02(%rip), %rsi      # 0x7100
pushq $0x9
popq %rdi
movl %ebx, %edx
callq 0x3766
movl %eax, %ebx
decl %eax
cmpl $0x3, %eax
ja 0x243e
movl %eax, %eax
leaq 0x1cf6(%rip), %rcx      # 0x4110
movq (%rcx,%rax,8), %rsi
leaq 0x1d0b(%rip), %rcx      # 0x4130
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
movq 0x4bc5(%rip), %rax      # 0x6ff8
movq (%rax), %rcx
pushq $0x1
popq %rdx
callq 0x2130
callq 0x2493
movl %ebx, %edi
callq 0x2120
xorl %edi, %edi
callq 0x2120
leaq 0x1bbd(%rip), %rdi      # 0x4015
callq 0x2100
movl $0xfe, %edi
callq 0x2120
nop