	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spi_nor_init_erase_cmd_list
_spi_nor_init_erase_cmd_list:           ## @spi_nor_init_erase_cmd_list
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r13d
	movq	%rdx, %r12
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movq	%rdx, %rsi
	callq	_spi_nor_find_erase_region
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_2:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_spi_nor_region_end
	testl	%r13d, %r13d
	movl	$0, %r15d
	je	LBB0_21
## %bb.3:
	movl	%r13d, %ecx
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %rax                 ## 8-byte Reload
LBB0_5:                                 ##   in Loop: Header=BB0_6 Depth=1
	testl	%ecx, %ecx
	je	LBB0_18
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, %r13
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movq	%rdx, %r14
	movl	%ecx, %r15d
	callq	_spi_nor_find_best_erase_type
	testq	%rax, %rax
	je	LBB0_17
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%rax, %r12
	cmpq	%rax, %r13
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	_SNOR_OVERLAID_REGION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r13)
	je	LBB0_16
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_spi_nor_init_erase_cmd
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_19
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	addq	$20, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_list_add_tail
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	8(%rbx), %rax
	movq	%r14, %rdx
	addq	%rax, %rdx
	movl	%r15d, %ecx
	subl	%eax, %ecx
	je	LBB0_4
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rax, %rdx
	jl	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	%ecx, %r15d
	movq	%rdx, %r14
	movq	%r13, %rdi
	callq	_spi_nor_region_next
	testq	%rax, %rax
	je	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_spi_nor_region_end
	movq	%r14, %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %ecx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_5
LBB0_16:                                ##   in Loop: Header=BB0_6 Depth=1
	incl	16(%rbx)
	jmp	LBB0_11
LBB0_17:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	jmp	LBB0_20
LBB0_18:
	xorl	%r15d, %r15d
	jmp	LBB0_21
LBB0_19:
	movq	%rbx, %rdi
	callq	_PTR_ERR
	movl	%eax, %r15d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
LBB0_20:
	callq	_spi_nor_destroy_erase_cmd_list
LBB0_21:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SNOR_OVERLAID_REGION,4,2       ## @SNOR_OVERLAID_REGION
	.no_dead_strip	_spi_nor_init_erase_cmd_list
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spi_nor_init_erase_cmd_list
_spi_nor_init_erase_cmd_list:           ; @spi_nor_init_erase_cmd_list
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x3
	mov	x21, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	mov	x1, x2
	bl	_spi_nor_find_erase_region
	mov	x24, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x24
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_2:
	mov	x0, x24
	bl	_spi_nor_region_end
	cbz	w20, LBB0_15
; %bb.3:
	mov	x26, x0
	mov	x25, #0
	mov	x28, #0
	neg	w23, w23
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x24, x0
	bl	_spi_nor_region_end
	mov	x26, x0
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	cbz	w20, LBB0_15
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x27, x28
	mov	x0, x22
	mov	x1, x24
	mov	x2, x21
	mov	x3, x20
	bl	_spi_nor_find_best_erase_type
	cbz	x0, LBB0_17
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x28, x0
	cmp	x27, x0
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x24]
Lloh3:
	adrp	x9, _SNOR_OVERLAID_REGION@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SNOR_OVERLAID_REGION@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x24
	mov	x1, x28
	bl	_spi_nor_init_erase_cmd
	mov	x25, x0
	bl	_IS_ERR
	cbnz	x0, LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	add	x0, x25, #20
	mov	x1, x19
	bl	_list_add_tail
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x25, #8]
	add	x21, x8, x21
	subs	w20, w20, w8
	b.eq	LBB0_5
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	x21, x26
	b.lt	LBB0_5
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x24
	bl	_spi_nor_region_next
	cbnz	x0, LBB0_4
	b	LBB0_17
LBB0_14:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x25, #16]
	add	w8, w8, #1
	str	w8, [x25, #16]
	b	LBB0_11
LBB0_15:
	mov	w23, #0
	b	LBB0_18
LBB0_16:
	mov	x0, x25
	bl	_PTR_ERR
	mov	x23, x0
LBB0_17:
	mov	x0, x19
	bl	_spi_nor_destroy_erase_cmd_list
LBB0_18:
	mov	x0, x23
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SNOR_OVERLAID_REGION,4,2       ; @SNOR_OVERLAID_REGION
	.no_dead_strip	_spi_nor_init_erase_cmd_list
.subsections_via_symbols
