	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r600_ih_ring_alloc             ## -- Begin function r600_ih_ring_alloc
	.p2align	4, 0x90
_r600_ih_ring_alloc:                    ## @r600_ih_ring_alloc
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%ebx, %ebx
	cmpq	$0, (%rdi)
	jne	LBB0_10
## %bb.1:
	movq	%rdi, %r14
	movl	16(%rdi), %esi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_RADEON_GEM_DOMAIN_GTT@GOTPCREL(%rip), %r15
	movl	(%r15), %r8d
	movq	%rdi, 16(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rsp)
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	_radeon_bo_create
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
LBB0_9:
	movl	%ebx, %esi
	callq	_DRM_ERROR
	jmp	LBB0_10
LBB0_3:
	movq	(%r14), %rdi
	xorl	%esi, %esi
	callq	_radeon_bo_reserve
	movl	%eax, %ebx
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_4
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	(%r14), %rdi
	movl	(%r15), %esi
	leaq	12(%r14), %rdx
	callq	_radeon_bo_pin
	movq	(%r14), %rdi
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	callq	_radeon_bo_unreserve
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_9
LBB0_6:
	leaq	8(%r14), %rsi
	callq	_radeon_bo_kmap
	movl	%eax, %ebx
	movq	(%r14), %rdi
	callq	_radeon_bo_unreserve
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_9
LBB0_7:
	xorl	%ebx, %ebx
	jmp	LBB0_10
	.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	"radeon: failed to create ih ring buffer (%d).\n"

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

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

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r600_ih_ring_alloc             ; -- Begin function r600_ih_ring_alloc
	.p2align	2
_r600_ih_ring_alloc:                    ; @r600_ih_ring_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	ldr	x8, [x0]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_6
LBB0_2:
	mov	x19, x0
	ldr	w1, [x0, #16]
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x21, _RADEON_GEM_DOMAIN_GTT@GOTPAGE
Lloh4:
	ldr	x21, [x21, _RADEON_GEM_DOMAIN_GTT@GOTPAGEOFF]
	ldr	w4, [x21]
	str	x0, [sp]
	mov	w3, #1
	mov	w5, #0
	mov	x6, #0
	mov	x7, #0
	bl	_radeon_bo_create
	cbz	w0, LBB0_5
; %bb.3:
	mov	x20, x0
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
LBB0_4:
	mov	x1, x20
	bl	_DRM_ERROR
	b	LBB0_6
LBB0_5:
	ldr	x0, [x19]
	mov	w1, #0
	bl	_radeon_bo_reserve
	mov	x20, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbz	x0, LBB0_7
LBB0_6:
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
LBB0_7:
	ldr	x0, [x19]
	ldr	w1, [x21]
	add	x2, x19, #12
	bl	_radeon_bo_pin
	mov	x20, x0
	ldr	x0, [x19]
	cbz	w20, LBB0_9
; %bb.8:
	bl	_radeon_bo_unreserve
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_9:
	add	x1, x19, #8
	bl	_radeon_bo_kmap
	mov	x20, x0
	ldr	x0, [x19]
	bl	_radeon_bo_unreserve
	cbz	w20, LBB0_6
; %bb.10:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_4
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.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	"radeon: failed to create ih ring buffer (%d).\n"

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

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

.subsections_via_symbols
