	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function reset
_reset:                                 ## @reset
	.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
	callq	_get_qcom_nand_controller
	movq	%rax, %rbx
	movq	_NAND_FLASH_CMD@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_OP_RESET_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_nandc_set_reg
	movq	_NAND_EXEC_CMD@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_nandc_set_reg
	movl	(%r14), %esi
	movq	_NAND_BAM_NEXT_SGL@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_write_reg_dma
	movl	(%r15), %esi
	movl	(%r14), %ecx
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_write_reg_dma
	movq	_NAND_FLASH_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %ecx
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_read_reg_dma
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_FLASH_CMD,4,2             ## @NAND_FLASH_CMD
	.comm	_OP_RESET_DEVICE,4,2            ## @OP_RESET_DEVICE
	.comm	_NAND_EXEC_CMD,4,2              ## @NAND_EXEC_CMD
	.comm	_NAND_BAM_NEXT_SGL,4,2          ## @NAND_BAM_NEXT_SGL
	.comm	_NAND_FLASH_STATUS,4,2          ## @NAND_FLASH_STATUS
	.no_dead_strip	_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function reset
_reset:                                 ; @reset
	.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
	bl	_get_qcom_nand_controller
	mov	x19, x0
Lloh0:
	adrp	x20, _NAND_FLASH_CMD@GOTPAGE
Lloh1:
	ldr	x20, [x20, _NAND_FLASH_CMD@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh2:
	adrp	x8, _OP_RESET_DEVICE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OP_RESET_DEVICE@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	bl	_nandc_set_reg
Lloh5:
	adrp	x21, _NAND_EXEC_CMD@GOTPAGE
Lloh6:
	ldr	x21, [x21, _NAND_EXEC_CMD@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #1
	bl	_nandc_set_reg
	ldr	w1, [x20]
Lloh7:
	adrp	x20, _NAND_BAM_NEXT_SGL@GOTPAGE
Lloh8:
	ldr	x20, [x20, _NAND_BAM_NEXT_SGL@GOTPAGEOFF]
	ldr	w3, [x20]
	mov	x0, x19
	mov	w2, #1
	bl	_write_reg_dma
	ldr	w1, [x21]
	ldr	w3, [x20]
	mov	x0, x19
	mov	w2, #1
	bl	_write_reg_dma
Lloh9:
	adrp	x8, _NAND_FLASH_STATUS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NAND_FLASH_STATUS@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	w3, [x20]
	mov	x0, x19
	mov	w2, #1
	bl	_read_reg_dma
	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 AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_FLASH_CMD,4,2             ; @NAND_FLASH_CMD
	.comm	_OP_RESET_DEVICE,4,2            ; @OP_RESET_DEVICE
	.comm	_NAND_EXEC_CMD,4,2              ; @NAND_EXEC_CMD
	.comm	_NAND_BAM_NEXT_SGL,4,2          ; @NAND_BAM_NEXT_SGL
	.comm	_NAND_FLASH_STATUS,4,2          ; @NAND_FLASH_STATUS
	.no_dead_strip	_reset
.subsections_via_symbols
