	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function t4_flash_erase_sectors
_t4_flash_erase_sectors:                ## @t4_flash_erase_sectors
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	xorl	%ebx, %ebx
	cmpl	%edx, %esi
	jg	LBB0_8
## %bb.1:
	movl	%edx, %r15d
	movl	%esi, %r12d
	incl	%r15d
	movl	%esi, %r13d
	shll	$8, %r13d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_SF_WR_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	_sf1_write
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_SF_ERASE_SECTOR@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	orl	%r13d, %r8d
	movq	%r14, %rdi
	movl	$4, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	_sf1_write
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	movl	$14, %esi
	movl	$500, %edx                      ## imm = 0x1F4
	callq	_flash_wait_op
	testl	%eax, %eax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%r12d
	addl	$256, %r13d                     ## imm = 0x100
	cmpl	%r12d, %r15d
	jne	LBB0_2
## %bb.7:
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_5:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_dev_err
LBB0_8:
	movq	_SF_OP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_t4_write_reg
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SF_WR_ENABLE,4,2               ## @SF_WR_ENABLE
	.comm	_SF_ERASE_SECTOR,4,2            ## @SF_ERASE_SECTOR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"erase of flash sector %d failed, error %d\n"

	.comm	_SF_OP,4,2                      ## @SF_OP
	.no_dead_strip	_t4_flash_erase_sectors
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function t4_flash_erase_sectors
_t4_flash_erase_sectors:                ; @t4_flash_erase_sectors
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	cmp	w1, w2
	b.le	LBB0_2
LBB0_1:
	mov	w21, #0
	b	LBB0_8
LBB0_2:
	mov	x20, x1
	add	w22, w2, #1
	lsl	w23, w1, #8
Lloh0:
	adrp	x24, _SF_WR_ENABLE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SF_WR_ENABLE@GOTPAGEOFF]
Lloh2:
	adrp	x25, _SF_ERASE_SECTOR@GOTPAGE
Lloh3:
	ldr	x25, [x25, _SF_ERASE_SECTOR@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w4, [x24]
	mov	x0, x19
	mov	w1, #1
	mov	w2, #0
	mov	w3, #1
	bl	_sf1_write
	cbnz	w0, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x25]
	orr	w4, w8, w23
	mov	x0, x19
	mov	w1, #4
	mov	w2, #0
	mov	w3, #1
	bl	_sf1_write
	cbnz	w0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	w1, #14
	mov	w2, #500
	bl	_flash_wait_op
	cbnz	w0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w20, w20, #1
	add	w23, w23, #256
	cmp	w22, w20
	b.ne	LBB0_3
	b	LBB0_1
LBB0_7:
	mov	x21, x0
	ldr	w0, [x19]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	mov	x3, x21
	bl	_dev_err
LBB0_8:
Lloh6:
	adrp	x8, _SF_OP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SF_OP@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_t4_write_reg
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_SF_WR_ENABLE,4,2               ; @SF_WR_ENABLE
	.comm	_SF_ERASE_SECTOR,4,2            ; @SF_ERASE_SECTOR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"erase of flash sector %d failed, error %d\n"

	.comm	_SF_OP,4,2                      ; @SF_OP
	.no_dead_strip	_t4_flash_erase_sectors
.subsections_via_symbols
