	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function efx_spi_erase
_efx_spi_erase:                         ## @efx_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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %r14
	movq	8(%r14), %r15
	movq	_EFX_SPI_VERIFY_BUF_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	(,%rax,4), %rbx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rax
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	cmpq	%r12, (%r15)
	jne	LBB0_1
## %bb.2:
	cmpq	$0, 8(%r15)
	je	LBB0_3
## %bb.4:
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	(%r14), %r12
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_efx_spi_unlock
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_17
## %bb.5:
	movq	_SPI_WREN@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	subq	$8, %rsp
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	$-1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	$0
	callq	_falcon_spi_cmd
	addq	$16, %rsp
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_17
## %bb.6:
	movq	8(%r15), %rdx
	subq	$8, %rsp
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	$0
	callq	_falcon_spi_cmd
	addq	$16, %rsp
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_17
## %bb.7:
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_efx_spi_slow_wait
	movl	%eax, %r14d
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	shll	$2, %edx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	$255, %esi
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memset
	cmpq	$0, -64(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_17
## %bb.8:
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	subq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_min
	movl	%eax, %r13d
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	leal	(%rbx,%rax), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r13d, %ecx
	xorl	%r8d, %r8d
	movq	-104(%rbp), %r12                ## 8-byte Reload
	movq	%r12, %r9
	callq	_falcon_spi_read
	testl	%eax, %eax
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	%r13d, %edx
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	xorl	%eax, %eax
	callq	_cond_resched
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_signal_pending
	testq	%rax, %rax
	jne	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_10 Depth=1
	addl	-96(%rbp), %r13d                ## 4-byte Folded Reload
	xorl	%r14d, %r14d
	movl	%r13d, %ebx
	cmpq	-64(%rbp), %r13                 ## 8-byte Folded Reload
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	jb	LBB0_10
	jmp	LBB0_17
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_3:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
LBB0_16:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_17:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_19
## %bb.18:
	movl	%r14d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	%eax, %r14d
	jmp	LBB0_17
LBB0_13:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_15:
	movq	_EINTR@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EFX_SPI_VERIFY_BUF_LEN,4,2     ## @EFX_SPI_VERIFY_BUF_LEN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_SPI_WREN,8,3                   ## @SPI_WREN
	.comm	_EIO,4,2                        ## @EIO
	.comm	_current,4,2                    ## @current
	.comm	_EINTR,4,2                      ## @EINTR
	.no_dead_strip	_efx_spi_erase
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function efx_spi_erase
_efx_spi_erase:                         ; @efx_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
	sub	sp, sp, #16
	mov	x19, x2
	mov	x20, x1
	mov	x25, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	ldr	x8, [x0]
	ldp	x22, x21, [x8]
Lloh3:
	adrp	x8, _EFX_SPI_VERIFY_BUF_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EFX_SPI_VERIFY_BUF_LEN@GOTPAGEOFF]
Lloh5:
	ldr	w27, [x8]
	lsl	x8, x27, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x8, #15
	and	x12, x10, #0x7fffffff0
	sub	x23, x9, x12
	mov	sp, x23
	mov	x9, x8
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	sub	x24, x8, x12
	mov	sp, x24
	ldr	x8, [x21]
	cmp	x8, x2
	b.ne	LBB0_11
; %bb.1:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_12
; %bb.2:
	mov	x0, x22
	mov	x1, x21
	bl	_efx_spi_unlock
	mov	x26, x0
	cbnz	w0, LBB0_14
; %bb.3:
Lloh10:
	adrp	x8, _SPI_WREN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SPI_WREN@GOTPAGEOFF]
Lloh12:
	ldr	x2, [x8]
	mov	x0, x22
	mov	x1, x21
	mov	w3, #-1
	mov	x4, #0
	mov	x5, #0
	mov	w6, #0
	bl	_falcon_spi_cmd
	mov	x26, x0
	cbnz	w0, LBB0_14
; %bb.4:
	ldr	x2, [x21, #8]
	mov	x0, x22
	mov	x1, x21
	mov	x3, x20
	mov	x4, #0
	mov	x5, #0
	mov	w6, #0
	bl	_falcon_spi_cmd
	mov	x26, x0
	cbnz	w0, LBB0_14
; %bb.5:
	mov	x0, x25
	mov	w1, #0
	bl	_efx_spi_slow_wait
	mov	x26, x0
	lsl	w25, w27, #2
	mov	x0, x23
	mov	w1, #255
	mov	x2, x25
	bl	_memset
	cbz	x19, LBB0_14
; %bb.6:
	mov	x8, #0
	mov	w28, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	sub	x0, x19, x8
	mov	x1, x25
	bl	_min
	mov	x27, x0
	add	w2, w28, w20
	mov	x0, x22
	mov	x1, x21
	mov	x3, x27
	mov	x4, #0
	mov	x5, x24
	bl	_falcon_spi_read
	cbnz	w0, LBB0_16
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x23
	mov	x1, x24
	mov	x2, x27
	bl	_memcmp
	cbnz	x0, LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	bl	_cond_resched
Lloh13:
	adrp	x8, _current@GOTPAGE
Lloh14:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_signal_pending
	cbnz	x0, LBB0_18
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	w26, #0
	add	w8, w27, w28
	cmp	x8, x19
	mov	x28, x8
	b.lo	LBB0_7
	b	LBB0_14
LBB0_11:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
Lloh18:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w26, w8
LBB0_14:
	ldur	x8, [x29, #-88]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.15:
	mov	x0, x26
	sub	sp, x29, #80
	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:
	mov	x26, x0
	b	LBB0_14
LBB0_17:
Lloh23:
	adrp	x8, _EIO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_13
LBB0_18:
Lloh25:
	adrp	x8, _EINTR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
	b	LBB0_13
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_EFX_SPI_VERIFY_BUF_LEN,4,2     ; @EFX_SPI_VERIFY_BUF_LEN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_SPI_WREN,8,3                   ; @SPI_WREN
	.comm	_EIO,4,2                        ; @EIO
	.comm	_current,4,2                    ; @current
	.comm	_EINTR,4,2                      ; @EINTR
	.no_dead_strip	_efx_spi_erase
.subsections_via_symbols
