	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r200_copy_dma                  ## -- Begin function r200_copy_dma
	.p2align	4, 0x90
_r200_copy_dma:                         ## @r200_copy_dma
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movl	%edx, %r12d
	movl	%esi, %r13d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_RADEON_RING_TYPE_GFX_INDEX@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	shlq	$2, %r15
	addq	(%rdi), %r15
	movq	_RADEON_GPU_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movl	%ebx, %edi
	movl	$2097151, %esi                  ## imm = 0x1FFFFF
	callq	_DIV_ROUND_UP
	movl	%eax, %r14d
	leal	64(,%r14,4), %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_radeon_ring_lock
	testl	%eax, %eax
	je	LBB0_1
## %bb.7:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	movl	%eax, %ebx
	callq	_DRM_ERROR
	movl	%ebx, %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_1:
	movq	_RADEON_WAIT_UNTIL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_PACKET0
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movq	%r15, %rdi
	movl	$65536, %esi                    ## imm = 0x10000
	callq	_radeon_ring_write
	testl	%r14d, %r14d
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	jle	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	cmpl	$2097151, %ebx                  ## imm = 0x1FFFFF
	movl	$2097151, %r15d                 ## imm = 0x1FFFFF
	cmovll	%ebx, %r15d
	subl	%r15d, %ebx
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	$1824, %edi                     ## imm = 0x720
	movl	$2, %esi
	callq	_PACKET0
	movl	%r12d, %r14d
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_radeon_ring_write
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_radeon_ring_write
	movl	%r15d, %esi
	orl	$-1073741824, %esi              ## imm = 0xC0000000
	movq	%r12, %rdi
	movl	%r14d, %r12d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	callq	_radeon_ring_write
	addl	%r15d, %r13d
	addl	%r15d, %r12d
	decl	%r14d
	jne	LBB0_2
LBB0_3:
	movq	_RADEON_WAIT_UNTIL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_PACKET0
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movq	_RADEON_WAIT_DMA_GUI_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_radeon_ring_write
	movq	_RADEON_RING_TYPE_GFX_INDEX@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	-80(%rbp), %rsi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_radeon_fence_emit
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r14d
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_radeon_ring_unlock_undo
	movl	%r14d, %edi
	callq	_ERR_PTR
	jmp	LBB0_6
LBB0_5:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_radeon_ring_unlock_commit
	movq	-80(%rbp), %rax
LBB0_6:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ## @RADEON_RING_TYPE_GFX_INDEX
	.comm	_RADEON_GPU_PAGE_SHIFT,4,2      ## @RADEON_GPU_PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"radeon: moving bo (%d).\n"

	.comm	_RADEON_WAIT_UNTIL,4,2          ## @RADEON_WAIT_UNTIL
	.comm	_RADEON_WAIT_DMA_GUI_IDLE,4,2   ## @RADEON_WAIT_DMA_GUI_IDLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r200_copy_dma                  ; -- Begin function r200_copy_dma
	.p2align	2
_r200_copy_dma:                         ; @r200_copy_dma
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x26, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGE
Lloh1:
	ldr	x26, [x26, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGEOFF]
	ldr	x9, [x26]
	add	x20, x8, x9, lsl #2
Lloh2:
	adrp	x8, _RADEON_GPU_PAGE_SHIFT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RADEON_GPU_PAGE_SHIFT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	lsl	w23, w3, w8
	mov	x0, x23
	mov	w1, #2097151
	bl	_DIV_ROUND_UP
	mov	x24, x0
	lsl	w8, w0, #2
	add	w2, w8, #64
	mov	x0, x19
	mov	x1, x20
	bl	_radeon_ring_lock
	cbz	w0, LBB0_2
; %bb.1:
	mov	x25, x0
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x25
	bl	_DRM_ERROR
	mov	x0, x25
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_ERR_PTR
LBB0_2:
Lloh7:
	adrp	x25, _RADEON_WAIT_UNTIL@GOTPAGE
Lloh8:
	ldr	x25, [x25, _RADEON_WAIT_UNTIL@GOTPAGEOFF]
	ldr	w0, [x25]
	mov	w1, #0
	bl	_PACKET0
	mov	x1, x0
	mov	x0, x20
	bl	_radeon_ring_write
	mov	x0, x20
	mov	w1, #65536
	bl	_radeon_ring_write
	cmp	w24, #1
	b.lt	LBB0_5
; %bb.3:
	mov	w27, #2097151
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w23, w27
	csel	w28, w23, w27, lt
	sub	w23, w23, w28
	mov	w0, #1824
	mov	w1, #2
	bl	_PACKET0
	mov	x1, x0
	mov	x0, x20
	bl	_radeon_ring_write
	mov	x0, x20
	mov	x1, x22
	bl	_radeon_ring_write
	mov	x0, x20
	mov	x1, x21
	bl	_radeon_ring_write
	orr	w1, w28, #0xc0000000
	mov	x0, x20
	bl	_radeon_ring_write
	add	w22, w22, w28
	add	w21, w28, w21
	subs	w24, w24, #1
	b.ne	LBB0_4
LBB0_5:
	ldr	w0, [x25]
	mov	w1, #0
	bl	_PACKET0
	mov	x1, x0
	mov	x0, x20
	bl	_radeon_ring_write
Lloh9:
	adrp	x8, _RADEON_WAIT_DMA_GUI_IDLE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RADEON_WAIT_DMA_GUI_IDLE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_radeon_ring_write
	ldr	x2, [x26]
	add	x1, sp, #8
	mov	x0, x19
	bl	_radeon_fence_emit
	cbz	w0, LBB0_7
; %bb.6:
	mov	x21, x0
	mov	x0, x19
	mov	x1, x20
	bl	_radeon_ring_unlock_undo
	mov	x0, x21
	bl	_ERR_PTR
	b	LBB0_8
LBB0_7:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_radeon_ring_unlock_commit
	ldr	x0, [sp, #8]
LBB0_8:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ; @RADEON_RING_TYPE_GFX_INDEX
	.comm	_RADEON_GPU_PAGE_SHIFT,4,2      ; @RADEON_GPU_PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"radeon: moving bo (%d).\n"

	.comm	_RADEON_WAIT_UNTIL,4,2          ; @RADEON_WAIT_UNTIL
	.comm	_RADEON_WAIT_DMA_GUI_IDLE,4,2   ; @RADEON_WAIT_DMA_GUI_IDLE
.subsections_via_symbols
