	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_v8_0_set_cpg_door_bell
_gfx_v8_0_set_cpg_door_bell:            ## @gfx_v8_0_set_cpg_door_bell
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	_CHIP_TOPAZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_mmCP_RB_DOORBELL_CONTROL@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_RREG32
	cmpq	$0, 8(%rbx)
	movq	_CP_RB_DOORBELL_CONTROL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	je	LBB0_3
## %bb.2:
	movq	_DOORBELL_OFFSET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	(%rbx), %ecx
	movl	%eax, %edi
	callq	_REG_SET_FIELD
	movl	(%r12), %esi
	movq	_DOORBELL_HIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	xorl	%ecx, %ecx
	callq	_REG_SET_FIELD
	movl	(%r12), %esi
	movq	_DOORBELL_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	$1, %ecx
	jmp	LBB0_4
LBB0_3:
	movq	_DOORBELL_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	xorl	%ecx, %ecx
LBB0_4:
	callq	_REG_SET_FIELD
	movl	(%r15), %edi
	movl	%eax, %esi
	callq	_WREG32
	movq	_AMD_IS_APU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r14)
	je	LBB0_6
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_CP_RB_DOORBELL_RANGE_LOWER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DOORBELL_RANGE_LOWER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	12(%r14), %ecx
	xorl	%edi, %edi
	callq	_REG_SET_FIELD
	movq	_mmCP_RB_DOORBELL_RANGE_LOWER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%eax, %esi
	callq	_WREG32
	movq	_mmCP_RB_DOORBELL_RANGE_UPPER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_CP_RB_DOORBELL_RANGE_UPPER__DOORBELL_RANGE_UPPER_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_WREG32                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CHIP_TOPAZ,8,3                 ## @CHIP_TOPAZ
	.comm	_mmCP_RB_DOORBELL_CONTROL,4,2   ## @mmCP_RB_DOORBELL_CONTROL
	.comm	_CP_RB_DOORBELL_CONTROL,4,2     ## @CP_RB_DOORBELL_CONTROL
	.comm	_DOORBELL_OFFSET,4,2            ## @DOORBELL_OFFSET
	.comm	_DOORBELL_HIT,4,2               ## @DOORBELL_HIT
	.comm	_DOORBELL_EN,4,2                ## @DOORBELL_EN
	.comm	_AMD_IS_APU,4,2                 ## @AMD_IS_APU
	.comm	_CP_RB_DOORBELL_RANGE_LOWER,4,2 ## @CP_RB_DOORBELL_RANGE_LOWER
	.comm	_DOORBELL_RANGE_LOWER,4,2       ## @DOORBELL_RANGE_LOWER
	.comm	_mmCP_RB_DOORBELL_RANGE_LOWER,4,2 ## @mmCP_RB_DOORBELL_RANGE_LOWER
	.comm	_mmCP_RB_DOORBELL_RANGE_UPPER,4,2 ## @mmCP_RB_DOORBELL_RANGE_UPPER
	.comm	_CP_RB_DOORBELL_RANGE_UPPER__DOORBELL_RANGE_UPPER_MASK,4,2 ## @CP_RB_DOORBELL_RANGE_UPPER__DOORBELL_RANGE_UPPER_MASK
	.no_dead_strip	_gfx_v8_0_set_cpg_door_bell
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_v8_0_set_cpg_door_bell
_gfx_v8_0_set_cpg_door_bell:            ; @gfx_v8_0_set_cpg_door_bell
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _CHIP_TOPAZ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHIP_TOPAZ@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.1:
	mov	x20, x1
	mov	x19, x0
Lloh3:
	adrp	x21, _mmCP_RB_DOORBELL_CONTROL@GOTPAGE
