	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_nand_read_buf
_atmel_nand_read_buf:                   ## @atmel_nand_read_buf
	.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
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_to_atmel_nand
	movq	%rax, %r12
	movl	4(%rbx), %edi
	callq	_to_nand_controller
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.1:
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_virt_addr_valid
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	_MIN_DMA_LEN@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jg	LBB0_4
## %bb.3:
	movq	(%r12), %rax
	movl	4(%rax), %edx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	%r15d, %ecx
	callq	_atmel_nand_dma_transfer
	testl	%eax, %eax
	je	LBB0_6
LBB0_4:
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r12), %rcx
	movl	(%rcx), %edi
	testl	%eax, (%rbx)
	je	LBB0_5
## %bb.7:
	movl	%r15d, %edx
	shrl	$31, %edx
	addl	%r15d, %edx
	sarl	%edx
	movq	%r14, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ioread16_rep                   ## TAILCALL
LBB0_5:
	movq	%r14, %rsi
	movl	%r15d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ioread8_rep                    ## TAILCALL
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MIN_DMA_LEN,4,2                ## @MIN_DMA_LEN
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_NAND_BUSWIDTH_16,4,2           ## @NAND_BUSWIDTH_16
	.no_dead_strip	_atmel_nand_read_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_nand_read_buf
_atmel_nand_read_buf:                   ; @atmel_nand_read_buf
	.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
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	bl	_to_atmel_nand
	mov	x22, x0
	ldr	w0, [x21, #4]
	bl	_to_nand_controller
	ldr	x8, [x0]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x23, x0
	mov	x0, x19
	bl	_virt_addr_valid
	cbz	x0, LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, _MIN_DMA_LEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MIN_DMA_LEN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.gt	LBB0_4
; %bb.3:
	ldr	x8, [x22]
	ldr	w2, [x8, #4]
Lloh3:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh5:
	ldr	w4, [x8]
	mov	x0, x23
	mov	x1, x19
	mov	x3, x20
	bl	_atmel_nand_dma_transfer
	cbz	w0, LBB0_7
LBB0_4:
	ldr	w8, [x21]
Lloh6:
	adrp	x9, _NAND_BUSWIDTH_16@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NAND_BUSWIDTH_16@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	ldr	x10, [x22]
	ldr	w0, [x10]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	cmp	w20, #0
	cinc	w8, w20, lt
	asr	w2, w8, #1
	mov	x1, x19
	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
	b	_ioread16_rep
LBB0_6:
	mov	x1, x19
	mov	x2, 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
	b	_ioread8_rep
LBB0_7:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MIN_DMA_LEN,4,2                ; @MIN_DMA_LEN
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_NAND_BUSWIDTH_16,4,2           ; @NAND_BUSWIDTH_16
	.no_dead_strip	_atmel_nand_read_buf
.subsections_via_symbols
