	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bf5xx_nand_read_buf
_bf5xx_nand_read_buf:                   ## @bf5xx_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
	testl	%edx, %edx
	jle	LBB0_8
## %bb.1:
	movq	%rsi, %r14
	movl	%edx, %r15d
	movq	_WB_FULL@GOTPCREL(%rip), %rbx
	movq	_RD_RDY@GOTPCREL(%rip), %r12
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_cpu_relax
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	xorl	%eax, %eax
	callq	_bfin_read_NFC_STAT
	testl	%eax, (%rbx)
	jne	LBB0_2
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%edi, %edi
	callq	_bfin_write_NFC_DATA_RD
	xorl	%eax, %eax
	callq	_SSYNC
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	xorl	%eax, %eax
	callq	_bfin_read_NFC_IRQSTAT
                                        ## kill: def $ax killed $ax def $eax
	notl	%eax
	testw	%ax, (%r12)
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=2
	xorl	%eax, %eax
	callq	_cpu_relax
	jmp	LBB0_6
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_bfin_read_NFC_READ
	movl	%eax, (%r14,%r13,4)
	xorl	%eax, %eax
	callq	_bfin_read_NFC_IRQSTAT
	orw	(%r12), %ax
	movzwl	%ax, %edi
	callq	_bfin_write_NFC_IRQSTAT
	xorl	%eax, %eax
	callq	_SSYNC
	incq	%r13
	cmpq	%r15, %r13
	jne	LBB0_3
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WB_FULL,4,2                    ## @WB_FULL
	.comm	_RD_RDY,2,1                     ## @RD_RDY
	.no_dead_strip	_bf5xx_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 bf5xx_nand_read_buf
_bf5xx_nand_read_buf:                   ; @bf5xx_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
	cmp	w2, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x19, x1
	mov	x20, #0
Lloh0:
	adrp	x21, _WB_FULL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _WB_FULL@GOTPAGEOFF]
Lloh2:
	adrp	x22, _RD_RDY@GOTPAGE
Lloh3:
	ldr	x22, [x22, _RD_RDY@GOTPAGEOFF]
	mov	w23, w2
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	bl	_cpu_relax
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	bl	_bfin_read_NFC_STAT
	ldr	w8, [x21]
	tst	w8, w0
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #0
	bl	_bfin_write_NFC_DATA_RD
	bl	_SSYNC
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	bl	_bfin_read_NFC_IRQSTAT
	ldrh	w8, [x22]
	bics	wzr, w8, w0
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	bl	_cpu_relax
	b	LBB0_5
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	bl	_bfin_read_NFC_READ
	str	w0, [x19, x20, lsl #2]
	bl	_bfin_read_NFC_IRQSTAT
	ldrh	w8, [x22]
	orr	w0, w8, w0
	bl	_bfin_write_NFC_IRQSTAT
	bl	_SSYNC
	add	x20, x20, #1
	cmp	x20, x23
	b.ne	LBB0_3
LBB0_8:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_WB_FULL,4,2                    ; @WB_FULL
	.comm	_RD_RDY,2,1                     ; @RD_RDY
	.no_dead_strip	_bf5xx_nand_read_buf
.subsections_via_symbols
