// File: /workspace/github_c_makefile_star2_O0/krinkinmu[P]64bit/ramfs_smoke_test.c
// Function: test_read_beyond_the_end
static void test_read_beyond_the_end(void)
{
	const char *file_path = RAMFS_FILE_PATH;
	struct fs_file file;
	int rc = vfs_open(file_path, &file);
	char buffer[256];
	
	if (!rc) {
		DBG_INFO("vfs_open(%s) succeeded", file_path);

		rc = vfs_seek(&file, 0, FSS_END);
		if (rc < 0)
			DBG_ERR("vfs_seek failed with error: %s",
				errstr(rc));
		else
			DBG_INFO("vfs_seek reports file size %d", rc);

		rc = vfs_read(&file, buffer, sizeof(buffer));
		if (rc < 0)
			DBG_ERR("vfs_read failed with error: %s",
				errstr(rc));
		else if (rc)
			DBG_ERR("vfs_read read %d bytes beyond the end", rc);
		else
			DBG_INFO("vfs_read read %d bytes beyond the end", rc);

		rc = vfs_release(&file);
		if (!rc)
			DBG_INFO("vfs_release succeeded");
		else
			DBG_ERR("vfs_release failed with error: %s",
				errstr(rc));
	} else {
		DBG_ERR("vfs_open(%s) failed with error: %s",
			file_path, errstr(rc));
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
leaq 0x4f52(%rip), %rax      # 0xffffffff80112a24
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xffffffff80109ab0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0xffffffff8010dc84
movq -0x8(%rbp), %r8
leaq 0x4649(%rip), %rdi      # 0xffffffff80112144
leaq 0x4eb0(%rip), %rsi      # 0xffffffff801129b2
movl $0xab, %edx
leaq 0x4fa8(%rip), %rcx      # 0xffffffff80112ab6
movb $0x0, %al
callq 0xffffffff80101e60
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0xffffffff80109d10
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jge 0xffffffff8010db5c
movl -0x2c(%rbp), %edi
callq 0xffffffff8010d240
movq %rax, %r8
leaq 0x4639(%rip), %rdi      # 0xffffffff80112179
leaq 0x4e6b(%rip), %rsi      # 0xffffffff801129b2
movl $0xb0, %edx
leaq 0x504b(%rip), %rcx      # 0xffffffff80112b9e
movb $0x0, %al
callq 0xffffffff80101e60
jmp 0xffffffff8010db81
movl -0x2c(%rbp), %r8d
leaq 0x45dd(%rip), %rdi      # 0xffffffff80112144
leaq 0x4e44(%rip), %rsi      # 0xffffffff801129b2
movl $0xb2, %edx
leaq 0x5043(%rip), %rcx      # 0xffffffff80112bbd
movb $0x0, %al
callq 0xffffffff80101e60
leaq -0x130(%rbp), %rsi
leaq -0x28(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
callq 0xffffffff80109bb0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jge 0xffffffff8010dbcd
movl -0x2c(%rbp), %edi
callq 0xffffffff8010d240
movq %rax, %r8
leaq 0x45c8(%rip), %rdi      # 0xffffffff80112179
leaq 0x4dfa(%rip), %rsi      # 0xffffffff801129b2
movl $0xb7, %edx
leaq 0x5053(%rip), %rcx      # 0xffffffff80112c17
movb $0x0, %al
callq 0xffffffff80101e60
jmp 0xffffffff8010dc21
cmpl $0x0, -0x2c(%rbp)
je 0xffffffff8010dbfa
movl -0x2c(%rbp), %r8d
leaq 0x459b(%rip), %rdi      # 0xffffffff80112179
leaq 0x4dcd(%rip), %rsi      # 0xffffffff801129b2
movl $0xb9, %edx
leaq 0x50b5(%rip), %rcx      # 0xffffffff80112ca6
movb $0x0, %al
callq 0xffffffff80101e60
jmp 0xffffffff8010dc1f
movl -0x2c(%rbp), %r8d
leaq 0x453f(%rip), %rdi      # 0xffffffff80112144
leaq 0x4da6(%rip), %rsi      # 0xffffffff801129b2
movl $0xbb, %edx
leaq 0x508e(%rip), %rcx      # 0xffffffff80112ca6
movb $0x0, %al
callq 0xffffffff80101e60
jmp 0xffffffff8010dc21
leaq -0x28(%rbp), %rdi
callq 0xffffffff80109ae0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0xffffffff8010dc56
leaq 0x450a(%rip), %rdi      # 0xffffffff80112144
leaq 0x4d71(%rip), %rsi      # 0xffffffff801129b2
movl $0xbf, %edx
leaq 0x4e0c(%rip), %rcx      # 0xffffffff80112a59
movb $0x0, %al
callq 0xffffffff80101e60
jmp 0xffffffff8010dc82
movl -0x2c(%rbp), %edi
callq 0xffffffff8010d240
movq %rax, %r8
leaq 0x4511(%rip), %rdi      # 0xffffffff80112179
leaq 0x4d43(%rip), %rsi      # 0xffffffff801129b2
movl $0xc2, %edx
leaq 0x4df4(%rip), %rcx      # 0xffffffff80112a6f
movb $0x0, %al
callq 0xffffffff80101e60
jmp 0xffffffff8010dcc2
movq -0x8(%rbp), %rax
movq %rax, -0x138(%rbp)
movl -0x2c(%rbp), %edi
callq 0xffffffff8010d240
movq -0x138(%rbp), %r8
movq %rax, %r9
leaq 0x44d1(%rip), %rdi      # 0xffffffff80112179
leaq 0x4d03(%rip), %rsi      # 0xffffffff801129b2
movl $0xc5, %edx
leaq 0x4e12(%rip), %rcx      # 0xffffffff80112acd
movb $0x0, %al
callq 0xffffffff80101e60
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopl (%rax,%rax)