	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mei_cl_write                   ## -- Begin function mei_cl_write
	.p2align	4, 0x90
_mei_cl_write:                          ## @mei_cl_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	cmpq	$0, 16(%r12)
	sete	%al
	jmp	LBB0_3
LBB0_2:
	movb	$1, %al
LBB0_3:
	movzbl	%al, %edi
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	xorl	%edi, %edi
	testq	%r15, %r15
	sete	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_7:
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
LBB0_8:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	16(%r12), %r14
	movq	16(%r15), %rbx
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rcx
	xorl	%eax, %eax
	callq	_cl_dbg
	movl	(%r15), %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	24(%r15), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	(%r14), %edi
	callq	_pm_runtime_get
	movq	$0, 8(%r15)
	movq	_MEI_IDLE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r12)
	movq	%r12, %rdi
	callq	_mei_cl_tx_flow_ctrl_creds
	movq	%rax, %r13
	leaq	-64(%rbp), %rdi
	movq	%r15, %rsi
	callq	_mei_msg_hdr_init
	testq	%r13, %r13
	je	LBB0_18
## %bb.10:
	movq	%r14, %rdi
	callq	_mei_hbuf_acquire
	testl	%eax, %eax
	je	LBB0_19
## %bb.11:
	movq	%r14, %rdi
	callq	_mei_hbuf_empty_slots
	testl	%eax, %eax
	js	LBB0_21
## %bb.12:
	movl	%eax, %edi
	callq	_mei_slots2data
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_mei_dma_ring_empty_slots
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	%eax, %edi
	callq	_mei_slots2data
	leaq	16(%rbx), %rcx
	cmpq	%r13, %rcx
	jbe	LBB0_30
## %bb.13:
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_33
## %bb.14:
	cmpq	$20, %r13
	jb	LBB0_33
## %bb.15:
	movl	$1, -52(%rbp)
	cmpq	%rax, %rbx
	ja	LBB0_17
## %bb.16:
	movl	$1, -56(%rbp)
	movq	%rbx, %rax
LBB0_17:
	leaq	-72(%rbp), %r13
	movq	$4, -64(%rbp)
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%eax, -72(%rbp)
	movl	$4, %ebx
	jmp	LBB0_35
LBB0_18:
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_20
LBB0_19:
	leaq	L_.str.3(%rip), %rdx
LBB0_20:
	movq	%r14, %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_cl_dbg
LBB0_21:
	xorl	%eax, %eax
	cmpl	$0, -56(%rbp)
	setne	%al
	leaq	(%r14,%rax,4), %rsi
	addq	$8, %rsi
	movq	%r15, %rdi
	callq	_mei_tx_cb_enqueue
	cmpl	$0, -68(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_24
## %bb.22:
	movq	(%r12), %rax
	movq	_MEI_WRITE_COMPLETE@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	jne	LBB0_25
LBB0_24:
	xorl	%r15d, %r15d
	jmp	LBB0_44
LBB0_25:
	leaq	4(%r14), %r15
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	8(%r12), %edi
	movq	(%r12), %rax
	movl	$1, %esi
	cmpq	(%r13), %rax
	je	LBB0_27
## %bb.26:
	movl	%edi, %r13d
	movq	%r12, %rdi
	callq	_mei_cl_is_connected
	movl	%r13d, %edi
	xorl	%esi, %esi
	testl	%eax, %eax
	sete	%sil
LBB0_27:
	callq	_wait_event_interruptible
	movq	%rax, %r13
	movq	%r15, %rdi
	callq	_mutex_lock
	testq	%r13, %r13
	je	LBB0_31
## %bb.28:
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_signal_pending
	testq	%rax, %rax
	je	LBB0_41
## %bb.29:
	movq	_EINTR@GOTPCREL(%rip), %rax
	jmp	LBB0_43
LBB0_30:
	movq	%rbx, -64(%rbp)
	movl	$1, -56(%rbp)
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_34
LBB0_31:
	movq	(%r12), %rax
	movq	_MEI_WRITE_COMPLETE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_24
## %bb.42:
	movq	_EFAULT@GOTPCREL(%rip), %rax
LBB0_43:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
	jmp	LBB0_44
LBB0_33:
	addq	$-16, %r13
	movq	%r13, -64(%rbp)
	movq	%r13, %rbx
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
LBB0_34:
	movq	-80(%rbp), %r13                 ## 8-byte Reload
LBB0_35:
	cmpl	$0, -52(%rbp)
	je	LBB0_37
## %bb.36:
	movq	24(%r15), %rsi
	movq	%r14, %rdi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_mei_dma_ring_write
	movq	-64(%rbp), %rbx
LBB0_37:
	leaq	-64(%rbp), %rsi
	movl	$16, %edx
	movq	%r14, %rdi
	movq	%r13, %rcx
	movq	%rbx, %r8
	callq	_mei_write_message
	testq	%rax, %rax
	jne	LBB0_38
## %bb.39:
	movq	%r12, %rdi
	callq	_mei_cl_tx_flow_ctrl_creds_reduce
	testq	%rax, %rax
	je	LBB0_45
LBB0_38:
	movq	%rax, %rbx
	jmp	LBB0_44
LBB0_41:
	xorl	%r15d, %r15d
	movq	%r13, %rbx
LBB0_44:
	leaq	L_.str.4(%rip), %rdx
	movq	%r14, %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_cl_dbg
	movl	(%r14), %edi
	callq	_pm_runtime_mark_last_busy
	movl	(%r14), %edi
	callq	_pm_runtime_put_autosuspend
	movq	%r15, %rdi
	callq	_mei_io_cb_free
	jmp	LBB0_8
LBB0_45:
	movq	_MEI_WRITING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r12)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%r15)
	movq	16(%r15), %rbx
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,8,3                     ## @ENODEV
	.comm	_EINVAL,8,3                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"len=%zd\n"

	.comm	_EINPROGRESS,8,3                ## @EINPROGRESS
	.comm	_MEI_IDLE,8,3                   ## @MEI_IDLE
