	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mei_txe_write
_mei_txe_write:                         ## @mei_txe_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
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r12
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_to_txe_hw
	movq	%rax, %r15
	movq	_TXE_HBUF_DEPTH@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	testq	%r14, %r14
	sete	%al
	testq	%r12, %r12
	sete	%cl
	testb	$3, %r13b
	setne	%dl
	orb	%al, %cl
	orb	%dl, %cl
	movzbl	%cl, %edi
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_3:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %r12d
	movq	_MEI_HDR_FMT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%r14, %rdi
	callq	_MEI_HDR_PRM
	movl	%r12d, %edi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_dev_dbg
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r13), %rdi
	callq	_mei_data2slots
	cmpq	-96(%rbp), %rax                 ## 8-byte Folded Reload
	jle	LBB0_5
## %bb.4:
	movq	_EMSGSIZE@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_5:
	movq	%r13, %rbx
	xorl	%edi, %edi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, 8(%rax)
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_WARN
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_22:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_24
## %bb.23:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_mei_txe_input_ready_interrupt_enable
	movq	%r13, %rdi
	callq	_mei_txe_is_input_ready
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movq	_MEI_SLOT_SIZE@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	xorl	%r12d, %r12d
	cmpq	%rbx, %rcx
	jbe	LBB0_10
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%rcx
	cmpq	%rax, %r12
	jae	LBB0_14
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14,%r12,8), %rdx
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_mei_txe_input_payload_write
	incq	%r12
	movq	(%r15), %rcx
	movq	%rbx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	cmpq	%rax, %r12
	jb	LBB0_10
LBB0_14:
	xorl	%ebx, %ebx
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	cmpq	%r14, %rcx
	jbe	LBB0_15
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_15 Depth=1
	movq	%r14, %rax
	xorl	%edx, %edx
	divq	%rcx
	cmpq	%rax, %rbx
	jae	LBB0_19
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	leaq	(%r12,%rbx), %rsi
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%rbx,8), %rdx
	movq	%r13, %rdi
	callq	_mei_txe_input_payload_write
	incq	%rbx
	movq	(%r15), %rcx
	movq	%r14, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	cmpq	%rax, %rbx
	jb	LBB0_15
LBB0_19:
	movq	%r14, %rdx
	andq	$3, %rdx
	je	LBB0_21
## %bb.20:
	movq	$0, -80(%rbp)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r14,4), %rsi
	leaq	(,%rdx,4), %rax
	subq	%rax, %rsi
	leaq	-80(%rbp), %rdi
	callq	_memcpy
	addq	%r12, %rbx
	movq	-80(%rbp), %rdx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_mei_txe_input_payload_write
LBB0_21:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	$0, (%rdi)
	callq	_mei_txe_input_doorbell_set
	xorl	%eax, %eax
	jmp	LBB0_22
LBB0_8:
	movq	%rsp, %r14
	movq	_MEI_FW_STATUS_STR_SZ@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movl	(%r15), %edx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_mei_fw_status_str
	movl	(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdx
	callq	_dev_err
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	movq	%r14, %rsp
	jmp	LBB0_22
LBB0_24:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_TXE_HBUF_DEPTH,8,3             ## @TXE_HBUF_DEPTH
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MEI_HDR_FMT,4,2                ## @MEI_HDR_FMT
	.comm	_EMSGSIZE,4,2                   ## @EMSGSIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"txe write: aliveness not asserted\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_MEI_FW_STATUS_STR_SZ,4,2       ## @MEI_FW_STATUS_STR_SZ
L_.str.1:                               ## @.str.1
	.asciz	"Input is not ready %s\n"

	.comm	_MEI_SLOT_SIZE,8,3              ## @MEI_SLOT_SIZE
	.no_dead_strip	_mei_txe_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mei_txe_write
_mei_txe_write:                         ; @mei_txe_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, #16
	mov	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, 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, #-88]
	bl	_to_txe_hw
	mov	x20, x0
Lloh3:
	adrp	x8, _TXE_HBUF_DEPTH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TXE_HBUF_DEPTH@GOTPAGEOFF]
Lloh5:
	ldr	x27, [x8]
	tst	x23, #0x3
	cset	w8, ne
	cmp	x24, #0
	ccmp	x22, #0, #4, ne
	cset	w9, eq
	orr	w0, w8, w9
	bl	_WARN_ON
	cbz	x0, LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_2:
	ldr	w25, [x19]