Lloh4:
	ldr	x21, [x21, _mmCP_RB_DOORBELL_CONTROL@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_RREG32
	ldr	x8, [x20, #8]
Lloh5:
	adrp	x22, _CP_RB_DOORBELL_CONTROL@GOTPAGE
Lloh6:
	ldr	x22, [x22, _CP_RB_DOORBELL_CONTROL@GOTPAGEOFF]
	ldr	w1, [x22]
	cbz	x8, LBB0_3
; %bb.2:
Lloh7:
	adrp	x8, _DOORBELL_OFFSET@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DOORBELL_OFFSET@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	ldr	w3, [x20]
	bl	_REG_SET_FIELD
	ldr	w1, [x22]
Lloh10:
	adrp	x8, _DOORBELL_HIT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DOORBELL_HIT@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	w3, #0
	bl	_REG_SET_FIELD
	ldr	w1, [x22]
Lloh13:
	adrp	x8, _DOORBELL_EN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DOORBELL_EN@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	w3, #1
	b	LBB0_4
LBB0_3:
Lloh16:
	adrp	x8, _DOORBELL_EN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DOORBELL_EN@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	w3, #0
LBB0_4:
	bl	_REG_SET_FIELD
	mov	x1, x0
	ldr	w0, [x21]
	bl	_WREG32
	ldr	w8, [x19, #8]
Lloh19:
	adrp	x9, _AMD_IS_APU@GOTPAGE
Lloh20:
	ldr	x9, [x9, _AMD_IS_APU@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
LBB0_5:
	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
LBB0_6:
Lloh22:
	adrp	x8, _CP_RB_DOORBELL_RANGE_LOWER@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CP_RB_DOORBELL_RANGE_LOWER@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x8, _DOORBELL_RANGE_LOWER@GOTPAGE
Lloh26:
	ldr	x8, [x8, _DOORBELL_RANGE_LOWER@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	ldr	w3, [x19, #12]
	mov	w0, #0
	bl	_REG_SET_FIELD
	mov	x1, x0
Lloh28:
	adrp	x8, _mmCP_RB_DOORBELL_RANGE_LOWER@GOTPAGE
Lloh29:
	ldr	x8, [x8, _mmCP_RB_DOORBELL_RANGE_LOWER@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	bl	_WREG32
Lloh31:
	adrp	x8, _mmCP_RB_DOORBELL_RANGE_UPPER@GOTPAGE
Lloh32:
	ldr	x8, [x8, _mmCP_RB_DOORBELL_RANGE_UPPER@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
Lloh34:
	adrp	x8, _CP_RB_DOORBELL_RANGE_UPPER__DOORBELL_RANGE_UPPER_MASK@GOTPAGE
Lloh35:
	ldr	x8, [x8, _CP_RB_DOORBELL_RANGE_UPPER__DOORBELL_RANGE_UPPER_MASK@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	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	_WREG32
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_CHIP_TOPAZ,8,3                 ; @CHIP_TOPAZ
	.comm	_mmCP_RB_DOORBELL_CONTROL,4,2   ; @mmCP_RB_DOORBELL_CONTROL
	.comm	_CP_RB_DOORBELL_CONTROL,4,2     ; @CP_RB_DOORBELL_CONTROL
	.comm	_DOORBELL_OFFSET,4,2            ; @DOORBELL_OFFSET
	.comm	_DOORBELL_HIT,4,2               ; @DOORBELL_HIT
	.comm	_DOORBELL_EN,4,2                ; @DOORBELL_EN
	.comm	_AMD_IS_APU,4,2                 ; @AMD_IS_APU
	.comm	_CP_RB_DOORBELL_RANGE_LOWER,4,2 ; @CP_RB_DOORBELL_RANGE_LOWER
	.comm	_DOORBELL_RANGE_LOWER,4,2       ; @DOORBELL_RANGE_LOWER
	.comm	_mmCP_RB_DOORBELL_RANGE_LOWER,4,2 ; @mmCP_RB_DOORBELL_RANGE_LOWER
	.comm	_mmCP_RB_DOORBELL_RANGE_UPPER,4,2 ; @mmCP_RB_DOORBELL_RANGE_UPPER
	.comm	_CP_RB_DOORBELL_RANGE_UPPER__DOORBELL_RANGE_UPPER_MASK,4,2 ; @CP_RB_DOORBELL_RANGE_UPPER__DOORBELL_RANGE_UPPER_MASK
	.no_dead_strip	_gfx_v8_0_set_cpg_door_bell
.subsections_via_symbols
