	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_spi_erase
_intel_spi_erase:                       ## @intel_spi_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	%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
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	8(%rdi), %rbx
	movq	16(%rdi), %r12
	movq	_SZ_64K@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	cmpq	%r13, %r12
	jb	LBB0_3
## %bb.1:
	cmpq	$0, 24(%rbx)
	je	LBB0_3
## %bb.2:
	movq	_HSFSTS_CTL_FCYCLE_ERASE_64K@GOTPCREL(%rip), %rax
	cmpq	$0, 16(%rbx)
	jne	LBB0_5
LBB0_9:
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	$0, 8(%rbx)
	testq	%r12, %r12
	je	LBB0_18
## %bb.10:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	_HSFSTS_CTL_FCERR@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	(%rax,%r15), %edi
	movq	_FADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%rbx), %rsi
	callq	_writel
	movq	_HSFSTS_CTL@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	(%rbx), %rdi
	callq	_readl
	movq	_HSFSTS_CTL_FCYCLE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_HSFSTS_CTL_FDBC_MASK@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movq	_HSFSTS_CTL_AEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	-44(%rbp), %edi                 ## 4-byte Folded Reload
	orl	(%r13), %edi
	orl	%ecx, %edi
	movq	_HSFSTS_CTL_FDONE@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_HSFSTS_CTL_FGO@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	(%r14), %rsi
	addq	(%rbx), %rsi
	callq	_writel
	movq	%rbx, %rdi
	callq	_intel_spi_wait_hw_busy
	testl	%eax, %eax
	jne	LBB0_19
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	(%r14), %rdi
	addq	(%rbx), %rdi
	callq	_readl
	testl	%eax, (%r13)
	jne	LBB0_13
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_HSFSTS_CTL_AEL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_11 Depth=1
	addq	-64(%rbp), %r15                 ## 8-byte Folded Reload
	cmpq	%r15, %r12
	jne	LBB0_11
	jmp	LBB0_18
LBB0_3:
	movq	_SZ_4K@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	_HSFSTS_CTL_FCYCLE_ERASE@GOTPCREL(%rip), %rax
	cmpq	$0, 16(%rbx)
	je	LBB0_9
LBB0_5:
	testq	%r12, %r12
	je	LBB0_18
## %bb.6:
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	(%rax,%r14), %edi
	movq	_FADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%rbx), %rsi
	callq	_writel
	movl	(%r15), %esi
	movq	_OPTYPE_WRITE_WITH_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_intel_spi_sw_cycle
	testl	%eax, %eax
	jne	LBB0_19
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	addq	%r13, %r14
	cmpq	%r14, %r12
	jne	LBB0_7
LBB0_18:
	xorl	%eax, %eax
LBB0_19:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_14
LBB0_16:
	movq	_EACCES@GOTPCREL(%rip), %rcx
LBB0_14:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_SZ_64K,8,3                     ## @SZ_64K
	.comm	_HSFSTS_CTL_FCYCLE_ERASE_64K,4,2 ## @HSFSTS_CTL_FCYCLE_ERASE_64K
	.comm	_HSFSTS_CTL_FCYCLE_ERASE,4,2    ## @HSFSTS_CTL_FCYCLE_ERASE
	.comm	_SZ_4K,8,3                      ## @SZ_4K
	.comm	_FADDR,8,3                      ## @FADDR
	.comm	_OPTYPE_WRITE_WITH_ADDR,4,2     ## @OPTYPE_WRITE_WITH_ADDR
	.comm	_HSFSTS_CTL,8,3                 ## @HSFSTS_CTL
	.comm	_HSFSTS_CTL_FDBC_MASK,4,2       ## @HSFSTS_CTL_FDBC_MASK
	.comm	_HSFSTS_CTL_FCYCLE_MASK,4,2     ## @HSFSTS_CTL_FCYCLE_MASK
	.comm	_HSFSTS_CTL_AEL,4,2             ## @HSFSTS_CTL_AEL
	.comm	_HSFSTS_CTL_FCERR,4,2           ## @HSFSTS_CTL_FCERR
	.comm	_HSFSTS_CTL_FDONE,4,2           ## @HSFSTS_CTL_FDONE
	.comm	_HSFSTS_CTL_FGO,4,2             ## @HSFSTS_CTL_FGO
	.comm	_EIO,4,2                        ## @EIO
	.comm	_EACCES,4,2                     ## @EACCES
	.no_dead_strip	_intel_spi_erase
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_spi_erase
_intel_spi_erase:                       ; @intel_spi_erase
	.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	x19, x1
	mov	x21, x0
	ldp	x20, x22, [x0, #8]
Lloh0:
	adrp	x8, _SZ_64K@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SZ_64K@GOTPAGEOFF]
Lloh2:
	ldr	x23, [x8]
	cmp	x22, x23
	b.lo	LBB0_9
