	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spi_nor_select_erase
_spi_nor_select_erase:                  ## @spi_nor_select_erase
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	leaq	24(%rdi), %rbx
	movq	8(%rdi), %rax
	movl	(%rax), %r15d
	callq	_spi_nor_has_uniform_erase
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_spi_nor_select_uniform_erase
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movl	8(%rax), %ecx
	movl	%ecx, (%r14)
	movq	(%rax), %rax
	movq	%rax, 16(%r14)
	jmp	LBB0_8
LBB0_4:
	movq	_SNOR_ERASE_TYPE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	1(%rax), %ecx
	shlq	$4, %rax
	addq	$-16, %rax
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	decl	%ecx
	testl	%ecx, %ecx
	jle	LBB0_2
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%rbx), %rdx
	movq	(%rdx,%rax), %rdx
	addq	$-16, %rax
	testq	%rdx, %rdx
	je	LBB0_5
## %bb.7:
	movq	%rdx, 16(%r14)
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SNOR_ERASE_TYPE_MAX,4,2        ## @SNOR_ERASE_TYPE_MAX
	.no_dead_strip	_spi_nor_select_erase
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spi_nor_select_erase
_spi_nor_select_erase:                  ; @spi_nor_select_erase
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	add	x20, x0, #24
	ldr	x8, [x0, #8]
	ldr	w21, [x8]
	bl	_spi_nor_has_uniform_erase
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x20
	mov	x1, x21
	bl	_spi_nor_select_uniform_erase
	cbz	x0, LBB0_7
; %bb.2:
	mov	x8, x0
	mov	w0, #0
	ldr	w9, [x8, #8]
	str	w9, [x19]
	ldr	x8, [x8]
	str	x8, [x19, #16]
	b	LBB0_8
LBB0_3:
Lloh0:
	adrp	x8, _SNOR_ERASE_TYPE_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SNOR_ERASE_TYPE_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	add	w8, w9, #1
	lsl	x9, x9, #4
	sub	x9, x9, #16
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	w8, w8, #1
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x10, [x20]
	ldr	x10, [x10, x9]
	sub	x9, x9, #16
	cbz	x10, LBB0_4
; %bb.6:
	mov	w0, #0
	str	x10, [x19, #16]
	b	LBB0_8
LBB0_7:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 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_ERASE_TYPE_MAX,4,2        ; @SNOR_ERASE_TYPE_MAX
	.no_dead_strip	_spi_nor_select_erase
.subsections_via_symbols
