// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_filesystem_render_volumeinfo
static void rt11_filesystem_render_volumeinfo(rt11_filesystem_t *_this, rt11_file_t *f) {
	// static stream instance as buffer for name=value text
	static rt11_stream_t stream_buffer;
	static char text_buffer[4096 + RT11_MAX_FILES_PER_IMAGE * 80]; // listing for all files
	char line[1024];
	int i;
	time_t t = time(NULL);
	struct tm tm = *localtime(&t);

	text_buffer[0] = 0;
	sprintf(line, "# %s.%s - info about RT-11 volume on %s device.\n", f->filnam, f->ext,
			_this->device_info->device_name);
	strcat(text_buffer, line);
	sprintf(line, "# Produced by TU58FS at %d-%d-%d %d:%d:%d\n", tm.tm_year + 1900,
			tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
	strcat(text_buffer, line);
	sprintf(line, "\npack_cluster_size=%d\n", _this->pack_cluster_size);
	strcat(text_buffer, line);

	sprintf(line, "\n# Block number of first directory segment\nfirst_dir_blocknr=%d\n",
			_this->first_dir_blocknr);
	strcat(text_buffer, line);

	sprintf(line, "\nsystem_version=%s\n", _this->system_version);
	strcat(text_buffer, line);

	sprintf(line, "\nvolume_id=%s\n", _this->volume_id);
	strcat(text_buffer, line);

	sprintf(line, "\nowner_name=%s\n", _this->owner_name);
	strcat(text_buffer, line);

	sprintf(line, "\nsystem_id=%s\n", _this->system_id);
	strcat(text_buffer, line);

	sprintf(line, "\n# number of %d byte blocks on volume\nblock_count=%d\n",
	RT11_BLOCKSIZE, _this->blockcount);
	strcat(text_buffer, line);

	sprintf(line, "\n# number of extra bytes per directory entry\ndir_entry_extra_bytes=%d\n",
			_this->dir_entry_extra_bytes);
	strcat(text_buffer, line);

	sprintf(line, "\n# Total number of segments in this directory (can hold %d files) \n"
			"dir_total_seg_num=%d\n",
			rt11_dir_entries_per_segment(_this) * _this->dir_total_seg_num,
			_this->dir_total_seg_num);
	strcat(text_buffer, line);

	sprintf(line, "\n# Number of highest dir segment in use\ndir_max_seg_nr=%d\n",
			_this->dir_max_seg_nr);
	strcat(text_buffer, line);

	sprintf(line, "\n# Start block of file area = %d\n", _this->file_space_blocknr);
	strcat(text_buffer, line);

	for (i = 0; i < _this->file_count; i++) {
		rt11_file_t *f = _this->file[i];
		sprintf(line, "\n# File %2d \"%s.%s\".", i, f->filnam, f->ext);
		strcat(text_buffer, line);
		if (f->prefix) {
			sprintf(line, " Prefix %d = 0x%X bytes, start block %d @ 0x%X.",
					f->prefix->data_size, f->prefix->data_size, f->prefix->blocknr,
					f->prefix->blocknr * RT11_BLOCKSIZE);
			strcat(text_buffer, line);
		} else
			strcat(text_buffer, " No prefix.");
		if (f->data) {
			sprintf(line, " Data %d = 0x%X bytes, start block %d @ 0x%X.", f->data->data_size,
					f->data->data_size, f->data->blocknr, f->data->blocknr * RT11_BLOCKSIZE);
			strcat(text_buffer, line);
		} else
			strcat(text_buffer, " No data.");
	}
	strcat(text_buffer, "\n");

	stream_init(&stream_buffer);
	stream_buffer.data = (uint8_t *)text_buffer;
	stream_buffer.data_size = strlen(text_buffer);
	assert(stream_buffer.data_size < sizeof(text_buffer)); // buffer overun?
	f->data = &stream_buffer;
	// VOLUM INF is "changed", if home block or directories changed
	f->data->changed = _this->struct_changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x480, %rsp            # imm = 0x480
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x3350
movq %rax, -0x420(%rbp)
leaq -0x420(%rbp), %rdi
callq 0x3060
movq %rax, %rsi
leaq -0x458(%rbp), %rdi
movl $0x38, %edx
callq 0x3330
movb $0x0, 0x274d6(%rip)     # 0x3d350
leaq -0x410(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x2, %rdx
movq -0x10(%rbp), %rcx
addq $0x52, %rcx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %r8
leaq 0x7df6(%rip), %rsi      # 0x1dc9a
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x27497(%rip), %rdi     # 0x3d350
callq 0x3500
leaq -0x410(%rbp), %rdi
movl -0x444(%rbp), %edx
addl $0x76c, %edx            # imm = 0x76C
movl -0x448(%rbp), %ecx
addl $0x1, %ecx
movl -0x44c(%rbp), %r8d
movl -0x450(%rbp), %r9d
movl -0x454(%rbp), %r10d
movl -0x458(%rbp), %eax
leaq 0x74a0(%rip), %rsi      # 0x1d39c
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x27437(%rip), %rdi     # 0x3d350
callq 0x3500
leaq -0x410(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x30(%rax), %edx
leaq 0x7d98(%rip), %rsi      # 0x1dccb
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x27408(%rip), %rdi     # 0x3d350
callq 0x3500
leaq -0x410(%rbp), %rdi
movq -0x8(%rbp), %rax
movzwl 0x34(%rax), %edx
leaq 0x7d7f(%rip), %rsi      # 0x1dce2
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x273d8(%rip), %rdi     # 0x3d350
callq 0x3500
leaq -0x410(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x36, %rdx
leaq 0x7d90(%rip), %rsi      # 0x1dd23
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x273a8(%rip), %rdi     # 0x3d350
callq 0x3500
leaq -0x410(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x3a, %rdx
leaq 0x7d74(%rip), %rsi      # 0x1dd37
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x27378(%rip), %rdi     # 0x3d350
callq 0x3500
leaq -0x410(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x47, %rdx
leaq 0x7d53(%rip), %rsi      # 0x1dd46
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x27348(%rip), %rdi     # 0x3d350
callq 0x3500
leaq -0x410(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x54, %rdx
leaq 0x7d33(%rip), %rsi      # 0x1dd56
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x27318(%rip), %rdi     # 0x3d350
callq 0x3500
leaq -0x410(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x6c(%rax), %ecx
leaq 0x7d13(%rip), %rsi      # 0x1dd65
movl $0x200, %edx            # imm = 0x200
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x272e4(%rip), %rdi     # 0x3d350
callq 0x3500
leaq -0x410(%rbp), %rdi
movq -0x8(%rbp), %rax
movzwl 0x68(%rax), %edx
leaq 0x7d14(%rip), %rsi      # 0x1dd9b
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x272b4(%rip), %rdi     # 0x3d350
callq 0x3500
leaq -0x410(%rbp), %rax
movq %rax, -0x468(%rbp)
movq -0x8(%rbp), %rdi
callq 0x16960
movq -0x468(%rbp), %rdi
movl %eax, %edx
movq -0x8(%rbp), %rax
movzwl 0x64(%rax), %eax
imull %eax, %edx
movq -0x8(%rbp), %rax
movzwl 0x64(%rax), %ecx
leaq 0x7d07(%rip), %rsi      # 0x1dde2
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x27260(%rip), %rdi     # 0x3d350
callq 0x3500
leaq -0x410(%rbp), %rdi
movq -0x8(%rbp), %rax
movzwl 0x66(%rax), %edx
leaq 0x7d30(%rip), %rsi      # 0x1de3b
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x27230(%rip), %rdi     # 0x3d350
callq 0x3500
leaq -0x410(%rbp), %rdi
movq -0x8(%rbp), %rax
movzwl 0x1fd4(%rax), %edx
leaq 0x7d38(%rip), %rsi      # 0x1de76
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x271fd(%rip), %rdi     # 0x3d350
callq 0x3500
movl $0x0, -0x414(%rbp)
movl -0x414(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8c(%rcx), %eax
jge 0x1631c
movq -0x8(%rbp), %rax
movslq -0x414(%rbp), %rcx
movq 0x90(%rax,%rcx,8), %rax
movq %rax, -0x460(%rbp)
leaq -0x410(%rbp), %rdi
movl -0x414(%rbp), %edx
movq -0x460(%rbp), %rcx
addq $0x2, %rcx
movq -0x460(%rbp), %r8
addq $0x52, %r8
leaq 0x7352(%rip), %rsi      # 0x1d50e
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x2717f(%rip), %rdi     # 0x3d350
callq 0x3500
movq -0x460(%rbp), %rax
cmpq $0x0, 0x88(%rax)
je 0x1625b
leaq -0x410(%rbp), %rdi
movq -0x460(%rbp), %rax
movq 0x88(%rax), %rax
movl 0x10(%rax), %edx
movq -0x460(%rbp), %rax
movq 0x88(%rax), %rax
movl 0x10(%rax), %ecx
movq -0x460(%rbp), %rax
movq 0x88(%rax), %rax
movzwl (%rax), %r8d
movq -0x460(%rbp), %rax
movq 0x88(%rax), %rax
movzwl (%rax), %r9d
shll $0x9, %r9d
leaq 0x7c59(%rip), %rsi      # 0x1de98
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x270fc(%rip), %rdi     # 0x3d350
callq 0x3500
jmp 0x1626e
leaq 0x270ee(%rip), %rdi     # 0x3d350
leaq 0x7c5f(%rip), %rsi      # 0x1dec8
callq 0x3500
movq -0x460(%rbp), %rax
cmpq $0x0, 0x80(%rax)
je 0x162f3
leaq -0x410(%rbp), %rdi
movq -0x460(%rbp), %rax
movq 0x80(%rax), %rax
movl 0x10(%rax), %edx
movq -0x460(%rbp), %rax
movq 0x80(%rax), %rax
movl 0x10(%rax), %ecx
movq -0x460(%rbp), %rax
movq 0x80(%rax), %rax
movzwl (%rax), %r8d
movq -0x460(%rbp), %rax
movq 0x80(%rax), %rax
movzwl (%rax), %r9d
shll $0x9, %r9d
leaq 0x724c(%rip), %rsi      # 0x1d523
movb $0x0, %al
callq 0x3520
leaq -0x410(%rbp), %rsi
leaq 0x27064(%rip), %rdi     # 0x3d350
callq 0x3500
jmp 0x16306
leaq 0x27056(%rip), %rdi     # 0x3d350
leaq 0x7bd3(%rip), %rsi      # 0x1ded4
callq 0x3500
jmp 0x16308
movl -0x414(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x414(%rbp)
jmp 0x16162
leaq 0x2702d(%rip), %rdi     # 0x3d350
leaq 0x6399(%rip), %rsi      # 0x1c6c3
callq 0x3500
leaq 0x26faa(%rip), %rdi     # 0x3d2e0
callq 0x13870
leaq 0x2700e(%rip), %rax     # 0x3d350
movq %rax, 0x26f9f(%rip)     # 0x3d2e8
leaq 0x27000(%rip), %rdi     # 0x3d350
callq 0x3190
movl %eax, 0x26f95(%rip)     # 0x3d2f0
movl 0x26f8f(%rip), %eax     # 0x3d2f0
cmpq $0x14880, %rax          # imm = 0x14880
jae 0x1636b
jmp 0x1638a
leaq 0x7b6c(%rip), %rdi      # 0x1dede
leaq 0x72bf(%rip), %rsi      # 0x1d638
movl $0x468, %edx            # imm = 0x468
leaq 0x7b87(%rip), %rcx      # 0x1df0c
callq 0x3200
movq -0x10(%rbp), %rax
leaq 0x26f4b(%rip), %rcx     # 0x3d2e0
movq %rcx, 0x80(%rax)
movq -0x8(%rbp), %rax
movl 0x88(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movb %cl, 0x64(%rax)
addq $0x480, %rsp            # imm = 0x480
popq %rbp
retq
nop