	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rave_sp_write
_rave_sp_write:                         ## @rave_sp_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %rbx
	movq	_RAVE_SP_TX_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r14, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -96(%rbp)                 ## 8-byte Spill
	movq	_RAVE_SP_CHECKSUM_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r13, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	xorl	%edi, %edi
	cmpq	%r13, %rbx
	seta	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, %r13
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	movslq	%r15d, %rax
	xorl	%edi, %edi
	cmpq	%r14, %rax
	seta	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_3
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_6
## %bb.5:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	8(%r13), %rax
	movq	(%rax), %rax
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	%r15d, %esi
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	*8(%rax)
	movq	_RAVE_SP_STX@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	leaq	1(%r12), %rdi
	movb	%al, (%r12)
	movq	%r13, %rsi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_stuff
	movq	%rax, %rdi
	movq	%rbx, %rsi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_stuff
	movq	_RAVE_SP_ETX@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movb	%cl, (%rax)
	subq	%r12, %rax
	leaq	1(%rax), %rbx
	movq	_DUMP_PREFIX_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	subq	$8, %rsp
	leaq	L_.str(%rip), %rdi
	movl	$16, %edx
	movl	$1, %ecx
	movq	%r12, %r8
	movq	%rbx, %r9
	pushq	$0
	callq	_print_hex_dump_debug
	addq	$16, %rsp
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_serdev_device_write
	jmp	LBB0_4
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RAVE_SP_TX_BUFFER_SIZE,4,2     ## @RAVE_SP_TX_BUFFER_SIZE
	.comm	_RAVE_SP_CHECKSUM_SIZE,4,2      ## @RAVE_SP_CHECKSUM_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_RAVE_SP_STX,4,2                ## @RAVE_SP_STX
	.comm	_RAVE_SP_ETX,4,2                ## @RAVE_SP_ETX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rave-sp tx: "

	.comm	_DUMP_PREFIX_NONE,4,2           ## @DUMP_PREFIX_NONE
	.comm	_HZ,4,2                         ## @HZ
	.no_dead_strip	_rave_sp_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rave_sp_write
_rave_sp_write:                         ; @rave_sp_write
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #16
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	ldr	x25, [x8]
Lloh3:
	adrp	x8, _RAVE_SP_TX_BUFFER_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RAVE_SP_TX_BUFFER_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x8]
	mov	x9, x24
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x24, #15
	and	x9, x9, #0x1fffffff0
	sub	x20, x8, x9
	mov	sp, x20
Lloh8:
	adrp	x8, _RAVE_SP_CHECKSUM_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RAVE_SP_CHECKSUM_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	mov	x9, x8
Lloh11:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh12:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x8, #15
	and	x10, x10, #0x1fffffff0
	sub	x23, x9, x10
	mov	sp, x23
	cmp	x25, x8
	cset	w0, hi
	bl	_WARN_ON
	cbnz	x0, LBB0_2
; %bb.1:
	sxtw	x8, w22
	cmp	x8, x24
	cset	w0, hi
	bl	_WARN_ON
	cbz	x0, LBB0_5
LBB0_2:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldur	x8, [x29, #-72]
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_6
; %bb.4:
	sub	sp, x29, #64
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	x8, [x8, #8]
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	blr	x8
Lloh19:
	adrp	x8, _RAVE_SP_STX@GOTPAGE
Lloh20:
	ldr	x8, [x8, _RAVE_SP_STX@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	mov	x0, x20
	strb	w8, [x0], #1
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	stp	x21, x22, [sp, #-16]!
	bl	_stuff
	add	sp, sp, #16
	stp	x23, x25, [sp, #-16]!
	bl	_stuff
	add	sp, sp, #16
Lloh22:
	adrp	x8, _RAVE_SP_ETX@GOTPAGE
Lloh23:
	ldr	x8, [x8, _RAVE_SP_ETX@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	strb	w8, [x0]
	sub	x8, x0, x20
	add	x21, x8, #1
Lloh25:
	adrp	x8, _DUMP_PREFIX_NONE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _DUMP_PREFIX_NONE@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x0, l_.str@PAGE
Lloh29:
	add	x0, x0, l_.str@PAGEOFF
	mov	w2, #16
	mov	w3, #1
	mov	x4, x20
	mov	x5, x21
	mov	w6, #0
	bl	_print_hex_dump_debug
	ldr	w0, [x19]
Lloh30:
	adrp	x8, _HZ@GOTPAGE
Lloh31:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh32:
	ldr	w3, [x8]
	mov	x1, x20
	mov	x2, x21
	bl	_serdev_device_write
	b	LBB0_3
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_RAVE_SP_TX_BUFFER_SIZE,4,2     ; @RAVE_SP_TX_BUFFER_SIZE
	.comm	_RAVE_SP_CHECKSUM_SIZE,4,2      ; @RAVE_SP_CHECKSUM_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_RAVE_SP_STX,4,2                ; @RAVE_SP_STX
	.comm	_RAVE_SP_ETX,4,2                ; @RAVE_SP_ETX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rave-sp tx: "

	.comm	_DUMP_PREFIX_NONE,4,2           ; @DUMP_PREFIX_NONE
	.comm	_HZ,4,2                         ; @HZ
	.no_dead_strip	_rave_sp_write
.subsections_via_symbols
