// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/xxdp.c
// Function: xxdp_filesystem_render
int xxdp_filesystem_render(xxdp_filesystem_t *_this) {
	int file_idx;
	unsigned needed_size = (int) _this->blockcount * XXDP_BLOCKSIZE;

	// calc blocklists and sizes
	if (xxdp_filesystem_layout(_this))
		return error_code; // overflow

	if (needed_size > _this->image_size)
		// more bytes needed than image provides. Expand?
		return error_set(ERROR_FILESYSTEM_OVERFLOW,
				"Image only %d bytes large, filesystem needs %d *%d = %d.", _this->image_size,
				_this->blockcount, XXDP_BLOCKSIZE, needed_size);

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

	render_multiblock(_this, _this->bootblock);
	render_multiblock(_this, _this->monitor);

	render_bitmap(_this);
	render_mfd(_this);
	render_ufd(_this);

	// read data for all user files
	for (file_idx = 0; file_idx < _this->file_count; file_idx++)
		render_file_data(_this, _this->file[file_idx]);
	return ERROR_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %r14
movl 0x4c(%rdi), %eax
movl %eax, 0x50(%rsp)
movl $0x804, %edi            # imm = 0x804
addq 0x90(%r14), %rdi
xorl %ebx, %ebx
movl $0x10000, %edx          # imm = 0x10000
xorl %esi, %esi
callq 0x3220
movq %r14, %r8
movzwl 0x50(%r8), %eax
cmpq %rax, %rbx
jae 0xbe63
movq 0x90(%r8), %rax
movb $0x1, 0x804(%rax,%rbx)
incq %rbx
jmp 0xbe45
movq 0x80(%r8), %rax
cmpl $0x0, 0x10(%rax)
je 0xbe7e
movzwl 0x48(%r8), %ecx
movw %cx, (%rax)
movw $0x1, %cx
jmp 0xbe80
xorl %ecx, %ecx
movw %cx, 0x2(%rax)
movq 0x88(%r8), %rax
movl 0x10(%rax), %ecx
testl %ecx, %ecx
je 0xbea5
addl $0x1ff, %ecx            # imm = 0x1FF
shrl $0x9, %ecx
movzwl 0x4a(%r8), %edx
movw %dx, (%rax)
jmp 0xbea7
xorl %ecx, %ecx
shll $0x9, 0x50(%rsp)
movw %cx, 0x2(%rax)
movzwl 0x32(%r8), %ecx
movzwl 0x30(%r8), %edx
movq 0x90(%r8), %rax
xorl %esi, %esi
cmpq %rsi, %rcx
je 0xbee8
leaq (%rdx,%rsi), %rdi
movzwl %di, %edi
movb $0x1, 0x804(%rax,%rdi)
movq 0x90(%r8), %rax
movw %di, 0x4(%rax,%rsi,2)
incq %rsi
jmp 0xbec3
movl %ecx, (%rax)
movl 0x58(%r8), %ecx
cmpl $0x2, %ecx
movq %r8, 0x40(%rsp)
je 0xbf38
cmpl $0x1, %ecx
jne 0xbf57
movq 0x98(%r8), %rcx
movl $0x2, (%rcx)
movslq 0x34(%r8), %rdx
movw %dx, 0x4(%rcx)
movzwl 0x38(%r8), %esi
movw %si, 0x6(%rcx)
movb $0x1, %cl
movb %cl, 0x804(%rax,%rdx)
movq 0x90(%r8), %rax
movslq 0x38(%r8), %rdx
movb %cl, 0x804(%rax,%rdx)
jmp 0xbf6a
movq 0x98(%r8), %rcx
movl $0x1, (%rcx)
movslq 0x34(%r8), %rdx
movw %dx, 0x4(%rcx)
movb $0x1, 0x804(%rax,%rdx)
jmp 0xbf6a
leaq 0x92f2(%rip), %rdi      # 0x15250
xorl %eax, %eax
callq 0x9b87
movq 0x40(%rsp), %r8
movl 0xa8(%r8), %eax
addl $0x1b, %eax
pushq $0x1c
popq %rcx
cltd
idivl %ecx
movzwl 0x2e(%r8), %ecx
cmpl %ecx, %eax
cmoval %eax, %ecx
movq 0xa0(%r8), %rax
movl %ecx, (%rax)
movzwl 0x2c(%r8), %edx
xorl %eax, %eax
cmpq %rax, %rcx
je 0xbfca
movzwl 0x2e(%r8), %esi
cmpq %rsi, %rax
jae 0xbfcd
leaq (%rdx,%rax), %rsi
movq 0x90(%r8), %rdi
movzwl %si, %esi
movb $0x1, 0x804(%rdi,%rsi)
movq 0xa0(%r8), %rdi
movw %si, 0x4(%rdi,%rax,2)
incq %rax
jmp 0xbf94
movq %rcx, %rax
movzwl 0x50(%r8), %ebx
cmpq %rcx, %rax
jae 0xbfff
movq 0x90(%r8), %rdx
movzwl %bx, %esi
movb $0x1, 0x804(%rdx,%rsi)
movq 0xa0(%r8), %rdx
movw %bx, 0x4(%rdx,%rax,2)
leal 0x1(%rbx), %edx
incq %rax
movl %edx, %ebx
jmp 0xbfd2
movl 0x50(%r8), %eax
cmpw %ax, %bx
cmovbel %eax, %ebx
xorl %ecx, %ecx
movslq 0xa8(%r8), %rax
cmpq %rax, %rcx
jge 0xc0e8
movq %rcx, 0x48(%rsp)
movq 0xb0(%r8,%rcx,8), %r15
movl 0x884(%r15), %eax
movl $0x1fd, %ecx            # imm = 0x1FD
addl %ecx, %eax
xorl %r14d, %r14d
xorl %edx, %edx
movl $0x1fe, %ecx            # imm = 0x1FE
divl %ecx
movl %eax, %r13d
leaq 0x808(%r15), %rbp
leaq 0x858(%r15), %r12
xorl %eax, %eax
testl %eax, %eax
jne 0xc0cb
cmpq %r13, %r14
jae 0xc0cb
cmpq $0x800, %r14            # imm = 0x800
jb 0xc086
pushq $-0x2
popq %rdi
leaq 0x91fa(%rip), %rsi      # 0x1526b
movq %rbp, %rdx
movq %r12, %rcx
movl $0x800, %r8d            # imm = 0x800
xorl %eax, %eax
callq 0x982c
jmp 0xc0be
movzwl %bx, %eax
movl 0x4c(%r8), %edx
cmpl %eax, %edx
jbe 0xc0ad
movq 0x90(%r8), %rcx
movb $0x1, 0x804(%rcx,%rax)
leal 0x1(%rax), %ebx
movw %ax, 0x4(%r15,%r14,2)
xorl %eax, %eax
jmp 0xc0c6
pushq $-0x2
popq %rdi
leaq 0x91e3(%rip), %rsi      # 0x1529a
xorl %eax, %eax
callq 0x982c
movq 0x40(%rsp), %r8
pushq $0x1
popq %rax
incq %r14
jmp 0xc055
movq 0x48(%rsp), %rcx
incq %rcx
movw %r13w, 0x880(%r15)
movl %r13d, (%r15)
testl %eax, %eax
je 0xc00b
jmp 0xc129
movzwl %bx, %eax
movl 0x4c(%r8), %ecx
cmpl %eax, %ecx
jbe 0xc129
movl 0x8(%r8), %edx
movl 0x50(%rsp), %r9d
cmpl %edx, %r9d
jbe 0xc144
leaq 0x8a98(%rip), %rsi      # 0x14ba0
pushq $-0x2
popq %rdi
movl $0x200, %r8d            # imm = 0x200
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x982c
leaq 0x12108(%rip), %rax     # 0x1e238
movl (%rax), %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r8), %rdi
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x3220
movq 0x40(%rsp), %rax
movq 0x80(%rax), %rax
movzwl (%rax), %edi
shll $0x9, %edi
movq 0x40(%rsp), %rcx
addq (%rcx), %rdi
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
callq 0x3340
movq 0x40(%rsp), %rax
movq 0x88(%rax), %rax
movzwl (%rax), %edi
shll $0x9, %edi
movq 0x40(%rsp), %rcx
addq (%rcx), %rdi
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
callq 0x3340
movq 0x40(%rsp), %rax
movq 0x90(%rax), %rsi
movq 0x40(%rsp), %rdi
callq 0xd870
movq 0x40(%rsp), %rdi
movw $0x3c0, %bx             # imm = 0x3C0
pushq $0x3
popq %r13
movl %ebp, %eax
xorl %edx, %edx
divw %bx
movzwl %bp, %r15d
cmpl %r15d, 0x4c(%rdi)
jbe 0xc290
imull $0xfffffc40, %eax, %r12d # imm = 0xFFFFFC40
movl %ebp, %eax
xorl %edx, %edx
divw %bx
movq 0x90(%rdi), %rcx
movzwl %ax, %edx
movzwl 0x4(%rcx,%rdx,2), %r14d
addw %bp, %r12w
jne 0xc247
incl %eax
movzwl %ax, %ecx
movl %r14d, %esi
pushq $0x1
popq %rdx
callq 0xd8b7
movq 0x40(%rsp), %rdi
movl %r14d, %esi
pushq $0x2
popq %rdx
pushq $0x3c
popq %rcx
callq 0xd8b7
movq 0x40(%rsp), %rax
movq 0x90(%rax), %rax
movzwl 0x4(%rax), %ecx
movq 0x40(%rsp), %rdi
movl %r14d, %esi
movl %r13d, %edx
callq 0xd8b7
movq 0x40(%rsp), %rdi
movq 0x90(%rdi), %rcx
cmpb $0x0, 0x804(%rcx,%r15)
je 0xc289
movl %r12d, %eax
shrl $0x4, %eax
addb $0x4, %al
movzbl %al, %r15d
movl %r14d, %esi
movl %r15d, %edx
callq 0xd832
andb $0xf, %r12b
btsl %r12d, %eax
movzwl %ax, %ecx
movq 0x40(%rsp), %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0xd8b7
movq 0x40(%rsp), %rdi
incl %ebp
jmp 0xc1bf
movq 0x98(%rdi), %rsi
callq 0xd870
movq 0x40(%rsp), %r14
movl 0x58(%r14), %eax
cmpl $0x2, %eax
je 0xc353
cmpl $0x1, %eax
jne 0xc47f
movq 0x98(%r14), %rax
cmpl $0x2, (%rax)
jne 0xc801
movzwl 0x54(%r14), %ecx
movzwl 0x4(%rax), %ebp
pushq $0x1
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0xd8b7
movq 0x40(%rsp), %rax
movq 0x90(%rax), %rax
movzwl 0x4(%rax), %ecx
pushq $0x2
popq %rdx
movq 0x40(%rsp), %rdi
movl %ebp, %esi
callq 0xd8b7
movq 0x40(%rsp), %rdi
movq 0x90(%rdi), %rax
movl (%rax), %ebx
cmpl $0xfb, %ebx
jg 0xc83f
xorl %r14d, %r14d
testl %ebx, %ebx
movl $0x0, %r15d
cmovgl %ebx, %r15d
cmpq %r14, %r15
je 0xc48f
leal 0x3(%r14), %eax
movq 0x90(%rdi), %rcx
movzwl 0x4(%rcx,%r14,2), %ecx
movzbl %al, %edx
movl %ebp, %esi
callq 0xd8b7
movq 0x40(%rsp), %rdi
incq %r14
jmp 0xc325
movq 0x98(%r14), %rax
cmpl $0x1, (%rax)
jne 0xc820
movzwl 0x4(%rax), %ebp
movq 0xa0(%r14), %rax
movzwl 0x4(%rax), %ecx
pushq $0x1
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0xd8b7
movq 0xa0(%r14), %rax
movzwl (%rax), %ecx
pushq $0x2
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0xd8b7
movq 0x90(%r14), %rax
movzwl 0x4(%rax), %ecx
pushq $0x3
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0xd8b7
movq 0x90(%r14), %rax
movzwl (%rax), %ecx
pushq $0x4
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0xd8b7
pushq $0x5
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
movl %ebp, %ecx
callq 0xd8b7
pushq $0x6
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0xd8b7
movzwl 0x4c(%r14), %ecx
pushq $0x7
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0xd8b7
movzwl 0x50(%r14), %ecx
pushq $0x8
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0xd8b7
movzwl 0x54(%r14), %ecx
pushq $0x9
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0xd8b7
pushq $0xa
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0xd8b7
movq 0x88(%r14), %rax
movzwl (%rax), %ecx
pushq $0xb
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0xd8b7
pushq $0xc
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0xd8b7
pushq $0xd
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0xd8b7
pushq $0xe
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0xd8b7
pushq $0xf
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0xd8b7
pushq $0x10
jmp 0xc4e8
leaq 0x8dca(%rip), %rdi      # 0x15250
xorl %eax, %eax
callq 0x9b87
jmp 0xc4f5
addb $0x3, %bl
movzbl %bl, %edx
movl %ebp, %esi
xorl %ecx, %ecx
movq %rdi, %r14
callq 0xd8b7
movq 0x98(%r14), %rax
movzwl 0x6(%rax), %ebp
pushq $0x1
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
movl $0x101, %ecx            # imm = 0x101
callq 0xd8b7
movq 0xa0(%r14), %rax
movzwl 0x4(%rax), %ecx
pushq $0x2
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0xd8b7
pushq $0x3
popq %rdx
pushq $0x9
popq %rcx
movq %r14, %rdi
movl %ebp, %esi
callq 0xd8b7
pushq $0x4
popq %rdx
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0xd8b7
movq 0xa0(%r14), %rsi
movq %r14, %rdi
callq 0xd870
xorl %esi, %esi
leaq 0x60(%rsp), %r13
pushq $0x3
popq %rbx
movq $0x0, 0x48(%rsp)
xorl %r8d, %r8d
movl %esi, %eax
xorl %edx, %edx
pushq $0x1c
popq %rcx
divl %ecx
movl %eax, %ebp
movslq 0xa8(%r14), %rax
cmpq %rax, %r8
movq %r14, %rdi
jge 0xc6fa
movq %rsi, 0x50(%rsp)
shlb $0x2, %bpl
movl %r8d, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %r15d
addw 0x2c(%rdi), %r15w
movq %r8, 0x58(%rsp)
movq 0xb0(%rdi,%r8,8), %r12
movq %r12, %rsi
callq 0xd870
leaq 0x808(%r12), %r14
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x30a0
movb $0x0, 0x63(%rsp)
addb 0x48(%rsp), %bpl
leal 0x1(%rbp), %ebx
movq %r13, %rdi
callq 0xa1d5
movzwl %r15w, %r15d
movzbl %bl, %edx
movzwl %ax, %ecx
movq 0x40(%rsp), %rdi
movl %r15d, %esi
callq 0xd8b7
movq %r14, %rdi
callq 0x3190
cmpq $0x3, %rax
ja 0xc5bc
movb $0x0, 0x60(%rsp)
jmp 0xc5cf
leaq 0x80b(%r12), %rsi
movq %r13, %rdi
pushq $0x3
popq %rdx
callq 0x30a0
movb $0x0, 0x63(%rsp)
leal 0x2(%rbp), %ebx
movq %r13, %rdi
callq 0xa1d5
movzbl %bl, %edx
movzwl %ax, %ecx
movq 0x40(%rsp), %r14
movq %r14, %rdi
movl %r15d, %esi
callq 0xd8b7
leal 0x3(%rbp), %ebx
leaq 0x858(%r12), %rdi
callq 0xa1d5
movzbl %bl, %edx
movzwl %ax, %ecx
movq %r14, %rdi
movl %r15d, %esi
callq 0xd8b7
leal 0x4(%rbp), %ebx
movq 0x8c0(%r12), %rax
movq %rax, 0x30(%rsp)
movups 0x890(%r12), %xmm0
movups 0x8a0(%r12), %xmm1
movups 0x8b0(%r12), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0xa41a
movzbl %bl, %edx
movzwl %ax, %ecx
movq %r14, %rdi
movl %r15d, %esi
callq 0xd8b7
leal 0x5(%rbp), %eax
movzbl %al, %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0xd8b7
leal 0x6(%rbp), %eax
movzwl 0x4(%r12), %ecx
movzbl %al, %edx
movq %r14, %rdi
movl %r15d, %esi
callq 0xd8b7
leal 0x7(%rbp), %eax
movzwl (%r12), %ecx
movzbl %al, %edx
movq %r14, %rdi
movl %r15d, %esi
callq 0xd8b7
movl (%r12), %eax
decl %eax
movzwl 0x4(%r12,%rax,2), %ecx
leal 0x8(%rbp), %eax
movzbl %al, %edx
movq %r14, %rdi
movl %r15d, %esi
callq 0xd8b7
addb $0x9, %bpl
movzbl %bpl, %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0xd8b7
movq 0x58(%rsp), %r8
incq %r8
movq 0x48(%rsp), %rax
addb $0x9, %al
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rsi
incl %esi
pushq $0x3
popq %rbx
jmp 0xc51a
xorl %ecx, %ecx
movslq 0xa8(%rdi), %rax
cmpq %rax, %rcx
jge 0xc7bc
movq %rcx, 0x48(%rsp)
movq 0xb0(%rdi,%rcx,8), %r14
movl 0x884(%r14), %ebp
movq 0x888(%r14), %r15
xorl %r13d, %r13d
movl (%r14), %eax
cmpq %rax, %r13
jae 0xc78d
testl %ebp, %ebp
je 0xc7c3
movzwl 0x4(%r14,%r13,2), %eax
movq (%rdi), %rcx
shll $0x9, %eax
leaq (%rcx,%rax), %rdi
addq $0x2, %rdi
movl $0x1fe, %eax            # imm = 0x1FE
cmpl %eax, %ebp
movl $0x1fe, %ebx            # imm = 0x1FE
cmovll %ebp, %ebx
movslq %ebx, %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0x3340
addq %r12, %r15
movl 0x884(%r14), %eax
addq 0x888(%r14), %rax
cmpq %rax, %r15
ja 0xc7e2
subl %ebx, %ebp
incq %r13
movq 0x40(%rsp), %rdi
jmp 0xc72a
movq 0x48(%rsp), %rcx
incq %rcx
testl %ebp, %ebp
je 0xc6fc
leaq 0x8c66(%rip), %rdi      # 0x1540a
leaq 0x8391(%rip), %rsi      # 0x14b3c
leaq 0x8c00(%rip), %rcx      # 0x153b2
movl $0x397, %edx            # imm = 0x397
callq 0x3200
xorl %eax, %eax
jmp 0xc132
leaq 0x8bdc(%rip), %rdi      # 0x153a6
leaq 0x836b(%rip), %rsi      # 0x14b3c
leaq 0x8bda(%rip), %rcx      # 0x153b2
movl $0x38a, %edx            # imm = 0x38A
callq 0x3200
leaq 0x8c03(%rip), %rdi      # 0x153ec
leaq 0x834c(%rip), %rsi      # 0x14b3c
leaq 0x8bbb(%rip), %rcx      # 0x153b2
movl $0x395, %edx            # imm = 0x395
callq 0x3200
leaq 0x8b2f(%rip), %rdi      # 0x15337
leaq 0x832d(%rip), %rsi      # 0x14b3c
leaq 0x8b42(%rip), %rcx      # 0x15358
movl $0x32d, %edx            # imm = 0x32D
callq 0x3200
leaq 0x8b5e(%rip), %rdi      # 0x15385
leaq 0x830e(%rip), %rsi      # 0x14b3c
leaq 0x8b23(%rip), %rcx      # 0x15358
movl $0x342, %edx            # imm = 0x342
callq 0x3200
leaq 0x8b37(%rip), %rdi      # 0x1537d
leaq 0x82ef(%rip), %rsi      # 0x14b3c
leaq 0x8b04(%rip), %rcx      # 0x15358
movl $0x334, %edx            # imm = 0x334
callq 0x3200