	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_etnaviv_gpu_wait_fence_interruptible ## -- Begin function etnaviv_gpu_wait_fence_interruptible
	.p2align	4, 0x90
_etnaviv_gpu_wait_fence_interruptible:  ## @etnaviv_gpu_wait_fence_interruptible
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %r14d
	movq	%rdi, %rbx
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_rcu_read_lock
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_idr_find
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rdi
	callq	_dma_fence_get_rcu
	movq	%rax, %r14
	xorl	%eax, %eax
	callq	_rcu_read_unlock
	testq	%r14, %r14
	je	LBB0_9
## %bb.3:
	testq	%r15, %r15
	je	LBB0_4
## %bb.5:
	movq	%r15, %rdi
	callq	_etnaviv_timeout_to_jiffies
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rax, %rdx
	callq	_dma_fence_wait_timeout
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rcx
	xorl	%r12d, %r12d
	movl	(%rcx), %ecx
	addl	%eax, %ecx
	cmovel	%eax, %r12d
	jmp	LBB0_8
LBB0_1:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_rcu_read_unlock
	jmp	LBB0_9
LBB0_4:
	movq	%r14, %rdi
	callq	_dma_fence_is_signaled
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%r12d, %r12d
	subl	(%rcx), %r12d
	xorl	%ecx, %ecx
	testq	%rax, %rax
	cmovnel	%ecx, %r12d
	jmp	LBB0_8
LBB0_6:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_8:
	movq	%r14, %rdi
	callq	_dma_fence_put
LBB0_9:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_etnaviv_gpu_wait_fence_interruptible ; -- Begin function etnaviv_gpu_wait_fence_interruptible
	.p2align	2
_etnaviv_gpu_wait_fence_interruptible:  ; @etnaviv_gpu_wait_fence_interruptible
	.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
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	bl	_rcu_read_lock
	mov	x0, x21
	mov	x1, x19
	bl	_idr_find
	cbz	x0, LBB0_5
; %bb.1:
	bl	_dma_fence_get_rcu
	mov	x19, x0
	bl	_rcu_read_unlock
	cbz	x19, LBB0_6
; %bb.2:
	cbz	x20, LBB0_7
; %bb.3:
	mov	x0, x20
	bl	_etnaviv_timeout_to_jiffies
	mov	x2, x0
	mov	x0, x19
	mov	w1, #1
	bl	_dma_fence_wait_timeout
	cbz	w0, LBB0_8
; %bb.4:
Lloh0:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmn	w0, w8
	csel	w20, w0, wzr, eq
	b	LBB0_9
LBB0_5:
	bl	_rcu_read_unlock
LBB0_6:
	mov	w20, #0
	b	LBB0_10
LBB0_7:
	mov	x0, x19
	bl	_dma_fence_is_signaled
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	x0, #0
	csneg	w20, wzr, w8, ne
	b	LBB0_9
LBB0_8:
Lloh6:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	mov	x0, x19
	bl	_dma_fence_put
LBB0_10:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
.subsections_via_symbols
