	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nand_maximize_ecc
_nand_maximize_ecc:                     ## @nand_maximize_ecc
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -84(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_nand_to_mtd
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movl	(%r15), %r8d
	testl	%r8d, %r8d
	jle	LBB0_18
## %bb.1:
	movq	%rax, %rsi
	xorl	%eax, %eax
                                        ## implicit-def: $ecx
                                        ## kill: killed $ecx
                                        ## implicit-def: $ecx
                                        ## kill: killed $ecx
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	movq	%r14, -96(%rbp)                 ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r8d
	movq	-96(%rbp), %r14                 ## 8-byte Reload
	movq	-104(%rbp), %rax                ## 8-byte Reload
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%rax
	movslq	%r8d, %rcx
	cmpq	%rcx, %rax
	jge	LBB0_17
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	16(%rcx), %rcx
	movq	%rax, %rdx
	shlq	$4, %rdx
	movl	(%rcx,%rdx), %edi
	movl	(%r14), %ebx
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%ebx, %edi
	jne	LBB0_16
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, 4(%rcx,%rdx)
	jle	LBB0_16
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	addq	%rdx, %rcx
	addq	$4, %rcx
	xorl	%r13d, %r13d
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_6
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=2
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=2
	incq	%r13
	movslq	(%rcx), %rax
	cmpq	%rax, %r13
	jge	LBB0_15
LBB0_6:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rsi), %eax
	cltd
	idivl	%edi
	testl	%edx, %edx
	jne	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	movl	%eax, %r14d
	movq	4(%rcx), %rax
	movl	(%rax,%r13,4), %r15d
	movl	%edi, %ebx
	movl	%r15d, %esi
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	callq	*8(%rax)
	movl	%eax, %r12d
	movl	%eax, %edi
	shrl	$31, %edi
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=2
	movl	%r12d, %eax
	imull	%r14d, %eax
	cmpl	-84(%rbp), %eax                 ## 4-byte Folded Reload
	jg	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=2
	imull	%r15d, %r14d
	cmpl	-48(%rbp), %r14d                ## 4-byte Folded Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	jg	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=2
	jne	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=2
	cmpl	-44(%rbp), %edi                 ## 4-byte Folded Reload
	jle	LBB0_14
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=2
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movl	%r15d, -76(%rbp)                ## 4-byte Spill
	movl	%r12d, -80(%rbp)                ## 4-byte Spill
	jmp	LBB0_14
LBB0_17:
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_18
## %bb.19:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r14)
	movl	-76(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%r14)
	movl	-80(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%r14)
	xorl	%eax, %eax
	jmp	LBB0_20
LBB0_18:
	movq	_ENOTSUPP@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_20:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.no_dead_strip	_nand_maximize_ecc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nand_maximize_ecc
_nand_maximize_ecc:                     ; @nand_maximize_ecc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	w2, [sp, #28]                   ; 4-byte Folded Spill
	mov	x21, x1
	mov	x20, x0
	bl	_nand_to_mtd
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.1:
	mov	x22, x0
	mov	x26, #0
	stp	wzr, wzr, [sp, #20]             ; 8-byte Folded Spill
                                        ; implicit-def: $w9
                                        ; kill: killed $w9
                                        ; implicit-def: $w9
                                        ; kill: killed $w9
	str	x20, [sp]                       ; 8-byte Folded Spill
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x21]
	ldr	x20, [sp]                       ; 8-byte Folded Reload
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x26, x26, #1
	cmp	x26, w8, sxtw
	b.ge	LBB0_13
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	ldr	x9, [x21, #16]
	lsl	x10, x26, #4
	ldr	w23, [x9, x10]
	ldr	w10, [x20]
	cmp	w10, #0
	ccmp	w23, w10, #4, ne
	b.ne	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x9, x9, x26, lsl #4
	mov	x19, x9
	ldr	w10, [x19, #4]!
	cmp	w10, #1
	b.lt	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x27, #0
	add	x28, x9, #8
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=2
	stp	w23, w8, [sp, #20]              ; 8-byte Folded Spill
	stp	w24, w25, [sp, #12]             ; 8-byte Folded Spill
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	add	x27, x27, #1
	ldrsw	x8, [x19]
	cmp	x27, x8
	b.ge	LBB0_2
LBB0_9:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x22]
	sdiv	w20, w8, w23
	msub	w8, w20, w23, w8
	cbnz	w8, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	x8, [x28]
	ldr	w24, [x8, x27, lsl #2]
	ldr	x8, [x21, #8]
	mov	x0, x23
	mov	x1, x24
	blr	x8
	mov	x25, x0
	lsr	w0, w0, #31
	bl	_WARN_ON_ONCE
	mul	w8, w25, w20
	cmp	x0, #0
	ldr	w9, [sp, #28]                   ; 4-byte Folded Reload
	ccmp	w8, w9, #0, eq
	b.gt	LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=2
	mul	w8, w20, w24
	ldr	w9, [sp, #24]                   ; 4-byte Folded Reload
	cmp	w8, w9
	b.gt	LBB0_7
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	w9, [sp, #20]                   ; 4-byte Folded Reload
	ccmp	w23, w9, #4, eq
	b.gt	LBB0_7
	b	LBB0_8
LBB0_13:
	ldr	w8, [sp, #24]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_15
; %bb.14:
	mov	w0, #0
	ldr	w9, [sp, #20]                   ; 4-byte Folded Reload
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	stp	w9, w8, [x20]
	ldr	w8, [sp, #16]                   ; 4-byte Folded Reload
	str	w8, [x20, #8]
	b	LBB0_16
LBB0_15:
Lloh0:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.no_dead_strip	_nand_maximize_ecc
.subsections_via_symbols
