	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mei_dma_ring_write             ## -- Begin function mei_dma_ring_write
	.p2align	4, 0x90
_mei_dma_ring_write:                    ## @mei_dma_ring_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
	movl	%edx, %r12d
	movq	%rsi, %r14
	movq	%rdi, %r15
	callq	_mei_dma_ring_ctrl
	movq	%rax, %rbx
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_1
## %bb.5:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	callq	_dev_dbg
	movq	%r15, %rdi
	callq	_mei_dma_ring_hbuf_depth
	movl	%eax, %r13d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rdi
	callq	_READ_ONCE
	leal	-1(%r13), %r14d
	andl	%eax, %r14d
	movl	%r12d, %edi
	callq	_mei_data2slots
	movl	%eax, %ebx
	leal	(%r14,%rbx), %eax
	cmpl	%r13d, %eax
	jle	LBB0_2
## %bb.3:
	subl	%r14d, %r13d
	movq	%r15, %rdi
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	%r14d, %edx
	movl	%r13d, %ecx
	callq	_mei_dma_copy_to
	cltq
	addq	%rax, %r12
	movl	%ebx, %ecx
	subl	%r13d, %ecx
	xorl	%r14d, %r14d
	jmp	LBB0_4
LBB0_2:
	movl	%ebx, %ecx
	movq	-48(%rbp), %r12                 ## 8-byte Reload
LBB0_4:
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_mei_dma_copy_to
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movslq	%ebx, %rsi
	addq	%rdi, %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_WRITE_ONCE                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"writing to dma %u bytes\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mei_dma_ring_write             ; -- Begin function mei_dma_ring_write
	.p2align	2
_mei_dma_ring_write:                    ; @mei_dma_ring_write
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x22, x2
	mov	x19, x1
	mov	x21, x0
	bl	_mei_dma_ring_ctrl
	mov	x20, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_WARN_ON
	cbz	x0, LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_2:
	ldr	w0, [x21]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	bl	_dev_dbg
	mov	x0, x21
	bl	_mei_dma_ring_hbuf_depth
	mov	x24, x0
	ldr	x0, [x20]
	bl	_READ_ONCE
	sub	w8, w24, #1
	and	w23, w0, w8
	mov	x0, x22
	bl	_mei_data2slots
	mov	x22, x0
	add	w8, w23, w0
	cmp	w8, w24
	b.le	LBB0_4
; %bb.3:
	sub	w24, w24, w23
	mov	x0, x21
	mov	x1, x19
	mov	x2, x23
	mov	x3, x24
	bl	_mei_dma_copy_to
	mov	w23, #0
	add	x19, x19, w0, sxtw
	sub	w3, w22, w24
	b	LBB0_5
LBB0_4:
	mov	x3, x22
LBB0_5:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x23
	bl	_mei_dma_copy_to
	ldr	x0, [x20]
	add	x1, x0, w22, sxtw
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_WRITE_ONCE
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"writing to dma %u bytes\n"

.subsections_via_symbols
