	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stfsm_erase_sector
_stfsm_erase_sector:                    ## @stfsm_erase_sector
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	4(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_dbg
	movq	_CFG_ERASESEC_TOGGLE_32BIT_ADDR@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	testl	%eax, (%rbx)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_stfsm_enter_32bit_addr
LBB0_2:
	movl	%r14d, %eax
	shrl	$16, %eax
	movq	_stfsm_seq_erase_sector@GOTPCREL(%rip), %rsi
	movl	%eax, (%rsi)
	movzwl	%r14w, %eax
	movl	%eax, 4(%rsi)
	movq	%rbx, %rdi
	callq	_stfsm_load_seq
	movq	%rbx, %rdi
	callq	_stfsm_wait_seq
	movq	%rbx, %rdi
	callq	_stfsm_wait_busy
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movq	_CFG_S25FL_CHECK_ERROR_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_stfsm_s25fl_clear_status_reg
LBB0_5:
	movl	(%r15), %eax
	testl	%eax, (%rbx)
	je	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_stfsm_enter_32bit_addr
LBB0_7:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_stfsm_seq_erase_sector,8,2     ## @stfsm_seq_erase_sector
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"erasing sector at 0x%08x\n"

	.comm	_CFG_ERASESEC_TOGGLE_32BIT_ADDR,4,2 ## @CFG_ERASESEC_TOGGLE_32BIT_ADDR
	.comm	_CFG_S25FL_CHECK_ERROR_FLAGS,4,2 ## @CFG_S25FL_CHECK_ERROR_FLAGS
	.no_dead_strip	_stfsm_erase_sector
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stfsm_erase_sector
_stfsm_erase_sector:                    ; @stfsm_erase_sector
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
	ldr	w8, [x19]
Lloh2:
	adrp	x21, _CFG_ERASESEC_TOGGLE_32BIT_ADDR@GOTPAGE
Lloh3:
	ldr	x21, [x21, _CFG_ERASESEC_TOGGLE_32BIT_ADDR@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #1
	bl	_stfsm_enter_32bit_addr
LBB0_2:
	lsr	w8, w20, #16
Lloh4:
	adrp	x1, _stfsm_seq_erase_sector@GOTPAGE
Lloh5:
	ldr	x1, [x1, _stfsm_seq_erase_sector@GOTPAGEOFF]
	and	w9, w20, #0xffff
	stp	w8, w9, [x1]
	mov	x0, x19
	bl	_stfsm_load_seq
	mov	x0, x19
	bl	_stfsm_wait_seq
	mov	x0, x19
	bl	_stfsm_wait_busy
	mov	x20, x0
	cbz	w0, LBB0_5
; %bb.3:
	ldr	w8, [x19]
Lloh6:
	adrp	x9, _CFG_S25FL_CHECK_ERROR_FLAGS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CFG_S25FL_CHECK_ERROR_FLAGS@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_stfsm_s25fl_clear_status_reg
LBB0_5:
	ldr	w8, [x19]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	mov	x0, x19
	mov	w1, #0
	bl	_stfsm_enter_32bit_addr
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_stfsm_seq_erase_sector,8,2     ; @stfsm_seq_erase_sector
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"erasing sector at 0x%08x\n"

	.comm	_CFG_ERASESEC_TOGGLE_32BIT_ADDR,4,2 ; @CFG_ERASESEC_TOGGLE_32BIT_ADDR
	.comm	_CFG_S25FL_CHECK_ERROR_FLAGS,4,2 ; @CFG_S25FL_CHECK_ERROR_FLAGS
	.no_dead_strip	_stfsm_erase_sector
.subsections_via_symbols
