	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function onenand_probe
_onenand_probe:                         ## @onenand_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	24(%rdi), %rbx
	movq	_ONENAND_REG_SYS_CFG1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rax, %r15
	addq	48(%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	48(%rbx), %rsi
	callq	*56(%rbx)
	movq	_ONENAND_CMD_READID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ONENAND_BOOTRAM@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	addq	48(%rbx), %rsi
	callq	*56(%rbx)
	movq	(%r15), %rdi
	addq	48(%rbx), %rdi
	callq	*(%rbx)
	movl	%eax, %r12d
	movq	48(%rbx), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$2, %rdi
	callq	*(%rbx)
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_ONENAND_CMD_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r15), %rsi
	addq	48(%rbx), %rsi
	callq	*56(%rbx)
	movq	_FL_RESETING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	*64(%rbx)
	movq	_ONENAND_REG_SYS_CFG1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	48(%rbx), %rsi
	movl	%r13d, %edi
	callq	*56(%rbx)
	movl	%r12d, %edi
	callq	_onenand_check_maf
	testq	%rax, %rax
	je	LBB0_3
LBB0_1:
	movq	_ENXIO@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_19:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_ONENAND_REG_MANUFACTURER_ID@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	48(%rbx), %rdi
	callq	*(%rbx)
	movl	%eax, %r15d
	movq	_ONENAND_REG_DEVICE_ID@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	48(%rbx), %rdi
	callq	*(%rbx)
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_ONENAND_REG_VERSION_ID@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	48(%rbx), %rdi
	callq	*(%rbx)
	movl	%eax, %r13d
	movq	_ONENAND_REG_TECHNOLOGY@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	48(%rbx), %rdi
	callq	*(%rbx)
	movl	%eax, 8(%rbx)
	cmpl	%r12d, %r15d
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	jne	LBB0_1
## %bb.4:
	cmpl	%r15d, -44(%rbp)                ## 4-byte Folded Reload
	jne	LBB0_1
## %bb.5:
	movl	%r15d, %edi
	movl	%r13d, %esi
	callq	_onenand_print_device_info
	movl	%r15d, 12(%rbx)
	movl	%r13d, 16(%rbx)
	movl	%r15d, %edi
	callq	_onenand_get_density
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_FLEXONENAND
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	%rbx, %rdi
	callq	_ONENAND_IS_DDP
	cmpq	$1, %rax
	movl	$2, %edi
	sbbl	$0, %edi
	movl	%edi, 20(%rbx)
	leal	(%rdi,%rdi), %eax
	movl	%eax, (%r14)
	shll	$3, %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_kzalloc
	movl	%eax, 20(%r14)
	testl	%eax, %eax
	je	LBB0_7
LBB0_8:
	movl	$16777216, %eax                 ## imm = 0x1000000
	movl	%r15d, %ecx
	shll	%cl, %eax
	movl	%eax, 24(%rbx)
	movq	_ONENAND_REG_DATA_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	48(%rbx), %rdi
	callq	*(%rbx)
	movl	%eax, 4(%r14)
	movq	%rbx, %rdi
	callq	_ONENAND_IS_MLC
	movl	4(%r14), %ecx
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	addl	%ecx, %ecx
	movl	%ecx, 4(%r14)
LBB0_10:
	movl	%ecx, %eax
	sarl	$5, %eax
	movl	%eax, 8(%r14)
	shll	$6, %ecx
	movl	%ecx, 12(%r14)
	movq	%rbx, %rdi
	callq	_FLEXONENAND
	movl	12(%r14), %edi
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	addl	%edi, %edi
	movl	%edi, 12(%r14)
LBB0_12:
	callq	_ffs
	decl	%eax
	movl	%eax, 28(%rbx)
	movl	4(%r14), %edi
	callq	_ffs
	decl	%eax
	movl	%eax, 32(%rbx)
	movl	28(%rbx), %ecx
	subl	%eax, %ecx
	movl	$-1, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	notl	%eax
	movl	%eax, 36(%rbx)
	movq	%rbx, %rdi
	callq	_ONENAND_IS_DDP
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movl	24(%rbx), %eax
	movb	28(%rbx), %cl
	incb	%cl
	sarl	%cl, %eax
	movl	%eax, 40(%rbx)