L_.str.2:                               ## @.str.2
	.asciz	"No flow control credentials: not sending.\n"

L_.str.3:                               ## @.str.3
	.asciz	"Cannot acquire the host buffer: not sending.\n"

	.comm	_EOVERFLOW,8,3                  ## @EOVERFLOW
	.comm	_MEI_WRITING,8,3                ## @MEI_WRITING
	.comm	_MEI_WRITE_COMPLETE,8,3         ## @MEI_WRITE_COMPLETE
	.comm	_current,4,2                    ## @current
	.comm	_EINTR,8,3                      ## @EINTR
	.comm	_EFAULT,8,3                     ## @EFAULT
L_.str.4:                               ## @.str.4
	.asciz	"rpm: autosuspend\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mei_cl_write                   ; -- Begin function mei_cl_write
	.p2align	2
_mei_cl_write:                          ; @mei_cl_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x22, x1
	mov	x19, x0
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x19, #16]
	cmp	x8, #0
	cset	w0, eq
	bl	_WARN_ON
	cbz	x0, LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:
	mov	w0, #1
	bl	_WARN_ON
	cbnz	x0, LBB0_2
LBB0_4:
	cmp	x22, #0
	cset	w0, eq
	bl	_WARN_ON
	cbz	x0, LBB0_8
