	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ctch_send
_ctch_send:                             ## @ctch_send
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -48(%rbp)                 ## 4-byte Spill
	movq	%r8, %r14
	movl	%ecx, %ebx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movq	%rdx, -112(%rbp)                ## 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	8(%rsi), %rax
	movq	_CTB_SEND@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rax,%rcx,8), %rdx
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	movq	(%rax,%rcx,8), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	xorl	%edi, %edi
	cmpl	$0, (%rsi)
	sete	%dil
	callq	_GEM_BUG_ON
	xorl	%edi, %edi
	testl	%ebx, %ebx
	sete	%dil
	callq	_GEM_BUG_ON
	movq	_GUC_CT_MSG_LEN_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	notl	%edi
	andl	%ebx, %edi
	callq	_GEM_BUG_ON
	xorl	%r13d, %r13d
	movq	%r14, %rbx
	testq	%r14, %r14
	setne	%r13b
	sete	%al
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	testl	%r14d, %r14d
	setne	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	callq	_GEM_BUG_ON
	movq	%r12, %rdi
	callq	_ctch_get_next_fence
	movl	%eax, %r12d
	movl	%eax, -88(%rbp)
	movl	$0, -84(%rbp)
	movl	%r14d, -80(%rbp)
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, -72(%rbp)
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	leaq	-64(%rbp), %rdi
	leaq	4(%r15), %rsi
	callq	_list_add_tail
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	-104(%rbp), %rdi                ## 8-byte Reload
	movq	-112(%rbp), %rsi                ## 8-byte Reload
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	%r12d, %ecx
	movl	%r13d, %r8d
	callq	_ctb_write
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_10
## %bb.1:
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movq	16(%rbp), %r14
	movq	%r15, %rdi
	callq	_ct_to_guc
	movl	%eax, %edi
	callq	_intel_guc_notify
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	testq	%r13, %r13
	je	LBB0_3
## %bb.2:
	leaq	-88(%rbp), %rdi
	movq	%r14, %rsi
	callq	_wait_for_ct_request_update
	jmp	LBB0_4
LBB0_3:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movq	%r14, %rdx
	callq	_wait_for_ctb_desc_update
LBB0_4:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_5
LBB0_10:
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	leaq	-64(%rbp), %rdi
	callq	_list_del
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%r13, %rbx
	movl	(%r14), %edi
	callq	_INTEL_GUC_MSG_IS_RESPONSE_SUCCESS
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.8:
	movl	-84(%rbp), %edi
	callq	_INTEL_GUC_MSG_TO_DATA
	movl	%eax, %edi
	callq	_WARN_ON
	movl	-80(%rbp), %ebx
	jmp	LBB0_10
LBB0_6:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_9:
	movl	-80(%rbp), %edi
	callq	_WARN_ON
	movl	(%r14), %edi
	callq	_INTEL_GUC_MSG_TO_DATA
	movl	%eax, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_CTB_SEND,8,3                   ## @CTB_SEND
	.comm	_GUC_CT_MSG_LEN_MASK,4,2        ## @GUC_CT_MSG_LEN_MASK
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_ctch_send
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ctch_send
_ctch_send:                             ; @ctch_send
	.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	x20, x6
	mov	x22, x5
	mov	x21, x4
	mov	x24, x3
	mov	x25, x2
	mov	x27, x1
	mov	x19, x0
	ldr	x8, [x1, #8]
Lloh0:
	adrp	x9, _CTB_SEND@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CTB_SEND@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x26, x8, x9, lsl #3
	ldr	x23, [x26]
	ldr	w8, [x1]
	cmp	w8, #0
	cset	w0, eq
	bl	_GEM_BUG_ON
	cmp	w24, #0
	cset	w0, eq
	bl	_GEM_BUG_ON
Lloh3:
	adrp	x8, _GUC_CT_MSG_LEN_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GUC_CT_MSG_LEN_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	bic	w0, w24, w8
	bl	_GEM_BUG_ON
	cmp	x21, #0
	cset	w28, ne
	cset	w8, eq
	cmp	w22, #0
	cset	w9, ne
	and	w0, w9, w8
	bl	_GEM_BUG_ON
	mov	x0, x27
	bl	_ctch_get_next_fence
	mov	x27, x0
	stp	w0, wzr, [sp]
	str	w22, [sp, #8]
	str	x21, [sp, #16]
	mov	x0, x19
	bl	_spin_lock_irqsave
	mov	x8, sp
	add	x22, x8, #24
	add	x1, x19, #4
	mov	x0, x22
	bl	_list_add_tail
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x26
	mov	x1, x25
	mov	x2, x24
	mov	x3, x27
	mov	x4, x28
	bl	_ctb_write
	mov	x24, x0
	bl	_unlikely
	cbnz	x0, LBB0_5
; %bb.1:
	mov	x0, x19
	bl	_ct_to_guc
	bl	_intel_guc_notify
	cbz	x21, LBB0_3
; %bb.2:
	mov	x0, sp
	mov	x1, x20
	bl	_wait_for_ct_request_update
	b	LBB0_4
LBB0_3:
	mov	x0, x23
	mov	x1, x27
	mov	x2, x20
	bl	_wait_for_ctb_desc_update
LBB0_4:
	mov	x24, x0
	bl	_unlikely
	cbz	x0, LBB0_6
LBB0_5:
	mov	x0, x19
	bl	_spin_lock_irqsave
	mov	x0, x22
	bl	_list_del
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x24
	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_6:
	ldr	w0, [x20]
	bl	_INTEL_GUC_MSG_IS_RESPONSE_SUCCESS
	cbz	w0, LBB0_9
; %bb.7:
	cbz	x21, LBB0_10
; %bb.8:
	ldr	w0, [sp, #4]
	bl	_INTEL_GUC_MSG_TO_DATA
	bl	_WARN_ON
	ldr	w24, [sp, #8]
	b	LBB0_5
LBB0_9:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_5
LBB0_10:
	ldr	w0, [sp, #8]
	bl	_WARN_ON
	ldr	w0, [x20]
	bl	_INTEL_GUC_MSG_TO_DATA
	mov	x24, x0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_CTB_SEND,8,3                   ; @CTB_SEND
	.comm	_GUC_CT_MSG_LEN_MASK,4,2        ; @GUC_CT_MSG_LEN_MASK
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_ctch_send
.subsections_via_symbols
