	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function update_rw_regs
_update_rw_regs:                        ## @update_rw_regs
	.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, %ebx
	movl	%esi, %r13d
	movq	%rdi, %r12
	addq	$48, %rdi
	callq	_get_qcom_nand_controller
	movq	%rax, %r14
	testl	%ebx, %ebx
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_3
## %bb.1:
	cmpq	$0, 40(%r12)
	je	LBB0_5
## %bb.2:
	movq	_OP_PAGE_READ_WITH_ECC@GOTPCREL(%rip), %rax
	movq	_PAGE_ACC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_LAST_PAGE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	jmp	LBB0_4
LBB0_3:
	movq	_OP_PROGRAM_PAGE@GOTPCREL(%rip), %rax
	movq	_PAGE_ACC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_LAST_PAGE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	cmpq	$0, 40(%r12)
	je	LBB0_6
LBB0_4:
	movq	_CW_PER_PAGE@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$7, %eax
	shll	%cl, %eax
	notl	%eax
	andl	(%r12), %eax
	decl	%r13d
	shll	%cl, %r13d
	orl	%eax, %r13d
	leaq	4(%r12), %rax
	movl	8(%r12), %ebx
	jmp	LBB0_7
LBB0_5:
	movq	_OP_PAGE_READ@GOTPCREL(%rip), %rax
	movq	_PAGE_ACC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_LAST_PAGE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
LBB0_6:
	movq	_CW_PER_PAGE@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$7, %eax
	shll	%cl, %eax
	notl	%eax
	andl	12(%r12), %eax
	decl	%r13d
	shll	%cl, %r13d
	orl	%eax, %r13d
	leaq	16(%r12), %rax
	movq	_ECC_CFG_ECC_DISABLE@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %ebx
	shll	%cl, %ebx
LBB0_7:
	movl	(%rax), %r15d
	movq	_NAND_FLASH_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_nandc_set_reg
	movq	_NAND_DEV0_CFG0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_nandc_set_reg
	movq	_NAND_DEV0_CFG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_nandc_set_reg
	movq	_NAND_DEV0_ECC_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_nandc_set_reg
	movq	_NAND_EBI2_ECC_BUF_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	20(%r12), %edx
	movq	%r14, %rdi
	callq	_nandc_set_reg
	movq	_NAND_FLASH_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	24(%r12), %edx
	movq	%r14, %rdi
	callq	_nandc_set_reg
	movq	_NAND_READ_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	28(%r12), %edx
	movq	%r14, %rdi
	callq	_nandc_set_reg
	movq	_NAND_EXEC_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_nandc_set_reg
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_8
## %bb.9:
	xorl	%eax, %eax
	cmpq	$0, 40(%r12)
	setne	%al
	movl	32(%r12,%rax,4), %ecx
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$1, %r8d
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nandc_set_read_loc             ## TAILCALL
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OP_PAGE_READ_WITH_ECC,4,2      ## @OP_PAGE_READ_WITH_ECC
	.comm	_PAGE_ACC,4,2                   ## @PAGE_ACC
	.comm	_LAST_PAGE,4,2                  ## @LAST_PAGE
	.comm	_OP_PAGE_READ,4,2               ## @OP_PAGE_READ
	.comm	_OP_PROGRAM_PAGE,4,2            ## @OP_PROGRAM_PAGE
	.comm	_CW_PER_PAGE,4,2                ## @CW_PER_PAGE
	.comm	_ECC_CFG_ECC_DISABLE,4,2        ## @ECC_CFG_ECC_DISABLE
	.comm	_NAND_FLASH_CMD,4,2             ## @NAND_FLASH_CMD
	.comm	_NAND_DEV0_CFG0,4,2             ## @NAND_DEV0_CFG0
	.comm	_NAND_DEV0_CFG1,4,2             ## @NAND_DEV0_CFG1
	.comm	_NAND_DEV0_ECC_CFG,4,2          ## @NAND_DEV0_ECC_CFG
	.comm	_NAND_EBI2_ECC_BUF_CFG,4,2      ## @NAND_EBI2_ECC_BUF_CFG
	.comm	_NAND_FLASH_STATUS,4,2          ## @NAND_FLASH_STATUS
	.comm	_NAND_READ_STATUS,4,2           ## @NAND_READ_STATUS
	.comm	_NAND_EXEC_CMD,4,2              ## @NAND_EXEC_CMD
	.no_dead_strip	_update_rw_regs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function update_rw_regs
_update_rw_regs:                        ; @update_rw_regs
	.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, x2
	mov	x22, x1
	mov	x19, x0
	add	x0, x0, #48
	bl	_get_qcom_nand_controller
	mov	x20, x0
	cbz	w21, LBB0_3
; %bb.1:
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _OP_PAGE_READ_WITH_ECC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OP_PAGE_READ_WITH_ECC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _PAGE_ACC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PAGE_ACC@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _LAST_PAGE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _LAST_PAGE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w2, w8, w9
	b	LBB0_4
LBB0_3:
Lloh9:
	adrp	x8, _OP_PROGRAM_PAGE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _OP_PROGRAM_PAGE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _PAGE_ACC@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PAGE_ACC@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _LAST_PAGE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _LAST_PAGE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w2, w8, w9
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_6
LBB0_4:
	ldr	w8, [x19]
