	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stfsm_n25q_config
_stfsm_n25q_config:                     ## @stfsm_n25q_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	24(%rdi), %rax
	movl	(%rax), %r14d
	movq	_FLASH_FLAG_32BIT_ADDR@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	andl	%r14d, %eax
	leaq	20(%rdi), %rsi
	testl	%eax, %eax
	jne	LBB0_1
## %bb.2:
	movq	_n25q_read3_configs@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_n25q_read4_configs@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_stfsm_search_prepare_rw_seq
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movl	%eax, %ebx
	movl	12(%r15), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_5
LBB0_6:
	leaq	16(%r15), %rsi
	movq	_default_write_configs@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_stfsm_search_prepare_rw_seq
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	movl	12(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_5:
	movl	%r14d, %edx
	callq	_dev_err
LBB0_14:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_stfsm_seq_erase_sector@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	callq	_stfsm_prepare_erasesec_seq
	testl	%r14d, (%r12)
	je	LBB0_13
## %bb.9:
	leaq	8(%r15), %rdi
	callq	_stfsm_n25q_en_32bit_addr_seq
	movq	%r15, %rdi
	callq	_stfsm_can_handle_soc_reset
	testl	%eax, %eax
	je	LBB0_10
LBB0_11:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_stfsm_enter_32bit_addr
	jmp	LBB0_13
LBB0_10:
	cmpl	$0, 4(%r15)
	je	LBB0_11
## %bb.12:
	movq	_CFG_WRITE_TOGGLE_32BIT_ADDR@GOTPCREL(%rip), %rax
	movq	_CFG_ERASESEC_TOGGLE_32BIT_ADDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, (%r15)
LBB0_13:
	movl	$8, %edi
	callq	_N25Q_VCR_DUMMY_CYCLES
	movq	_N25Q_VCR_XIP_DISABLED@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_N25Q_VCR_WRAP_CONT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_N25Q_CMD_WRVCR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movl	%eax, %edx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	_stfsm_write_status
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_FLASH_FLAG_32BIT_ADDR,4,2      ## @FLASH_FLAG_32BIT_ADDR
	.comm	_n25q_read4_configs,4,2         ## @n25q_read4_configs
	.comm	_n25q_read3_configs,4,2         ## @n25q_read3_configs
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to prepare READ sequence with flags [0x%08x]\n"

	.comm	_default_write_configs,4,2      ## @default_write_configs
L_.str.1:                               ## @.str.1
	.asciz	"preparing WRITE sequence using flags [0x%08x] failed\n"

	.comm	_stfsm_seq_erase_sector,4,2     ## @stfsm_seq_erase_sector
	.comm	_CFG_WRITE_TOGGLE_32BIT_ADDR,4,2 ## @CFG_WRITE_TOGGLE_32BIT_ADDR
	.comm	_CFG_ERASESEC_TOGGLE_32BIT_ADDR,4,2 ## @CFG_ERASESEC_TOGGLE_32BIT_ADDR
	.comm	_N25Q_VCR_XIP_DISABLED,4,2      ## @N25Q_VCR_XIP_DISABLED
	.comm	_N25Q_VCR_WRAP_CONT,4,2         ## @N25Q_VCR_WRAP_CONT
	.comm	_N25Q_CMD_WRVCR,4,2             ## @N25Q_CMD_WRVCR
	.no_dead_strip	_stfsm_n25q_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stfsm_n25q_config
_stfsm_n25q_config:                     ; @stfsm_n25q_config
	.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	x19, x0
	ldr	x8, [x0, #24]
	ldr	w20, [x8]
Lloh0:
	adrp	x22, _FLASH_FLAG_32BIT_ADDR@GOTPAGE
Lloh1:
	ldr	x22, [x22, _FLASH_FLAG_32BIT_ADDR@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh2:
	adrp	x9, _n25q_read3_configs@GOTPAGE
Lloh3:
	ldr	x9, [x9, _n25q_read3_configs@GOTPAGEOFF]
	add	x1, x0, #20
Lloh4:
	adrp	x10, _n25q_read4_configs@GOTPAGE
Lloh5:
	ldr	x10, [x10, _n25q_read4_configs@GOTPAGEOFF]
	tst	w8, w20
	csel	x8, x9, x10, eq
	ldr	w2, [x8]
	bl	_stfsm_search_prepare_rw_seq
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
	ldr	w0, [x19, #12]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	add	x1, x19, #16
Lloh8:
	adrp	x8, _default_write_configs@GOTPAGE
Lloh9:
	ldr	x8, [x8, _default_write_configs@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_stfsm_search_prepare_rw_seq
	cbz	w0, LBB0_6
; %bb.3:
	mov	x21, x0
	ldr	w0, [x19, #12]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_4:
	mov	x2, x20
	bl	_dev_err
LBB0_5:
	mov	x0, x21
	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
LBB0_6:
Lloh13:
	adrp	x1, _stfsm_seq_erase_sector@GOTPAGE
Lloh14:
	ldr	x1, [x1, _stfsm_seq_erase_sector@GOTPAGEOFF]
	mov	x0, x19
	bl	_stfsm_prepare_erasesec_seq
	ldr	w8, [x22]
	tst	w8, w20
	b.eq	LBB0_11
; %bb.7:
	add	x0, x19, #8
	bl	_stfsm_n25q_en_32bit_addr_seq
	mov	x0, x19
	bl	_stfsm_can_handle_soc_reset
	cbz	w0, LBB0_9
LBB0_8:
	mov	x0, x19
	mov	w1, #1
	bl	_stfsm_enter_32bit_addr
	b	LBB0_11
LBB0_9:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_8
; %bb.10:
Lloh15:
	adrp	x8, _CFG_WRITE_TOGGLE_32BIT_ADDR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CFG_WRITE_TOGGLE_32BIT_ADDR@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _CFG_ERASESEC_TOGGLE_32BIT_ADDR@GOTPAGE
Lloh19:
	ldr	x9, [x9, _CFG_ERASESEC_TOGGLE_32BIT_ADDR@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_11:
	mov	w0, #8
	bl	_N25Q_VCR_DUMMY_CYCLES
Lloh21:
	adrp	x8, _N25Q_VCR_XIP_DISABLED@GOTPAGE
Lloh22:
	ldr	x8, [x8, _N25Q_VCR_XIP_DISABLED@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _N25Q_VCR_WRAP_CONT@GOTPAGE
Lloh25:
	ldr	x9, [x9, _N25Q_VCR_WRAP_CONT@GOTPAGEOFF]
	orr	w8, w8, w0
Lloh26:
	ldr	w9, [x9]
	orr	w2, w8, w9
Lloh27:
	adrp	x8, _N25Q_CMD_WRVCR@GOTPAGE
Lloh28:
	ldr	x8, [x8, _N25Q_CMD_WRVCR@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w3, #1
	mov	w4, #0
	bl	_stfsm_write_status
	mov	w21, #0
	b	LBB0_5
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_FLASH_FLAG_32BIT_ADDR,4,2      ; @FLASH_FLAG_32BIT_ADDR
	.comm	_n25q_read4_configs,4,2         ; @n25q_read4_configs
	.comm	_n25q_read3_configs,4,2         ; @n25q_read3_configs
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to prepare READ sequence with flags [0x%08x]\n"

	.comm	_default_write_configs,4,2      ; @default_write_configs
l_.str.1:                               ; @.str.1
	.asciz	"preparing WRITE sequence using flags [0x%08x] failed\n"

	.comm	_stfsm_seq_erase_sector,4,2     ; @stfsm_seq_erase_sector
	.comm	_CFG_WRITE_TOGGLE_32BIT_ADDR,4,2 ; @CFG_WRITE_TOGGLE_32BIT_ADDR
	.comm	_CFG_ERASESEC_TOGGLE_32BIT_ADDR,4,2 ; @CFG_ERASESEC_TOGGLE_32BIT_ADDR
	.comm	_N25Q_VCR_XIP_DISABLED,4,2      ; @N25Q_VCR_XIP_DISABLED
	.comm	_N25Q_VCR_WRAP_CONT,4,2         ; @N25Q_VCR_WRAP_CONT
	.comm	_N25Q_CMD_WRVCR,4,2             ; @N25Q_CMD_WRVCR
	.no_dead_strip	_stfsm_n25q_config
.subsections_via_symbols
