	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_ring_backup             ## -- Begin function radeon_ring_backup
	.p2align	4, 0x90
_radeon_ring_backup:                    ## @radeon_ring_backup
	.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	%rdx, %r13
	movq	%rsi, %r12
	movq	%rdi, %r14
	callq	_mutex_lock
	movq	$0, (%r13)
	cmpq	$0, 48(%r12)
	je	LBB0_1
## %bb.2:
	movl	40(%r12), %esi
	movq	%r14, %rdi
	callq	_radeon_fence_count_emitted
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	32(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	callq	_RREG32
	jmp	LBB0_7
LBB0_5:
	cmpq	$0, 8(%r14)
	je	LBB0_1
## %bb.6:
	movq	24(%r12), %rax
	movl	(%rax), %edi
	callq	_le32_to_cpu
LBB0_7:
	movl	%eax, %ebx
	movl	(%r12), %r15d
	movl	4(%r12), %eax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	subl	%ebx, %r15d
	addl	%ecx, %r15d
	andl	8(%r12), %r15d
	je	LBB0_1
## %bb.8:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %edi
	movl	$4, %esi
	callq	_kmalloc_array
	movq	%rax, (%r13)
	testq	%rax, %rax
	je	LBB0_1
## %bb.9:
	movq	16(%r12), %rcx
	cmpl	$1, %r15d
	jne	LBB0_11
## %bb.10:
	xorl	%edx, %edx
	jmp	LBB0_13
LBB0_1:
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%r15d, %r15d
LBB0_16:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	%r15d, %esi
	andl	$-2, %esi
	xorl	%edx, %edx
	movl	%ebx, %edi
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	%edi, %ebx
	incl	%edi
	movl	(%rcx,%rbx,4), %ebx
	movl	%ebx, (%rax,%rdx,4)
	andl	8(%r12), %edi
	movl	%edi, %ebx
	incl	%ebx
	movl	(%rcx,%rdi,4), %edi
	movl	%edi, 4(%rax,%rdx,4)
	andl	8(%r12), %ebx
	addq	$2, %rdx
	movl	%ebx, %edi
	cmpq	%rdx, %rsi
	jne	LBB0_12
LBB0_13:
	testb	$1, %r15b
	je	LBB0_15
## %bb.14:
	movl	%ebx, %esi
	movl	(%rcx,%rsi,4), %ecx
	movl	%ecx, (%rax,%rdx,4)
LBB0_15:
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_ring_backup             ; -- Begin function radeon_ring_backup
	.p2align	2
_radeon_ring_backup:                    ; @radeon_ring_backup
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	bl	_mutex_lock
	str	xzr, [x21]
	ldr	x8, [x20, #48]
	cbz	x8, LBB0_11
; %bb.1:
	ldr	w1, [x20, #40]
	mov	x0, x19
	bl	_radeon_fence_count_emitted
	cbz	w0, LBB0_11
; %bb.2:
	ldr	x0, [x20, #32]
	cbz	x0, LBB0_4
; %bb.3:
	bl	_RREG32
	b	LBB0_6
LBB0_4:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_11
; %bb.5:
	ldr	x8, [x20, #24]
	ldr	w0, [x8]
	bl	_le32_to_cpu
LBB0_6:
	mov	x23, x0
	ldp	w8, w9, [x20]
	add	w10, w9, #3
	cmp	w9, #0
	csel	w9, w10, w9, lt
	sub	w8, w8, w0
	add	w8, w8, w9, asr #2
	ldr	w9, [x20, #8]
	ands	w22, w8, w9
	b.eq	LBB0_10
; %bb.7:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #4
	bl	_kmalloc_array
	str	x0, [x21]
	cbz	x0, LBB0_11
; %bb.8:
	ldr	x8, [x20, #16]
	mov	x9, x22
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x8, w23, uxtw #2]
	add	w11, w23, #1
	str	w10, [x0], #4
	ldr	w10, [x20, #8]
	and	w23, w10, w11
	subs	x9, x9, #1
	b.ne	LBB0_9
LBB0_10:
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_12
LBB0_11:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w22, #0
LBB0_12:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
.subsections_via_symbols
