	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stfsm_s25fl_config
_stfsm_s25fl_config:                    ## @stfsm_s25fl_config
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	16(%rdi), %r12
	movl	(%r12), %ebx
	movq	_FLASH_FLAG_32BIT_ADDR@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_4
## %bb.1:
	leaq	4(%r14), %rsi
	movq	_stfsm_s25fl_read4_configs@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_stfsm_search_prepare_rw_seq
	testl	%eax, %eax
	jne	LBB0_20
## %bb.2:
	leaq	8(%r14), %rsi
	movq	_stfsm_s25fl_write4_configs@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_stfsm_search_prepare_rw_seq
	testl	%eax, %eax
	jne	LBB0_20
## %bb.3:
	movq	_stfsm_seq_erase_sector@GOTPCREL(%rip), %rdi
	callq	_stfsm_s25fl_prepare_erasesec_seq_32
	jmp	LBB0_5
LBB0_4:
	movq	%r14, %rdi
	callq	_stfsm_prepare_rwe_seqs_default
	testl	%eax, %eax
	jne	LBB0_20
LBB0_5:
	movq	_FLASH_FLAG_DYB_LOCKING@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_13
## %bb.6:
	movl	8(%r12), %eax
	imull	4(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_13
## %bb.7:
	xorl	%ebx, %ebx
	leaq	-40(%rbp), %r15
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	cmpl	%edx, %ebx
	cmovll	%r8d, %esi
	addl	%esi, %ebx
	imull	%eax, %ecx
	cmpl	%ecx, %ebx
	jge	LBB0_13
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	movq	%r15, %rdx
	callq	_stfsm_s25fl_read_dyb
	cmpl	$0, -40(%rbp)
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$255, %edx
	callq	_stfsm_s25fl_write_dyb
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	4(%r12), %eax
	movl	8(%r12), %ecx
	leal	(%rax,%rax), %edx
	leal	(,%rcx,4), %esi
	movl	%eax, %edi
	subl	%esi, %edi
	movl	$65536, %esi                    ## imm = 0x10000
	movl	$4096, %r8d                     ## imm = 0x1000
	cmpl	%edi, %ebx
	jl	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	$4096, %esi                     ## imm = 0x1000
	jmp	LBB0_12
LBB0_13:
	movq	_SPINOR_OP_RDCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_stfsm_read_status
	movl	4(%r14), %edx
	notl	%edx
	movl	-36(%rbp), %ecx
	movq	_STFSM_S25FL_CONFIG_QE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	$196608, %edx                   ## imm = 0x30000
	jne	LBB0_16
## %bb.14:
	testl	%ecx, %eax
	jne	LBB0_19
## %bb.15:
	orl	%ecx, %eax
	jmp	LBB0_18
LBB0_16:
	testl	%ecx, %eax
	je	LBB0_19
## %bb.17:
	notl	%eax
	andl	%ecx, %eax
LBB0_18:
	movl	%eax, -36(%rbp)
	movq	_SPINOR_OP_RDSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_stfsm_read_status
	movl	-36(%rbp), %edx
	shll	$8, %edx
	orl	-44(%rbp), %edx
	movq	_SPINOR_OP_WRSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$2, %ecx
	movl	$1, %r8d
	callq	_stfsm_write_status
LBB0_19:
	movq	_CFG_S25FL_CHECK_ERROR_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r14)
	xorl	%eax, %eax
LBB0_20:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FLASH_FLAG_32BIT_ADDR,4,2      ## @FLASH_FLAG_32BIT_ADDR
	.comm	_stfsm_s25fl_read4_configs,4,2  ## @stfsm_s25fl_read4_configs
	.comm	_stfsm_s25fl_write4_configs,4,2 ## @stfsm_s25fl_write4_configs
	.comm	_stfsm_seq_erase_sector,4,2     ## @stfsm_seq_erase_sector
	.comm	_FLASH_FLAG_DYB_LOCKING,4,2     ## @FLASH_FLAG_DYB_LOCKING
	.comm	_SPINOR_OP_RDCR,4,2             ## @SPINOR_OP_RDCR
	.comm	_STFSM_S25FL_CONFIG_QE,4,2      ## @STFSM_S25FL_CONFIG_QE
	.comm	_SPINOR_OP_RDSR,4,2             ## @SPINOR_OP_RDSR
	.comm	_SPINOR_OP_WRSR,4,2             ## @SPINOR_OP_WRSR
	.comm	_CFG_S25FL_CHECK_ERROR_FLAGS,4,2 ## @CFG_S25FL_CHECK_ERROR_FLAGS
	.no_dead_strip	_stfsm_s25fl_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stfsm_s25fl_config
