	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qcom_nandc_setup
_qcom_nandc_setup:                      ## @qcom_nandc_setup
	.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
	movq	%rdi, %rbx
	movq	_SFLASHC_BURST_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_nandc_write
	movq	_NAND_DEV_CMD_VLD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_dev_cmd_reg_addr
	movq	_NAND_DEV_CMD_VLD_VAL@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_nandc_write
	movq	16(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_NAND_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_nandc_read
	movl	(%r15), %esi
	movq	_BAM_MODE_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%rbx, %rdi
	movl	%eax, %edx
	jmp	LBB0_3
LBB0_2:
	movq	_NAND_FLASH_CHIP_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DM_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
LBB0_3:
	callq	_nandc_write
	movq	_NAND_DEV_CMD1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_dev_cmd_reg_addr
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_nandc_read
	movq	%rax, 8(%rbx)
	movl	(%r14), %eax
	movl	%eax, (%rbx)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SFLASHC_BURST_CFG,4,2          ## @SFLASHC_BURST_CFG
	.comm	_NAND_DEV_CMD_VLD,4,2           ## @NAND_DEV_CMD_VLD
	.comm	_NAND_DEV_CMD_VLD_VAL,4,2       ## @NAND_DEV_CMD_VLD_VAL
	.comm	_NAND_CTRL,4,2                  ## @NAND_CTRL
	.comm	_BAM_MODE_EN,4,2                ## @BAM_MODE_EN
	.comm	_NAND_FLASH_CHIP_SELECT,4,2     ## @NAND_FLASH_CHIP_SELECT
	.comm	_DM_EN,4,2                      ## @DM_EN
	.comm	_NAND_DEV_CMD1,4,2              ## @NAND_DEV_CMD1
	.no_dead_strip	_qcom_nandc_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qcom_nandc_setup
_qcom_nandc_setup:                      ; @qcom_nandc_setup
	.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	x19, x0
Lloh0:
	adrp	x8, _SFLASHC_BURST_CFG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SFLASHC_BURST_CFG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_nandc_write
Lloh3:
	adrp	x8, _NAND_DEV_CMD_VLD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAND_DEV_CMD_VLD@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dev_cmd_reg_addr
	mov	x1, x0
Lloh6:
	adrp	x20, _NAND_DEV_CMD_VLD_VAL@GOTPAGE
Lloh7:
	ldr	x20, [x20, _NAND_DEV_CMD_VLD_VAL@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_nandc_write
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh8:
	adrp	x21, _NAND_CTRL@GOTPAGE
Lloh9:
	ldr	x21, [x21, _NAND_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_nandc_read
	ldr	w1, [x21]
Lloh10:
	adrp	x8, _BAM_MODE_EN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BAM_MODE_EN@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	orr	w2, w8, w0
	b	LBB0_3
LBB0_2:
Lloh13:
	adrp	x8, _NAND_FLASH_CHIP_SELECT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NAND_FLASH_CHIP_SELECT@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _DM_EN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DM_EN@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
LBB0_3:
	mov	x0, x19
	bl	_nandc_write
Lloh19:
	adrp	x8, _NAND_DEV_CMD1@GOTPAGE
Lloh20:
	ldr	x8, [x8, _NAND_DEV_CMD1@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dev_cmd_reg_addr
	mov	x1, x0
	mov	x0, x19
	bl	_nandc_read
	str	x0, [x19, #8]
	ldr	w8, [x20]
	str	w8, [x19]
	mov	w0, #0
	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
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_SFLASHC_BURST_CFG,4,2          ; @SFLASHC_BURST_CFG
	.comm	_NAND_DEV_CMD_VLD,4,2           ; @NAND_DEV_CMD_VLD
	.comm	_NAND_DEV_CMD_VLD_VAL,4,2       ; @NAND_DEV_CMD_VLD_VAL
	.comm	_NAND_CTRL,4,2                  ; @NAND_CTRL
	.comm	_BAM_MODE_EN,4,2                ; @BAM_MODE_EN
	.comm	_NAND_FLASH_CHIP_SELECT,4,2     ; @NAND_FLASH_CHIP_SELECT
	.comm	_DM_EN,4,2                      ; @DM_EN
	.comm	_NAND_DEV_CMD1,4,2              ; @NAND_DEV_CMD1
	.no_dead_strip	_qcom_nandc_setup
.subsections_via_symbols
