// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/xxdp.c
// Function: xxdp_filesystem_file_get
xxdp_file_t *xxdp_filesystem_file_get(xxdp_filesystem_t *_this, int fileidx) {
	xxdp_file_t *result = NULL;
	static xxdp_file_t buff[3]; // buffers for monitor and bootblock
	if (fileidx == -3) {
		result = &buff[0];
		strcpy(result->filnam, XXDP_VOLUMEINFO_FILNAM);
		strcpy(result->ext, XXDP_VOLUMEINFO_EXT);
		result->fixed = 1; // can not be deleted on shared dir
		xxdp_filesystem_render_volumeinfo(_this, result);
		memset(&result->date, 0, sizeof(result->date));
		result->fixed = 1;
	} else if (fileidx == -2
			&& !is_memset(_this->monitor->data, 0, _this->monitor->data_size)) {
		result = &buff[1];
		strcpy(result->filnam, XXDP_MONITOR_FILNAM);
		strcpy(result->ext, XXDP_MONITOR_EXT);
		result->data = _this->monitor->data;
		result->data_size = _this->monitor->data_size;
		memset(&result->date, 0, sizeof(result->date));
		result->fixed = 0;
	} else if (fileidx == -1
			&& !is_memset(_this->bootblock->data, 0, _this->bootblock->data_size)) {
		result = &buff[0];
		strcpy(result->filnam, XXDP_BOOTBLOCK_FILNAM);
		strcpy(result->ext, XXDP_BOOTBLOCK_EXT);
		result->data = _this->bootblock->data;
		result->data_size = _this->bootblock->data_size;
		memset(&result->date, 0, sizeof(result->date));
		result->fixed = 0;
	} else if (fileidx >= 0 && fileidx < (int)_this->file_count) {
		result = _this->file[fileidx];
	} else
		result = NULL;
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
cmpl $-0x3, -0xc(%rbp)
jne 0x1247b
leaq 0x1477c(%rip), %rax     # 0x26b80
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x808, %rdi            # imm = 0x808
leaq 0xa783(%rip), %rsi      # 0x1cb9d
callq 0x30c0
movq -0x18(%rbp), %rdi
addq $0x858, %rdi            # imm = 0x858
leaq 0x9fbf(%rip), %rsi      # 0x1c3f0
callq 0x30c0
movq -0x18(%rbp), %rax
movl $0x1, 0x8cc(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x12660
movq -0x18(%rbp), %rdi
addq $0x890, %rdi            # imm = 0x890
xorl %esi, %esi
movl $0x38, %edx
callq 0x3220
movq -0x18(%rbp), %rax
movl $0x1, 0x8cc(%rax)
jmp 0x1264f
cmpl $-0x2, -0xc(%rbp)
jne 0x1254d
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movl 0x10(%rax), %edx
xorl %esi, %esi
callq 0xd3d0
cmpl $0x0, %eax
jne 0x1254d
leaq 0x146c7(%rip), %rax     # 0x26b80
addq $0x8d0, %rax            # imm = 0x8D0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x808, %rdi            # imm = 0x808
leaq 0xa6cf(%rip), %rsi      # 0x1cba4
callq 0x30c0
movq -0x18(%rbp), %rdi
addq $0x858, %rdi            # imm = 0x858
leaq 0xa619(%rip), %rsi      # 0x1cb05
callq 0x30c0
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x888(%rax)
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movl 0x10(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x884(%rax)
movq -0x18(%rbp), %rdi
addq $0x890, %rdi            # imm = 0x890
xorl %esi, %esi
movl $0x38, %edx
callq 0x3220
movq -0x18(%rbp), %rax
movl $0x0, 0x8cc(%rax)
jmp 0x1264d
cmpl $-0x1, -0xc(%rbp)
jne 0x12616
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rax
movl 0x10(%rax), %edx
xorl %esi, %esi
callq 0xd3d0
cmpl $0x0, %eax
jne 0x12616
leaq 0x145f5(%rip), %rax     # 0x26b80
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x808, %rdi            # imm = 0x808
leaq 0xa609(%rip), %rsi      # 0x1cbaa
callq 0x30c0
movq -0x18(%rbp), %rdi
addq $0x858, %rdi            # imm = 0x858
leaq 0xa52a(%rip), %rsi      # 0x1cae2
callq 0x30c0
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x888(%rax)
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rax
movl 0x10(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x884(%rax)
movq -0x18(%rbp), %rdi
addq $0x890, %rdi            # imm = 0x890
xorl %esi, %esi
movl $0x38, %edx
callq 0x3220
movq -0x18(%rbp), %rax
movl $0x0, 0x8cc(%rax)
jmp 0x1264b
cmpl $0x0, -0xc(%rbp)
jl 0x12641
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xa8(%rcx), %eax
jge 0x12641
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movq 0xb0(%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
jmp 0x12649
movq $0x0, -0x18(%rbp)
jmp 0x1264b
jmp 0x1264d
jmp 0x1264f
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)