// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_filesystem_file_get
rt11_file_t *rt11_filesystem_file_get(rt11_filesystem_t *_this, int fileidx) {
	rt11_file_t *result = NULL;
	static rt11_file_t buff[3]; // buffer for bootblock, monitor, volinfo
	if (fileidx == -3) {
		result = &buff[0];
		strcpy(result->filnam, RT11_VOLUMEINFO_FILNAM);
		strcpy(result->ext, RT11_VOLUMEINFO_EXT);
		result->fixed = 1; // can not be deleted on shared dir
		rt11_filesystem_render_volumeinfo(_this, result);
		memset(&result->date, 0, sizeof(result->date));
	} else if (fileidx == -2
			&& !is_memset(_this->monitor->data, 0, _this->monitor->data_size)) {
		result = &buff[1];
		strcpy(result->filnam, RT11_MONITOR_FILNAM);
		strcpy(result->ext, RT11_MONITOR_EXT);
		result->data = _this->monitor;
		memset(&result->date, 0, sizeof(result->date));
	} else if (fileidx == -1
			&& !is_memset(_this->bootblock->data, 0, _this->bootblock->data_size)) {
		result = &buff[2];
		strcpy(result->filnam, RT11_BOOTBLOCK_FILNAM);
		strcpy(result->ext, RT11_BOOTBLOCK_EXT);
		result->data = _this->bootblock;
		memset(&result->date, 0, sizeof(result->date));
	} else if (fileidx >= 0 && fileidx < _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 0x15cb7
leaq 0x2735c(%rip), %rax     # 0x3cfb0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x2, %rdi
leaq 0x6f36(%rip), %rsi      # 0x1cb9d
callq 0x30c0
movq -0x18(%rbp), %rdi
addq $0x52, %rdi
leaq 0x6775(%rip), %rsi      # 0x1c3f0
callq 0x30c0
movq -0x18(%rbp), %rax
movl $0x1, 0xd4(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15e30
movq -0x18(%rbp), %rdi
addq $0x98, %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x3220
jmp 0x15e20
cmpl $-0x2, -0xc(%rbp)
jne 0x15d55
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 0x15d55
leaq 0x272bf(%rip), %rax     # 0x3cfb0
addq $0xd8, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x2, %rdi
leaq 0x6e9a(%rip), %rsi      # 0x1cba4
callq 0x30c0
movq -0x18(%rbp), %rdi
addq $0x52, %rdi
leaq 0x6de7(%rip), %rsi      # 0x1cb05
callq 0x30c0
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x18(%rbp), %rdi
addq $0x98, %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x3220
jmp 0x15e1e
cmpl $-0x1, -0xc(%rbp)
jne 0x15de7
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rax
movl 0x10(%rax), %edx
xorl %esi, %esi
callq 0xd3d0
cmpl $0x0, %eax
jne 0x15de7
leaq 0x27227(%rip), %rax     # 0x3cfb0
addq $0x1b0, %rax            # imm = 0x1B0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x2, %rdi
leaq 0x6e08(%rip), %rsi      # 0x1cbaa
callq 0x30c0
movq -0x18(%rbp), %rdi
addq $0x52, %rdi
leaq 0x6d2c(%rip), %rsi      # 0x1cae2
callq 0x30c0
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x18(%rbp), %rdi
addq $0x98, %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x3220
jmp 0x15e1c
cmpl $0x0, -0xc(%rbp)
jl 0x15e12
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8c(%rcx), %eax
jge 0x15e12
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movq 0x90(%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
jmp 0x15e1a
movq $0x0, -0x18(%rbp)
jmp 0x15e1c
jmp 0x15e1e
jmp 0x15e20
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)