	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spi_nor_find_best_erase_type
_spi_nor_find_best_erase_type:          ## @spi_nor_find_best_erase_type
	.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	$24, %rsp
	.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	_SNOR_ERASE_TYPE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	jle	LBB0_7
## %bb.1:
	movq	%rcx, %r12
	movq	%rdi, %r13
	movq	_SNOR_ERASE_TYPE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	andl	(%rsi), %r15d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rax
	incq	%rax
	cmpq	$1, %rax
	jbe	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	decq	%rbx
	movl	%ebx, %edi
	callq	_BIT
	testl	%eax, %r15d
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rax
	movl	%ebx, %ecx
	cmpq	%r12, (%rax,%rcx,8)
	jg	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%rax,%rcx,8), %r14
	movq	_SNOR_OVERLAID_REGION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, (%rcx)
	jne	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	leaq	-64(%rbp), %rdx
	callq	_spi_nor_div_by_erase_size
	cmpq	$0, -64(%rbp)
	jne	LBB0_6
	jmp	LBB0_8
LBB0_7:
	xorl	%r14d, %r14d
LBB0_8:
	movq	%r14, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SNOR_ERASE_TYPE_MASK,4,2       ## @SNOR_ERASE_TYPE_MASK
	.comm	_SNOR_ERASE_TYPE_MAX,4,2        ## @SNOR_ERASE_TYPE_MAX
	.comm	_SNOR_OVERLAID_REGION,4,2       ## @SNOR_OVERLAID_REGION
	.no_dead_strip	_spi_nor_find_best_erase_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spi_nor_find_best_erase_type
_spi_nor_find_best_erase_type:          ; @spi_nor_find_best_erase_type
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
Lloh0:
	adrp	x8, _SNOR_ERASE_TYPE_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SNOR_ERASE_TYPE_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	cmp	w23, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	ldr	w8, [x1]
Lloh3:
	adrp	x9, _SNOR_ERASE_TYPE_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SNOR_ERASE_TYPE_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w25, w9, w8
Lloh6:
	adrp	x26, _SNOR_OVERLAID_REGION@GOTPAGE
Lloh7:
	ldr	x26, [x26, _SNOR_OVERLAID_REGION@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x8, x23, #1
	cmp	x8, #1
	b.ls	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	sub	x23, x23, #1
	mov	x0, x23
	bl	_BIT
	tst	w25, w0
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x22]
	add	x24, x8, w23, uxtw #3
	ldr	x8, [x24]
	cmp	x8, x19
	b.gt	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x21]
	ldr	w9, [x26]
	tst	w9, w8
	b.ne	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x2, sp, #8
	mov	x0, x24
	mov	x1, x20
	bl	_spi_nor_div_by_erase_size
	ldr	x8, [sp, #8]
	cbnz	x8, LBB0_2
	b	LBB0_8
LBB0_7:
	mov	x24, #0
LBB0_8:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SNOR_ERASE_TYPE_MASK,4,2       ; @SNOR_ERASE_TYPE_MASK
	.comm	_SNOR_ERASE_TYPE_MAX,4,2        ; @SNOR_ERASE_TYPE_MAX
	.comm	_SNOR_OVERLAID_REGION,4,2       ; @SNOR_OVERLAID_REGION
	.no_dead_strip	_spi_nor_find_best_erase_type
.subsections_via_symbols
