// File: /workspace/github_c_makefile_star2_O0/sguerrini97[P]ps3linux-ps3vuart-tools/ps3dm/iim/cmd_iim_get_data_size.c
// Function: cmd_iim_get_data_size_exec
int
cmd_iim_get_data_size_exec(int cmdc, struct cmd **cmdv, int argc, char **argv)
{
	struct ps3dm_iim_get_data_size get_data_size;
	uint64_t index;
	char *endptr;
	uint64_t laid, paid;
	int len;
	int ret;

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

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

	ps3dm_init_header(&get_data_size.dm_hdr, 1, PS3DM_FID_IIM,
	    sizeof(get_data_size) - sizeof(struct ps3dm_header),
	    sizeof(get_data_size) - sizeof(struct ps3dm_header));
	ps3dm_init_ss_header(&get_data_size.ss_hdr, PS3DM_PID_IIM_GET_DATA_SIZE,
	    laid, paid);
	get_data_size.index = index;

	len = sizeof(struct ps3dm_iim_get_data_size);

	ret = dev_write(&get_data_size, len);
	if (ret != len)
		return (CMD_EIO);

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

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

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

	fprintf(stdout, "%llx\n", get_data_size.size);

	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 -0x78(%rbp), %rsi
xorl %edx, %edx
callq 0x20a0
movq %rax, -0x70(%rbp)
movq -0x78(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x43c7
movl $0x2, -0x4(%rbp)
jmp 0x4547
leaq 0x4cf2(%rip), %rax      # 0x90c0
cmpl $0x0, 0x20(%rax)
je 0x43e8
leaq 0x4ce5(%rip), %rax      # 0x90c0
movq 0x18(%rax), %rax
movq %rax, -0x98(%rbp)
jmp 0x43fb
movabsq $0x1070000002000001, %rax # imm = 0x1070000002000001
movq %rax, -0x98(%rbp)
jmp 0x43fb
movq -0x98(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq 0x4cb3(%rip), %rax      # 0x90c0
cmpl $0x0, 0x30(%rax)
je 0x4427
leaq 0x4ca6(%rip), %rax      # 0x90c0
movq 0x28(%rax), %rax
movq %rax, -0xa0(%rbp)
jmp 0x443a
movabsq $0x1070000300000001, %rax # imm = 0x1070000300000001
movq %rax, -0xa0(%rbp)
jmp 0x443a
movq -0xa0(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x68(%rbp), %rdi
movl $0x1, %esi
movl $0x17000, %edx          # imm = 0x17000
movl $0x38, %r8d
movl %r8d, %ecx
callq 0x4560
leaq -0x68(%rbp), %rdi
addq $0x10, %rdi
movq -0x80(%rbp), %rdx
movq -0x88(%rbp), %rcx
movl $0x17001, %esi          # imm = 0x17001
callq 0x45a0
movq -0x70(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x48, -0x8c(%rbp)
movslq -0x8c(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x2620
movl %eax, -0x90(%rbp)
movl -0x90(%rbp), %eax
cmpl -0x8c(%rbp), %eax
je 0x44c3
movl $0x3, -0x4(%rbp)
jmp 0x4547
leaq -0x68(%rbp), %rdi
movl $0x48, %esi
callq 0x2670
movl %eax, -0x90(%rbp)
movslq -0x90(%rbp), %rax
cmpq $0x48, %rax
je 0x44ed
movl $0x3, -0x4(%rbp)
jmp 0x4547
leaq 0x4bcc(%rip), %rax      # 0x90c0
cmpl $0x0, 0x8(%rax)
jle 0x4515
movq 0x4af7(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
movl -0x48(%rbp), %edx
leaq 0x1d16(%rip), %rsi      # 0x6224
movb $0x0, %al
callq 0x20c0
cmpl $0x0, -0x48(%rbp)
je 0x4524
movl $0x3, -0x4(%rbp)
jmp 0x4547
movq 0x4a9d(%rip), %rax      # 0x8fc8
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
leaq 0x1db7(%rip), %rsi      # 0x62f0
movb $0x0, %al
callq 0x20c0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)