// File: /workspace/github_c_makefile_star2_O3/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_filesystem_parse
int rt11_filesystem_parse(rt11_filesystem_t *_this) {
	rt11_filesystem_init(_this);

	// read bootblock at 0, length 1 block. may consists of 00's
	// allocates bootblock->data
	stream_parse(_this, _this->bootblock, 0, 0, RT11_BLOCKSIZE);

	// read more boot code from blocks 2..5, length 4 block.
	stream_parse(_this, _this->monitor, 2, 0, 4 * RT11_BLOCKSIZE);

	if (parse_homeblock(_this))
		return error_code;
	if (parse_directory(_this))
		return error_code;

	// image must be patched, but filesystem files always unpatched
	// and directory struct needed to find DD.SYS files
	rt11_filesystem_unpatch(_this); 	// restore original DD[X].SYS

	parse_file_data(_this);

	rt11_filesystem_patch(_this); 	// re-patch iamge

	// rt11_filesystem_print_diag(_this, stderr);

	// mark file->data , ->prefix as changed, for changed image blocks
	rt11_filesystem_mark_filestreams_as_changed(_this);

	return ERROR_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r12
callq 0xe701
movq (%r12), %r14
movq 0x78(%r12), %r15
movw $0x0, (%r15)
xorl %ebx, %ebx
movl %ebx, 0x4(%r15)
movl $0x200, 0x10(%r15)      # imm = 0x200
movl $0x200, %edi            # imm = 0x200
callq 0x33b0
movq %rax, 0x8(%r15)
movl $0x200, %edx            # imm = 0x200
movq %rax, %rdi
movq %r14, %rsi
callq 0x3340
movb %bl, 0x14(%r15)
movl $0x400, %r14d           # imm = 0x400
addq (%r12), %r14
movq 0x80(%r12), %r15
movw $0x2, (%r15)
movl %ebx, 0x4(%r15)
movl $0x800, 0x10(%r15)      # imm = 0x800
movl $0x800, %edi            # imm = 0x800
callq 0x33b0
movq %rax, 0x8(%r15)
movl $0x800, %edx            # imm = 0x800
movq %rax, %rdi
movq %r14, %rsi
callq 0x3340
movb %bl, 0x14(%r15)
movl 0x8(%r12), %eax
cmpl $0x3d3, %eax            # imm = 0x3D3
jbe 0xf11e
movq (%r12), %rcx
movzwl 0x3d2(%rcx), %edx
movl %edx, 0x30(%r12)
cmpl $0x3d5, %eax            # imm = 0x3D5
jbe 0xf11e
movzwl 0x3d4(%rcx), %edx
movw %dx, 0x34(%r12)
cmpl $0x6, %edx
jne 0xea25
movzwl 0x3d4(%rcx), %edx
movw %dx, 0x34(%r12)
cmpl $0x3d7, %eax            # imm = 0x3D7
jbe 0xf11e
movzwl 0x3d6(%rcx), %edi
leaq 0x36(%r12), %r14
callq 0xa8de
movq %r14, %rdi
movq %rax, %rsi
callq 0x30c0
movq (%r12), %rbx
leaq 0x3d8(%rbx), %rsi
leaq 0x3a(%r12), %rdi
movl $0xc, %edx
callq 0x30a0
xorl %r14d, %r14d
movb %r14b, 0x46(%r12)
leaq 0x3e4(%rbx), %rsi
leaq 0x47(%r12), %rdi
movl $0xc, %edx
callq 0x30a0
movb %r14b, 0x53(%r12)
leaq 0x3f0(%rbx), %rsi
leaq 0x54(%r12), %rdi
movl $0xc, %edx
callq 0x30a0
movb %r14b, 0x60(%r12)
cmpl $0x3ff, 0x8(%r12)       # imm = 0x3FF
jbe 0xf11e
movzwl 0x3fe(%rbx), %eax
movw %ax, 0x62(%r12)
movq %r12, %rdi
movl %r14d, %esi
callq 0x1073f
leal 0x2(%r14), %eax
cmpl $0x1fc, %r14d           # imm = 0x1FC
movl %eax, %r14d
jb 0xea08
jmp 0xea40
leaq 0x7ef6(%rip), %rsi      # 0x16922
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x9f73
testl %eax, %eax
jne 0xee23
movl $0x0, 0x1fd0(%r12)
movl $0x1, %edx
movq %r12, 0x10(%rsp)
movq (%r12), %rax
movzwl 0x34(%r12), %esi
shll $0x9, %esi
leaq (%rax,%rsi), %r14
movl %edx, %edi
shlq $0xa, %rdi
movzwl -0x400(%rdi,%r14), %ecx
addq %rdi, %r14
cmpl $0x1, %edx
jne 0xea94
movw %cx, 0x64(%r12)
movzwl -0x3fc(%r14), %ecx
movw %cx, 0x66(%r12)
jmp 0xeaa9
movzwl 0x64(%r12), %r8d
cmpl %r8d, %ecx
jne 0xf0ee
movzwl 0x66(%r12), %ecx
movzwl -0x3fe(%r14), %r8d
movzwl %cx, %ecx
cmpl %ecx, %r8d
ja 0xf0d3
movzwl -0x3f8(%r14), %r13d
cmpl $0x1, %edx
movl %r8d, 0x24(%rsp)
jne 0xeae8
movzwl -0x3fa(%r14), %ecx
movw %cx, 0x68(%r12)
movw %r13w, 0x1fd4(%r12)
jmp 0xeaee
movzwl 0x68(%r12), %ecx
addq $-0x3f6, %r14           # imm = 0xFC0A
addq %rdi, %rax
leaq (%rsi,%rax), %rbx
addq $-0x3e8, %rbx           # imm = 0xFC18
andl $0xfffe, %ecx           # imm = 0xFFFE
addq $0xe, %rcx
movl $0xa, %ebp
movq %r14, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movzbl -0x9(%r14,%rbp), %eax
testb $0x8, %al
jne 0xede4
testb $0x2, %al
jne 0xec50
testb $0x4, %al
je 0xedc9
shll $0x8, %eax
movzbl -0xa(%r14,%rbp), %r15d
orl %eax, %r15d
movl $0xd8, %edi
callq 0x33b0
movq %r14, %r12
movq %rax, %r14
addq $0x2, %rax
movq %rax, 0x18(%rsp)
xorl %eax, %eax
movb %al, 0x2(%r14)
leaq 0x52(%r14), %rcx
movq %rcx, 0x8(%rsp)
movb %al, 0x52(%r14)
movw $0x0, 0x7c(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%r14)
movups %xmm0, 0x90(%r14)
movups %xmm0, 0xa0(%r14)
movups %xmm0, 0xb0(%r14)
movups %xmm0, 0xc0(%r14)
movq $0x0, 0xd0(%r14)
movw %r15w, (%r14)
movzwl -0x8(%r12,%rbp), %edi
callq 0xa8de
movq 0x18(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x3510
movzwl -0x6(%r12,%rbp), %edi
callq 0xa8de
movq %r15, %rdi
movq 0x10(%rsp), %r15
movq %rax, %rsi
callq 0x3510
movzwl -0x4(%r12,%rbp), %edi
callq 0xa8de
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x30c0
movw %r13w, 0x7a(%r14)
movzwl -0x2(%r12,%rbp), %eax
movw %ax, 0x7c(%r14)
movq %r15, %rdi
addw %ax, 0x1fd0(%r15)
movzbl 0x2(%r12,%rbp), %edx
movzbl 0x3(%r12,%rbp), %ecx
movl %ecx, %eax
shll $0x8, %eax
orl %edx, %eax
je 0xec64
andl $0x1f, %edx
movl %ecx, %esi
shrl %esi
andl $-0x20, %esi
addl %esi, %edx
addl $0x48, %edx
shrl $0x5, %eax
andl $0x1f, %eax
shrl $0x2, %ecx
andl $0xf, %ecx
decl %ecx
jmp 0xec70
movzwl -0x2(%r14,%rbp), %eax
addw %ax, 0x1fd2(%r12)
jmp 0xedc9
movl $0x1, %eax
movl $0x48, %edx
xorl %ecx, %ecx
movl %edx, 0xac(%r14)
movl %eax, 0xa4(%r14)
movl %ecx, 0xa8(%r14)
movzwl (%r14), %eax
movl %eax, %ecx
shrl $0xe, %ecx
andl $0x1, %ecx
testw %ax, %ax
movl $0x1, %eax
cmovsl %eax, %ecx
movl %ecx, 0xd0(%r14)
movq %rdi, %r12
movzwl 0x68(%rdi), %eax
testl %eax, %eax
je 0xed9c
movl %eax, 0x8(%rsp)
cmpq $0x0, 0x90(%r14)
jne 0xf15c
movl $0x68, %edi
callq 0x33b0
movq %rax, %r12
movb $0x0, 0x14(%rax)
movq %rax, 0x90(%r14)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq %rbx, %r15
subq %rax, %r15
leaq 0x1ff(%r15), %rax
testq %r15, %r15
cmovnsq %r15, %rax
movq %rax, %rcx
sarq $0x9, %rcx
movq %rcx, 0x28(%rsp)
andq $-0x200, %rax           # imm = 0xFE00
subq %rax, %r15
movw %cx, (%r12)
movl %r15d, 0x4(%r12)
movl 0x8(%rsp), %eax
movl %eax, 0x10(%r12)
movl %eax, %edi
movq %rdi, 0x30(%rsp)
callq 0x33b0
movq %rax, 0x8(%r12)
movq %rax, %rcx
movzwl 0x28(%rsp), %eax
shll $0x9, %eax
addq 0x18(%rsp), %rax
movl %r15d, %esi
addq %rax, %rsi
movq %rcx, %r15
movq %rcx, %rdi
movq 0x30(%rsp), %rdx
callq 0x3340
movl $0x65726964, 0x14(%r12) # imm = 0x65726964
movl $0x747865, 0x17(%r12)   # imm = 0x747865
movq 0x10(%rsp), %r12
movq %r15, %rdi
xorl %esi, %esi
movl 0x8(%rsp), %edx
callq 0xa508
testl %eax, %eax
je 0xed9c
movq 0x90(%r14), %rdi
callq 0x1071e
movq $0x0, 0x90(%r14)
movslq 0x8c(%r12), %rax
cmpq $0x3e7, %rax            # imm = 0x3E7
jg 0xee07
leal 0x1(%rax), %ecx
movl %ecx, 0x8c(%r12)
movq %r14, 0x90(%r12,%rax,8)
movq 0x40(%rsp), %r14
movq 0x38(%rsp), %rcx
addw -0x2(%r14,%rbp), %r13w
addq %rcx, %rbx
addq %rcx, %rbp
cmpq $0x801, %rbp            # imm = 0x801
jl 0xeb1c
jmp 0xedf4
movl 0x24(%rsp), %eax
movl %eax, %edx
testl %eax, %eax
jne 0xea56
jmp 0xee3f
leaq 0x7c95(%rip), %rsi      # 0x16a90
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0x400, %edx            # imm = 0x400
jmp 0xee18
leaq 0x7c5a(%rip), %rsi      # 0x16a68
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0x3e8, %edx            # imm = 0x3E8
xorl %eax, %eax
callq 0x9f73
testl %eax, %eax
je 0xee3f
leaq 0xf40e(%rip), %rax      # 0x1e238
movl (%rax), %r14d
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7a29(%rip), %rsi      # 0x1686f
movq %r12, %rdi
movl $0x200, %edx            # imm = 0x200
callq 0xf6ce
leaq 0x7a1c(%rip), %rsi      # 0x16876
movq %r12, %rdi
movl $0x200, %edx            # imm = 0x200
callq 0xf6ce
cmpl $0x0, 0x8c(%r12)
jle 0xefd7
xorl %r13d, %r13d
movq 0x90(%r12,%r13,8), %r12
testb $0x10, (%r12)
movl $0x0, %ebp
je 0xef40
cmpq $0x0, 0x88(%r12)
jne 0xf13d
movq 0x10(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0x8(%rsp)
movzwl 0x7a(%r12), %eax
shll $0x9, %eax
movzbl (%rcx,%rax), %ebp
movl $0x68, %edi
callq 0x33b0
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rax)
xorl %eax, %eax
movb %al, 0x14(%r14)
movq %r14, 0x88(%r12)
movzwl 0x7a(%r12), %ebx
movl %ebp, %r15d
shll $0x9, %r15d
addl $-0x2, %r15d
movw %bx, (%r14)
movl $0x2, 0x4(%r14)
movl %r15d, 0x10(%r14)
movq %r15, %rdi
callq 0x33b0
movq %rax, 0x8(%r14)
shll $0x9, %ebx
movq 0x8(%rsp), %rcx
leaq (%rcx,%rbx), %rsi
addq $0x2, %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x3340
xorl %eax, %eax
movb %al, 0x14(%r14)
movq 0x88(%r12), %rax
movl $0x66657270, 0x14(%rax) # imm = 0x66657270
movl $0x786966, 0x17(%rax)   # imm = 0x786966
cmpq $0x0, 0x80(%r12)
jne 0xf0ff
movl $0x68, %edi
callq 0x33b0
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rax)
xorl %eax, %eax
movb %al, 0x14(%r14)
movq %r14, 0x80(%r12)
movzwl 0x7a(%r12), %eax
addw %bp, %ax
movzwl 0x7c(%r12), %r15d
subl %ebp, %r15d
shll $0x9, %r15d
movzwl %ax, %eax
movl %eax, %r12d
shll $0x9, %r12d
movq 0x10(%rsp), %rbx
addq (%rbx), %r12
movw %ax, (%r14)
movl %r15d, 0x10(%r14)
movq %r15, %rdi
callq 0x33b0
movq %rax, 0x8(%r14)
movq %rax, %rdi
movq %r12, %rsi
movq %rbx, %r12
movq %r15, %rdx
callq 0x3340
xorl %eax, %eax
movb %al, 0x14(%r14)
incq %r13
movslq 0x8c(%rbx), %rax
cmpq %rax, %r13
jl 0xee79
movzwl 0x6c(%r12), %edx
leaq 0x788b(%rip), %rsi      # 0x1686f
movq %r12, %rdi
callq 0xf6ce
movzwl 0x6c(%r12), %edx
leaq 0x787d(%rip), %rsi      # 0x16876
movq %r12, %rdi
callq 0xf6ce
xorl %r14d, %r14d
cmpq $0x0, 0x10(%r12)
je 0xee2d
movq 0x78(%r12), %rsi
movq %r12, %rdi
callq 0x10783
movq 0x80(%r12), %rsi
movq %r12, %rdi
callq 0x10783
movq 0x10(%r12), %rax
movq (%rax), %rax
movl (%rax), %ecx
shrl %ecx
andl $0x1, %ecx
movl %ecx, 0x88(%r12)
movzwl 0x64(%r12), %edx
testl %edx, %edx
je 0xf084
movzwl 0x34(%r12), %edi
leal (%rdi,%rdx,2), %edx
leal 0x1(%rdi), %esi
movl %edi, %r8d
shrl $0x5, %r8d
movl (%rax,%r8,4), %r8d
xorl %r9d, %r9d
btl %edi, %r8d
setb %r9b
orl %r9d, %ecx
movl %ecx, 0x88(%r12)
movzwl %si, %edi
incl %esi
cmpl %edi, %edx
ja 0xf05a
cmpl $0x0, 0x8c(%r12)
jle 0xee2d
xorl %r14d, %r14d
xorl %ebx, %ebx
movq 0x90(%r12,%rbx,8), %r15
movq 0x88(%r15), %rsi
movq %r12, %rdi
callq 0x10783
movq 0x80(%r15), %rsi
movq %r12, %rdi
callq 0x10783
incq %rbx
movslq 0x8c(%r12), %rax
cmpq %rax, %rbx
jl 0xf098
jmp 0xee2d
leaq 0x791e(%rip), %rsi      # 0x169f8
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl %r8d, %edx
xorl %eax, %eax
callq 0x9f73
jmp 0xee1f
leaq 0x78b4(%rip), %rsi      # 0x169a9
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
jmp 0xee18
leaq 0x79fb(%rip), %rdi      # 0x16b01
leaq 0x7673(%rip), %rsi      # 0x16780
leaq 0x79c3(%rip), %rcx      # 0x16ad7
movl $0x2ad, %edx            # imm = 0x2AD
callq 0x3200
leaq 0x71f0(%rip), %rdi      # 0x16315
leaq 0x7654(%rip), %rsi      # 0x16780
leaq 0x7827(%rip), %rcx      # 0x1695a
movl $0x71, %edx
callq 0x3200
leaq 0x7981(%rip), %rdi      # 0x16ac5
leaq 0x7635(%rip), %rsi      # 0x16780
leaq 0x7985(%rip), %rcx      # 0x16ad7
movl $0x2a3, %edx            # imm = 0x2A3
callq 0x3200
leaq 0x78c9(%rip), %rdi      # 0x16a2c
leaq 0x7616(%rip), %rsi      # 0x16780
leaq 0x78ce(%rip), %rcx      # 0x16a3f
movl $0x26d, %edx            # imm = 0x26D
callq 0x3200