Lloh18:
	adrp	x9, _CW_PER_PAGE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _CW_PER_PAGE@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	mov	w10, #7
	lsl	w10, w10, w9
	bic	w8, w8, w10
	sub	w10, w22, #1
	lsl	w9, w10, w9
	orr	w23, w8, w9
	add	x8, x19, #4
	ldr	w22, [x19, #8]
	b	LBB0_7
LBB0_5:
Lloh21:
	adrp	x8, _OP_PAGE_READ@GOTPAGE
Lloh22:
	ldr	x8, [x8, _OP_PAGE_READ@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _PAGE_ACC@GOTPAGE
Lloh25:
	ldr	x9, [x9, _PAGE_ACC@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh27:
	adrp	x9, _LAST_PAGE@GOTPAGE
Lloh28:
	ldr	x9, [x9, _LAST_PAGE@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	orr	w2, w8, w9
LBB0_6:
	ldr	w8, [x19, #12]
Lloh30:
	adrp	x9, _CW_PER_PAGE@GOTPAGE
Lloh31:
	ldr	x9, [x9, _CW_PER_PAGE@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	mov	w10, #7
	lsl	w10, w10, w9
	bic	w8, w8, w10
	sub	w10, w22, #1
	lsl	w9, w10, w9
	orr	w23, w8, w9
	add	x8, x19, #16
Lloh33:
	adrp	x9, _ECC_CFG_ECC_DISABLE@GOTPAGE
Lloh34:
	ldr	x9, [x9, _ECC_CFG_ECC_DISABLE@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	mov	w10, #1
	lsl	w22, w10, w9
LBB0_7:
	ldr	w24, [x8]
Lloh36:
	adrp	x8, _NAND_FLASH_CMD@GOTPAGE
Lloh37:
	ldr	x8, [x8, _NAND_FLASH_CMD@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_nandc_set_reg
Lloh39:
	adrp	x8, _NAND_DEV0_CFG0@GOTPAGE
Lloh40:
	ldr	x8, [x8, _NAND_DEV0_CFG0@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x23
	bl	_nandc_set_reg
Lloh42:
	adrp	x8, _NAND_DEV0_CFG1@GOTPAGE
Lloh43:
	ldr	x8, [x8, _NAND_DEV0_CFG1@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x24
	bl	_nandc_set_reg
Lloh45:
	adrp	x8, _NAND_DEV0_ECC_CFG@GOTPAGE
Lloh46:
	ldr	x8, [x8, _NAND_DEV0_ECC_CFG@GOTPAGEOFF]
Lloh47:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x22
	bl	_nandc_set_reg
Lloh48:
	adrp	x8, _NAND_EBI2_ECC_BUF_CFG@GOTPAGE
Lloh49:
	ldr	x8, [x8, _NAND_EBI2_ECC_BUF_CFG@GOTPAGEOFF]
Lloh50:
	ldr	w1, [x8]
	ldr	w2, [x19, #20]
	mov	x0, x20
	bl	_nandc_set_reg
Lloh51:
	adrp	x8, _NAND_FLASH_STATUS@GOTPAGE
Lloh52:
	ldr	x8, [x8, _NAND_FLASH_STATUS@GOTPAGEOFF]
Lloh53:
	ldr	w1, [x8]
	ldr	w2, [x19, #24]
	mov	x0, x20
	bl	_nandc_set_reg
Lloh54:
	adrp	x8, _NAND_READ_STATUS@GOTPAGE
Lloh55:
	ldr	x8, [x8, _NAND_READ_STATUS@GOTPAGEOFF]
Lloh56:
	ldr	w1, [x8]
	ldr	w2, [x19, #28]
	mov	x0, x20
	bl	_nandc_set_reg
Lloh57:
	adrp	x8, _NAND_EXEC_CMD@GOTPAGE
Lloh58:
	ldr	x8, [x8, _NAND_EXEC_CMD@GOTPAGEOFF]
Lloh59:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	bl	_nandc_set_reg
	cbz	w21, LBB0_9
; %bb.8:
	ldr	x8, [x19, #40]
	mov	w9, #36
	mov	w10, #32
	cmp	x8, #0
	csel	x8, x10, x9, eq
	ldr	w3, [x19, x8]
	mov	x0, x20
	mov	w1, #0
	mov	w2, #0
	mov	w4, #1
	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	_nandc_set_read_loc
LBB0_9:
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_OP_PAGE_READ_WITH_ECC,4,2      ; @OP_PAGE_READ_WITH_ECC
	.comm	_PAGE_ACC,4,2                   ; @PAGE_ACC
	.comm	_LAST_PAGE,4,2                  ; @LAST_PAGE
	.comm	_OP_PAGE_READ,4,2               ; @OP_PAGE_READ
	.comm	_OP_PROGRAM_PAGE,4,2            ; @OP_PROGRAM_PAGE
	.comm	_CW_PER_PAGE,4,2                ; @CW_PER_PAGE
	.comm	_ECC_CFG_ECC_DISABLE,4,2        ; @ECC_CFG_ECC_DISABLE
	.comm	_NAND_FLASH_CMD,4,2             ; @NAND_FLASH_CMD
	.comm	_NAND_DEV0_CFG0,4,2             ; @NAND_DEV0_CFG0
	.comm	_NAND_DEV0_CFG1,4,2             ; @NAND_DEV0_CFG1
	.comm	_NAND_DEV0_ECC_CFG,4,2          ; @NAND_DEV0_ECC_CFG
	.comm	_NAND_EBI2_ECC_BUF_CFG,4,2      ; @NAND_EBI2_ECC_BUF_CFG
	.comm	_NAND_FLASH_STATUS,4,2          ; @NAND_FLASH_STATUS
	.comm	_NAND_READ_STATUS,4,2           ; @NAND_READ_STATUS
	.comm	_NAND_EXEC_CMD,4,2              ; @NAND_EXEC_CMD
	.no_dead_strip	_update_rw_regs
.subsections_via_symbols
