	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spi_nor_find_erase_region
_spi_nor_find_erase_region:             ## @spi_nor_find_erase_region
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	(%rdi), %rax
	movq	_SNOR_ERASE_FLAGS_MASK@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	notq	%rcx
	andq	(%rax), %rcx
	cmpq	%rsi, %rcx
	jg	LBB0_2
LBB0_1:
	addq	8(%rax), %rcx
	cmpq	%rbx, %rcx
	jg	LBB0_4
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rdi
	callq	_spi_nor_region_next
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r14), %rcx
	notq	%rcx
	andq	(%rax), %rcx
	cmpq	%rbx, %rcx
	jle	LBB0_1
	jmp	LBB0_2
LBB0_4:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SNOR_ERASE_FLAGS_MASK,8,3      ## @SNOR_ERASE_FLAGS_MASK
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_spi_nor_find_erase_region
.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_erase_region
_spi_nor_find_erase_region:             ; @spi_nor_find_erase_region
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x0, [x0]
Lloh0:
	adrp	x20, _SNOR_ERASE_FLAGS_MASK@GOTPAGE
Lloh1:
	ldr	x20, [x20, _SNOR_ERASE_FLAGS_MASK@GOTPAGEOFF]
	ldr	x8, [x20]
	ldp	x9, x10, [x0]
	bic	x8, x9, x8
	add	x9, x8, x10
	cmp	x8, x1
	ccmp	x9, x1, #4, le
	b.gt	LBB0_4
; %bb.1:
	mov	x19, x1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	bl	_spi_nor_region_next
	cbz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x20]
	ldp	x9, x10, [x0]
	bic	x8, x9, x8
	add	x9, x8, x10
	cmp	x8, x19
	ccmp	x9, x19, #4, le
	b.le	LBB0_2
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_5:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_ERR_PTR
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_SNOR_ERASE_FLAGS_MASK,8,3      ; @SNOR_ERASE_FLAGS_MASK
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_spi_nor_find_erase_region
.subsections_via_symbols
