	.file	"extr_intel_guc_ct.c_ctch_enable.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"CT: can't open channel %d; err=%d\n"
	.text
	.p2align 4
	.type	ctch_enable, @function
ctch_enable:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	xor	edi, edi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	eax, DWORD PTR 16[rsi]
	test	eax, eax
	sete	dil
	xor	ebp, ebp
	call	GEM_BUG_ON@PLT
	mov	edi, DWORD PTR [r12]
	call	GEM_BUG_ON@PLT
	mov	esi, DWORD PTR 16[r12]
	mov	rdi, r14
	call	intel_guc_ggtt_offset@PLT
	mov	r13, rax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L4:
	xor	edi, edi
	cmp	DWORD PTR CTB_SEND[rip], ebp
	je	.L3
	xor	edi, edi
	cmp	DWORD PTR CTB_RECV[rip], ebx
	setne	dil
.L3:
	call	GEM_BUG_ON@PLT
	mov	eax, DWORD PTR PAGE_SIZE[rip]
	mov	ecx, DWORD PTR 4[r12]
	test	eax, eax
	lea	edx, 3[rax]
	cmovns	edx, eax
	sar	edx, 2
	imul	ebx, edx
	movsx	rsi, ebx
	lea	rbx, [rsi+r13]
	mov	esi, eax
	shr	esi, 31
	add	esi, eax
	mov	rax, QWORD PTR 8[r12]
	sar	esi
	mov	edi, DWORD PTR [rax+rbp*4]
	movsx	rsi, esi
	add	rbp, 1
	add	rsi, rbx
	call	guc_ct_buffer_desc_init@PLT
.L2:
	mov	rdi, QWORD PTR 8[r12]
	mov	ebx, ebp
	call	ARRAY_SIZE@PLT
	cmp	eax, ebp
	jg	.L4
	mov	eax, DWORD PTR PAGE_SIZE[rip]
	mov	edx, DWORD PTR INTEL_GUC_CT_BUFFER_TYPE_RECV[rip]
	mov	rdi, r14
	test	eax, eax
	lea	esi, 3[rax]
	cmovns	esi, eax
	sar	esi, 2
	imul	esi, DWORD PTR CTB_RECV[rip]
	movsx	rsi, esi
	add	rsi, r13
	call	guc_action_register_ct_buffer@PLT
	mov	edi, eax
	mov	r15d, eax
	call	unlikely@PLT
	test	rax, rax
	je	.L11
.L5:
	mov	esi, DWORD PTR 4[r12]
	mov	edx, r15d
	lea	rdi, .LC0[rip]
	call	DRM_ERROR@PLT
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	eax, DWORD PTR PAGE_SIZE[rip]
	mov	edx, DWORD PTR INTEL_GUC_CT_BUFFER_TYPE_SEND[rip]
	mov	rdi, r14
	test	eax, eax
	lea	esi, 3[rax]
	cmovns	esi, eax
	sar	esi, 2
	imul	esi, DWORD PTR CTB_SEND[rip]
	movsx	rsi, esi
	add	rsi, r13
	call	guc_action_register_ct_buffer@PLT
	mov	edi, eax
	mov	r15d, eax
	call	unlikely@PLT
	test	rax, rax
	jne	.L12
	mov	DWORD PTR [r12], 1
	xor	r15d, r15d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L12:
	mov	esi, DWORD PTR 4[r12]
	mov	edx, DWORD PTR INTEL_GUC_CT_BUFFER_TYPE_RECV[rip]
	mov	rdi, r14
	call	guc_action_deregister_ct_buffer@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	ctch_enable, .-ctch_enable
	.comm	PAGE_SIZE,4,4
	.comm	INTEL_GUC_CT_BUFFER_TYPE_SEND,4,4
	.comm	INTEL_GUC_CT_BUFFER_TYPE_RECV,4,4
	.comm	CTB_SEND,4,4
	.comm	CTB_RECV,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_intel_guc_ct.c_ctch_enable.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"CT: can't open channel %d; err=%d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ctch_enable, %function
ctch_enable:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r1, #12]
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r10, r0
	clz	r0, r3
	mov	r5, r1
	lsr	r0, r0, #5
	bl	GEM_BUG_ON
	ldr	r0, [r5]
	bl	GEM_BUG_ON
	mov	r0, r10
	ldr	r1, [r5, #12]
	bl	intel_guc_ggtt_offset
	mov	r4, #0
	mov	r6, r0
	ldr	r9, .L12
	ldr	r7, .L12+4
	ldr	r8, .L12+8
	b	.L2
.L4:
	ldr	r3, [r8]
	cmp	r3, r4
	moveq	r0, #0
	beq	.L3
	ldr	r0, [r9]
	subs	r0, r0, r4
	movne	r0, #1
.L3:
	bl	GEM_BUG_ON
	ldr	r3, [r7]
	ldr	r0, [r5, #8]
	cmp	r3, #0
	add	r2, r3, #3
	movge	r2, r3
	asr	r2, r2, #2
	mla	r1, r4, r2, r6
	add	r3, r3, r3, lsr #31
	ldr	r0, [r0, r4, lsl #2]
	add	r1, r1, r3, asr #1
	ldr	r3, [r5, #4]
	bl	guc_ct_buffer_desc_init
	add	r4, r4, #1
.L2:
	ldr	r0, [r5, #8]
	bl	ARRAY_SIZE
	cmp	r0, r4
	bgt	.L4
	ldr	r3, [r7]
	ldr	r1, [r9]
	cmp	r3, #0
	add	r2, r3, #3
	movlt	r3, r2
	ldr	r8, .L12+12
	asr	r3, r3, #2
	mla	r1, r3, r1, r6
	ldr	r2, [r8]
	mov	r0, r10
	bl	guc_action_register_ct_buffer
	mov	r4, r0
	bl	unlikely
	cmp	r0, #0
	beq	.L11
.L5:
	mov	r2, r4
	ldr	r1, [r5, #4]
	ldr	r0, .L12+16
	bl	DRM_ERROR
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L11:
	ldr	r1, [r7]
	ldr	r3, .L12+8
	cmp	r1, #0
	add	r2, r1, #3
	movlt	r1, r2
	ldr	r2, [r3]
	ldr	r3, .L12+20
	asr	r1, r1, #2
	mla	r1, r2, r1, r6
	mov	r0, r10
	ldr	r2, [r3]
	bl	guc_action_register_ct_buffer
	mov	r6, r0
	bl	unlikely
	subs	r4, r0, #0
	moveq	r3, #1
	streq	r3, [r5]
	beq	.L1
	mov	r0, r10
	ldr	r2, [r8]
	ldr	r1, [r5, #4]
	mov	r4, r6
	bl	guc_action_deregister_ct_buffer
	b	.L5
.L13:
	.align	2
.L12:
	.word	CTB_RECV
	.word	PAGE_SIZE
	.word	CTB_SEND
	.word	INTEL_GUC_CT_BUFFER_TYPE_RECV
	.word	.LC0
	.word	INTEL_GUC_CT_BUFFER_TYPE_SEND
	.size	ctch_enable, .-ctch_enable
	.comm	PAGE_SIZE,4,4
	.comm	INTEL_GUC_CT_BUFFER_TYPE_SEND,4,4
	.comm	INTEL_GUC_CT_BUFFER_TYPE_RECV,4,4
	.comm	CTB_SEND,4,4
	.comm	CTB_RECV,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
