	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function panfrost_ioctl_wait_bo
_panfrost_ioctl_wait_bo:                ## @panfrost_ioctl_wait_bo
	.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	%rdx, %r14
	movq	%rsi, %rbx
	movl	16(%rsi), %edi
	callq	_drm_timeout_abs_to_jiffies
	cmpq	$0, 8(%rbx)
	je	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_3:
	movq	%rax, %r15
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r14
	movl	(%rax), %edi
	movl	$1, %esi
	movl	$1, %edx
	movq	%r15, %rcx
	callq	_dma_resv_wait_timeout_rcu
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_10
## %bb.6:
	testq	%r15, %r15
	jne	LBB0_7
## %bb.8:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_4:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_7:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
LBB0_9:
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
LBB0_10:
	movq	%r14, %rdi
	callq	_drm_gem_object_put_unlocked
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_ETIMEDOUT,8,3                  ## @ETIMEDOUT
	.comm	_EBUSY,8,3                      ## @EBUSY
	.no_dead_strip	_panfrost_ioctl_wait_bo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function panfrost_ioctl_wait_bo
_panfrost_ioctl_wait_bo:                ; @panfrost_ioctl_wait_bo
	.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	x21, x1
	ldr	w0, [x1, #16]
	bl	_drm_timeout_abs_to_jiffies
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_7
LBB0_3:
	mov	x19, x0
	ldr	w1, [x21]
	mov	x0, x20
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_8
; %bb.4:
	mov	x20, x0
	ldr	w0, [x0]
	mov	w1, #1
	mov	w2, #1
	mov	x3, x19
	bl	_dma_resv_wait_timeout_rcu
	mov	x21, x0
	cbnz	x0, LBB0_6
; %bb.5:
Lloh2:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh4:
	adrp	x9, _EBUSY@GOTPAGE
Lloh5:
	ldr	x9, [x9, _EBUSY@GOTPAGEOFF]
	cmp	x19, #0
	csel	x8, x9, x8, eq
	ldr	x8, [x8]
	neg	x21, x8
LBB0_6:
	mov	x0, x20
	bl	_drm_gem_object_put_unlocked
LBB0_7:
	mov	x0, x21
	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_8:
Lloh6:
	adrp	x8, _ENOENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_ETIMEDOUT,8,3                  ; @ETIMEDOUT
	.comm	_EBUSY,8,3                      ; @EBUSY
	.no_dead_strip	_panfrost_ioctl_wait_bo
.subsections_via_symbols