; %bb.1:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_9
; %bb.2:
Lloh3:
	adrp	x8, _HSFSTS_CTL_FCYCLE_ERASE_64K@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HSFSTS_CTL_FCYCLE_ERASE_64K@GOTPAGEOFF]
	ldr	x9, [x20, #16]
	cbnz	x9, LBB0_10
LBB0_3:
	ldr	w21, [x8]
	str	xzr, [x20, #8]
	cbz	x22, LBB0_14
; %bb.4:
	mov	x24, #0
Lloh5:
	adrp	x26, _HSFSTS_CTL@GOTPAGE
Lloh6:
	ldr	x26, [x26, _HSFSTS_CTL@GOTPAGEOFF]
Lloh7:
	adrp	x25, _HSFSTS_CTL_AEL@GOTPAGE
Lloh8:
	ldr	x25, [x25, _HSFSTS_CTL_AEL@GOTPAGEOFF]
Lloh9:
	adrp	x27, _HSFSTS_CTL_FCERR@GOTPAGE
Lloh10:
	ldr	x27, [x27, _HSFSTS_CTL_FCERR@GOTPAGEOFF]
Lloh11:
	adrp	x28, _HSFSTS_CTL_FGO@GOTPAGE
Lloh12:
	ldr	x28, [x28, _HSFSTS_CTL_FGO@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	w0, w19, w24
	ldr	x8, [x20]
Lloh13:
	adrp	x9, _FADDR@GOTPAGE
Lloh14:
	ldr	x9, [x9, _FADDR@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x20]
	ldr	x9, [x26]
	add	x0, x9, x8
	bl	_readl
Lloh16:
	adrp	x8, _HSFSTS_CTL_FDBC_MASK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _HSFSTS_CTL_FDBC_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _HSFSTS_CTL_FCYCLE_MASK@GOTPAGE
Lloh20:
	ldr	x9, [x9, _HSFSTS_CTL_FCYCLE_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w8, w0, w8
	ldr	w9, [x25]
	ldr	w10, [x27]
Lloh22:
	adrp	x11, _HSFSTS_CTL_FDONE@GOTPAGE
Lloh23:
	ldr	x11, [x11, _HSFSTS_CTL_FDONE@GOTPAGEOFF]
Lloh24:
	ldr	w11, [x11]
	ldr	w12, [x28]
	orr	w9, w9, w21
	orr	w9, w9, w10
	orr	w8, w9, w8
	orr	w8, w8, w11
	orr	w0, w8, w12
	ldr	x8, [x20]
	ldr	x9, [x26]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x20
	bl	_intel_spi_wait_hw_busy
	cbnz	w0, LBB0_15
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20]
	ldr	x9, [x26]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x27]
	tst	w8, w0
	b.ne	LBB0_16
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x25]
	tst	w8, w0
	b.ne	LBB0_17
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x24, x24, x23
	cmp	x22, x24
	b.ne	LBB0_5
	b	LBB0_14
LBB0_9:
Lloh25:
	adrp	x8, _SZ_4K@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SZ_4K@GOTPAGEOFF]
Lloh27:
	ldr	x23, [x8]
Lloh28:
	adrp	x8, _HSFSTS_CTL_FCYCLE_ERASE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _HSFSTS_CTL_FCYCLE_ERASE@GOTPAGEOFF]
	ldr	x9, [x20, #16]
	cbz	x9, LBB0_3
LBB0_10:
	cbz	x22, LBB0_14
; %bb.11:
	mov	x24, #0
Lloh30:
	adrp	x25, _FADDR@GOTPAGE
Lloh31:
	ldr	x25, [x25, _FADDR@GOTPAGEOFF]
Lloh32:
	adrp	x26, _OPTYPE_WRITE_WITH_ADDR@GOTPAGE
Lloh33:
	ldr	x26, [x26, _OPTYPE_WRITE_WITH_ADDR@GOTPAGEOFF]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	add	w0, w19, w24
	ldr	x8, [x20]
	ldr	x9, [x25]
	add	x1, x9, x8
	bl	_writel
	ldr	w1, [x21]
	ldr	w3, [x26]
	mov	x0, x20
	mov	w2, #0
	bl	_intel_spi_sw_cycle
	cbnz	w0, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x24, x24, x23
	cmp	x22, x24
	b.ne	LBB0_12
LBB0_14:
	mov	w0, #0
LBB0_15:
	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
LBB0_16:
Lloh34:
	adrp	x8, _EIO@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_18
LBB0_17:
Lloh36:
	adrp	x8, _EACCES@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_SZ_64K,8,3                     ; @SZ_64K
	.comm	_HSFSTS_CTL_FCYCLE_ERASE_64K,4,2 ; @HSFSTS_CTL_FCYCLE_ERASE_64K
	.comm	_HSFSTS_CTL_FCYCLE_ERASE,4,2    ; @HSFSTS_CTL_FCYCLE_ERASE
	.comm	_SZ_4K,8,3                      ; @SZ_4K
	.comm	_FADDR,8,3                      ; @FADDR
	.comm	_OPTYPE_WRITE_WITH_ADDR,4,2     ; @OPTYPE_WRITE_WITH_ADDR
	.comm	_HSFSTS_CTL,8,3                 ; @HSFSTS_CTL
	.comm	_HSFSTS_CTL_FDBC_MASK,4,2       ; @HSFSTS_CTL_FDBC_MASK
	.comm	_HSFSTS_CTL_FCYCLE_MASK,4,2     ; @HSFSTS_CTL_FCYCLE_MASK
	.comm	_HSFSTS_CTL_AEL,4,2             ; @HSFSTS_CTL_AEL
	.comm	_HSFSTS_CTL_FCERR,4,2           ; @HSFSTS_CTL_FCERR
	.comm	_HSFSTS_CTL_FDONE,4,2           ; @HSFSTS_CTL_FDONE
	.comm	_HSFSTS_CTL_FGO,4,2             ; @HSFSTS_CTL_FGO
	.comm	_EIO,4,2                        ; @EIO
	.comm	_EACCES,4,2                     ; @EACCES
	.no_dead_strip	_intel_spi_erase
.subsections_via_symbols
