	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stfsm_write
_stfsm_write:                           ## @stfsm_write
	.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
	movl	%ecx, %r14d
	movl	%edx, %r13d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	%rsp, -104(%rbp)                ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	28(%rdi), %r12
	movq	_FLASH_PAGESIZE_32@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -88(%rbp)                 ## 8-byte Spill
	movl	24(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movl	%r13d, %edx
	movl	%r14d, -76(%rbp)                ## 4-byte Spill
	movl	%r14d, %ecx
	callq	_dev_dbg
	movq	_CFG_WRITE_TOGGLE_32BIT_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_stfsm_enter_32bit_addr
LBB0_2:
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	movl	(%r12), %r12d
	shrq	$14, %r12
	andl	$12, %r12d
	movq	%r12, %r13
	orq	$3, %r13
	testb	$3, %bl
	je	LBB0_3
## %bb.4:
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movl	%ebx, %edx
	callq	_memcpy
	movq	%rbx, %rax
	movq	%r14, %rbx
	jmp	LBB0_5
LBB0_3:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
LBB0_5:
	leal	(%rax,%r13), %edi
	movl	%r12d, %r14d
	xorl	$-4, %r14d
	andl	%r14d, %edi
	andl	%eax, %r14d
	callq	_TRANSFER_SIZE
	movl	%eax, 40(%r15)
	movl	-76(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, %eax
	shrl	$16, %eax
	movl	%eax, 32(%r15)
	movzwl	%cx, %eax
	movl	%eax, 36(%r15)
	movq	_SPI_FAST_SEQ_CFG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	movl	$262144, %edi                   ## imm = 0x40000
	callq	_writel
	movq	8(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.7:
	callq	_udelay
	jmp	LBB0_8
LBB0_6:
	movq	_SPI_FAST_SEQ_CFG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%r15), %rdi
	callq	_readl
LBB0_8:
	andl	-72(%rbp), %r13d                ## 4-byte Folded Reload
	testl	%r14d, %r14d
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	callq	_stfsm_write_fifo
	movslq	%r14d, %rax
	leaq	(%rbx,%rax,4), %rbx
LBB0_10:
	testl	%r13d, %r13d
	je	LBB0_19
## %bb.11:
	addl	$4, %r12d
	leaq	-64(%rbp), %rdi
	movl	$255, %esi
	movl	%r12d, %edx
	callq	_memset
	leaq	-1(%r13), %rcx
	movl	%r13d, %eax
	andl	$3, %eax
	cmpq	$3, %rcx
	jae	LBB0_13
## %bb.12:
	xorl	%ecx, %ecx
	jmp	LBB0_15
LBB0_13:
	andl	$-4, %r13d
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edx
	movl	%edx, -64(%rbp,%rcx,4)
	movl	4(%rbx), %edx
	movl	%edx, -60(%rbp,%rcx,4)
	movl	8(%rbx), %edx
	movl	%edx, -56(%rbp,%rcx,4)
	movl	12(%rbx), %edx
	addq	$16, %rbx
	movl	%edx, -52(%rbp,%rcx,4)
	addq	$4, %rcx
	cmpq	%rcx, %r13
	jne	LBB0_14
LBB0_15:
	testq	%rax, %rax
	je	LBB0_18
## %bb.16:
	leaq	-64(,%rcx,4), %rcx
	addq	%rbp, %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%rdx,4), %esi
	movl	%esi, (%rcx,%rdx,4)
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_17
LBB0_18:
	leaq	-64(%rbp), %rsi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_stfsm_write_fifo
LBB0_19:
	movq	%r15, %rdi
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	callq	_stfsm_load_seq
	movq	%r15, %rdi
	callq	_stfsm_wait_seq
	movq	%r15, %rdi
	callq	_stfsm_wait_busy
	testl	%eax, %eax
	je	LBB0_22
## %bb.20:
	movq	_CFG_S25FL_CHECK_ERROR_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_22
## %bb.21:
	movq	%r15, %rdi
	callq	_stfsm_s25fl_clear_status_reg
LBB0_22:
	movq	_CFG_WRITE_TOGGLE_32BIT_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_24
## %bb.23:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_stfsm_enter_32bit_addr
LBB0_24:
	movq	-104(%rbp), %rsp                ## 8-byte Reload
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_26
## %bb.25:
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_FLASH_PAGESIZE_32,4,2          ## @FLASH_PAGESIZE_32
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"writing %d bytes to 0x%08x\n"

	.comm	_CFG_WRITE_TOGGLE_32BIT_ADDR,4,2 ## @CFG_WRITE_TOGGLE_32BIT_ADDR
	.comm	_SPI_FAST_SEQ_CFG,8,3           ## @SPI_FAST_SEQ_CFG
	.comm	_CFG_S25FL_CHECK_ERROR_FLAGS,4,2 ## @CFG_S25FL_CHECK_ERROR_FLAGS
	.no_dead_strip	_stfsm_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stfsm_write
_stfsm_write:                           ; @stfsm_write
	.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, #32
	mov	x22, x3
	mov	x23, x2
	mov	x21, x1
	mov	x19, x0
	mov	x25, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	add	x20, x0, #28
Lloh3:
	adrp	x8, _FLASH_PAGESIZE_32@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FLASH_PAGESIZE_32@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x24, x9, x8
	mov	sp, x24
	ldr	w0, [x0, #24]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w8, [x19]
Lloh10:
	adrp	x26, _CFG_WRITE_TOGGLE_32BIT_ADDR@GOTPAGE
Lloh11:
	ldr	x26, [x26, _CFG_WRITE_TOGGLE_32BIT_ADDR@GOTPAGEOFF]
	ldr	w9, [x26]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #1
	bl	_stfsm_enter_32bit_addr
LBB0_2:
	ldr	w8, [x20]
	lsr	x8, x8, #14
	and	x27, x8, #0xc
	orr	x28, x27, #0x3
	tst	x21, #0x3
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x24
	mov	x1, x21
	mov	x2, x23
	bl	_memcpy
	mov	x21, x24
LBB0_4:
	eor	w8, w27, #0xfffffffc
	add	w9, w28, w23
	and	w0, w9, w8
	and	w24, w8, w23
	mov	w8, w23
	and	x23, x28, x8
	bl	_TRANSFER_SIZE
	lsr	w8, w22, #16
	and	w9, w22, #0xffff
	str	w8, [x19, #32]
	stp	w9, w0, [x19, #36]
	ldr	x8, [x19, #16]
Lloh12:
	adrp	x22, _SPI_FAST_SEQ_CFG@GOTPAGE
Lloh13:
	ldr	x22, [x22, _SPI_FAST_SEQ_CFG@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x1, x9, x8
	mov	w0, #262144
	bl	_writel
	ldr	x0, [x19, #8]
	cbz	x0, LBB0_18
; %bb.5:
	bl	_udelay
	cbz	w24, LBB0_7
LBB0_6:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x24
	bl	_stfsm_write_fifo
	add	x21, x21, w24, sxtw #2
LBB0_7:
	cbz	w23, LBB0_11
; %bb.8:
	add	w22, w27, #4
	sub	x24, x29, #104
	sub	x0, x29, #104
	mov	w1, #255
	mov	x2, x22
	bl	_memset
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x21], #4
	str	w8, [x24], #4
	subs	x23, x23, #1
	b.ne	LBB0_9
; %bb.10:
	sub	x1, x29, #104
	mov	x0, x19
	mov	x2, x22
	bl	_stfsm_write_fifo
LBB0_11:
	mov	x0, x19
	mov	x1, x20
	bl	_stfsm_load_seq
	mov	x0, x19
	bl	_stfsm_wait_seq
	mov	x0, x19
	bl	_stfsm_wait_busy
	cbz	w0, LBB0_14
; %bb.12:
	ldr	w8, [x19]
Lloh14:
	adrp	x9, _CFG_S25FL_CHECK_ERROR_FLAGS@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CFG_S25FL_CHECK_ERROR_FLAGS@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.13:
	mov	x0, x19
	bl	_stfsm_s25fl_clear_status_reg
LBB0_14:
	ldr	w8, [x19]
	ldr	w9, [x26]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.15:
	mov	x0, x19
	mov	w1, #0
	bl	_stfsm_enter_32bit_addr
LBB0_16:
	mov	sp, x25
	ldur	x8, [x29, #-88]
Lloh17:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh18:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.17:
	mov	w0, #0
	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_18:
	ldr	x8, [x19, #16]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
	cbnz	w24, LBB0_6
	b	LBB0_7
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_FLASH_PAGESIZE_32,4,2          ; @FLASH_PAGESIZE_32
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"writing %d bytes to 0x%08x\n"

	.comm	_CFG_WRITE_TOGGLE_32BIT_ADDR,4,2 ; @CFG_WRITE_TOGGLE_32BIT_ADDR
	.comm	_SPI_FAST_SEQ_CFG,8,3           ; @SPI_FAST_SEQ_CFG
	.comm	_CFG_S25FL_CHECK_ERROR_FLAGS,4,2 ; @CFG_S25FL_CHECK_ERROR_FLAGS
	.no_dead_strip	_stfsm_write
.subsections_via_symbols
