	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spinand_detect
_spinand_detect:                        ## @spinand_detect
	.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, %rbx
	movq	(%rdi), %rax
	movq	(%rax), %r12
	callq	_spinand_to_nand
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_spinand_reset_op
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	movl	20(%rbx), %esi
	movq	%rbx, %rdi
	callq	_spinand_read_id_op
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.2:
	movq	_SPINAND_MAX_ID_LEN@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movl	%eax, 24(%rbx)
	movq	%rbx, %rdi
	callq	_spinand_manufacturer_detect
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r15d
	movl	(%r13), %edx
	movl	20(%rbx), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_8
LBB0_4:
	cmpl	$2, (%r14)
	jl	LBB0_7
## %bb.5:
	cmpl	$0, 16(%rbx)
	je	LBB0_6
LBB0_7:
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	movq	(%rax), %rdi
	movl	(%rcx), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_info
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_nanddev_size
	movl	%eax, %r13d
	sarl	$20, %r13d
	movq	%r14, %rdi
	callq	_nanddev_eraseblock_size
	movl	%eax, %ebx
	sarl	$10, %ebx
	movq	%r14, %rdi
	callq	_nanddev_page_size
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_nanddev_per_page_oobsize
	leaq	L_.str.3(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %edx
	movl	%ebx, %ecx
	movl	%r12d, %r8d
	movl	%eax, %r9d
	xorl	%eax, %eax
	callq	_dev_info
	jmp	LBB0_8
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_8:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SPINAND_MAX_ID_LEN,4,2         ## @SPINAND_MAX_ID_LEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown raw ID %*phN\n"

L_.str.1:                               ## @.str.1
	.asciz	"SPI NANDs with more than one die must implement ->select_target()\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"%s SPI NAND was found.\n"

L_.str.3:                               ## @.str.3
	.asciz	"%llu MiB, block size: %zu KiB, page size: %zu, OOB size: %u\n"

	.no_dead_strip	_spinand_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spinand_detect
_spinand_detect:                        ; @spinand_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x0
	ldr	x8, [x0]
	ldr	x21, [x8]
	bl	_spinand_to_nand
	mov	x19, x0
	mov	x0, x20
	bl	_spinand_reset_op
	mov	x22, x0
	cbnz	w0, LBB0_8
; %bb.1:
	ldr	w1, [x20, #20]
	mov	x0, x20
	bl	_spinand_read_id_op
	mov	x22, x0
	cbnz	w0, LBB0_8
; %bb.2:
Lloh0:
	adrp	x23, _SPINAND_MAX_ID_LEN@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SPINAND_MAX_ID_LEN@GOTPAGEOFF]
	ldr	w8, [x23]
	str	w8, [x20, #24]
	mov	x0, x20
	bl	_spinand_manufacturer_detect
	cbz	w0, LBB0_4
; %bb.3:
	mov	x22, x0
	ldr	w8, [x23]
	ldr	w9, [x20, #20]
	stp	x8, x9, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	b	LBB0_8
LBB0_4:
	ldr	w8, [x19]
	cmp	w8, #2
	b.lt	LBB0_6
; %bb.5:
	ldr	w8, [x20, #16]
	cbz	w8, LBB0_7
LBB0_6:
	ldp	x8, x9, [x20]
	ldr	x0, [x8]
	ldr	w2, [x9]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_info
	ldr	x8, [x20]
	ldr	x20, [x8]
	mov	x0, x19
	bl	_nanddev_size
	asr	w21, w0, #20
	mov	x0, x19
	bl	_nanddev_eraseblock_size
	asr	w23, w0, #10
	mov	x0, x19
	bl	_nanddev_page_size
	mov	x22, x0
	mov	x0, x19
	bl	_nanddev_per_page_oobsize
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x22, x0, [sp, #8]
	str	x23, [sp]
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_dev_info
	mov	w22, #0
	b	LBB0_8
LBB0_7:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_err
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_8:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_SPINAND_MAX_ID_LEN,4,2         ; @SPINAND_MAX_ID_LEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown raw ID %*phN\n"

l_.str.1:                               ; @.str.1
	.asciz	"SPI NANDs with more than one die must implement ->select_target()\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"%s SPI NAND was found.\n"

l_.str.3:                               ; @.str.3
	.asciz	"%llu MiB, block size: %zu KiB, page size: %zu, OOB size: %u\n"

	.no_dead_strip	_spinand_detect
.subsections_via_symbols
