	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_resetDosDirSection             ## -- Begin function resetDosDirSection
	.p2align	4, 0x90
_resetDosDirSection:                    ## @resetDosDirSection
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movq	_FSOK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	(%rdi), %edi
	shll	$5, %edi
	movslq	4(%r12), %rax
	movslq	8(%r12), %rbx
	imulq	%rax, %rbx
	movl	%ebx, %esi
	callq	_MAX
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_malloc
	movq	%rax, %r13
	movq	_buffer@GOTPCREL(%rip), %rax
	movq	%r13, (%rax)
	testq	%r13, %r13
	je	LBB0_1
## %bb.4:
	movq	%rbx, %rdi
	callq	_malloc
	movq	_delbuf@GOTPCREL(%rip), %r14
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	xorl	%eax, %eax
	callq	_newDosDirEntry
	movq	_rootDir@GOTPCREL(%rip), %rbx
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	_FAT32@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 12(%r12)
	je	LBB0_15
## %bb.9:
	movq	16(%r12), %rsi
	movq	_CLUST_FIRST@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jb	LBB0_11
## %bb.10:
	cmpq	24(%r12), %rsi
	jae	LBB0_11
## %bb.12:
	movq	%rsi, %rax
	shlq	$4, %rax
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	cmpq	%rsi, (%rdx,%rax)
	jne	LBB0_13
## %bb.14:
	movq	_FAT_USED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 8(%rdx,%rax)
	movq	(%rbx), %rax
	movq	%rsi, (%rax)
	jmp	LBB0_15
LBB0_1:
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	jmp	LBB0_2
LBB0_5:
	movq	%r13, %rdi
	callq	_free
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
LBB0_2:
	xorl	%eax, %eax
	callq	_perr
LBB0_3:
	movq	_FSFATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_15:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_free
	movq	(%r14), %rdi
	callq	_free
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_perr
	jmp	LBB0_3
LBB0_11:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_pfatal
	jmp	LBB0_3
LBB0_13:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_pfatal
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_FSOK,4,2                       ## @FSOK
	.comm	_buffer,8,3                     ## @buffer
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No space for directory buffer (%zu)"

	.comm	_FSFATAL,4,2                    ## @FSFATAL
	.comm	_delbuf,8,3                     ## @delbuf
L_.str.1:                               ## @.str.1
	.asciz	"No space for directory delbuf (%zu)"

	.comm	_rootDir,8,3                    ## @rootDir
L_.str.2:                               ## @.str.2
	.asciz	"No space for directory entry"

	.comm	_FAT32,4,2                      ## @FAT32
	.comm	_CLUST_FIRST,8,3                ## @CLUST_FIRST
L_.str.3:                               ## @.str.3
	.asciz	"Root directory starts with cluster out of range(%u)"

L_.str.4:                               ## @.str.4
	.asciz	"Root directory doesn't start a cluster chain"

	.comm	_FAT_USED,4,2                   ## @FAT_USED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_resetDosDirSection             ; -- Begin function resetDosDirSection
	.p2align	2
_resetDosDirSection:                    ; @resetDosDirSection
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _FSOK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FSOK@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	ldp	w8, w9, [x0]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	lsl	w0, w8, #5
	ldrsw	x8, [x21, #8]
	mul	x22, x8, x9
	mov	x1, x22
	bl	_MAX
	mov	x24, x0
	bl	_malloc
Lloh3:
	adrp	x25, _buffer@GOTPAGE
Lloh4:
	ldr	x25, [x25, _buffer@GOTPAGEOFF]
	str	x0, [x25]
	cbz	x0, LBB0_8
; %bb.1:
	mov	x23, x0
	mov	x0, x22
	bl	_malloc
Lloh5:
	adrp	x24, _delbuf@GOTPAGE
Lloh6:
	ldr	x24, [x24, _delbuf@GOTPAGEOFF]
	str	x0, [x24]
	cbz	x0, LBB0_9
; %bb.2:
	bl	_newDosDirEntry
Lloh7:
	adrp	x22, _rootDir@GOTPAGE
Lloh8:
	ldr	x22, [x22, _rootDir@GOTPAGEOFF]
	str	x0, [x22]
	cbz	x0, LBB0_10
; %bb.3:
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	w8, [x21, #12]
Lloh9:
	adrp	x9, _FAT32@GOTPAGE
Lloh10:
	ldr	x9, [x9, _FAT32@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.4:
	ldr	x8, [x21, #16]
Lloh12:
	adrp	x9, _CLUST_FIRST@GOTPAGE
Lloh13:
	ldr	x9, [x9, _CLUST_FIRST@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lo	LBB0_14
; %bb.5:
	ldr	x9, [x21, #24]
	cmp	x8, x9
	b.hs	LBB0_14
; %bb.6:
	lsl	x9, x8, #4
	ldr	x9, [x20, x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.7:
Lloh15:
	adrp	x9, _FAT_USED@GOTPAGE
Lloh16:
	ldr	x9, [x9, _FAT_USED@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	add	x10, x20, x8, lsl #4
	ldr	w11, [x10, #8]
	orr	w9, w11, w9
	str	w9, [x10, #8]
	ldr	x9, [x22]
	str	x8, [x9]
	b	LBB0_13
LBB0_8:
	str	x24, [sp]
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_11
LBB0_9:
	mov	x0, x23
	bl	_free
	str	x22, [sp]
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_10:
	ldr	x0, [x25]
	bl	_free
	ldr	x0, [x24]
	bl	_free
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_11:
	bl	_perr
LBB0_12:
Lloh24:
	adrp	x8, _FSFATAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _FSFATAL@GOTPAGEOFF]
Lloh26:
	ldr	w19, [x8]
LBB0_13:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_14:
	str	x8, [sp]
Lloh27:
	adrp	x0, l_.str.3@PAGE
Lloh28:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pfatal
	b	LBB0_12
LBB0_15:
Lloh29:
	adrp	x0, l_.str.4@PAGE
Lloh30:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pfatal
	b	LBB0_12
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_FSOK,4,2                       ; @FSOK
	.comm	_buffer,8,3                     ; @buffer
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No space for directory buffer (%zu)"

	.comm	_FSFATAL,4,2                    ; @FSFATAL
	.comm	_delbuf,8,3                     ; @delbuf
l_.str.1:                               ; @.str.1
	.asciz	"No space for directory delbuf (%zu)"

	.comm	_rootDir,8,3                    ; @rootDir
l_.str.2:                               ; @.str.2
	.asciz	"No space for directory entry"

	.comm	_FAT32,4,2                      ; @FAT32
	.comm	_CLUST_FIRST,8,3                ; @CLUST_FIRST
l_.str.3:                               ; @.str.3
	.asciz	"Root directory starts with cluster out of range(%u)"

l_.str.4:                               ; @.str.4
	.asciz	"Root directory doesn't start a cluster chain"

	.comm	_FAT_USED,4,2                   ; @FAT_USED
.subsections_via_symbols
