	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stfsm_read
_stfsm_read:                            ## @stfsm_read
	.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, %r15d
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	%rsp, -112(%rbp)                ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	8(%rdi), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	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, %r13
	movl	4(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movl	%r14d, %edx
	movl	%r15d, -72(%rbp)                ## 4-byte Spill
	movl	%r15d, %ecx
	callq	_dev_dbg
	movq	_CFG_READ_TOGGLE_32BIT_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_stfsm_enter_32bit_addr
LBB0_2:
	movl	8(%rbx), %r15d
	shrl	$14, %r15d
	andl	$12, %r15d
	leal	3(%r15), %eax
	testb	$3, %r12b
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movq	%r13, %r14
	movq	%r12, -104(%rbp)                ## 8-byte Spill
	cmoveq	%r12, %r14
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	leal	(%r15,%r12), %edi
	addl	$3, %edi
	movl	%r15d, %r13d
	xorl	$-4, %r13d
	andl	%r13d, %edi
	andl	%r12d, %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	callq	_TRANSFER_SIZE
	movl	%eax, 20(%rbx)
	movl	-72(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, %eax
	shrl	$16, %eax
	movl	%eax, 12(%rbx)
	movzwl	%cx, %eax
	movl	%eax, 16(%rbx)
	movq	%rbx, %rdi
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	callq	_stfsm_load_seq
	andl	%r12d, %r13d
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r13d, %edx
	callq	_stfsm_read_fifo
LBB0_4:
	movl	-68(%rbp), %r12d                ## 4-byte Reload
	testl	%r12d, %r12d
	je	LBB0_6
## %bb.5:
	addl	$4, %r15d
	leaq	-64(%rbp), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_stfsm_read_fifo
	movslq	%r13d, %rax
	leaq	(%r14,%rax,4), %rdi
	leaq	-64(%rbp), %rsi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_memcpy
LBB0_6:
	movq	-104(%rbp), %rdi                ## 8-byte Reload
	testb	$3, %dil
	je	LBB0_8
## %bb.7:
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_memcpy
LBB0_8:
	movq	%rbx, %rdi
	callq	_stfsm_wait_seq
	movq	%rbx, %rdi
	callq	_stfsm_clear_fifo
	movq	_CFG_READ_TOGGLE_32BIT_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_stfsm_enter_32bit_addr
LBB0_10:
	movq	-112(%rbp), %rsp                ## 8-byte Reload
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	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	"reading %d bytes from 0x%08x\n"

	.comm	_CFG_READ_TOGGLE_32BIT_ADDR,4,2 ## @CFG_READ_TOGGLE_32BIT_ADDR
	.no_dead_strip	_stfsm_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stfsm_read
_stfsm_read:                            ; @stfsm_read
	.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, #48
	mov	x22, x3
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	mov	x8, sp
	stur	x8, [x29, #-112]                ; 8-byte Folded Spill
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	add	x8, x0, #8
	stur	x8, [x29, #-120]                ; 8-byte Folded Spill
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	x28, x9, x8
	mov	sp, x28
	ldr	w0, [x0, #4]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w8, [x19]
Lloh10:
	adrp	x9, _CFG_READ_TOGGLE_32BIT_ADDR@GOTPAGE
Lloh11:
	ldr	x9, [x9, _CFG_READ_TOGGLE_32BIT_ADDR@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #1
	bl	_stfsm_enter_32bit_addr
LBB0_2:
	ldr	w8, [x19, #8]
	lsr	w8, w8, #14
	and	w23, w8, #0xc
	orr	w8, w23, #0x3
	ands	x27, x20, #0x3
	csel	x24, x20, x28, eq
	eor	w9, w23, #0xfffffffc
	add	w10, w8, w21
	and	w0, w10, w9
	and	w25, w9, w21
	and	w26, w8, w21
	bl	_TRANSFER_SIZE
	lsr	w8, w22, #16
	and	w9, w22, #0xffff
	str	w8, [x19, #12]
	stp	w9, w0, [x19, #16]
	mov	x0, x19
	ldur	x1, [x29, #-120]                ; 8-byte Folded Reload
	bl	_stfsm_load_seq
	cbz	w25, LBB0_4
; %bb.3:
	mov	x0, x19
	mov	x1, x24
	mov	x2, x25
	bl	_stfsm_read_fifo
LBB0_4:
	cbz	w26, LBB0_6
; %bb.5:
	add	w2, w23, #4
	sub	x22, x29, #104
	sub	x1, x29, #104
	mov	x0, x19
	bl	_stfsm_read_fifo
	add	x0, x24, w25, sxtw #2
	stp	x22, x26, [sp, #-16]!
	bl	_memcpy
	add	sp, sp, #16
LBB0_6:
	cbz	x27, LBB0_8
; %bb.7:
	stp	x28, x21, [sp, #-16]!
	mov	x0, x20
	bl	_memcpy
	add	sp, sp, #16
LBB0_8:
	mov	x0, x19
	bl	_stfsm_wait_seq
	mov	x0, x19
	bl	_stfsm_clear_fifo
	ldr	w8, [x19]
Lloh13:
	adrp	x9, _CFG_READ_TOGGLE_32BIT_ADDR@GOTPAGE
Lloh14:
	ldr	x9, [x9, _CFG_READ_TOGGLE_32BIT_ADDR@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x19
	mov	w1, #0
	bl	_stfsm_enter_32bit_addr
LBB0_10:
	ldur	x8, [x29, #-112]                ; 8-byte Folded Reload
	mov	sp, x8
	ldur	x8, [x29, #-88]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	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_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_FLASH_PAGESIZE_32,4,2          ; @FLASH_PAGESIZE_32
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reading %d bytes from 0x%08x\n"

	.comm	_CFG_READ_TOGGLE_32BIT_ADDR,4,2 ; @CFG_READ_TOGGLE_32BIT_ADDR
	.no_dead_strip	_stfsm_read
.subsections_via_symbols