_stfsm_s25fl_config:                    ; @stfsm_s25fl_config
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	ldr	x21, [x0, #16]
	ldr	w20, [x21]
Lloh0:
	adrp	x8, _FLASH_FLAG_32BIT_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FLASH_FLAG_32BIT_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_4
; %bb.1:
	add	x1, x19, #4
Lloh3:
	adrp	x8, _stfsm_s25fl_read4_configs@GOTPAGE
Lloh4:
	ldr	x8, [x8, _stfsm_s25fl_read4_configs@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_stfsm_search_prepare_rw_seq
	cbnz	w0, LBB0_18
; %bb.2:
	add	x1, x19, #8
Lloh6:
	adrp	x8, _stfsm_s25fl_write4_configs@GOTPAGE
Lloh7:
	ldr	x8, [x8, _stfsm_s25fl_write4_configs@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_stfsm_search_prepare_rw_seq
	cbnz	w0, LBB0_18
; %bb.3:
Lloh9:
	adrp	x0, _stfsm_seq_erase_sector@GOTPAGE
Lloh10:
	ldr	x0, [x0, _stfsm_seq_erase_sector@GOTPAGEOFF]
	bl	_stfsm_s25fl_prepare_erasesec_seq_32
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_stfsm_prepare_rwe_seqs_default
	cbnz	w0, LBB0_18
LBB0_5:
Lloh11:
	adrp	x8, _FLASH_FLAG_DYB_LOCKING@GOTPAGE
Lloh12:
	ldr	x8, [x8, _FLASH_FLAG_DYB_LOCKING@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_11
; %bb.6:
	ldp	w8, w9, [x21, #4]
	mul	w8, w9, w8
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.7:
	mov	w20, #0
	mov	w22, #4096
	mov	w23, #65536
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldp	w8, w9, [x21, #4]
	sub	w10, w8, w9, lsl #2
	cmp	w20, w10
	csel	w10, w23, w22, lt
	cmp	w20, w8, lsl #1
	csel	w10, w22, w10, lt
	mul	w8, w9, w8
	add	w20, w20, w10
	cmp	w20, w8
	b.ge	LBB0_11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #4
	mov	x0, x19
	mov	x1, x20
	bl	_stfsm_s25fl_read_dyb
	ldr	w8, [sp, #4]
	cbnz	w8, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x19
	mov	x1, x20
	mov	w2, #255
	bl	_stfsm_s25fl_write_dyb
	b	LBB0_8
LBB0_11:
Lloh14:
	adrp	x8, _SPINOR_OP_RDCR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SPINOR_OP_RDCR@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	mov	w3, #1
	bl	_stfsm_read_status
	ldr	w8, [x19, #4]
	mvn	w11, w8
	ldr	w8, [sp, #8]
Lloh17:
	adrp	x9, _STFSM_S25FL_CONFIG_QE@GOTPAGE
Lloh18:
	ldr	x9, [x9, _STFSM_S25FL_CONFIG_QE@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	and	w10, w9, w8
	tst	w11, #0x30000
	b.ne	LBB0_14
; %bb.12:
	cbnz	w10, LBB0_17
; %bb.13:
	orr	w8, w9, w8
	b	LBB0_16
LBB0_14:
	cbz	w10, LBB0_17
; %bb.15:
	bic	w8, w8, w9
LBB0_16:
	str	w8, [sp, #8]
Lloh20:
	adrp	x8, _SPINOR_OP_RDSR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SPINOR_OP_RDSR@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_stfsm_read_status
	ldp	w8, w9, [sp, #8]
	orr	w2, w9, w8, lsl #8
Lloh23:
	adrp	x8, _SPINOR_OP_WRSR@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SPINOR_OP_WRSR@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w3, #2
	mov	w4, #1
	bl	_stfsm_write_status
LBB0_17:
	mov	w0, #0
Lloh26:
	adrp	x8, _CFG_S25FL_CHECK_ERROR_FLAGS@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CFG_S25FL_CHECK_ERROR_FLAGS@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_18:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_FLASH_FLAG_32BIT_ADDR,4,2      ; @FLASH_FLAG_32BIT_ADDR
	.comm	_stfsm_s25fl_read4_configs,4,2  ; @stfsm_s25fl_read4_configs
	.comm	_stfsm_s25fl_write4_configs,4,2 ; @stfsm_s25fl_write4_configs
	.comm	_stfsm_seq_erase_sector,4,2     ; @stfsm_seq_erase_sector
	.comm	_FLASH_FLAG_DYB_LOCKING,4,2     ; @FLASH_FLAG_DYB_LOCKING
	.comm	_SPINOR_OP_RDCR,4,2             ; @SPINOR_OP_RDCR
	.comm	_STFSM_S25FL_CONFIG_QE,4,2      ; @STFSM_S25FL_CONFIG_QE
	.comm	_SPINOR_OP_RDSR,4,2             ; @SPINOR_OP_RDSR
	.comm	_SPINOR_OP_WRSR,4,2             ; @SPINOR_OP_WRSR
	.comm	_CFG_S25FL_CHECK_ERROR_FLAGS,4,2 ; @CFG_S25FL_CHECK_ERROR_FLAGS
	.no_dead_strip	_stfsm_s25fl_config
.subsections_via_symbols
