	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_reg_dma
_write_reg_dma:                         ## @write_reg_dma
	.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	%ecx, %r14d
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	movq	%r12, %rdi
	callq	_offset_to_nandc_reg
	movq	%rax, %r13
	movq	_NAND_ERASED_CW_DETECT_CFG@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_4
## %bb.1:
	movq	_NAND_ERASED_CW_SET@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_3
## %bb.2:
	addq	$4, %r12
LBB0_3:
	movq	%r12, %r13
LBB0_4:
	movq	_NAND_EXEC_CMD@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	cmpl	%ebx, (%rax)
	jne	LBB0_6
## %bb.5:
	movq	_NAND_BAM_NWD@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_6:
	movq	_NAND_DEV_CMD1_RESTORE@GOTPCREL(%rip), %rax
	movq	_NAND_DEV_CMD1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	cmpl	%ebx, (%rax)
	je	LBB0_8
## %bb.7:
	cmpl	%ebx, %esi
	jne	LBB0_9
LBB0_8:
	movq	%r15, %rdi
	callq	_dev_cmd_reg_addr
	movl	%eax, %ebx
LBB0_9:
	movq	_NAND_DEV_CMD_VLD_RESTORE@GOTPCREL(%rip), %rax
	movq	_NAND_DEV_CMD_VLD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	cmpl	(%rax), %ebx
	je	LBB0_11
## %bb.10:
	cmpl	%esi, %ebx
	jne	LBB0_12
LBB0_11:
	movq	%r15, %rdi
	callq	_dev_cmd_reg_addr
	movl	%eax, %ebx
LBB0_12:
	movq	(%r15), %rax
	cmpq	$0, (%rax)
	je	LBB0_14
## %bb.13:
	orl	%r14d, %r12d
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	movq	%r13, %rcx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	%r12d, %r9d
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_prep_bam_dma_desc_cmd          ## TAILCALL
LBB0_14:
	movq	_NAND_FLASH_CMD@GOTPCREL(%rip), %rax
	xorl	%r9d, %r9d
	cmpl	(%rax), %ebx
	sete	%r9b
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	shll	$2, %r8d
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	movq	%r13, %rcx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_prep_adm_dma_desc              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_ERASED_CW_DETECT_CFG,4,2  ## @NAND_ERASED_CW_DETECT_CFG
	.comm	_NAND_ERASED_CW_SET,4,2         ## @NAND_ERASED_CW_SET
	.comm	_NAND_EXEC_CMD,4,2              ## @NAND_EXEC_CMD
	.comm	_NAND_BAM_NWD,4,2               ## @NAND_BAM_NWD
	.comm	_NAND_DEV_CMD1_RESTORE,4,2      ## @NAND_DEV_CMD1_RESTORE
	.comm	_NAND_DEV_CMD1,4,2              ## @NAND_DEV_CMD1
	.comm	_NAND_DEV_CMD_VLD_RESTORE,4,2   ## @NAND_DEV_CMD_VLD_RESTORE
	.comm	_NAND_DEV_CMD_VLD,4,2           ## @NAND_DEV_CMD_VLD
	.comm	_NAND_FLASH_CMD,4,2             ## @NAND_FLASH_CMD
	.no_dead_strip	_write_reg_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_reg_dma
_write_reg_dma:                         ; @write_reg_dma
	.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	x21, x3
	mov	x19, x2
	mov	x23, x1
	mov	x20, x0
	ldr	x24, [x0, #8]
	mov	x0, x24
	bl	_offset_to_nandc_reg
Lloh0:
	adrp	x8, _NAND_ERASED_CW_DETECT_CFG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_ERASED_CW_DETECT_CFG@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w23
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _NAND_ERASED_CW_SET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAND_ERASED_CW_SET@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w21
	add	x8, x24, #4
	csel	x22, x24, x8, eq
	b	LBB0_3
LBB0_2:
	mov	x22, x0
LBB0_3:
Lloh6:
	adrp	x8, _NAND_EXEC_CMD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NAND_EXEC_CMD@GOTPAGEOFF]
Lloh8:
	adrp	x9, _NAND_BAM_NWD@GOTPAGE
Lloh9:
	ldr	x9, [x9, _NAND_BAM_NWD@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	ldr	w9, [x9]
	cmp	w8, w23
	csel	w24, w9, wzr, eq
Lloh12:
	adrp	x8, _NAND_DEV_CMD1_RESTORE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NAND_DEV_CMD1_RESTORE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _NAND_DEV_CMD1@GOTPAGE
Lloh16:
	ldr	x9, [x9, _NAND_DEV_CMD1@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x9]
	cmp	w8, w23
	ccmp	w1, w23, #4, ne
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x20
	bl	_dev_cmd_reg_addr
	mov	x23, x0
LBB0_5:
Lloh18:
	adrp	x8, _NAND_DEV_CMD_VLD_RESTORE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _NAND_DEV_CMD_VLD_RESTORE@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _NAND_DEV_CMD_VLD@GOTPAGE
Lloh22:
	ldr	x9, [x9, _NAND_DEV_CMD_VLD@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x9]
	cmp	w23, w8
	ccmp	w23, w1, #4, ne
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x20
	bl	_dev_cmd_reg_addr
	mov	x23, x0
LBB0_7:
	ldr	x8, [x20]
	ldr	x8, [x8]
	cbz	x8, LBB0_9
; %bb.8:
	orr	w5, w24, w21
	mov	x0, x20
	mov	w1, #0
	mov	x2, x23
	mov	x3, x22
	mov	x4, 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	_prep_bam_dma_desc_cmd
LBB0_9:
Lloh24:
	adrp	x8, _NAND_FLASH_CMD@GOTPAGE
Lloh25:
	ldr	x8, [x8, _NAND_FLASH_CMD@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	cmp	w23, w8
	cset	w5, eq
	lsl	w4, w19, #2
	mov	x0, x20
	mov	w1, #0
	mov	x2, x23
	mov	x3, x22
	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	_prep_adm_dma_desc
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_ERASED_CW_DETECT_CFG,4,2  ; @NAND_ERASED_CW_DETECT_CFG
	.comm	_NAND_ERASED_CW_SET,4,2         ; @NAND_ERASED_CW_SET
	.comm	_NAND_EXEC_CMD,4,2              ; @NAND_EXEC_CMD
	.comm	_NAND_BAM_NWD,4,2               ; @NAND_BAM_NWD
	.comm	_NAND_DEV_CMD1_RESTORE,4,2      ; @NAND_DEV_CMD1_RESTORE
	.comm	_NAND_DEV_CMD1,4,2              ; @NAND_DEV_CMD1
	.comm	_NAND_DEV_CMD_VLD_RESTORE,4,2   ; @NAND_DEV_CMD_VLD_RESTORE
	.comm	_NAND_DEV_CMD_VLD,4,2           ; @NAND_DEV_CMD_VLD
	.comm	_NAND_FLASH_CMD,4,2             ; @NAND_FLASH_CMD
	.no_dead_strip	_write_reg_dma
.subsections_via_symbols
