	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nand_flash_detect_ext_param_page
_nand_flash_detect_ext_param_page:      ## @nand_flash_detect_ext_param_page
	.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	%rsi, %r13
	movq	%rdi, %r14
	movl	4(%rsi), %edi
	callq	_le16_to_cpu
	movq	%rax, %rbx
	shll	$4, %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %r15
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_nand_read_param_page_op
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.2:
	movl	(%r13), %esi
	shll	$3, %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	movl	%ebx, %ecx
	movl	$1, %r8d
	callq	_nand_change_read_column_op
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movq	_ONFI_CRC_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%r15), %r13
	addl	$-2, %ebx
	movq	%r13, %rsi
	movl	%ebx, %edx
	callq	_onfi_crc16
	movq	%rax, %rbx
	movl	12(%r15), %edi
	callq	_le16_to_cpu
	cmpq	%rax, %rbx
	jne	LBB0_7
## %bb.4:
	movl	(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	$4, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_11
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_8
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_10
LBB0_7:
	leaq	L_.str(%rip), %rdi
LBB0_8:
	callq	_pr_debug
LBB0_9:
	movq	%r15, %rdi
	callq	_kfree
LBB0_10:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%r15, %rax
	addq	$16, %rax
	movq	_ONFI_EXT_SECTION_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, %ecx
	jle	LBB0_15
## %bb.12:
	movq	(%r15), %rsi
	movq	_ONFI_SECTION_TYPE_2@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdi
	addq	$8, %rsi
	xorl	%edx, %edx
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%rdi, -8(%rsi)
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movslq	(%rsi), %rbx
	shlq	$6, %rbx
	addq	%rbx, %rax
	incq	%rdx
	addq	$16, %rsi
	cmpq	%rdx, %rcx
	jne	LBB0_13
	jmp	LBB0_17
LBB0_15:
	xorl	%edx, %edx
LBB0_16:
	cmpl	%ecx, %edx
	jne	LBB0_18
LBB0_17:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_8
LBB0_18:
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	je	LBB0_20
## %bb.19:
	movl	$1, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	movl	4(%rax), %eax
	movl	%eax, 4(%r14)
	movl	%edx, (%r14)
	xorl	%r12d, %r12d
	jmp	LBB0_9
LBB0_20:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ONFI_CRC_BASE,4,2              ## @ONFI_CRC_BASE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fail in the CRC.\n"

L_.str.1:                               ## @.str.1
	.asciz	"EPPS"

L_.str.2:                               ## @.str.2
	.asciz	"The signature is invalid.\n"

	.comm	_ONFI_EXT_SECTION_MAX,4,2       ## @ONFI_EXT_SECTION_MAX
	.comm	_ONFI_SECTION_TYPE_2,8,3        ## @ONFI_SECTION_TYPE_2
L_.str.3:                               ## @.str.3
	.asciz	"We can not find the ECC section.\n"

L_.str.4:                               ## @.str.4
	.asciz	"Invalid codeword size\n"

	.no_dead_strip	_nand_flash_detect_ext_param_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nand_flash_detect_ext_param_page
_nand_flash_detect_ext_param_page:      ; @nand_flash_detect_ext_param_page
	.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	x23, x1
	mov	x21, x0
	ldr	w0, [x1, #4]
	bl	_le16_to_cpu
	lsl	w22, w0, #4
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_kmalloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
	mov	x0, x21
	mov	w1, #0
	mov	x2, #0
	mov	w3, #0
	bl	_nand_read_param_page_op
	mov	x20, x0
	cbnz	w0, LBB0_9
; %bb.2:
	ldr	w8, [x23]
	lsl	w1, w8, #3
	mov	x0, x21
	mov	x2, x19
	mov	x3, x22
	mov	w4, #1
	bl	_nand_change_read_column_op
	mov	x20, x0
	cbnz	w0, LBB0_9
; %bb.3:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
Lloh6:
	adrp	x8, _ONFI_CRC_BASE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ONFI_CRC_BASE@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	add	x23, x19, #8
	sub	w2, w22, #2
	mov	x1, x23
	bl	_onfi_crc16
	mov	x22, x0
	ldr	w0, [x19, #12]
	bl	_le16_to_cpu
	cmp	x22, x0
	b.ne	LBB0_7
; %bb.4:
	ldr	w0, [x23]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #4
	bl	_strncmp
	cbz	x0, LBB0_11
; %bb.5:
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_6:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_10
LBB0_7:
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
LBB0_8:
	bl	_pr_debug
LBB0_9:
	mov	x0, x19
	bl	_kfree
LBB0_10:
	mov	x0, x20
	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_11:
	add	x8, x19, #16
Lloh18:
	adrp	x9, _ONFI_EXT_SECTION_MAX@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ONFI_EXT_SECTION_MAX@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	cmp	w9, #1
	b.lt	LBB0_15
; %bb.12:
	mov	x10, #0
	ldr	x12, [x19]
Lloh21:
	adrp	x11, _ONFI_SECTION_TYPE_2@GOTPAGE
Lloh22:
	ldr	x11, [x11, _ONFI_SECTION_TYPE_2@GOTPAGEOFF]
Lloh23:
	ldr	x11, [x11]
	add	x12, x12, #8
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldur	x13, [x12, #-8]
	cmp	x13, x11
	b.eq	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldrsw	x13, [x12], #16
	add	x8, x8, x13, lsl #6
	add	x10, x10, #1
	cmp	x9, x10
	b.ne	LBB0_13
	b	LBB0_17
LBB0_15:
	mov	w10, #0
LBB0_16:
	cmp	w10, w9
	b.ne	LBB0_18
LBB0_17:
Lloh24:
	adrp	x0, l_.str.3@PAGE
Lloh25:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_8
LBB0_18:
	ldr	w9, [x8]
	cbz	w9, LBB0_20
; %bb.19:
	mov	w20, #0
	ldr	w8, [x8, #4]
	mov	w10, #1
	lsl	w9, w10, w9
	stp	w9, w8, [x21]
	b	LBB0_9
LBB0_20:
Lloh26:
	adrp	x0, l_.str.4@PAGE
Lloh27:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ONFI_CRC_BASE,4,2              ; @ONFI_CRC_BASE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fail in the CRC.\n"

l_.str.1:                               ; @.str.1
	.asciz	"EPPS"

l_.str.2:                               ; @.str.2
	.asciz	"The signature is invalid.\n"

	.comm	_ONFI_EXT_SECTION_MAX,4,2       ; @ONFI_EXT_SECTION_MAX
	.comm	_ONFI_SECTION_TYPE_2,8,3        ; @ONFI_SECTION_TYPE_2
l_.str.3:                               ; @.str.3
	.asciz	"We can not find the ECC section.\n"

l_.str.4:                               ; @.str.4
	.asciz	"Invalid codeword size\n"

	.no_dead_strip	_nand_flash_detect_ext_param_page
.subsections_via_symbols
