	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_v5_0_ring_preempt_ib
_sdma_v5_0_ring_preempt_ib:             ## @sdma_v5_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	32(%rdi), %r12
	movq	$0, -56(%rbp)
	leaq	-56(%rbp), %rsi
	callq	_amdgpu_sdma_get_index_from_ring
	cmpq	$0, -56(%rbp)
	jne	LBB0_1
## %bb.2:
	movq	_mmSDMA0_GFX_PREEMPT@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_mmSDMA1_GFX_PREEMPT@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %ebx
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_ring_set_preempt_cond_exec
	incq	(%r13)
	movq	%r13, %rdi
	movl	$10, %esi
	callq	_amdgpu_ring_alloc
	movl	24(%r13), %esi
	movq	(%r13), %rdx
	movq	%r13, %rdi
	xorl	%ecx, %ecx
	callq	_sdma_v5_0_ring_emit_fence
	movq	%r13, %rdi
	callq	_amdgpu_ring_commit
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	movl	$1, %esi
	callq	_WREG32
	movl	(%r12), %eax
	movl	$0, %ebx
	testl	%eax, %eax
	jle	LBB0_8
## %bb.4:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>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_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$1, %edi
	callq	_udelay
	incl	%ebx
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	jl	LBB0_5
LBB0_8:
	cmpl	%eax, %ebx
	jl	LBB0_10
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movl	8(%r13), %esi
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_10:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	xorl	%esi, %esi
	callq	_WREG32
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_amdgpu_ring_set_preempt_cond_exec
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	jge	LBB0_9
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_mmSDMA0_GFX_PREEMPT,4,2        ## @mmSDMA0_GFX_PREEMPT
	.comm	_mmSDMA1_GFX_PREEMPT,4,2        ## @mmSDMA1_GFX_PREEMPT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ring %d failed to be preempted\n"

	.no_dead_strip	_sdma_v5_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 sdma_v5_0_ring_preempt_ib
_sdma_v5_0_ring_preempt_ib:             ; @sdma_v5_0_ring_preempt_ib
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x0
	ldr	x21, [x0, #32]
	str	xzr, [sp, #8]
	add	x1, sp, #8
	bl	_amdgpu_sdma_get_index_from_ring
Lloh0:
	adrp	x8, _mmSDMA0_GFX_PREEMPT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mmSDMA0_GFX_PREEMPT@GOTPAGEOFF]
	ldr	x9, [sp, #8]
Lloh2:
	adrp	x10, _mmSDMA1_GFX_PREEMPT@GOTPAGE
Lloh3:
	ldr	x10, [x10, _mmSDMA1_GFX_PREEMPT@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x8, x10, eq
	ldr	w20, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_amdgpu_ring_set_preempt_cond_exec
	ldr	x8, [x19]
	add	x8, x8, #1
	str	x8, [x19]
	mov	x0, x19
	mov	w1, #10
	bl	_amdgpu_ring_alloc
	ldr	w1, [x19, #24]
	ldr	x2, [x19]
	mov	x0, x19
	mov	w3, #0
	bl	_sdma_v5_0_ring_emit_fence
	mov	x0, x19
	bl	_amdgpu_ring_commit
	mov	x0, x20
	mov	w1, #1
	bl	_WREG32
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	w22, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x23, [x19]
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	bl	_le32_to_cpu
	cmp	x23, x0
	b.eq	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #1
	bl	_udelay
	add	w22, w22, #1
	ldr	w8, [x21]
	cmp	w22, w8
	b.lt	LBB0_2
	b	LBB0_5
LBB0_4:
	mov	w22, #0
LBB0_5:
	cmp	w22, w8
	b.ge	LBB0_8
LBB0_6:
	mov	w21, #0
	b	LBB0_9
LBB0_7:
	ldr	w8, [x21]
	cmp	w22, w8
	b.lt	LBB0_6
LBB0_8:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	w1, [x19, #8]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_9:
	mov	x0, x20
	mov	w1, #0
	bl	_WREG32
	mov	x0, x19
	mov	w1, #1
	bl	_amdgpu_ring_set_preempt_cond_exec
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_mmSDMA0_GFX_PREEMPT,4,2        ; @mmSDMA0_GFX_PREEMPT
	.comm	_mmSDMA1_GFX_PREEMPT,4,2        ; @mmSDMA1_GFX_PREEMPT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ring %d failed to be preempted\n"

	.no_dead_strip	_sdma_v5_0_ring_preempt_ib
.subsections_via_symbols
