	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ctch_enable
_ctch_enable:                           ## @ctch_enable
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %rbx
	xorl	%edi, %edi
	cmpl	$0, 16(%rsi)
	sete	%dil
	callq	_GEM_BUG_ON
	movl	(%r13), %edi
	callq	_GEM_BUG_ON
	movl	16(%r13), %esi
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_intel_guc_ggtt_offset
	movq	%rax, %r15
	movq	8(%r13), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	movq	_CTB_RECV@GOTPCREL(%rip), %r14
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_CTB_SEND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%rax, %rbx
	setne	%al
	movl	(%r14), %ecx
	cmpq	%rcx, %rbx
	setne	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	callq	_GEM_BUG_ON
	movq	8(%r13), %rax
	movl	(%rax,%rbx,4), %edi
	movl	(%r12), %eax
	leal	3(%rax), %edx
	testl	%eax, %eax
	cmovnsl	%eax, %edx
	sarl	$2, %edx
	movl	%ebx, %ecx
	imull	%edx, %ecx
	movslq	%ecx, %rcx
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	movslq	%esi, %rsi
	addq	%r15, %rsi
	addq	%rcx, %rsi
	movl	4(%r13), %ecx
	callq	_guc_ct_buffer_desc_init
	incq	%rbx
	movq	8(%r13), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_3:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	movq	_CTB_RECV@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movslq	%ecx, %rsi
	imulq	%rax, %rsi
	addq	%r15, %rsi
	movq	_INTEL_GUC_CT_BUFFER_TYPE_RECV@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_guc_action_register_ct_buffer
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_7
## %bb.4:
	movl	(%rbx), %eax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	movq	_CTB_SEND@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movslq	%ecx, %rcx
	imulq	%rax, %rcx
	addq	%rcx, %r15
	movq	_INTEL_GUC_CT_BUFFER_TYPE_SEND@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_guc_action_register_ct_buffer
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movl	4(%r13), %esi
	movq	_INTEL_GUC_CT_BUFFER_TYPE_RECV@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_guc_action_deregister_ct_buffer
LBB0_7:
	movl	4(%r13), %esi
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %edx
	callq	_DRM_ERROR
LBB0_8:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	$1, (%r13)
	xorl	%r12d, %r12d
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_CTB_SEND,4,2                   ## @CTB_SEND
	.comm	_CTB_RECV,4,2                   ## @CTB_RECV
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_INTEL_GUC_CT_BUFFER_TYPE_RECV,4,2 ## @INTEL_GUC_CT_BUFFER_TYPE_RECV
	.comm	_INTEL_GUC_CT_BUFFER_TYPE_SEND,4,2 ## @INTEL_GUC_CT_BUFFER_TYPE_SEND
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CT: can't open channel %d; err=%d\n"

	.no_dead_strip	_ctch_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ctch_enable
_ctch_enable:                           ; @ctch_enable
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	w8, [x1, #16]
	cmp	w8, #0
	cset	w0, eq
	bl	_GEM_BUG_ON
	ldr	w0, [x19]
	bl	_GEM_BUG_ON
	ldr	w1, [x19, #16]
	mov	x0, x20
	bl	_intel_guc_ggtt_offset
	mov	x21, x0
	ldr	x0, [x19, #8]
	bl	_ARRAY_SIZE
Lloh0:
	adrp	x23, _CTB_SEND@GOTPAGE
Lloh1:
	ldr	x23, [x23, _CTB_SEND@GOTPAGEOFF]
Lloh2:
	adrp	x22, _CTB_RECV@GOTPAGE
Lloh3:
	ldr	x22, [x22, _CTB_RECV@GOTPAGEOFF]
Lloh4:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh5:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x25, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23]
	cmp	x25, x8
	ldr	w8, [x22]
	ccmp	x25, x8, #4, ne
	cset	w0, ne
	bl	_GEM_BUG_ON
	ldr	x8, [x19, #8]
	ldr	w0, [x8, x25, lsl #2]
	ldr	w8, [x24]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w9, w9, w8, lt
	asr	w2, w9, #2
	mul	w9, w2, w25
	cinc	w8, w8, lt
	asr	w8, w8, #1
	add	x8, x21, w8, sxtw
	add	x1, x8, w9, sxtw
	ldr	w3, [x19, #4]
	bl	_guc_ct_buffer_desc_init
	add	x25, x25, #1
	ldr	x0, [x19, #8]
	bl	_ARRAY_SIZE
	cmp	x25, w0, sxtw
	b.lt	LBB0_2
LBB0_3:
	ldr	w8, [x24]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	ldrsw	x9, [x22]
	sbfx	x8, x8, #2, #30
	madd	x1, x8, x9, x21
Lloh6:
	adrp	x25, _INTEL_GUC_CT_BUFFER_TYPE_RECV@GOTPAGE
Lloh7:
	ldr	x25, [x25, _INTEL_GUC_CT_BUFFER_TYPE_RECV@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x0, x20
	bl	_guc_action_register_ct_buffer
	mov	x22, x0
	bl	_unlikely
	cbnz	x0, LBB0_6
; %bb.4:
	ldr	w8, [x24]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	ldrsw	x9, [x23]
	sbfx	x8, x8, #2, #30
	madd	x1, x8, x9, x21
Lloh8:
	adrp	x8, _INTEL_GUC_CT_BUFFER_TYPE_SEND@GOTPAGE
Lloh9:
	ldr	x8, [x8, _INTEL_GUC_CT_BUFFER_TYPE_SEND@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_guc_action_register_ct_buffer
	mov	x22, x0
	bl	_unlikely
	cbz	x0, LBB0_8
; %bb.5:
	ldr	w1, [x19, #4]
	ldr	w2, [x25]
	mov	x0, x20
	bl	_guc_action_deregister_ct_buffer
LBB0_6:
	ldr	w1, [x19, #4]
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x22
	bl	_DRM_ERROR
LBB0_7:
	mov	x0, x22
	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_8:
	mov	w22, #0
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_CTB_SEND,4,2                   ; @CTB_SEND
	.comm	_CTB_RECV,4,2                   ; @CTB_RECV
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_INTEL_GUC_CT_BUFFER_TYPE_RECV,4,2 ; @INTEL_GUC_CT_BUFFER_TYPE_RECV
	.comm	_INTEL_GUC_CT_BUFFER_TYPE_SEND,4,2 ; @INTEL_GUC_CT_BUFFER_TYPE_SEND
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CT: can't open channel %d; err=%d\n"

	.no_dead_strip	_ctch_enable
.subsections_via_symbols
