	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_v10_0_ring_preempt_ib
_gfx_v10_0_ring_preempt_ib:             ## @gfx_v10_0_ring_preempt_ib
	.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	32(%rdi), %r12
	movq	8(%r12), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.4:
	movq	%rdi, %r13
	leaq	16(%r12), %r15
	movl	8(%rax), %esi
	movq	%r15, %rdi
	callq	_amdgpu_ring_alloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_14:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_ring_set_preempt_cond_exec
	movq	8(%r12), %rax
	movq	(%rax), %rax
	movq	_PREEMPT_QUEUES_NO_UNMAP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	24(%r13), %ecx
	movq	(%r13), %r8
	incq	%r8
	movq	%r8, (%r13)
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	*%rax
	movq	%r15, %rdi
	callq	_amdgpu_ring_commit
	movl	(%r12), %eax
	movl	$0, %ebx
	testl	%eax, %eax
	jle	LBB0_11
## %bb.7:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %r15
	movq	16(%r13), %rax
	movl	(%rax), %edi
	callq	_le32_to_cpu
	cmpq	%rax, %r15
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	$1, %edi
	callq	_udelay
	incl	%ebx
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	jl	LBB0_8
	jmp	LBB0_11
LBB0_9:
	movl	(%r12), %eax
LBB0_11:
	cmpl	%eax, %ebx
	jl	LBB0_13
## %bb.12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movl	8(%r13), %esi
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_13:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_amdgpu_ring_set_preempt_cond_exec
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PREEMPT_QUEUES_NO_UNMAP,4,2    ## @PREEMPT_QUEUES_NO_UNMAP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ring %d failed to preempt ib\n"

	.no_dead_strip	_gfx_v10_0_ring_preempt_ib
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_v10_0_ring_preempt_ib
_gfx_v10_0_ring_preempt_ib:             ; @gfx_v10_0_ring_preempt_ib
	.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
	ldr	x21, [x0, #32]
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	x9, [x8]
	cbz	x9, LBB0_4
; %bb.2:
	mov	x19, x0
	add	x20, x21, #16
	ldr	w1, [x8, #8]
	mov	x0, x20
	bl	_amdgpu_ring_alloc
	cbz	x0, LBB0_7
; %bb.3:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_6:
	mov	x0, x20
	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
LBB0_7:
	mov	x0, x19
	mov	w1, #0
	bl	_amdgpu_ring_set_preempt_cond_exec
	ldr	x8, [x21, #8]
Lloh4:
	adrp	x9, _PREEMPT_QUEUES_NO_UNMAP@GOTPAGE
Lloh5:
	ldr	x9, [x9, _PREEMPT_QUEUES_NO_UNMAP@GOTPAGEOFF]
	ldr	x8, [x8]
Lloh6:
	ldr	w2, [x9]
	ldr	w3, [x19, #24]
	ldr	x9, [x19]
	add	x4, x9, #1
	str	x4, [x19]
	mov	x0, x20
	mov	x1, x19
	blr	x8
	mov	x0, x20
	bl	_amdgpu_ring_commit
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.8:
	mov	w20, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x22, [x19]
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	bl	_le32_to_cpu
	cmp	x22, x0
	b.eq	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	w0, #1
	bl	_udelay
	add	w20, w20, #1
	ldr	w8, [x21]
	cmp	w20, w8
	b.lt	LBB0_9
	b	LBB0_12
LBB0_11:
	mov	w20, #0
LBB0_12:
	cmp	w20, w8
	b.ge	LBB0_15
LBB0_13:
	mov	w20, #0
	b	LBB0_16
LBB0_14:
	ldr	w8, [x21]
	cmp	w20, w8
	b.lt	LBB0_13
LBB0_15:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w20, w8
	ldr	w1, [x19, #8]
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_16:
	mov	x0, x19
	mov	w1, #1
	bl	_amdgpu_ring_set_preempt_cond_exec
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PREEMPT_QUEUES_NO_UNMAP,4,2    ; @PREEMPT_QUEUES_NO_UNMAP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ring %d failed to preempt ib\n"

	.no_dead_strip	_gfx_v10_0_ring_preempt_ib
.subsections_via_symbols
