	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cik_hdp_flush_cp_ring_emit
_cik_hdp_flush_cp_ring_emit:            ## @cik_hdp_flush_cp_ring_emit
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movslq	%esi, %rcx
	leaq	(%rcx,%rcx,2), %rdx
	cmpl	$128, (%rax,%rdx,4)
	jne	LBB0_1
## %bb.6:
	movq	_CP0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	jmp	LBB0_7
LBB0_1:
	movl	8(%rax,%rdx,4), %ecx
	cmpl	$1, %ecx
	je	LBB0_5
## %bb.2:
	testl	%ecx, %ecx
	jne	LBB0_8
## %bb.3:
	movq	_CP2@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_5:
	movq	_CP6@GOTPCREL(%rip), %rcx
LBB0_4:
	movl	(%rcx), %r14d
	movb	4(%rax,%rdx,4), %cl
	shll	%cl, %r14d
LBB0_7:
	leaq	(%rax,%rdx,4), %r15
	movq	_PACKET3_WAIT_REG_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$5, %esi
	callq	_PACKET3
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movl	$1, %edi
	callq	_WAIT_REG_MEM_OPERATION
	movl	%eax, %ebx
	movl	$3, %edi
	callq	_WAIT_REG_MEM_FUNCTION
	orl	%eax, %ebx
	movl	$1, %edi
	callq	_WAIT_REG_MEM_ENGINE
	orl	%eax, %ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_radeon_ring_write
	movq	_GPU_HDP_FLUSH_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	sarl	$2, %esi
	movq	%r15, %rdi
	callq	_radeon_ring_write
	movq	_GPU_HDP_FLUSH_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	sarl	$2, %esi
	movq	%r15, %rdi
	callq	_radeon_ring_write
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_radeon_ring_write
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_radeon_ring_write
	movq	%r15, %rdi
	movl	$32, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_radeon_ring_write              ## TAILCALL
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CP2,4,2                        ## @CP2
	.comm	_CP6,4,2                        ## @CP6
	.comm	_CP0,4,2                        ## @CP0
	.comm	_PACKET3_WAIT_REG_MEM,4,2       ## @PACKET3_WAIT_REG_MEM
	.comm	_GPU_HDP_FLUSH_REQ,4,2          ## @GPU_HDP_FLUSH_REQ
	.comm	_GPU_HDP_FLUSH_DONE,4,2         ## @GPU_HDP_FLUSH_DONE
	.no_dead_strip	_cik_hdp_flush_cp_ring_emit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cik_hdp_flush_cp_ring_emit
_cik_hdp_flush_cp_ring_emit:            ; @cik_hdp_flush_cp_ring_emit
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
                                        ; kill: def $w1 killed $w1 def $x1
	ldr	x8, [x0]
	mov	w9, #12
	smaddl	x19, w1, w9, x8
	ldr	w9, [x19]
	cmp	w9, #128
	b.ne	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _CP0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CP0@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	b	LBB0_7
LBB0_2:
	sxtw	x9, w1
	mov	w10, #12
	madd	x10, x9, x10, x8
	ldr	w10, [x10, #8]
	cmp	w10, #1
	b.eq	LBB0_5
; %bb.3:
	cbnz	w10, LBB0_8
; %bb.4:
Lloh3:
	adrp	x10, _CP2@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CP2@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh5:
	adrp	x10, _CP6@GOTPAGE
Lloh6:
	ldr	x10, [x10, _CP6@GOTPAGEOFF]
LBB0_6:
	ldr	w10, [x10]
	mov	w11, #12
	madd	x8, x9, x11, x8
	ldr	w8, [x8, #4]
	lsl	w20, w10, w8
LBB0_7:
Lloh7:
	adrp	x8, _PACKET3_WAIT_REG_MEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PACKET3_WAIT_REG_MEM@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	mov	w1, #5
	bl	_PACKET3
	mov	x1, x0
	mov	x0, x19
	bl	_radeon_ring_write
	mov	w0, #1
	bl	_WAIT_REG_MEM_OPERATION
	mov	x21, x0
	mov	w0, #3
	bl	_WAIT_REG_MEM_FUNCTION
	orr	w21, w0, w21
	mov	w0, #1
	bl	_WAIT_REG_MEM_ENGINE
	orr	w1, w21, w0
	mov	x0, x19
	bl	_radeon_ring_write
Lloh10:
	adrp	x8, _GPU_HDP_FLUSH_REQ@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GPU_HDP_FLUSH_REQ@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	asr	w1, w8, #2
	mov	x0, x19
	bl	_radeon_ring_write
Lloh13:
	adrp	x8, _GPU_HDP_FLUSH_DONE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GPU_HDP_FLUSH_DONE@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	asr	w1, w8, #2
	mov	x0, x19
	bl	_radeon_ring_write
	mov	x0, x19
	mov	x1, x20
	bl	_radeon_ring_write
	mov	x0, x19
	mov	x1, x20
	bl	_radeon_ring_write
	mov	x0, x19
	mov	w1, #32
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_radeon_ring_write
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_CP2,4,2                        ; @CP2
	.comm	_CP6,4,2                        ; @CP6
	.comm	_CP0,4,2                        ; @CP0
	.comm	_PACKET3_WAIT_REG_MEM,4,2       ; @PACKET3_WAIT_REG_MEM
	.comm	_GPU_HDP_FLUSH_REQ,4,2          ; @GPU_HDP_FLUSH_REQ
	.comm	_GPU_HDP_FLUSH_DONE,4,2         ; @GPU_HDP_FLUSH_DONE
	.no_dead_strip	_cik_hdp_flush_cp_ring_emit
.subsections_via_symbols
