	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_id
_read_id:                               ## @read_id
	.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
	callq	_get_qcom_nand_controller
	cmpl	$-1, %r14d
	je	LBB0_4
## %bb.1:
	movq	%rax, %rbx
	movq	_NAND_FLASH_CMD@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_OP_FETCH_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_nandc_set_reg
	movq	_NAND_ADDR0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_nandc_set_reg
	movq	_NAND_ADDR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_nandc_set_reg
	movq	_NAND_FLASH_CHIP_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%rbx), %rax
	cmpq	$0, (%rax)
	jne	LBB0_3
## %bb.2:
	movq	_DM_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_3:
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_nandc_set_reg
	movq	_NAND_EXEC_CMD@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_nandc_set_reg
	movl	(%r15), %esi
	movq	_NAND_BAM_NEXT_SGL@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_write_reg_dma
	movl	(%r14), %esi
	movl	(%r15), %ecx
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_write_reg_dma
	movq	_NAND_READ_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %ecx
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_read_reg_dma
LBB0_4:
	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_FETCH_ID,4,2                ## @OP_FETCH_ID
	.comm	_NAND_ADDR0,4,2                 ## @NAND_ADDR0
	.comm	_NAND_ADDR1,4,2                 ## @NAND_ADDR1
	.comm	_NAND_FLASH_CHIP_SELECT,4,2     ## @NAND_FLASH_CHIP_SELECT
	.comm	_DM_EN,4,2                      ## @DM_EN
	.comm	_NAND_EXEC_CMD,4,2              ## @NAND_EXEC_CMD
	.comm	_NAND_BAM_NEXT_SGL,4,2          ## @NAND_BAM_NEXT_SGL
	.comm	_NAND_READ_ID,4,2               ## @NAND_READ_ID
	.no_dead_strip	_read_id
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_id
_read_id:                               ; @read_id
	.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
	bl	_get_qcom_nand_controller
	cmn	w20, #1
	b.eq	LBB0_2
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x21, _NAND_FLASH_CMD@GOTPAGE
Lloh1:
	ldr	x21, [x21, _NAND_FLASH_CMD@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh2:
	adrp	x8, _OP_FETCH_ID@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OP_FETCH_ID@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	bl	_nandc_set_reg
Lloh5:
	adrp	x8, _NAND_ADDR0@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NAND_ADDR0@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_nandc_set_reg
Lloh8:
	adrp	x8, _NAND_ADDR1@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NAND_ADDR1@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_nandc_set_reg
Lloh11:
	adrp	x8, _NAND_FLASH_CHIP_SELECT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NAND_FLASH_CHIP_SELECT@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	ldr	x8, [x19]
	ldr	x8, [x8]
Lloh14:
	adrp	x9, _DM_EN@GOTPAGE
Lloh15:
	ldr	x9, [x9, _DM_EN@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	x8, #0
	csel	w2, w9, wzr, eq
	mov	x0, x19
	bl	_nandc_set_reg
Lloh17:
	adrp	x20, _NAND_EXEC_CMD@GOTPAGE
Lloh18:
	ldr	x20, [x20, _NAND_EXEC_CMD@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #1
	bl	_nandc_set_reg
	ldr	w1, [x21]
Lloh19:
	adrp	x21, _NAND_BAM_NEXT_SGL@GOTPAGE
Lloh20:
	ldr	x21, [x21, _NAND_BAM_NEXT_SGL@GOTPAGEOFF]
	ldr	w3, [x21]
	mov	x0, x19
	mov	w2, #4
	bl	_write_reg_dma
	ldr	w1, [x20]
	ldr	w3, [x21]
	mov	x0, x19
	mov	w2, #1
	bl	_write_reg_dma
Lloh21:
	adrp	x8, _NAND_READ_ID@GOTPAGE
Lloh22:
	ldr	x8, [x8, _NAND_READ_ID@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	ldr	w3, [x21]
	mov	x0, x19
	mov	w2, #1
	bl	_read_reg_dma
LBB0_2:
	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	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_FLASH_CMD,4,2             ; @NAND_FLASH_CMD
	.comm	_OP_FETCH_ID,4,2                ; @OP_FETCH_ID
	.comm	_NAND_ADDR0,4,2                 ; @NAND_ADDR0
	.comm	_NAND_ADDR1,4,2                 ; @NAND_ADDR1
	.comm	_NAND_FLASH_CHIP_SELECT,4,2     ; @NAND_FLASH_CHIP_SELECT
	.comm	_DM_EN,4,2                      ; @DM_EN
	.comm	_NAND_EXEC_CMD,4,2              ; @NAND_EXEC_CMD
	.comm	_NAND_BAM_NEXT_SGL,4,2          ; @NAND_BAM_NEXT_SGL
	.comm	_NAND_READ_ID,4,2               ; @NAND_READ_ID
	.no_dead_strip	_read_id
.subsections_via_symbols
