	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drm_syncobj_fence_add_wait
_drm_syncobj_fence_add_wait:            ## @drm_syncobj_fence_add_wait
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpq	$0, (%rsi)
	jne	LBB0_9
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_spin_lock
	movl	8(%r14), %edi
	movl	$1, %esi
	callq	_rcu_dereference_protected
	movl	%eax, %edi
	callq	_dma_fence_get
	movq	%rax, -24(%rbp)
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movl	12(%rbx), %esi
	leaq	-24(%rbp), %rdi
	callq	_dma_fence_chain_find_seqno
	movq	-24(%rbp), %rdi
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.7:
	movq	%rdi, (%rbx)
	jmp	LBB0_8
LBB0_2:
	xorl	%edi, %edi
LBB0_4:
	callq	_dma_fence_put
	addq	$8, %rbx
	leaq	4(%r14), %rsi
	movq	%rbx, %rdi
	callq	_list_add_tail
LBB0_8:
	movq	%r14, %rdi
	callq	_spin_unlock
LBB0_9:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	xorl	%eax, %eax
	callq	_dma_fence_get_stub
	movq	%rax, (%rbx)
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_drm_syncobj_fence_add_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drm_syncobj_fence_add_wait
_drm_syncobj_fence_add_wait:            ; @drm_syncobj_fence_add_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	ldr	x8, [x1]
	cbnz	x8, LBB0_8
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	bl	_spin_lock
	ldr	w0, [x19, #8]
	mov	w1, #1
	bl	_rcu_dereference_protected
	bl	_dma_fence_get
	str	x0, [sp, #8]
	cbz	x0, LBB0_3
; %bb.2:
	ldr	w1, [x20, #12]
	add	x0, sp, #8
	bl	_dma_fence_chain_find_seqno
	mov	x8, x0
	ldr	x0, [sp, #8]
	cbz	x8, LBB0_4
LBB0_3:
	bl	_dma_fence_put
	add	x0, x20, #8
	add	x1, x19, #4
	bl	_list_add_tail
	b	LBB0_7
LBB0_4:
	cbnz	x0, LBB0_6
; %bb.5:
	bl	_dma_fence_get_stub
LBB0_6:
	str	x0, [x20]
LBB0_7:
	mov	x0, x19
	bl	_spin_unlock
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_drm_syncobj_fence_add_wait
.subsections_via_symbols