Lloh8:
	adrp	x8, _MEI_HDR_FMT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MEI_HDR_FMT@GOTPAGEOFF]
Lloh10:
	ldr	w26, [x8]
	mov	x0, x24
	bl	_MEI_HDR_PRM
	mov	x2, x0
	mov	x0, x25
	mov	x1, x26
	bl	_dev_dbg
	add	x0, x21, x23
	bl	_mei_data2slots
	cmp	x0, x27
	b.le	LBB0_4
; %bb.3:
Lloh11:
	adrp	x8, _EMSGSIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EMSGSIZE@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	ldr	w8, [x20, #8]
	cmp	w8, #0
	cset	w0, eq
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	bl	_WARN
	cbz	x0, LBB0_9
; %bb.5:
Lloh15:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldur	x8, [x29, #-88]
Lloh17:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh18:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.8:
	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_9:
	mov	x0, x19
	bl	_mei_txe_input_ready_interrupt_enable
	mov	x0, x19
	bl	_mei_txe_is_input_ready
	cbz	w0, LBB0_12
; %bb.10:
Lloh20:
	adrp	x26, _MEI_SLOT_SIZE@GOTPAGE
Lloh21:
	ldr	x26, [x26, _MEI_SLOT_SIZE@GOTPAGEOFF]
	ldr	x8, [x26]
	cmp	x8, x23
	b.ls	LBB0_13
; %bb.11:
	mov	x25, #0
	b	LBB0_15
LBB0_12:
	mov	x21, sp
Lloh22:
	adrp	x12, _MEI_FW_STATUS_STR_SZ@GOTPAGE
Lloh23:
	ldr	x12, [x12, _MEI_FW_STATUS_STR_SZ@GOTPAGEOFF]
	ldr	w8, [x12]
	mov	x9, x8
Lloh24:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh25:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	ldr	w2, [x12]
	mov	x0, x19
	mov	x1, x20
	bl	_mei_fw_status_str
	ldr	w0, [x19]
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_err
Lloh28:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w0, w8
	mov	sp, x21
	b	LBB0_7
LBB0_13:
	mov	x25, #0
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x2, [x24, x25, lsl #3]
	mov	x0, x19
	mov	x1, x25
	bl	_mei_txe_input_payload_write
	add	x25, x25, #1
	ldr	x8, [x26]
	udiv	x9, x23, x8
	cmp	x25, x9
	b.lo	LBB0_14
LBB0_15:
	cmp	x8, x21
	b.ls	LBB0_17
; %bb.16:
	mov	x23, #0
	b	LBB0_19
LBB0_17:
	mov	x23, #0
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	add	x1, x25, x23
	ldr	x2, [x22, x23, lsl #3]
	mov	x0, x19
	bl	_mei_txe_input_payload_write
	add	x23, x23, #1
	ldr	x8, [x26]
	udiv	x8, x21, x8
	cmp	x23, x8
	b.lo	LBB0_18
LBB0_19:
	ands	x2, x21, #0x3
	b.eq	LBB0_21
; %bb.20:
	stur	xzr, [x29, #-96]
	add	x8, x22, x21, lsl #2
	sub	x1, x8, x2, lsl #2
	sub	x0, x29, #96
	bl	_memcpy
	add	x1, x23, x25
	ldur	x2, [x29, #-96]
	mov	x0, x19
	bl	_mei_txe_input_payload_write
LBB0_21:
	str	xzr, [x20]
	mov	x0, x20
	bl	_mei_txe_input_doorbell_set
	mov	w0, #0
	b	LBB0_7
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_TXE_HBUF_DEPTH,8,3             ; @TXE_HBUF_DEPTH
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MEI_HDR_FMT,4,2                ; @MEI_HDR_FMT
	.comm	_EMSGSIZE,4,2                   ; @EMSGSIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"txe write: aliveness not asserted\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_MEI_FW_STATUS_STR_SZ,4,2       ; @MEI_FW_STATUS_STR_SZ
l_.str.1:                               ; @.str.1
	.asciz	"Input is not ready %s\n"

	.comm	_MEI_SLOT_SIZE,8,3              ; @MEI_SLOT_SIZE
	.no_dead_strip	_mei_txe_write
.subsections_via_symbols
