	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_falcon_spi_write               ## -- Begin function falcon_spi_write
	.p2align	4, 0x90
_falcon_spi_write:                      ## @falcon_spi_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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -112(%rbp)                 ## 8-byte Spill
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movq	%rcx, %rbx
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_FALCON_SPI_MAX_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -96(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.3:
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_SPI_WREN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	subq	$8, %rsp
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	$-1, %rcx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	$0
	callq	_falcon_spi_cmd
	addq	$16, %rsp
	testl	%eax, %eax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	subq	%r14, %rbx
	movq	-104(%rbp), %rax                ## 8-byte Reload
	leaq	(%r14,%rax), %r13
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_falcon_spi_write_limit
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_min
	movq	%rax, %r12
	movq	_SPI_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	%r13, %rdx
	callq	_efx_spi_munge_command
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	leaq	(%rcx,%r14,4), %r8
	subq	$8, %rsp
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rdi, %rbx
	movq	%r15, %rsi
	movl	%eax, %edx
	movq	%r13, %rcx
	movq	%r8, -120(%rbp)                 ## 8-byte Spill
	xorl	%r9d, %r9d
	movq	%r12, %r14
	pushq	%r12
	callq	_falcon_spi_cmd
	addq	$16, %rsp
	testl	%eax, %eax
	jne	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_falcon_spi_wait_write
	testl	%eax, %eax
	jne	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_SPI_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	%r13, %rdx
	callq	_efx_spi_munge_command
	subq	$8, %rsp
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	movq	%r13, %rcx
	xorl	%r8d, %r8d
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %r9
	movq	%r14, %rbx
	pushq	%r14
	callq	_falcon_spi_cmd
	addq	$16, %rsp
	movl	%eax, %r12d
	movq	%r15, %rdi
	movq	-120(%rbp), %rsi                ## 8-byte Reload
	movq	%r14, %rdx
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	addq	%rbx, %r14
	xorl	%eax, %eax
	callq	_cond_resched
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_signal_pending
	testq	%rax, %rax
	jne	LBB0_12
## %bb.2:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	cmpq	%rbx, %r14
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	jb	LBB0_4
	jmp	LBB0_13
LBB0_1:
	xorl	%r12d, %r12d
	jmp	LBB0_13
LBB0_7:
	movl	%eax, %r12d
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_5:
	movl	%eax, %r12d
	jmp	LBB0_13
LBB0_10:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_12:
	movq	_EINTR@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_13:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	movq	%r14, (%rax)
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	movl	%r12d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_FALCON_SPI_MAX_LEN,4,2         ## @FALCON_SPI_MAX_LEN
	.comm	_SPI_WREN,4,2                   ## @SPI_WREN
	.comm	_SPI_WRITE,4,2                  ## @SPI_WRITE
	.comm	_SPI_READ,4,2                   ## @SPI_READ
	.comm	_EIO,4,2                        ## @EIO
	.comm	_current,4,2                    ## @current
	.comm	_EINTR,4,2                      ## @EINTR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_falcon_spi_write               ; -- Begin function falcon_spi_write
	.p2align	2
_falcon_spi_write:                      ; @falcon_spi_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
	stur	x5, [x29, #-96]                 ; 8-byte Folded Spill
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x24, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _FALCON_SPI_MAX_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FALCON_SPI_MAX_LEN@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	x25, x9, x8
	mov	sp, x25
	cbz	x3, LBB0_8
; %bb.1:
	stur	x4, [x29, #-104]                ; 8-byte Folded Spill
	mov	x20, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
Lloh8:
	adrp	x8, _SPI_WREN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SPI_WREN@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x24
	mov	x1, x23
	mov	x3, #-1
	mov	x4, #0
	mov	x5, #0
	mov	x6, #0
	bl	_falcon_spi_cmd
	cbnz	w0, LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	x19, x21, x20
	add	x28, x20, x22
	mov	x0, x23
	mov	x1, x28
	bl	_falcon_spi_write_limit
	mov	x1, x0
	mov	x0, x19
	bl	_min
	mov	x27, x0
Lloh11:
	adrp	x8, _SPI_WRITE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SPI_WRITE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x23
	mov	x2, x28
	bl	_efx_spi_munge_command
	mov	x2, x0
	ldur	x8, [x29, #-96]                 ; 8-byte Folded Reload
	add	x19, x8, x20, lsl #2
	mov	x0, x24
	mov	x1, x23
	mov	x3, x28
	mov	x4, x19
	mov	x5, #0
	mov	x6, x27
	bl	_falcon_spi_cmd
	cbnz	w0, LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x24
	mov	x1, x23
	bl	_falcon_spi_wait_write
	cbnz	w0, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh14:
	adrp	x8, _SPI_READ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SPI_READ@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x23
	mov	x2, x28
	bl	_efx_spi_munge_command
	mov	x2, x0
	mov	x0, x24
	mov	x1, x23
	mov	x3, x28
	mov	x4, #0
	mov	x5, x25
	mov	x6, x27
	bl	_falcon_spi_cmd
	mov	x26, x0
	mov	x0, x25
	mov	x1, x19
	mov	x2, x27
	bl	_memcmp
	cbnz	x0, LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x20, x27, x20
	bl	_cond_resched
Lloh17:
	adrp	x8, _current@GOTPAGE
Lloh18:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_signal_pending
	cbnz	x0, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	x20, x21
	b.lo	LBB0_2
	b	LBB0_13
LBB0_8:
	mov	x20, #0
	mov	w26, #0
	cbnz	x4, LBB0_14
	b	LBB0_15
LBB0_9:
	mov	x26, x0
	b	LBB0_13
LBB0_10:
Lloh20:
	adrp	x8, _EIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh22:
	adrp	x8, _EINTR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w26, w8
LBB0_13:
	ldur	x4, [x29, #-104]                ; 8-byte Folded Reload
	cbz	x4, LBB0_15
LBB0_14:
	str	x20, [x4]
LBB0_15:
	ldur	x8, [x29, #-88]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.16:
	mov	x0, x26
	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_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_FALCON_SPI_MAX_LEN,4,2         ; @FALCON_SPI_MAX_LEN
	.comm	_SPI_WREN,4,2                   ; @SPI_WREN
	.comm	_SPI_WRITE,4,2                  ; @SPI_WRITE
	.comm	_SPI_READ,4,2                   ; @SPI_READ
	.comm	_EIO,4,2                        ; @EIO
	.comm	_current,4,2                    ; @current
	.comm	_EINTR,4,2                      ; @EINTR
.subsections_via_symbols
