	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function onenand_chip_probe
_onenand_chip_probe:                    ## @onenand_chip_probe
	.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
	movq	%rdi, %r14
	movq	(%rdi), %rbx
	movq	_ONENAND_REG_SYS_CFG1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rax, %r15
	addq	8(%rbx), %rdi
	callq	*(%rbx)
	movl	%eax, %r13d
	movq	_ONENAND_SYS_CFG1_SYNC_READ@GOTPCREL(%rip), %rax
	movq	_ONENAND_SYS_CFG1_SYNC_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	notl	%edi
	andl	%r13d, %edi
	movq	(%r15), %rsi
	addq	8(%rbx), %rsi
	callq	*16(%rbx)
	movq	_ONENAND_CMD_READID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ONENAND_BOOTRAM@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	addq	8(%rbx), %rsi
	callq	*16(%rbx)
	movq	(%r12), %rdi
	addq	8(%rbx), %rdi
	callq	*(%rbx)
	movl	%eax, %r15d
	movq	8(%rbx), %rax
	movq	(%r12), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$2, %rdi
	callq	*(%rbx)
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_ONENAND_CMD_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r12), %rsi
	addq	8(%rbx), %rsi
	callq	*16(%rbx)
	movq	_FL_RESETING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	*24(%rbx)
	movq	_ONENAND_REG_SYS_CFG1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	movl	%r13d, %edi
	callq	*16(%rbx)
	movl	%r15d, %edi
	callq	_onenand_check_maf
	testq	%rax, %rax
	je	LBB0_1
LBB0_3:
	movq	_ENXIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movq	_ONENAND_REG_MANUFACTURER_ID@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	callq	*(%rbx)
	movl	%eax, %r14d
	movq	_ONENAND_REG_DEVICE_ID@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	callq	*(%rbx)
	cmpl	%r15d, %r14d
	jne	LBB0_3
## %bb.2:
	movl	%eax, %ecx
	xorl	%eax, %eax
	cmpl	%r12d, %ecx
	je	LBB0_4
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_ONENAND_REG_SYS_CFG1,8,3       ## @ONENAND_REG_SYS_CFG1
	.comm	_ONENAND_SYS_CFG1_SYNC_READ,4,2 ## @ONENAND_SYS_CFG1_SYNC_READ
	.comm	_ONENAND_SYS_CFG1_SYNC_WRITE,4,2 ## @ONENAND_SYS_CFG1_SYNC_WRITE
	.comm	_ONENAND_CMD_READID,4,2         ## @ONENAND_CMD_READID
	.comm	_ONENAND_BOOTRAM,8,3            ## @ONENAND_BOOTRAM
	.comm	_ONENAND_CMD_RESET,4,2          ## @ONENAND_CMD_RESET
	.comm	_FL_RESETING,4,2                ## @FL_RESETING
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_ONENAND_REG_MANUFACTURER_ID,8,3 ## @ONENAND_REG_MANUFACTURER_ID
	.comm	_ONENAND_REG_DEVICE_ID,8,3      ## @ONENAND_REG_DEVICE_ID
	.no_dead_strip	_onenand_chip_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function onenand_chip_probe
_onenand_chip_probe:                    ; @onenand_chip_probe
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	x23, [x0]
	ldp	x8, x9, [x23]
Lloh0:
	adrp	x24, _ONENAND_REG_SYS_CFG1@GOTPAGE
Lloh1:
	ldr	x24, [x24, _ONENAND_REG_SYS_CFG1@GOTPAGEOFF]
	ldr	x10, [x24]
	add	x0, x10, x9
	blr	x8
	mov	x20, x0
