	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cik_copy_cpdma                 ## -- Begin function cik_copy_cpdma
	.p2align	4, 0x90
_cik_copy_cpdma:                        ## @cik_copy_cpdma
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r12d
	movl	%edx, %r13d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movslq	(%rax), %r14
	shlq	$2, %r14
	addq	(%rdi), %r14
	leaq	-48(%rbp), %rdi
	callq	_radeon_sync_create
	movq	_RADEON_GPU_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r12d
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	movl	%r12d, %edi
	movl	$2097151, %esi                  ## imm = 0x1FFFFF
	callq	_DIV_ROUND_UP
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%rax,8), %edx
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	subl	%eax, %edx
	addl	$18, %edx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_radeon_ring_lock
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_DRM_ERROR
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_radeon_sync_free
	movl	%r12d, %edi
	callq	_ERR_PTR
	jmp	LBB0_10
LBB0_2:
	leaq	-48(%rbp), %r12
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	xorl	%ecx, %ecx
	callq	_radeon_sync_resv
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movl	(%r14), %edx
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_radeon_sync_rings
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	testl	%eax, %eax
	jle	LBB0_7
## %bb.3:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_PACKET3_DMA_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$5, %esi
	callq	_PACKET3
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_radeon_ring_write
	movl	%ebx, %edi
	callq	_lower_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movl	%ebx, %edi
	callq	_upper_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movl	%r13d, %edi
	callq	_lower_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movl	%r13d, %edi
	callq	_upper_32_bits
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_radeon_ring_write
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_radeon_ring_write
	addl	%r15d, %ebx
	addl	%r15d, %r13d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	decl	%eax
	je	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cmpl	$2097151, %eax                  ## imm = 0x1FFFFF
	movl	$2097151, %r15d                 ## imm = 0x1FFFFF
	cmovll	%eax, %r15d
	xorl	%r12d, %r12d
	subl	%r15d, %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_PACKET3_DMA_DATA_CP_SYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_6
LBB0_7:
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	(%r15), %edx
	leaq	-80(%rbp), %rsi
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_radeon_fence_emit
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %r14d
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_radeon_ring_unlock_undo
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_radeon_sync_free
	movl	%r14d, %edi
	callq	_ERR_PTR
	jmp	LBB0_10
LBB0_9:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_radeon_ring_unlock_commit
	movq	-80(%rbp), %rdx
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_radeon_sync_free
	movq	-80(%rbp), %rax
LBB0_10:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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	_PACKET3_DMA_DATA_CP_SYNC,4,2   ## @PACKET3_DMA_DATA_CP_SYNC
	.comm	_PACKET3_DMA_DATA,4,2           ## @PACKET3_DMA_DATA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cik_copy_cpdma                 ; -- Begin function cik_copy_cpdma
	.p2align	2
_cik_copy_cpdma:                        ; @cik_copy_cpdma
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x25, x4
	mov	x23, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldp	x9, x8, [x0]
	ldrsw	x8, [x8]
	add	x20, x9, x8, lsl #2
	add	x0, sp, #16
	bl	_radeon_sync_create
Lloh0:
	adrp	x8, _RADEON_GPU_PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RADEON_GPU_PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	lsl	w23, w23, w8
	mov	x0, x23
	mov	w1, #2097151
	bl	_DIV_ROUND_UP
	mov	x24, x0
	lsl	w8, w0, #3
	sub	w8, w8, w0
	add	w2, w8, #18
	mov	x0, x19
	mov	x1, x20
	bl	_radeon_ring_lock
	cbz	w0, LBB0_2
; %bb.1:
	mov	x26, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x26
	bl	_DRM_ERROR
	add	x1, sp, #16
	mov	x0, x19
	mov	x2, #0
	bl	_radeon_sync_free
	mov	x0, x26
	bl	_ERR_PTR
	b	LBB0_8
LBB0_2:
	add	x1, sp, #16
	mov	x0, x19
	mov	x2, x25
	mov	w3, #0
	bl	_radeon_sync_resv
	ldr	w2, [x20]
	add	x1, sp, #16
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	mov	x0, x19
	bl	_radeon_sync_rings
	cmp	w24, #1
	b.lt	LBB0_5
; %bb.3:
	mov	w27, #2097151
Lloh5:
	adrp	x28, _PACKET3_DMA_DATA_CP_SYNC@GOTPAGE
Lloh6:
	ldr	x28, [x28, _PACKET3_DMA_DATA_CP_SYNC@GOTPAGEOFF]
Lloh7:
	adrp	x19, _PACKET3_DMA_DATA@GOTPAGE
Lloh8:
	ldr	x19, [x19, _PACKET3_DMA_DATA@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w23, w27
	csel	w25, w23, w27, lt
	subs	w23, w23, w25
	ldr	w8, [x28]
	csel	w26, w8, wzr, eq
	ldr	w0, [x19]
	mov	w1, #5
	bl	_PACKET3
	mov	x1, x0
	mov	x0, x20
	bl	_radeon_ring_write
	mov	x0, x20
	mov	x1, x26
	bl	_radeon_ring_write
	mov	x0, x22
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_radeon_ring_write
	mov	x0, x22
	bl	_upper_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_radeon_ring_write
	mov	x0, x21
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_radeon_ring_write
	mov	x0, x21
	bl	_upper_32_bits
	mov	x1, x0
	mov	x0, x20
	bl	_radeon_ring_write
	mov	x0, x20
	mov	x1, x25
	bl	_radeon_ring_write
	add	w22, w25, w22
	add	w21, w25, w21
	subs	w24, w24, #1
	b.ne	LBB0_4
LBB0_5:
	ldr	w2, [x20]
	add	x1, sp, #24
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	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
	add	x1, sp, #16
	mov	x0, x19
	mov	x2, #0
	bl	_radeon_sync_free
	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	x2, [sp, #24]
	add	x1, sp, #16
	mov	x0, x19
	bl	_radeon_sync_free
	ldr	x0, [sp, #24]
LBB0_8:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.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	_PACKET3_DMA_DATA_CP_SYNC,4,2   ; @PACKET3_DMA_DATA_CP_SYNC
	.comm	_PACKET3_DMA_DATA,4,2           ; @PACKET3_DMA_DATA
.subsections_via_symbols
