	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_ib_get                  ## -- Begin function radeon_ib_get
	.p2align	4, 0x90
_radeon_ib_get:                         ## @radeon_ib_get
	.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
	movq	%rcx, %r15
	movq	%rdx, %r13
	movl	%esi, %r12d
	movq	%rdi, %rbx
	leaq	4(%rdi), %rsi
	addq	$16, %rdx
	movl	%r8d, %ecx
	movl	$256, %r8d                      ## imm = 0x100
	movl	$1, %r9d
	callq	_radeon_sa_bo_new
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r14d
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_14
LBB0_2:
	leaq	56(%r13), %rsi
	movq	%rbx, %rdi
	callq	_radeon_semaphore_create
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_3
LBB0_14:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	%r12d, (%r13)
	movq	$0, 48(%r13)
	movq	16(%r13), %rdi
	callq	_radeon_sa_bo_cpu_addr
	movl	%eax, 40(%r13)
	movq	%r15, 32(%r13)
	movq	16(%r13), %rdi
	testq	%r15, %r15
	je	LBB0_5
## %bb.4:
	movq	_RADEON_VA_IB_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	(%rdi), %rax
	jmp	LBB0_6
LBB0_5:
	callq	_radeon_sa_bo_gpu_addr
LBB0_6:
	movq	%rax, 24(%r13)
	movl	$0, 4(%r13)
	movq	_RADEON_NUM_RINGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jle	LBB0_7
## %bb.8:
	leaq	-1(%rdx), %rcx
	movl	%edx, %eax
	andl	$3, %eax
	xorl	%r14d, %r14d
	cmpq	$3, %rcx
	jae	LBB0_10
## %bb.9:
	xorl	%ecx, %ecx
	jmp	LBB0_12
LBB0_7:
	xorl	%r14d, %r14d
	jmp	LBB0_14
LBB0_10:
	andl	$-4, %edx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rsi
	movq	$0, (%rsi,%rcx,8)
	movq	8(%r13), %rsi
	movq	$0, 8(%rsi,%rcx,8)
	movq	8(%r13), %rsi
	movq	$0, 16(%rsi,%rcx,8)
	movq	8(%r13), %rsi
	movq	$0, 24(%rsi,%rcx,8)
	addq	$4, %rcx
	cmpq	%rcx, %rdx
	jne	LBB0_11
LBB0_12:
	testq	%rax, %rax
	je	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rdx
	movq	$0, (%rdx,%rcx,8)
	incq	%rcx
	decq	%rax
	jne	LBB0_13
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to get a new IB (%d)\n"

	.comm	_RADEON_VA_IB_OFFSET,8,3        ## @RADEON_VA_IB_OFFSET
	.comm	_RADEON_NUM_RINGS,4,2           ## @RADEON_NUM_RINGS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_ib_get                  ; -- Begin function radeon_ib_get
	.p2align	2
_radeon_ib_get:                         ; @radeon_ib_get
	.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	x20, x3
	mov	x19, x2
	mov	x21, x1
	mov	x23, x0
	add	x1, x0, #4
	add	x2, x2, #16
	mov	x3, x4
	mov	w4, #256
	mov	w5, #1
	bl	_radeon_sa_bo_new
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
	ldr	w0, [x23]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	bl	_dev_err
	b	LBB0_10
LBB0_2:
	add	x1, x19, #56
	mov	x0, x23
	bl	_radeon_semaphore_create
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.3:
	str	w21, [x19]
	str	xzr, [x19, #48]
	ldr	x0, [x19, #16]
	bl	_radeon_sa_bo_cpu_addr
	str	w0, [x19, #40]
	str	x20, [x19, #32]
	ldr	x0, [x19, #16]
	cbz	x20, LBB0_5
; %bb.4:
	ldr	x8, [x0]
Lloh2:
	adrp	x9, _RADEON_VA_IB_OFFSET@GOTPAGE
Lloh3:
	ldr	x9, [x9, _RADEON_VA_IB_OFFSET@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x0, x9, x8
	b	LBB0_6
LBB0_5:
	bl	_radeon_sa_bo_gpu_addr
LBB0_6:
	str	x0, [x19, #24]
	str	wzr, [x19, #4]
Lloh5:
	adrp	x8, _RADEON_NUM_RINGS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RADEON_NUM_RINGS@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_9
; %bb.7:
	mov	x8, #0
	lsl	x9, x9, #3
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x19, #8]
	str	xzr, [x10, x8]
	add	x8, x8, #8
	cmp	x9, x8
	b.ne	LBB0_8
LBB0_9:
	mov	w22, #0
LBB0_10:
	mov	x0, x22
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to get a new IB (%d)\n"

	.comm	_RADEON_VA_IB_OFFSET,8,3        ; @RADEON_VA_IB_OFFSET
	.comm	_RADEON_NUM_RINGS,4,2           ; @RADEON_NUM_RINGS
.subsections_via_symbols