LBB0_14:
	movl	4(%r14), %eax
	movl	%eax, 44(%rbx)
	movq	%rbx, %rdi
	callq	_FLEXONENAND
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	%r14, %rdi
	callq	_flexonenand_get_size
	jmp	LBB0_17
LBB0_16:
	movl	24(%rbx), %eax
	movl	%eax, 16(%r14)
LBB0_17:
	movq	%r14, %rdi
	callq	_onenand_check_features
	movq	%rbx, %rdi
	callq	_ONENAND_IS_2PLANE
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	je	LBB0_19
## %bb.18:
	shll	4(%r14)
	shll	12(%r14)
	jmp	LBB0_19
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.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
	.comm	_ONENAND_REG_VERSION_ID,8,3     ## @ONENAND_REG_VERSION_ID
	.comm	_ONENAND_REG_TECHNOLOGY,8,3     ## @ONENAND_REG_TECHNOLOGY
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ONENAND_REG_DATA_BUFFER_SIZE,8,3 ## @ONENAND_REG_DATA_BUFFER_SIZE
	.no_dead_strip	_onenand_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function onenand_probe
_onenand_probe:                         ; @onenand_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	x20, [x0, #24]
	ldr	x8, [x20]
	ldr	x9, [x20, #48]
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	x23, 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, [x20, #48]
	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, [x20, #48]
Lloh11:
	adrp	x25, _ONENAND_BOOTRAM@GOTPAGE
Lloh12:
	ldr	x25, [x25, _ONENAND_BOOTRAM@GOTPAGEOFF]
	ldr	x10, [x25]
	add	x1, x10, x9
	blr	x8
	ldr	x8, [x20]
	ldr	x9, [x20, #48]
	ldr	x10, [x25]
	add	x0, x10, x9
	blr	x8
	mov	x22, x0
	ldr	x8, [x20]
	ldr	x9, [x20, #48]
	ldr	x10, [x25]
	add	x9, x9, x10
	add	x0, x9, #2
	blr	x8
	mov	x21, x0
Lloh13:
	adrp	x8, _ONENAND_CMD_RESET@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ONENAND_CMD_RESET@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	ldp	x9, x8, [x20, #48]
	ldr	x10, [x25]
	add	x1, x10, x9
	blr	x8
	ldr	x8, [x20, #64]
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, [x20, #48]
	ldr	x10, [x24]
	add	x1, x10, x9
	mov	x0, x23
	blr	x8
	mov	x0, x22
	bl	_onenand_check_maf
	cbz	x0, LBB0_4
LBB0_1:
Lloh19:
	adrp	x8, _ENXIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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_4:
	ldr	x8, [x20]
	ldr	x9, [x20, #48]
Lloh21:
	adrp	x10, _ONENAND_REG_MANUFACTURER_ID@GOTPAGE
Lloh22:
	ldr	x10, [x10, _ONENAND_REG_MANUFACTURER_ID@GOTPAGEOFF]
Lloh23:
	ldr	x10, [x10]
	add	x0, x10, x9
	blr	x8
	mov	x25, x0
	ldr	x8, [x20]
	ldr	x9, [x20, #48]
Lloh24:
	adrp	x10, _ONENAND_REG_DEVICE_ID@GOTPAGE
Lloh25:
	ldr	x10, [x10, _ONENAND_REG_DEVICE_ID@GOTPAGEOFF]
Lloh26:
	ldr	x10, [x10]
	add	x0, x10, x9
	blr	x8
	mov	x24, x0
	ldr	x8, [x20]
	ldr	x9, [x20, #48]
Lloh27:
	adrp	x10, _ONENAND_REG_VERSION_ID@GOTPAGE
Lloh28:
	ldr	x10, [x10, _ONENAND_REG_VERSION_ID@GOTPAGEOFF]
Lloh29:
	ldr	x10, [x10]
	add	x0, x10, x9
	blr	x8
	mov	x23, x0
	ldr	x8, [x20]
	ldr	x9, [x20, #48]
Lloh30:
	adrp	x10, _ONENAND_REG_TECHNOLOGY@GOTPAGE
Lloh31:
	ldr	x10, [x10, _ONENAND_REG_TECHNOLOGY@GOTPAGEOFF]
Lloh32:
	ldr	x10, [x10]
	add	x0, x10, x9
	blr	x8
	str	w0, [x20, #8]
	cmp	w25, w22
	b.ne	LBB0_1
; %bb.5:
	cmp	w24, w21
	b.ne	LBB0_1
; %bb.6:
	mov	x0, x21
	mov	x1, x23
	bl	_onenand_print_device_info
	stp	w21, w23, [x20, #12]
	mov	x0, x21
	bl	_onenand_get_density
	mov	x21, x0
	mov	x0, x20
	bl	_FLEXONENAND
	cbz	x0, LBB0_8
; %bb.7:
	mov	x0, x20
	bl	_ONENAND_IS_DDP
	cmp	x0, #0
	mov	w8, #1
	cinc	w8, w8, ne
	str	w8, [x20, #20]
	lsl	w9, w8, #1
	str	w9, [x19]
	lsl	w0, w8, #3
Lloh33:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh34:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	bl	_kzalloc
	str	w0, [x19, #20]
	cbz	w0, LBB0_19
LBB0_8:
	mov	w8, #16777216
	lsl	w8, w8, w21
	str	w8, [x20, #24]
	ldr	x8, [x20]
	ldr	x9, [x20, #48]
Lloh36:
	adrp	x10, _ONENAND_REG_DATA_BUFFER_SIZE@GOTPAGE
Lloh37:
	ldr	x10, [x10, _ONENAND_REG_DATA_BUFFER_SIZE@GOTPAGEOFF]
Lloh38:
	ldr	x10, [x10]
	add	x0, x10, x9
	blr	x8
	str	w0, [x19, #4]
	mov	x0, x20
	bl	_ONENAND_IS_MLC
	ldr	w8, [x19, #4]
	cbz	x0, LBB0_10
; %bb.9:
	lsl	w8, w8, #1
	str	w8, [x19, #4]
LBB0_10:
	asr	w9, w8, #5
	lsl	w8, w8, #6
	stp	w9, w8, [x19, #8]
	mov	x0, x20
	bl	_FLEXONENAND
	mov	x8, x0
	ldr	w0, [x19, #12]
	cbz	x8, LBB0_12
; %bb.11:
	lsl	w0, w0, #1
	str	w0, [x19, #12]
LBB0_12:
	bl	_ffs
	sub	w8, w0, #1
	str	w8, [x20, #28]
	ldr	w0, [x19, #4]
	bl	_ffs
	sub	w8, w0, #1
	ldr	w9, [x20, #28]
	sub	w9, w9, w8
	mov	w10, #-1
	lsl	w9, w10, w9
	mvn	w9, w9
	stp	w8, w9, [x20, #32]
	mov	x0, x20
	bl	_ONENAND_IS_DDP
	cbz	x0, LBB0_14
; %bb.13:
	ldp	w8, w9, [x20, #24]
	add	w9, w9, #1
	asr	w8, w8, w9
	str	w8, [x20, #40]
LBB0_14:
	ldr	w8, [x19, #4]
	str	w8, [x20, #44]
	mov	x0, x20
	bl	_FLEXONENAND
	cbz	x0, LBB0_16
; %bb.15:
	mov	x0, x19
	bl	_flexonenand_get_size
	b	LBB0_17
LBB0_16:
	ldr	w8, [x20, #24]
	str	w8, [x19, #16]
LBB0_17:
	mov	x0, x19
	bl	_onenand_check_features
	mov	x0, x20
	bl	_ONENAND_IS_2PLANE
	cbz	x0, LBB0_3
; %bb.18:
	mov	w0, #0
	ldr	w8, [x19, #4]
	lsl	w8, w8, #1
	str	w8, [x19, #4]
	ldr	w8, [x19, #12]
	lsl	w8, w8, #1
	str	w8, [x19, #12]
	b	LBB0_3
LBB0_19:
Lloh39:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh40:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	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 AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh39, Lloh40
	.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
	.comm	_ONENAND_REG_VERSION_ID,8,3     ; @ONENAND_REG_VERSION_ID
	.comm	_ONENAND_REG_TECHNOLOGY,8,3     ; @ONENAND_REG_TECHNOLOGY
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ONENAND_REG_DATA_BUFFER_SIZE,8,3 ; @ONENAND_REG_DATA_BUFFER_SIZE
	.no_dead_strip	_onenand_probe
.subsections_via_symbols
