	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_ring_init               ## -- Begin function radeon_ring_init
	.p2align	4, 0x90
_radeon_ring_init:                      ## @radeon_ring_init
	.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
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	32(%rbp), %eax
	movl	24(%rbp), %esi
	movl	16(%rbp), %edi
	movl	%edx, (%rbx)
	movl	%ecx, 4(%rbx)
	movl	%r8d, 8(%rbx)
	movl	%r9d, 12(%rbx)
	movl	%edi, 16(%rbx)
	movl	%esi, 20(%rbx)
	movl	%eax, 24(%rbx)
	cmpq	$0, 56(%rbx)
	je	LBB0_1
LBB0_8:
	shrl	$2, %edx
	leal	-1(%rdx), %eax
	movl	%eax, 28(%rbx)
	movl	%edx, 32(%rbx)
	cmpq	$0, 16(%r14)
	je	LBB0_10
## %bb.9:
	movq	_RADEON_WB_RING0_NEXT_RPTR@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movslq	36(%rbx), %rcx
	leaq	(%rax,%rcx,4), %rax
	movq	%rax, %rcx
	addq	8(%r14), %rcx
	movq	%rcx, 48(%rbx)
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	movslq	%ecx, %rax
	shlq	$2, %rax
	addq	(%r14), %rax
	movq	%rax, 40(%rbx)
LBB0_10:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_radeon_debugfs_ring_init
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.3(%rip), %rdi
	callq	_DRM_ERROR
LBB0_12:
	movq	%rbx, %rdi
	callq	_radeon_ring_lockup_update
	xorl	%r15d, %r15d
	jmp	LBB0_15
LBB0_1:
	leaq	56(%rbx), %r13
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_RADEON_GEM_DOMAIN_GTT@GOTPCREL(%rip), %r12
	movl	(%r12), %r8d
	movq	%r13, (%rsp)
	movq	%r14, %rdi
	movl	%edx, %esi
	movl	%eax, %edx
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	_radeon_bo_create
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %r15d
	movl	24(%r14), %edi
	leaq	L_.str(%rip), %rsi
LBB0_14:
	movl	%r15d, %edx
	callq	_dev_err
	jmp	LBB0_15
LBB0_3:
	movq	(%r13), %rdi
	xorl	%esi, %esi
	callq	_radeon_bo_reserve
	movl	%eax, %r15d
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_4
LBB0_15:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	56(%rbx), %rdi
	movl	(%r12), %esi
	leaq	68(%rbx), %rdx
	callq	_radeon_bo_pin
	movq	56(%rbx), %rdi
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r15d
	callq	_radeon_bo_unreserve
	movl	24(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_14
LBB0_6:
	leaq	64(%rbx), %rsi
	callq	_radeon_bo_kmap
	movl	%eax, %r15d
	movq	56(%rbx), %rdi
	callq	_radeon_bo_unreserve
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.13:
	movl	24(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_14
LBB0_7:
	movl	(%rbx), %edx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_RADEON_GEM_DOMAIN_GTT,4,2      ## @RADEON_GEM_DOMAIN_GTT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%d) ring create failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"(%d) ring pin failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"(%d) ring map failed\n"

	.comm	_RADEON_WB_RING0_NEXT_RPTR,4,2  ## @RADEON_WB_RING0_NEXT_RPTR
L_.str.3:                               ## @.str.3
	.asciz	"Failed to register debugfs file for rings !\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_ring_init               ; -- Begin function radeon_ring_init
	.p2align	2
_radeon_ring_init:                      ; @radeon_ring_init
	.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	x19, x1
	mov	x20, x0
	ldr	w8, [x29, #16]
	stp	w2, w3, [x1]
	stp	w4, w5, [x1, #8]
	stp	w6, w7, [x1, #16]
	str	w8, [x1, #24]
	mov	x22, x1
	ldr	x8, [x22, #56]!
	cbz	x8, LBB0_6
LBB0_1:
	lsr	w8, w2, #2
	sub	w9, w8, #1
	stp	w9, w8, [x19, #28]
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _RADEON_WB_RING0_NEXT_RPTR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RADEON_WB_RING0_NEXT_RPTR@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	ldrsw	x9, [x19, #36]
	add	x8, x8, x9, lsl #2
	ldp	x10, x9, [x20]
	add	x9, x9, x8
	add	w11, w8, #3
	cmp	w8, #0
	csel	w8, w11, w8, lt
	asr	w8, w8, #2
	add	x8, x10, w8, sxtw #2
	stp	x8, x9, [x19, #40]
LBB0_3:
	mov	x0, x20
	mov	x1, x19
	bl	_radeon_debugfs_ring_init
	cbz	x0, LBB0_5
; %bb.4:
Lloh3:
	adrp	x0, l_.str.3@PAGE
Lloh4:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
LBB0_5:
	mov	x0, x19
	bl	_radeon_ring_lockup_update
	mov	w21, #0
	b	LBB0_10
LBB0_6:
Lloh5:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x23, _RADEON_GEM_DOMAIN_GTT@GOTPAGE
Lloh9:
	ldr	x23, [x23, _RADEON_GEM_DOMAIN_GTT@GOTPAGEOFF]
	ldr	w4, [x23]
	mov	x0, x20
	mov	x1, x2
	mov	x2, x8
	mov	w3, #1
	mov	x5, #0
	mov	x6, x22
	bl	_radeon_bo_create
	cbz	w0, LBB0_9
; %bb.7:
	mov	x21, x0
	ldr	w0, [x20, #24]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
LBB0_8:
	mov	x2, x21
	bl	_dev_err
	b	LBB0_10
LBB0_9:
	ldr	x0, [x22]
	mov	w1, #0
	bl	_radeon_bo_reserve
	mov	x21, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbz	x0, LBB0_11
LBB0_10:
	mov	x0, x21
	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
LBB0_11:
	ldr	x0, [x19, #56]
	ldr	w1, [x23]
	add	x2, x19, #68
	bl	_radeon_bo_pin
	mov	x21, x0
	ldr	x0, [x19, #56]
	cbz	w21, LBB0_13
; %bb.12:
	bl	_radeon_bo_unreserve
	ldr	w0, [x20, #24]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_13:
	add	x1, x19, #64
	bl	_radeon_bo_kmap
	mov	x21, x0
	ldr	x0, [x19, #56]
	bl	_radeon_bo_unreserve
	cbz	w21, LBB0_15
; %bb.14:
	ldr	w0, [x20, #24]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_15:
	ldr	w2, [x19]
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_RADEON_GEM_DOMAIN_GTT,4,2      ; @RADEON_GEM_DOMAIN_GTT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%d) ring create failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"(%d) ring pin failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"(%d) ring map failed\n"

	.comm	_RADEON_WB_RING0_NEXT_RPTR,4,2  ; @RADEON_WB_RING0_NEXT_RPTR
l_.str.3:                               ; @.str.3
	.asciz	"Failed to register debugfs file for rings !\n"

.subsections_via_symbols
