	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_fence_driver_start_ring ## -- Begin function amdgpu_fence_driver_start_ring
	.p2align	4, 0x90
_amdgpu_fence_driver_start_ring:        ## @amdgpu_fence_driver_start_ring
	.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
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	64(%rdi), %rax
	movq	72(%rdi), %r15
	movq	(%rax), %rax
	movq	_AMDGPU_RING_TYPE_UVD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	16(%r15), %rax
	movl	(%rax), %edi
	movl	$8, %esi
	callq	_ALIGN
	movq	8(%r15), %rdx
	movq	8(%rbx), %rsi
	shlq	$4, %rsi
	cltq
	leaq	(,%rax,4), %rcx
	addq	8(%rdx,%rsi), %rcx
	addl	(%rdx,%rsi), %eax
	jmp	LBB0_3
LBB0_1:
	movq	(%rbx), %rax
	leaq	(,%rax,4), %rcx
	addq	32(%r15), %rcx
	shll	$2, %eax
	addl	24(%r15), %eax
LBB0_3:
	movq	%rcx, 32(%rbx)
	movl	%eax, 16(%rbx)
	leaq	48(%rbx), %rdi
	callq	_atomic_read
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_amdgpu_fence_write
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_amdgpu_irq_get
	movq	%r12, 40(%rbx)
	movl	%r14d, 20(%rbx)
	movl	$1, 24(%rbx)
	movl	(%r15), %edi
	movl	56(%rbx), %edx
	movl	16(%rbx), %ecx
	movq	32(%rbx), %r8
	leaq	L_.str(%rip), %rsi
	callq	_DRM_DEV_DEBUG
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_RING_TYPE_UVD,8,3       ## @AMDGPU_RING_TYPE_UVD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fence driver on ring %s use gpu addr 0x%016llx, cpu addr 0x%p\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_fence_driver_start_ring ; -- Begin function amdgpu_fence_driver_start_ring
	.p2align	2
_amdgpu_fence_driver_start_ring:        ; @amdgpu_fence_driver_start_ring
	.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	x20, x2
	mov	x22, x1
	mov	x19, x0
	ldp	x8, x21, [x0, #64]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _AMDGPU_RING_TYPE_UVD@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AMDGPU_RING_TYPE_UVD@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x21, #16]
	ldr	w0, [x8]
	mov	w1, #8
	bl	_ALIGN
	ldr	x8, [x21, #8]
	ldr	x9, [x19, #8]
	add	x9, x8, x9, lsl #4
	ldr	x8, [x9, #8]
	add	x8, x8, w0, sxtw #2
	ldr	w9, [x9]
	add	w9, w9, w0
	b	LBB0_3
LBB0_2:
	ldr	x8, [x21, #32]
	ldr	x9, [x19]
	add	x8, x8, x9, lsl #2
	ldr	w10, [x21, #24]
	add	w9, w10, w9, lsl #2
LBB0_3:
	str	x8, [x19, #32]
	str	w9, [x19, #16]
	add	x0, x19, #48
	bl	_atomic_read
	mov	x1, x0
	mov	x0, x19
	bl	_amdgpu_fence_write
	mov	x0, x21
	mov	x1, x22
	mov	x2, x20
	bl	_amdgpu_irq_get
	str	x22, [x19, #40]
	mov	w8, #1
	stp	w20, w8, [x19, #20]
	ldr	w0, [x21]
	ldr	w2, [x19, #56]
	ldr	w3, [x19, #16]
	ldr	x4, [x19, #32]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_DEBUG
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_RING_TYPE_UVD,8,3       ; @AMDGPU_RING_TYPE_UVD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fence driver on ring %s use gpu addr 0x%016llx, cpu addr 0x%p\n"

.subsections_via_symbols
