// File: /workspace/github_c_makefile_star2_O3/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 0x1ba5(%rip), %r15      # 0x4088
leaq 0x4c66(%rip), %r12      # 0x7150
movq 0x4ae7(%rip), %rbp      # 0x6fd8
movq %rsp, %r13
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x2060
cmpl $0x6b, %eax
jg 0x252b
cmpl $0x63, %eax
jle 0x259d
cmpl $0x64, %eax
jne 0x26ae
movq (%rbp), %rax
movq %rax, 0x4ba7(%rip)      # 0x70d0
jmp 0x24f4
cmpl $0x6c, %eax
je 0x2546
cmpl $0x70, %eax
je 0x2570
cmpl $0x76, %eax
jne 0x26b3
incl 0x4b84(%rip)            # 0x70c8
jmp 0x24f4
movq (%rbp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x20b0
movq %rax, 0x4b7d(%rip)      # 0x70d8
movq (%rsp), %rax
cmpb $0x0, (%rax)
jne 0x25c5
movl $0x1, 0x4b72(%rip)      # 0x70e0
jmp 0x24f4
movq (%rbp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x20b0
movq %rax, 0x4b63(%rip)      # 0x70e8
movq (%rsp), %rax
cmpb $0x0, (%rax)
jne 0x25d8
movl $0x1, 0x4b58(%rip)      # 0x70f0
jmp 0x24f4
cmpl $-0x1, %eax
jne 0x25fd
movq 0x4a27(%rip), %rax      # 0x6fd0
cmpl %ebx, (%rax)
jl 0x2619
movq 0x4a44(%rip), %rax      # 0x6ff8
movq (%rax), %rcx
leaq 0x1b22(%rip), %rdi      # 0x40e0
movl $0x15, %esi
jmp 0x25ee
movq 0x4a2c(%rip), %rax      # 0x6ff8
movq (%rax), %rcx
leaq 0x1abc(%rip), %rdi      # 0x4092
jmp 0x25e9
movq 0x4a19(%rip), %rax      # 0x6ff8
movq (%rax), %rcx
leaq 0x1ac1(%rip), %rdi      # 0x40aa
movl $0x17, %esi
movl $0x1, %edx
callq 0x2130
jmp 0x26cd
cmpl $0x3f, %eax
je 0x26d7
cmpl $0x56, %eax
jne 0x26b3
movl $0x1, 0x4aab(%rip)      # 0x70c4
cmpl $0x0, 0x4aa0(%rip)      # 0x70c0
jne 0x26e1
cmpl $0x0, 0x4a97(%rip)      # 0x70c4
jne 0x26e1
movq 0x4a96(%rip), %rdi      # 0x70d0
callq 0x2700
testl %eax, %eax
jne 0x26e8
movq 0x4982(%rip), %rax      # 0x6fd0
movslq (%rax), %rax
subl %eax, %ebx
leaq (%r14,%rax,8), %rcx
leaq 0x4aa2(%rip), %rsi      # 0x7100
movl $0x9, %edi
movl %ebx, %edx
callq 0x396c
movl %eax, %ebx
decl %eax
cmpl $0x3, %eax
ja 0x26a2
movl %eax, %eax
leaq 0x1a94(%rip), %rcx      # 0x4110
movq (%rcx,%rax,8), %rsi
leaq 0x1aa9(%rip), %rcx      # 0x4130
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
movq 0x4963(%rip), %rax      # 0x6ff8
movq (%rax), %rcx
movl $0x1, %edx
callq 0x2130
callq 0x272d
movl %ebx, %edi
callq 0x2120
cmpl $0x68, %eax
je 0x26d7
movq 0x493e(%rip), %rcx      # 0x6ff8
movq (%rcx), %rdi
leaq 0x19fe(%rip), %rsi      # 0x40c2
movl %eax, %edx
xorl %eax, %eax
callq 0x20d0
movl $0xff, %edi
callq 0x2120
movl $0x1, 0x49df(%rip)      # 0x70c0
xorl %edi, %edi
callq 0x2120
leaq 0x1926(%rip), %rdi      # 0x4015
callq 0x2100
movl $0xfe, %edi
callq 0x2120
nop