	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cdfs_read_file                 ## -- Begin function cdfs_read_file
	.p2align	4, 0x90
_cdfs_read_file:                        ## @cdfs_read_file
	.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
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.1:
	movq	%rsi, %r15
	xorl	%ebx, %ebx
	testq	%rsi, %rsi
	je	LBB0_19
## %bb.2:
	movq	%rdi, %r14
	movq	(%rdi), %rsi
	testq	%rsi, %rsi
	js	LBB0_19
## %bb.3:
	movq	8(%r14), %rbx
	subq	16(%r14), %rbx
	cmpq	%rdx, %rbx
	cmovaeq	%rdx, %rbx
	testq	%rbx, %rbx
	je	LBB0_10
## %bb.4:
	cmpl	$0, 24(%r14)
	je	LBB0_11
## %bb.5:
	movslq	28(%r14), %rsi
	xorl	%r13d, %r13d
	movq	%rsi, %r12
	subq	$2048, %r12                     ## imm = 0x800
	je	LBB0_8
## %bb.6:
	negq	%r12
	addq	32(%r14), %rsi
	movq	%rbx, %rax
	subq	%r12, %rax
	jbe	LBB0_20
## %bb.7:
	movq	%r15, %rdi
	movq	%r12, %rdx
	movq	%rax, %rbx
	callq	_memcpy
	addq	%r12, %r15
	movl	%r12d, %r13d
LBB0_8:
	movq	40(%r14), %rsi
	incq	%rsi
	movq	%rsi, 40(%r14)
	movq	$0, 24(%r14)
	jmp	LBB0_14
LBB0_10:
	xorl	%ebx, %ebx
	jmp	LBB0_19
LBB0_11:
	movq	40(%r14), %rax
	xorl	%r13d, %r13d
	cmpq	%rsi, %rax
	jge	LBB0_13
## %bb.12:
	movq	%rsi, 40(%r14)
	movl	$0, 28(%r14)
	jmp	LBB0_14
LBB0_13:
	movq	%rax, %rsi
LBB0_14:
	cmpq	$2048, %rbx                     ## imm = 0x800
	jb	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	48(%r14), %rdi
	callq	_cdfs_seek_track_sector
	movq	48(%r14), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	movl	$2048, %edx                     ## imm = 0x800
	callq	_intfstream_read
	addq	$2048, %r15                     ## imm = 0x800
	addl	$2048, %r13d                    ## imm = 0x800
	movq	40(%r14), %rsi
	incq	%rsi
	movq	%rsi, 40(%r14)
	addq	$-2048, %rbx                    ## imm = 0xF800
	cmpq	$2047, %rbx                     ## imm = 0x7FF
	ja	LBB0_15
LBB0_16:
	testq	%rbx, %rbx
	je	LBB0_18
## %bb.17:
	movq	48(%r14), %rdi
	callq	_cdfs_seek_track_sector
	movq	32(%r14), %rsi
	movq	48(%r14), %rax
	movl	(%rax), %edi
	movl	$2048, %edx                     ## imm = 0x800
	callq	_intfstream_read
	movq	32(%r14), %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_memcpy
	movl	%ebx, 28(%r14)
	movl	$1, 24(%r14)
	addl	%ebx, %r13d
LBB0_18:
	movslq	%r13d, %rbx
	addq	%rbx, 16(%r14)
LBB0_19:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_memcpy
	addl	%ebx, 28(%r14)
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cdfs_read_file                 ; -- Begin function cdfs_read_file
	.p2align	2
_cdfs_read_file:                        ; @cdfs_read_file
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	cbz	x0, LBB0_7
; %bb.1:
	mov	x21, x1
	mov	x20, #0
	cbz	x1, LBB0_17
; %bb.2:
	mov	x19, x0
	ldr	x1, [x0]
	tbnz	x1, #63, LBB0_17
; %bb.3:
	ldp	x8, x9, [x19, #8]
	sub	x8, x8, x9
	cmp	x8, x2
	csel	x20, x8, x2, lo
	cbz	x20, LBB0_17
; %bb.4:
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_8
; %bb.5:
	ldrsw	x8, [x19, #28]
	cmp	w8, #2048
	b.ne	LBB0_10
; %bb.6:
	mov	w22, #0
	b	LBB0_12
LBB0_7:
	mov	x20, #0
	b	LBB0_17
LBB0_8:
	ldr	x8, [x19, #40]
	cmp	x8, x1
	b.ge	LBB0_18
; %bb.9:
	mov	w22, #0
	str	x1, [x19, #40]
	str	wzr, [x19, #28]
	cmp	x20, #2048
	b.hs	LBB0_13
	b	LBB0_14
LBB0_10:
	mov	w9, #2048
	ldr	x10, [x19, #32]
	add	x1, x10, x8
	sub	x22, x9, x8
	subs	x23, x20, x22
	b.ls	LBB0_19
; %bb.11:
	mov	x0, x21
	mov	x2, x22
	bl	_memcpy
	add	x21, x21, x22
	mov	x20, x23
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
LBB0_12:
	ldr	x8, [x19, #40]
	add	x1, x8, #1
	str	x1, [x19, #40]
	str	xzr, [x19, #24]
	cmp	x20, #2048
	b.lo	LBB0_14
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19, #48]
	bl	_cdfs_seek_track_sector
	ldr	x8, [x19, #48]
	ldr	w0, [x8]
	mov	x1, x21
	mov	w2, #2048
	bl	_intfstream_read
	add	x21, x21, #2048
	add	w22, w22, #2048
	ldr	x8, [x19, #40]
	add	x1, x8, #1
	str	x1, [x19, #40]
	sub	x20, x20, #2048
	cmp	x20, #2047
	b.hi	LBB0_13
LBB0_14:
	cbz	x20, LBB0_16
; %bb.15:
	ldr	x0, [x19, #48]
	bl	_cdfs_seek_track_sector
	ldr	x8, [x19, #48]
	ldr	w0, [x8]
	ldr	x1, [x19, #32]
	mov	w2, #2048
	bl	_intfstream_read
	ldr	x1, [x19, #32]
	mov	x0, x21
	mov	x2, x20
	bl	_memcpy
	mov	w8, #1
	stp	w8, w20, [x19, #24]
	add	w22, w22, w20
LBB0_16:
	sxtw	x20, w22
	ldr	x8, [x19, #16]
	add	x8, x8, x20
	str	x8, [x19, #16]
LBB0_17:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_18:
	mov	w22, #0
	mov	x1, x8
	cmp	x20, #2048
	b.hs	LBB0_13
	b	LBB0_14
LBB0_19:
	mov	x0, x21
	mov	x2, x20
	bl	_memcpy
	ldr	w8, [x19, #28]
	add	w8, w8, w20
	str	w8, [x19, #28]
	b	LBB0_17
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
