	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function config_nand_cw_read
_config_nand_cw_read:                   ## @config_nand_cw_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_NAND_READ_LOCATION_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_NAND_BAM_NEXT_SGL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_write_reg_dma
LBB0_2:
	movq	_NAND_FLASH_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_NAND_BAM_NEXT_SGL@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_write_reg_dma
	movq	_NAND_EXEC_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %ecx
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_write_reg_dma
	movq	_NAND_FLASH_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	movl	$2, %edx
	xorl	%ecx, %ecx
	callq	_read_reg_dma
	movq	_NAND_ERASED_CW_DETECT_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_4:
	movl	(%r15), %ecx
	movq	%rbx, %rdi
	movl	$1, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_read_reg_dma                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_READ_LOCATION_0,4,2       ## @NAND_READ_LOCATION_0
	.comm	_NAND_BAM_NEXT_SGL,4,2          ## @NAND_BAM_NEXT_SGL
	.comm	_NAND_FLASH_CMD,4,2             ## @NAND_FLASH_CMD
	.comm	_NAND_EXEC_CMD,4,2              ## @NAND_EXEC_CMD
	.comm	_NAND_FLASH_STATUS,4,2          ## @NAND_FLASH_STATUS
	.comm	_NAND_ERASED_CW_DETECT_STATUS,4,2 ## @NAND_ERASED_CW_DETECT_STATUS
	.no_dead_strip	_config_nand_cw_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function config_nand_cw_read
_config_nand_cw_read:                   ; @config_nand_cw_read
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x8, [x8]
Lloh0:
	adrp	x21, _NAND_BAM_NEXT_SGL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _NAND_BAM_NEXT_SGL@GOTPAGEOFF]
	cbz	x8, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _NAND_READ_LOCATION_0@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NAND_READ_LOCATION_0@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	ldr	w3, [x21]
	mov	x0, x19
	mov	w2, #4
	bl	_write_reg_dma
LBB0_2:
Lloh5:
	adrp	x8, _NAND_FLASH_CMD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NAND_FLASH_CMD@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	ldr	w3, [x21]
	mov	x0, x19
	mov	w2, #1
	bl	_write_reg_dma
Lloh8:
	adrp	x8, _NAND_EXEC_CMD@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NAND_EXEC_CMD@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	ldr	w3, [x21]
	mov	x0, x19
	mov	w2, #1
	bl	_write_reg_dma
Lloh11:
	adrp	x8, _NAND_FLASH_STATUS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NAND_FLASH_STATUS@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	cbz	w20, LBB0_4
; %bb.3:
	mov	x0, x19
	mov	w2, #2
	mov	w3, #0
	bl	_read_reg_dma
Lloh14:
	adrp	x8, _NAND_ERASED_CW_DETECT_STATUS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NAND_ERASED_CW_DETECT_STATUS@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
LBB0_4:
	ldr	w3, [x21]
	mov	x0, x19
	mov	w2, #1
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_read_reg_dma
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_READ_LOCATION_0,4,2       ; @NAND_READ_LOCATION_0
	.comm	_NAND_BAM_NEXT_SGL,4,2          ; @NAND_BAM_NEXT_SGL
	.comm	_NAND_FLASH_CMD,4,2             ; @NAND_FLASH_CMD
	.comm	_NAND_EXEC_CMD,4,2              ; @NAND_EXEC_CMD
	.comm	_NAND_FLASH_STATUS,4,2          ; @NAND_FLASH_STATUS
	.comm	_NAND_ERASED_CW_DETECT_STATUS,4,2 ; @NAND_ERASED_CW_DETECT_STATUS
	.no_dead_strip	_config_nand_cw_read
.subsections_via_symbols
