	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dos_read
_dos_read:                              ## @dos_read
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r12
	movq	%rdx, %r14
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r13
	movl	$4, %edi
	callq	_twiddle
	movq	8(%r13), %rdi
	leaq	16(%r13), %rbx
	movq	%rbx, %rsi
	callq	_fsize
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %r15d
	movq	%r14, %rax
	movl	(%r13), %r14d
	subl	%r14d, %r15d
	cmpl	%eax, %r15d
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	cmovgel	%eax, %r15d
	movq	8(%r13), %rax
	movl	8(%rax), %edi
	movq	%rbx, %rsi
	callq	_stclus
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	8(%r13), %rax
	movl	(%rax), %eax
	decl	%eax
	andl	%eax, %r14d
LBB0_4:
	movl	4(%r13), %ecx
	movl	%ecx, -48(%rbp)
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.6:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_13 Depth 2
	testl	%ecx, %ecx
	je	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	xorl	%ebx, %ebx
	testl	%r14d, %r14d
	sete	%bl
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, -48(%rbp)
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	8(%r13), %rdi
	movl	(%r13), %esi
	callq	_bytblk
	movl	%eax, %ebx
	jmp	LBB0_12
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	incl	%ebx
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r13), %r12
	decl	%ebx
	je	LBB0_18
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=2
	movq	%r12, %rdi
	leaq	-48(%rbp), %rsi
	callq	_fatget
	testl	%eax, %eax
	jne	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=2
	movq	8(%r13), %rdi
	movl	-48(%rbp), %esi
	callq	_okclus
	testl	%eax, %eax
	jne	LBB0_13
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r12), %eax
	subl	%r14d, %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	jle	LBB0_21
LBB0_20:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
LBB0_21:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	-48(%rbp), %esi
	testl	%esi, %esi
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r12, %rdi
	callq	_blkoff
	jmp	LBB0_24
LBB0_23:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	4(%r12), %edi
	callq	_secbyt
LBB0_24:                                ##   in Loop: Header=BB0_7 Depth=1
	movslq	%r14d, %rsi
	addq	%rax, %rsi
	movq	%r12, %rdi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %ecx
	callq	_ioread
	testl	%eax, %eax
	jne	LBB0_15
## %bb.25:                              ##   in Loop: Header=BB0_7 Depth=1
	addl	%r12d, (%r13)
	movl	-48(%rbp), %ecx
	movl	%ecx, 4(%r13)
	movslq	%r12d, %rax
	addq	%rax, %rbx
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movl	$0, %eax
	subl	%r12d, -44(%rbp)                ## 4-byte Folded Spill
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	jne	LBB0_7
	jmp	LBB0_26
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_28
LBB0_5:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
LBB0_26:
	testq	%r12, %r12
	je	LBB0_28
LBB0_27:
	movslq	%r15d, %rcx
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	subq	%rcx, %rdx
	movslq	%r14d, %rcx
	addq	%rdx, %rcx
	movq	%rcx, (%r12)
LBB0_28:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_15:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	testq	%r12, %r12
	jne	LBB0_27
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_dos_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dos_read
_dos_read:                              ; @dos_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	ldr	x26, [x0]
	mov	w0, #4
	bl	_twiddle
	ldr	x0, [x26, #8]
	add	x22, x26, #16
	mov	x1, x22
	bl	_fsize
	cmn	w0, #1
	b.eq	LBB0_22
; %bb.1:
	ldr	w27, [x26]
	sub	w8, w0, w27
	cmp	w8, w20
	csel	w25, w8, w20, lt
	ldr	x8, [x26, #8]
	ldr	w0, [x8, #8]
	mov	x1, x22
	bl	_stclus
	mov	x22, x0
	cbz	w0, LBB0_3
; %bb.2:
	ldr	x8, [x26, #8]
	ldr	w8, [x8]
	sub	w8, w8, #1
	and	w27, w8, w27
LBB0_3:
	ldr	w9, [x26, #4]
	str	w9, [sp, #12]
	cbz	w25, LBB0_23
; %bb.4:
	mov	x28, x25
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	cbz	w9, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w27, #0
	cset	w0, eq
	b	LBB0_10
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	str	w22, [sp, #12]
	cbz	w22, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x26, #8]
	ldr	w1, [x26]
	bl	_bytblk
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #0
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w23, w0, #1
LBB0_11:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x24, [x26, #8]
	subs	w23, w23, #1
	b.eq	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	add	x1, sp, #12
	mov	x0, x24
	bl	_fatget
	cbnz	w0, LBB0_24
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=2
	ldr	x0, [x26, #8]
	ldr	w1, [sp, #12]
	bl	_okclus
	cbnz	w0, LBB0_11
	b	LBB0_25
LBB0_14:                                ;   in Loop: Header=BB0_5 Depth=1
	cbz	w22, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x24]
	sub	w23, w8, w27
	cmp	w23, w28
	b.le	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, x28
LBB0_17:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [sp, #12]
	cbz	w1, LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	bl	_blkoff
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x24, #4]
	bl	_secbyt
LBB0_20:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x1, x0, w27, sxtw
	mov	x0, x24
	mov	x2, x21
	mov	x3, x23
	bl	_ioread
	cbnz	w0, LBB0_24
; %bb.21:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	w27, #0
	mov	w8, #0
	ldr	w9, [x26]
	add	w9, w9, w23
	str	w9, [x26]
	ldr	w9, [sp, #12]
	str	w9, [x26, #4]
	add	x21, x21, w23, sxtw
	subs	w28, w28, w23
	b.ne	LBB0_5
	b	LBB0_26
LBB0_22:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	b	LBB0_28
LBB0_23:
	mov	w8, #0
	mov	w0, #0
	cbnz	x19, LBB0_27
	b	LBB0_28
LBB0_24:
	mov	x8, x28
	cbnz	x19, LBB0_27
	b	LBB0_28
LBB0_25:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	x8, x28
LBB0_26:
	cbz	x19, LBB0_28
LBB0_27:
	sub	x9, x20, w25, sxtw
	add	x8, x9, w8, sxtw
	str	x8, [x19]
LBB0_28:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_dos_read
.subsections_via_symbols