Lloh2:
	adrp	x8, _ONENAND_SYS_CFG1_SYNC_READ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ONENAND_SYS_CFG1_SYNC_READ@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _ONENAND_SYS_CFG1_SYNC_WRITE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ONENAND_SYS_CFG1_SYNC_WRITE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w0, w0, w8
	ldp	x9, x8, [x23, #8]
	ldr	x10, [x24]
	add	x1, x10, x9
	blr	x8
Lloh8:
	adrp	x8, _ONENAND_CMD_READID@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ONENAND_CMD_READID@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldp	x9, x8, [x23, #8]
Lloh11:
	adrp	x25, _ONENAND_BOOTRAM@GOTPAGE
Lloh12:
	ldr	x25, [x25, _ONENAND_BOOTRAM@GOTPAGEOFF]
	ldr	x10, [x25]
	add	x1, x10, x9
	blr	x8
	ldp	x8, x9, [x23]
	ldr	x10, [x25]
	add	x0, x10, x9
	blr	x8
	mov	x21, x0
	ldp	x8, x9, [x23]
	ldr	x10, [x25]
	add	x9, x9, x10
	add	x0, x9, #2
	blr	x8
	mov	x22, x0
Lloh13:
	adrp	x8, _ONENAND_CMD_RESET@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ONENAND_CMD_RESET@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	ldp	x9, x8, [x23, #8]
	ldr	x10, [x25]
	add	x1, x10, x9
	blr	x8
	ldr	x8, [x23, #24]
Lloh16:
	adrp	x9, _FL_RESETING@GOTPAGE
Lloh17:
	ldr	x9, [x9, _FL_RESETING@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x9]
	mov	x0, x19
	blr	x8
	ldp	x9, x8, [x23, #8]
	ldr	x10, [x24]
	add	x1, x10, x9
	mov	x0, x20
	blr	x8
	mov	x0, x21
	bl	_onenand_check_maf
	cbz	x0, LBB0_3
LBB0_1:
Lloh19:
	adrp	x8, _ENXIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_2:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_3:
	ldp	x8, x9, [x23]
Lloh22:
	adrp	x10, _ONENAND_REG_MANUFACTURER_ID@GOTPAGE
Lloh23:
	ldr	x10, [x10, _ONENAND_REG_MANUFACTURER_ID@GOTPAGEOFF]
Lloh24:
	ldr	x10, [x10]
	add	x0, x10, x9
	blr	x8
	mov	x19, x0
	ldp	x8, x9, [x23]
Lloh25:
	adrp	x10, _ONENAND_REG_DEVICE_ID@GOTPAGE
Lloh26:
	ldr	x10, [x10, _ONENAND_REG_DEVICE_ID@GOTPAGEOFF]
Lloh27:
	ldr	x10, [x10]
	add	x0, x10, x9
	blr	x8
	cmp	w19, w21
	b.ne	LBB0_1
; %bb.4:
	cmp	w0, w22
	b.ne	LBB0_1
; %bb.5:
	mov	w0, #0
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_ONENAND_REG_SYS_CFG1,8,3       ; @ONENAND_REG_SYS_CFG1
	.comm	_ONENAND_SYS_CFG1_SYNC_READ,4,2 ; @ONENAND_SYS_CFG1_SYNC_READ
	.comm	_ONENAND_SYS_CFG1_SYNC_WRITE,4,2 ; @ONENAND_SYS_CFG1_SYNC_WRITE
	.comm	_ONENAND_CMD_READID,4,2         ; @ONENAND_CMD_READID
	.comm	_ONENAND_BOOTRAM,8,3            ; @ONENAND_BOOTRAM
	.comm	_ONENAND_CMD_RESET,4,2          ; @ONENAND_CMD_RESET
	.comm	_FL_RESETING,4,2                ; @FL_RESETING
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_ONENAND_REG_MANUFACTURER_ID,8,3 ; @ONENAND_REG_MANUFACTURER_ID
	.comm	_ONENAND_REG_DEVICE_ID,8,3      ; @ONENAND_REG_DEVICE_ID
	.no_dead_strip	_onenand_chip_probe
.subsections_via_symbols
