	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_cp_stop                 ## -- Begin function radeon_cp_stop
	.p2align	4, 0x90
_radeon_cp_stop:                        ## @radeon_cp_stop
	.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	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	(%rdi), %r15
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_LOCK_TEST_WITH_RETURN
	xorl	%eax, %eax
	cmpl	$0, 4(%r15)
	je	LBB0_15
## %bb.1:
	cmpq	$0, 8(%r12)
	je	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	callq	_radeon_do_cp_flush
LBB0_3:
	cmpq	$0, (%r12)
	je	LBB0_8
## %bb.4:
	movq	_RADEON_FAMILY_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r15), %eax
	movq	_CHIP_R600@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_5
## %bb.6:
	movq	%r15, %rdi
	callq	_radeon_do_cp_idle
	testl	%eax, %eax
	jne	LBB0_15
	jmp	LBB0_8
LBB0_5:
	movq	%r15, %rdi
	callq	_r600_do_cp_idle
	testl	%eax, %eax
	jne	LBB0_15
LBB0_8:
	movq	_RADEON_FAMILY_MASK@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	andl	(%r15), %eax
	movq	_CHIP_R600@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %eax
	jge	LBB0_9
## %bb.10:
	movq	%r15, %rdi
	callq	_radeon_do_cp_stop
	jmp	LBB0_11
LBB0_9:
	movq	%r15, %rdi
	callq	_r600_do_cp_stop
LBB0_11:
	movl	(%r12), %eax
	andl	(%r15), %eax
	cmpl	(%rbx), %eax
	jge	LBB0_12
## %bb.13:
	movq	%r14, %rdi
	callq	_radeon_do_engine_reset
	jmp	LBB0_14
LBB0_12:
	movq	%r14, %rdi
	callq	_r600_do_engine_reset
LBB0_14:
	xorl	%eax, %eax
LBB0_15:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

	.comm	_RADEON_FAMILY_MASK,4,2         ## @RADEON_FAMILY_MASK
	.comm	_CHIP_R600,4,2                  ## @CHIP_R600
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_cp_stop                 ; -- Begin function radeon_cp_stop
	.p2align	2
_radeon_cp_stop:                        ; @radeon_cp_stop
	.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
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x20, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	mov	x0, x19
	mov	x1, x22
	bl	_LOCK_TEST_WITH_RETURN
	ldr	w8, [x20, #4]
	cbz	w8, LBB0_13
; %bb.1:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x20
	bl	_radeon_do_cp_flush
LBB0_3:
	ldr	x8, [x21]
Lloh2:
	adrp	x22, _RADEON_FAMILY_MASK@GOTPAGE
Lloh3:
	ldr	x22, [x22, _RADEON_FAMILY_MASK@GOTPAGEOFF]
Lloh4:
	adrp	x21, _CHIP_R600@GOTPAGE
Lloh5:
	ldr	x21, [x21, _CHIP_R600@GOTPAGEOFF]
	cbz	x8, LBB0_7
; %bb.4:
	ldr	w8, [x20]
	ldr	w9, [x22]
	and	w8, w9, w8
	ldr	w9, [x21]
	mov	x0, x20
	cmp	w8, w9
	b.ge	LBB0_6
; %bb.5:
	bl	_radeon_do_cp_idle
	cbnz	w0, LBB0_14
	b	LBB0_7
LBB0_6:
	bl	_r600_do_cp_idle
	cbnz	w0, LBB0_14
LBB0_7:
	ldr	w8, [x20]
	ldr	w9, [x22]
	and	w8, w9, w8
	ldr	w9, [x21]
	mov	x0, x20
	cmp	w8, w9
	b.ge	LBB0_9
; %bb.8:
	bl	_radeon_do_cp_stop
	b	LBB0_10
LBB0_9:
	bl	_r600_do_cp_stop
LBB0_10:
	ldr	w8, [x20]
	ldr	w9, [x22]
	and	w8, w9, w8
	ldr	w9, [x21]
	mov	x0, x19
	cmp	w8, w9
	b.ge	LBB0_12
; %bb.11:
	bl	_radeon_do_engine_reset
	b	LBB0_13
LBB0_12:
	bl	_r600_do_engine_reset
LBB0_13:
	mov	w0, #0
LBB0_14:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_RADEON_FAMILY_MASK,4,2         ; @RADEON_FAMILY_MASK
	.comm	_CHIP_R600,4,2                  ; @CHIP_R600
.subsections_via_symbols
