// File: /workspace/github_c_makefile_star2_O1/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_filesystem_render
int rt11_filesystem_render(rt11_filesystem_t *_this) {

	// format media, all 0's
	memset(_this->image_data, 0, _this->image_size);

	if (rt11_filesystem_layout(_this))
		return error_code; // oversized

	if (_this->bootblock->data_size)
		stream_render(_this, _this->bootblock);
#ifdef DEFAULTBOOTLOADER
	else
	// volume not bootable
	stream_render(_this, _this->nobootblock);
#endif
	if (_this->monitor->data_size)
		stream_render(_this, _this->monitor);
	render_homeblock(_this);
	if (render_directory(_this))
		return error_code;
	render_file_data(_this);

	// modify DD[X].SYS
	rt11_filesystem_patch(_this);

	return ERROR_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbp
movq (%rdi), %rdi
movl 0x8(%rbp), %edx
xorl %esi, %esi
callq 0x3230
movq 0x78(%rbp), %rax
movl 0x10(%rax), %edx
testl %edx, %edx
je 0xf277
movw $0x0, (%rax)
cmpl $0x200, %edx            # imm = 0x200
jne 0xf2b7
movq 0x80(%rbp), %rax
movl 0x10(%rax), %edx
testl %edx, %edx
je 0xf29b
movw $0x2, (%rax)
cmpl $0x801, %edx            # imm = 0x801
jb 0xf29b
leaq 0x7808(%rip), %rsi      # 0x16aa1
jmp 0xf2be
movq %rbp, %rdi
xorl %esi, %esi
callq 0xfca3
testl %eax, %eax
je 0xf2cf
leaq 0xef98(%rip), %rax      # 0x1e248
movl (%rax), %eax
jmp 0xf382
leaq 0x77bb(%rip), %rsi      # 0x16a79
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x9f8f
jmp 0xf382
movzwl 0x34(%rbp), %eax
movzwl 0x64(%rbp), %ecx
leal (%rax,%rcx,2), %r8d
movw %r8w, 0x1fd4(%rbp)
movslq 0x8c(%rbp), %rax
testq %rax, %rax
jle 0xf376
xorl %ecx, %ecx
movl $0x1ff, %edx            # imm = 0x1FF
movl $0x201, %edi            # imm = 0x201
movl %r8d, %esi
movq 0x90(%rbp,%rcx,8), %r9
movw %r8w, 0x7a(%r9)
movq 0x88(%r9), %r10
testq %r10, %r10
je 0xf333
movw %r8w, (%r10)
movl $0x2, 0x4(%r10)
movl 0x10(%r10), %esi
addl %edi, %esi
shrl $0x9, %esi
addl %r8d, %esi
movq 0x80(%r9), %r10
testq %r10, %r10
je 0xf351
movw %si, (%r10)
movl 0x10(%r10), %r10d
addl %edx, %r10d
shrl $0x9, %r10d
addl %r10d, %esi
movzwl %r8w, %r8d
movl %esi, %r10d
subl %r8d, %r10d
movzwl 0x7c(%r9), %r8d
cmpl %r8d, %r10d
jne 0xf6f9
incq %rcx
movl %esi, %r8d
cmpq %rcx, %rax
jne 0xf302
jmp 0xf379
movl %r8d, %esi
movw %si, 0x1fd6(%rbp)
xorl %eax, %eax
testl %eax, %eax
je 0xf394
leaq 0xeebb(%rip), %rax      # 0x1e248
movl (%rax), %eax
jmp 0xf6ea
movq 0x78(%rbp), %rax
movl 0x10(%rax), %edx
testq %rdx, %rdx
je 0xf3b9
movzwl (%rax), %ecx
shll $0x9, %ecx
addq (%rbp), %rcx
movl 0x4(%rax), %edi
addq %rcx, %rdi
movq 0x8(%rax), %rsi
callq 0x3350
movq 0x80(%rbp), %rax
movl 0x10(%rax), %edx
testq %rdx, %rdx
je 0xf3e1
movzwl (%rax), %ecx
shll $0x9, %ecx
addq (%rbp), %rcx
movl 0x4(%rax), %edi
addq %rcx, %rdi
movq 0x8(%rax), %rsi
callq 0x3350
movl $0x200, %eax            # imm = 0x200
movq (%rbp), %rdi
addq %rax, %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x3230
cmpl $0x201, 0x8(%rbp)       # imm = 0x201
jbe 0xf718
movq (%rbp), %rax
xorl %ecx, %ecx
movb %cl, 0x200(%rax)
movq (%rbp), %rax
movb %cl, 0x201(%rax)
cmpl $0x203, 0x8(%rbp)       # imm = 0x203
jbe 0xf718
movq (%rbp), %rax
movb $0x0, 0x202(%rax)
movq (%rbp), %rax
movb $-0x10, 0x203(%rax)
cmpl $0x205, 0x8(%rbp)       # imm = 0x205
jbe 0xf718
movq (%rbp), %rax
movb $-0x1, 0x204(%rax)
movq (%rbp), %rax
movb $0xf, 0x205(%rax)
cmpl $0x3d3, 0x8(%rbp)       # imm = 0x3D3
jbe 0xf718
movl 0x30(%rbp), %eax
movq (%rbp), %rcx
movb %al, 0x3d2(%rcx)
movq (%rbp), %rcx
movb %ah, 0x3d3(%rcx)
cmpl $0x3d5, 0x8(%rbp)       # imm = 0x3D5
jbe 0xf718
movzwl 0x34(%rbp), %eax
movq (%rbp), %rcx
movb %al, 0x3d4(%rcx)
movq (%rbp), %rcx
movb %ah, 0x3d5(%rcx)
leaq 0x36(%rbp), %rdi
callq 0xaa53
cmpl $0x3d7, 0x8(%rbp)       # imm = 0x3D7
jbe 0xf718
movq (%rbp), %rcx
movb %al, 0x3d6(%rcx)
movq (%rbp), %rcx
movb %ah, 0x3d7(%rcx)
movl $0x3d8, %r14d           # imm = 0x3D8
addq (%rbp), %r14
leaq 0x3a(%rbp), %rdi
movl $0xc, %esi
movl $0x20, %edx
callq 0xa77d
movq %r14, %rdi
movq %rax, %rsi
callq 0x30d0
movl $0x3e4, %r14d           # imm = 0x3E4
addq (%rbp), %r14
leaq 0x47(%rbp), %rdi
movl $0xc, %esi
movl $0x20, %edx
callq 0xa77d
movq %r14, %rdi
movq %rax, %rsi
callq 0x30d0
movl $0x3f0, %r14d           # imm = 0x3F0
addq (%rbp), %r14
leaq 0x54(%rbp), %rdi
movl $0xc, %esi
movl $0x20, %edx
callq 0xa77d
movq %r14, %rdi
movq %rax, %rsi
callq 0x30d0
xorl %ecx, %ecx
xorl %ebx, %ebx
movq %rbp, %rdi
movl %ebx, %esi
movl %ecx, %r14d
callq 0x107cf
movl %r14d, %ecx
movzwl %ax, %eax
addl %eax, %ecx
leal 0x2(%rbx), %eax
cmpl $0x1fc, %ebx            # imm = 0x1FC
movl %eax, %ebx
jb 0xf551
movw %cx, 0x62(%rbp)
cmpl $0x3ff, 0x8(%rbp)       # imm = 0x3FF
jbe 0xf718
movq (%rbp), %rax
movb %cl, 0x3fe(%rax)
movq (%rbp), %rax
movb %ch, 0x3ff(%rax)
movzwl 0x68(%rbp), %ecx
addl $0xe, %ecx
movl $0x3f6, %eax            # imm = 0x3F6
xorl %edx, %edx
divl %ecx
movl %eax, %ebx
addl $-0x3, %ebx
movl 0x8c(%rbp), %eax
testl %eax, %eax
jle 0xf5e4
xorl %r14d, %r14d
movq 0x90(%rbp,%r14,8), %rsi
movl %r14d, %eax
cltd
idivl %ebx
movl %edx, %ecx
leal 0x1(%rax), %edx
movq %rbp, %rdi
callq 0x1089e
incq %r14
movslq 0x8c(%rbp), %rax
cmpq %rax, %r14
jl 0xf5ba
cltd
idivl %ebx
movl %edx, %ecx
leal 0x1(%rax), %edx
movq %rbp, %rdi
xorl %esi, %esi
callq 0x1089e
cmpl $0x0, 0x8c(%rbp)
jle 0xf6e0
movl $0x201, %ebx            # imm = 0x201
xorl %r12d, %r12d
movq 0x90(%rbp,%r12,8), %r13
movq 0x88(%r13), %rax
testq %rax, %rax
je 0xf6a5
movl 0x10(%rax), %r15d
addl %ebx, %r15d
movl %r15d, %r14d
shrl $0x9, %r14d
movzwl %r14w, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0xf653
leaq 0x2(%r13), %rsi
leaq 0x52(%r13), %rdx
leaq 0x7584(%rip), %rdi      # 0x16bd0
xorl %eax, %eax
callq 0xa2ef
movq (%rbp), %rax
movq 0x88(%r13), %rcx
movzwl (%rcx), %ecx
shll $0x9, %ecx
movb %r14b, (%rax,%rcx)
shrl $0x11, %r15d
movq (%rbp), %rax
movq 0x88(%r13), %rcx
movzwl (%rcx), %ecx
shll $0x9, %ecx
movb %r15b, 0x1(%rax,%rcx)
movq 0x88(%r13), %rax
movzwl (%rax), %ecx
shll $0x9, %ecx
addq (%rbp), %rcx
movl 0x4(%rax), %edi
addq %rcx, %rdi
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
callq 0x3350
movq 0x80(%r13), %rax
testq %rax, %rax
je 0xf6cd
movzwl (%rax), %ecx
shll $0x9, %ecx
addq (%rbp), %rcx
movl 0x4(%rax), %edi
addq %rcx, %rdi
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
callq 0x3350
incq %r12
movslq 0x8c(%rbp), %rax
cmpq %rax, %r12
jl 0xf60b
movq %rbp, %rdi
callq 0xf219
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x73c7(%rip), %rdi      # 0x16ac7
leaq 0x6fe1(%rip), %rsi      # 0x166e8
leaq 0x73ec(%rip), %rcx      # 0x16afa
movl $0x305, %edx            # imm = 0x305
callq 0x3210
leaq 0x6b5e(%rip), %rdi      # 0x1627d
leaq 0x6fc2(%rip), %rsi      # 0x166e8
leaq 0x73fd(%rip), %rcx      # 0x16b2a
movl $0x79, %edx
callq 0x3210