// File: /workspace/github_c_makefile_star2_O0/sguerrini97[P]ps3linux-ps3vuart-tools/ps3dm/sm/cmd_sm_set_del_encdec_key.c
// Function: cmd_sm_set_del_encdec_key_exec
int
cmd_sm_set_del_encdec_key_exec(int cmdc, struct cmd **cmdv, int argc, char **argv)
{
	struct ps3dm_sm_set_del_encdec_key set_del_encdec_key;
	uint64_t arg, laid, paid;
	char *endptr;
	int ret;

	arg = strtoull(argv[0], &endptr, 0);
	if (*endptr != '\0')
		return (CMD_EINVAL);

	laid = opts.laid_valid ? opts.laid : 0x1070000002000001ull;
	paid = opts.paid_valid ? opts.paid : 0x10700003ff000001ull;

	ps3dm_init_header(&set_del_encdec_key.dm_hdr, 1, PS3DM_FID_SM,
	    sizeof(set_del_encdec_key) - sizeof(struct ps3dm_header),
	    sizeof(set_del_encdec_key) - sizeof(struct ps3dm_header));
	ps3dm_init_ss_header(&set_del_encdec_key.ss_hdr, PS3DM_PID_SM_SET_DEL_ENCDEC_KEY,
	    laid, paid);
	set_del_encdec_key.arg = arg;

	ret = dev_write(&set_del_encdec_key, sizeof(set_del_encdec_key));
	if (ret != sizeof(set_del_encdec_key))
		return (CMD_EIO);

	ret = dev_read(&set_del_encdec_key, sizeof(set_del_encdec_key));
	if (ret != sizeof(set_del_encdec_key))
		return (CMD_EIO);

	if (opts.do_verbose > 0)
		fprintf(stderr, "ss status %d\n", set_del_encdec_key.ss_hdr.status);

	if (set_del_encdec_key.ss_hdr.status)
		return (CMD_EIO);

	return (CMD_EOK);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq -0x80(%rbp), %rsi
xorl %edx, %edx
callq 0x20a0
movq %rax, -0x68(%rbp)
movq -0x80(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x2ea7
movl $0x2, -0x4(%rbp)
jmp 0x2ff5
leaq 0x6212(%rip), %rax      # 0x90c0
cmpl $0x0, 0x20(%rax)
je 0x2ec8
leaq 0x6205(%rip), %rax      # 0x90c0
movq 0x18(%rax), %rax
movq %rax, -0x90(%rbp)
jmp 0x2edb
movabsq $0x1070000002000001, %rax # imm = 0x1070000002000001
movq %rax, -0x90(%rbp)
jmp 0x2edb
movq -0x90(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq 0x61d3(%rip), %rax      # 0x90c0
cmpl $0x0, 0x30(%rax)
je 0x2f07
leaq 0x61c6(%rip), %rax      # 0x90c0
movq 0x28(%rax), %rax
movq %rax, -0x98(%rbp)
jmp 0x2f1a
movabsq $0x10700003ff000001, %rax # imm = 0x10700003FF000001
movq %rax, -0x98(%rbp)
jmp 0x2f1a
movq -0x98(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x60(%rbp), %rdi
movl $0x1, %esi
movl $0x5000, %edx           # imm = 0x5000
movl $0x30, %r8d
movl %r8d, %ecx
callq 0x3010
leaq -0x60(%rbp), %rdi
addq $0x10, %rdi
movq -0x70(%rbp), %rdx
movq -0x78(%rbp), %rcx
movl $0x5002, %esi           # imm = 0x5002
callq 0x3050
movq -0x68(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0x60(%rbp), %rdi
movl $0x40, %esi
callq 0x2620
movl %eax, -0x84(%rbp)
movslq -0x84(%rbp), %rax
cmpq $0x40, %rax
je 0x2f8d
movl $0x3, -0x4(%rbp)
jmp 0x2ff5
leaq -0x60(%rbp), %rdi
movl $0x40, %esi
callq 0x2670
movl %eax, -0x84(%rbp)
movslq -0x84(%rbp), %rax
cmpq $0x40, %rax
je 0x2fb7
movl $0x3, -0x4(%rbp)
jmp 0x2ff5
leaq 0x6102(%rip), %rax      # 0x90c0
cmpl $0x0, 0x8(%rax)
jle 0x2fdf
movq 0x602d(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
movl -0x40(%rbp), %edx
leaq 0x324c(%rip), %rsi      # 0x6224
movb $0x0, %al
callq 0x20c0
cmpl $0x0, -0x40(%rbp)
je 0x2fee
movl $0x3, -0x4(%rbp)
jmp 0x2ff5
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)