	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nand_check_ecc_caps
_nand_check_ecc_caps:                   ## @nand_check_ecc_caps
	.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
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %r15
	callq	_nand_to_mtd
	movl	(%r15), %r14d
	movl	4(%r15), %ebx
	movl	(%rax), %eax
	cltd
	idivl	%r14d
	movl	(%r12), %r8d
	testl	%r8d, %r8d
	jle	LBB0_12
## %bb.1:
	movl	%eax, %r13d
	movq	16(%r12), %rcx
	xorl	%edx, %edx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%rdx
	cmpq	%r8, %rdx
	je	LBB0_12
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	%rdx, %rax
	shlq	$4, %rax
	cmpl	%r14d, (%rcx,%rax)
	jne	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%rcx,%rax), %esi
	testl	%esi, %esi
	jle	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%rcx,%rax), %rdi
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	%ebx, (%rdi,%rax,4)
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=2
	incq	%rax
	cmpq	%rax, %rsi
	jne	LBB0_6
	jmp	LBB0_11
LBB0_7:
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	*8(%r12)
	movl	%eax, %r12d
	movl	%eax, %edi
	shrl	$31, %edi
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	jne	LBB0_14
## %bb.8:
	movl	%r12d, %eax
	imull	%r13d, %eax
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	jle	LBB0_10
## %bb.9:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_pr_err
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_12:
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_pr_err
	movq	_ENOTSUPP@GOTPCREL(%rip), %rax
LBB0_13:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_14:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	%r12d, 8(%r15)
	xorl	%r12d, %r12d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ECC (step, strength) = (%d, %d) does not fit in OOB"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
L_.str.1:                               ## @.str.1
	.asciz	"ECC (step, strength) = (%d, %d) not supported on this controller"

	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.no_dead_strip	_nand_check_ecc_caps
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nand_check_ecc_caps
_nand_check_ecc_caps:                   ; @nand_check_ecc_caps
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x22, x2
	mov	x23, x1
	mov	x21, x0
	bl	_nand_to_mtd
	ldp	w19, w20, [x21]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.1:
	mov	x9, #0
	ldr	w11, [x0]
	ldr	x10, [x23, #16]
	sdiv	w24, w11, w19
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x9, x9, #1
	cmp	x9, x8
	b.eq	LBB0_11
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	lsl	x11, x9, #4
	ldr	w11, [x10, x11]
	cmp	w11, w19
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x12, x10, x9, lsl #4
	ldr	w11, [x12, #4]
	cmp	w11, #1
	b.lt	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x12, [x12, #8]
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w13, [x12]
	cmp	w13, w20
	b.eq	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	add	x12, x12, #4
	subs	x11, x11, #1
	b.ne	LBB0_6
	b	LBB0_2
LBB0_8:
	ldr	x8, [x23, #8]
	mov	x0, x19
	mov	x1, x20
	blr	x8
	mov	x23, x0
	lsr	w0, w0, #31
	bl	_WARN_ON_ONCE
	cbnz	x0, LBB0_13
; %bb.9:
	mul	w8, w23, w24
	cmp	w8, w22
	b.le	LBB0_14
; %bb.10:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	mov	x2, x20
	bl	_pr_err
Lloh2:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	mov	x2, x20
	bl	_pr_err
Lloh6:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_13:
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_14:
	str	w23, [x21, #8]
	mov	w23, #0
	b	LBB0_13
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ECC (step, strength) = (%d, %d) does not fit in OOB"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
l_.str.1:                               ; @.str.1
	.asciz	"ECC (step, strength) = (%d, %d) not supported on this controller"

	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.no_dead_strip	_nand_check_ecc_caps
.subsections_via_symbols
