	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_falcon_spi_wait_write          ## -- Begin function falcon_spi_wait_write
	.p2align	4, 0x90
_falcon_spi_wait_write:                 ## @falcon_spi_wait_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	_jiffies@GOTPCREL(%rip), %rax
	movslq	(%rax), %r13
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$100, %esi
	callq	_DIV_ROUND_UP
	movl	%eax, %ebx
	movq	_SPI_RDSR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4, (%rsp)
	leaq	-44(%rbp), %r9
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	$-1, %ecx
	xorl	%r8d, %r8d
	callq	_falcon_spi_cmd
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_1
LBB0_7:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movslq	%ebx, %rax
	leaq	(%rax,%r13), %rbx
	incq	%rbx
	xorl	%r15d, %r15d
	leaq	-44(%rbp), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_SPI_STATUS_NRDY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -44(%rbp)
	je	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_jiffies@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_time_after_eq
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %edi
	callq	_schedule_timeout_uninterruptible
	movq	_SPI_RDSR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4, (%rsp)
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	$-1, %ecx
	xorl	%r8d, %r8d
	movq	%r13, %r9
	callq	_falcon_spi_cmd
	testl	%eax, %eax
	je	LBB0_2
## %bb.6:
	movl	%eax, %r15d
	jmp	LBB0_7
LBB0_4:
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
	movl	(%r12), %r8d
	movl	-44(%rbp), %r9d
	leaq	L_.str(%rip), %rcx
	movq	%r14, %rdi
	callq	_netif_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,4,2                    ## @jiffies
	.comm	_HZ,4,2                         ## @HZ
	.comm	_SPI_RDSR,4,2                   ## @SPI_RDSR
	.comm	_SPI_STATUS_NRDY,4,2            ## @SPI_STATUS_NRDY
	.comm	_hw,4,2                         ## @hw
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SPI write timeout on device %d last status=0x%02x\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_falcon_spi_wait_write          ; -- Begin function falcon_spi_wait_write
	.p2align	2
_falcon_spi_wait_write:                 ; @falcon_spi_wait_write
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _jiffies@GOTPAGE
Lloh1:
	ldr	x22, [x22, _jiffies@GOTPAGEOFF]
	ldrsw	x24, [x22]
Lloh2:
	adrp	x8, _HZ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	w1, #100
	bl	_DIV_ROUND_UP
	mov	x21, x0
Lloh5:
	adrp	x23, _SPI_RDSR@GOTPAGE
Lloh6:
	ldr	x23, [x23, _SPI_RDSR@GOTPAGEOFF]
	ldr	w2, [x23]
	add	x5, sp, #12
	mov	x0, x19
	mov	x1, x20
	mov	w3, #-1
	mov	x4, #0
	mov	w6, #4
	bl	_falcon_spi_cmd
	cbz	w0, LBB0_2
LBB0_1:
	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
LBB0_2:
	add	x8, x24, w21, sxtw
	add	x21, x8, #1
Lloh7:
	adrp	x24, _SPI_STATUS_NRDY@GOTPAGE
Lloh8:
	ldr	x24, [x24, _SPI_STATUS_NRDY@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [sp, #12]
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x22]
	mov	x1, x21
	bl	_time_after_eq
	cbnz	x0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #1
	bl	_schedule_timeout_uninterruptible
	ldr	w2, [x23]
	add	x5, sp, #12
	mov	x0, x19
	mov	x1, x20
	mov	w3, #-1
	mov	x4, #0
	mov	w6, #4
	bl	_falcon_spi_cmd
	cbz	w0, LBB0_3
	b	LBB0_1
LBB0_6:
	mov	w0, #0
	b	LBB0_1
LBB0_7:
Lloh9:
	adrp	x8, _hw@GOTPAGE
Lloh10:
	ldr	x8, [x8, _hw@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	w2, [x19]
	ldr	w4, [x20]
	ldr	w5, [sp, #12]
Lloh12:
	adrp	x3, l_.str@PAGE
Lloh13:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netif_err
Lloh14:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,4,2                    ; @jiffies
	.comm	_HZ,4,2                         ; @HZ
	.comm	_SPI_RDSR,4,2                   ; @SPI_RDSR
	.comm	_SPI_STATUS_NRDY,4,2            ; @SPI_STATUS_NRDY
	.comm	_hw,4,2                         ; @hw
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SPI write timeout on device %d last status=0x%02x\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
.subsections_via_symbols
