	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ctx_wait_prev_fence     ## -- Begin function amdgpu_ctx_wait_prev_fence
	.p2align	4, 0x90
_amdgpu_ctx_wait_prev_fence:            ## @amdgpu_ctx_wait_prev_fence
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_to_amdgpu_ctx_entity
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_spin_lock
	movq	_amdgpu_sched_jobs@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	andl	(%rbx), %eax
	movq	8(%rbx), %rcx
	movl	(%rcx,%rax,4), %edi
	callq	_dma_fence_get
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_spin_unlock
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_dma_fence_wait
	movq	%rax, %r14
	testq	%rax, %rax
	jns	LBB0_5
## %bb.3:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	%r14, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	callq	_DRM_ERROR
LBB0_5:
	movq	%r15, %rdi
	callq	_dma_fence_put
	jmp	LBB0_6
LBB0_1:
	xorl	%r14d, %r14d
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_amdgpu_sched_jobs,4,2          ## @amdgpu_sched_jobs
	.comm	_ERESTARTSYS,8,3                ## @ERESTARTSYS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error (%ld) waiting for fence!\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ctx_wait_prev_fence     ; -- Begin function amdgpu_ctx_wait_prev_fence
	.p2align	2
_amdgpu_ctx_wait_prev_fence:            ; @amdgpu_ctx_wait_prev_fence
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	mov	x0, x1
	bl	_to_amdgpu_ctx_entity
	mov	x19, x0
	mov	x0, x20
	bl	_spin_lock
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _amdgpu_sched_jobs@GOTPAGE
Lloh1:
	ldr	x9, [x9, _amdgpu_sched_jobs@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sub	w9, w9, #1
	and	x8, x9, x8
	ldr	x9, [x19, #8]
	ldr	w0, [x9, x8, lsl #2]
	bl	_dma_fence_get
	mov	x19, x0
	mov	x0, x20
	bl	_spin_unlock
	cbz	x19, LBB0_5
; %bb.1:
	mov	x0, x19
	mov	w1, #1
	bl	_dma_fence_wait
	mov	x20, x0
	tbz	x0, #63, LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmn	x20, x8
	b.eq	LBB0_4
; %bb.3:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_DRM_ERROR
LBB0_4:
	mov	x0, x19
	bl	_dma_fence_put
	b	LBB0_6
LBB0_5:
	mov	w20, #0
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_amdgpu_sched_jobs,4,2          ; @amdgpu_sched_jobs
	.comm	_ERESTARTSYS,8,3                ; @ERESTARTSYS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error (%ld) waiting for fence!\n"

.subsections_via_symbols