; %bb.5:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	x8, [x8]
	neg	x21, x8
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_8:
	ldr	x20, [x19, #16]
	ldr	x21, [x22, #16]
	str	x21, [sp]
Lloh4:
	adrp	x2, l_.str@PAGE
Lloh5:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	mov	x1, x19
	bl	_cl_dbg
	ldr	w27, [x22]
	ldr	x23, [x22, #24]
	ldr	w0, [x20]
	bl	_pm_runtime_get
	str	xzr, [x22, #8]
Lloh6:
	adrp	x8, _MEI_IDLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MEI_IDLE@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	x8, [x19]
	mov	x0, x19
	bl	_mei_cl_tx_flow_ctrl_creds
	mov	x24, x0
	add	x0, sp, #16
	mov	x1, x22
	bl	_mei_msg_hdr_init
	cbz	x24, LBB0_17
; %bb.9:
	mov	x0, x20
	bl	_mei_hbuf_acquire
	cbz	w0, LBB0_18
; %bb.10:
	mov	x0, x20
	bl	_mei_hbuf_empty_slots
	tbnz	w0, #31, LBB0_20
; %bb.11:
	bl	_mei_slots2data
	mov	x25, x0
	mov	x0, x20
	bl	_mei_dma_ring_empty_slots
	mov	x26, x0
	bl	_mei_slots2data
	add	x8, x21, #16
	cmp	x8, x25
	b.ls	LBB0_25
; %bb.12:
	cbz	w26, LBB0_33
; %bb.13:
	cmp	x25, #20
	b.lo	LBB0_33
; %bb.14:
	mov	x24, x0
	mov	w8, #1
	str	w8, [sp, #28]
	cmp	x21, x0
	b.hi	LBB0_16
; %bb.15:
	str	w8, [sp, #24]
	mov	x24, x21
LBB0_16:
	add	x23, sp, #12
	mov	w21, #4
	str	x21, [sp, #16]
	str	w24, [sp, #12]
	b	LBB0_35
LBB0_17:
Lloh9:
	adrp	x2, l_.str.2@PAGE
Lloh10:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_19
LBB0_18:
Lloh11:
	adrp	x2, l_.str.3@PAGE
Lloh12:
	add	x2, x2, l_.str.3@PAGEOFF
LBB0_19:
	mov	x0, x20
	mov	x1, x19
	bl	_cl_dbg
LBB0_20:
	ldr	w8, [sp, #24]
	add	x9, x20, #8
	add	x10, x20, #12
	cmp	w8, #0
	csel	x1, x9, x10, eq
	mov	x0, x22
	bl	_mei_tx_cb_enqueue
	cbz	w27, LBB0_22
; %bb.21:
	ldr	x8, [x19]
Lloh13:
	adrp	x24, _MEI_WRITE_COMPLETE@GOTPAGE
Lloh14:
	ldr	x24, [x24, _MEI_WRITE_COMPLETE@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_23
LBB0_22:
	mov	x22, #0
	b	LBB0_41
LBB0_23:
	add	x22, x20, #4
	mov	x0, x22
	bl	_mutex_unlock
	ldr	w23, [x19, #8]
	ldr	x8, [x19]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_26
; %bb.24:
	mov	w1, #1
	b	LBB0_27
LBB0_25:
	str	x21, [sp, #16]
	mov	w8, #1
	str	w8, [sp, #24]
	b	LBB0_34
LBB0_26:
	mov	x0, x19
	bl	_mei_cl_is_connected
	cmp	w0, #0
	cset	w1, eq
LBB0_27:
	mov	x0, x23
	bl	_wait_event_interruptible
	mov	x23, x0
	mov	x0, x22
	bl	_mutex_lock
	cbz	x23, LBB0_30
; %bb.28:
Lloh15:
	adrp	x8, _current@GOTPAGE
Lloh16:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_signal_pending
	mov	x22, #0
	cbz	x0, LBB0_40
; %bb.29:
Lloh18:
	adrp	x8, _EINTR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
	b	LBB0_32
LBB0_30:
	ldr	x8, [x19]
	ldr	x9, [x24]
	cmp	x8, x9
	b.eq	LBB0_22
; %bb.31:
	mov	x22, #0
Lloh20:
	adrp	x8, _EFAULT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
LBB0_32:
	ldr	x8, [x8]
	neg	x21, x8
	b	LBB0_41
LBB0_33:
	sub	x21, x25, #16
	str	x21, [sp, #16]
LBB0_34:
	mov	x24, x21
LBB0_35:
	ldr	w8, [sp, #28]
	cbz	w8, LBB0_37
; %bb.36:
	ldr	x1, [x22, #24]
	mov	x0, x20
	mov	x2, x24
	bl	_mei_dma_ring_write
	ldr	x21, [sp, #16]
LBB0_37:
	add	x1, sp, #16
	mov	x0, x20
	mov	w2, #16
	mov	x3, x23
	mov	x4, x21
	bl	_mei_write_message
	cbnz	x0, LBB0_39
; %bb.38:
	mov	x0, x19
	bl	_mei_cl_tx_flow_ctrl_creds_reduce
	cbz	x0, LBB0_42
LBB0_39:
	mov	x21, x0
	b	LBB0_41
LBB0_40:
	mov	x21, x23
LBB0_41:
Lloh22:
	adrp	x2, l_.str.4@PAGE
Lloh23:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x20
	mov	x1, x19
	bl	_cl_dbg
	ldr	w0, [x20]
	bl	_pm_runtime_mark_last_busy
	ldr	w0, [x20]
	bl	_pm_runtime_put_autosuspend
	mov	x0, x22
	bl	_mei_io_cb_free
	b	LBB0_7
LBB0_42:
Lloh24:
	adrp	x8, _MEI_WRITING@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MEI_WRITING@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	str	x8, [x19]
	str	x24, [x22, #8]
	ldr	x21, [x22, #16]
	b	LBB0_20
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,8,3                     ; @ENODEV
	.comm	_EINVAL,8,3                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"len=%zd\n"

	.comm	_EINPROGRESS,8,3                ; @EINPROGRESS
	.comm	_MEI_IDLE,8,3                   ; @MEI_IDLE
l_.str.2:                               ; @.str.2
	.asciz	"No flow control credentials: not sending.\n"

l_.str.3:                               ; @.str.3
	.asciz	"Cannot acquire the host buffer: not sending.\n"

	.comm	_EOVERFLOW,8,3                  ; @EOVERFLOW
	.comm	_MEI_WRITING,8,3                ; @MEI_WRITING
	.comm	_MEI_WRITE_COMPLETE,8,3         ; @MEI_WRITE_COMPLETE
	.comm	_current,4,2                    ; @current
	.comm	_EINTR,8,3                      ; @EINTR
	.comm	_EFAULT,8,3                     ; @EFAULT
l_.str.4:                               ; @.str.4
	.asciz	"rpm: autosuspend\n"

.subsections_via_symbols
