	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v3d_wait_bo_ioctl              ## -- Begin function v3d_wait_bo_ioctl
	.p2align	4, 0x90
_v3d_wait_bo_ioctl:                     ## @v3d_wait_bo_ioctl
	.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, %r12
	movq	%rsi, %rbx
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, %r15d
	movq	(%rbx), %rdi
	callq	_nsecs_to_jiffies_timeout
	cmpq	$0, 8(%rbx)
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_2:
	movl	16(%rbx), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	movq	%rax, %rcx
	callq	_drm_gem_dma_resv_wait
	movl	%eax, %r14d
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, %edi
	movl	%r15d, %esi
	callq	_ktime_sub
	movl	%eax, %edi
	callq	_ktime_to_ns
	movq	(%rbx), %rcx
	subq	%rax, %rcx
	cmovgq	%rcx, %r12
	movq	%r12, (%rbx)
	movq	_ETIME@GOTPCREL(%rip), %rax
	movl	%r14d, %ecx
	addl	(%rax), %ecx
	jne	LBB0_6
## %bb.3:
	testq	%r12, %r12
	je	LBB0_6
## %bb.4:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
LBB0_5:
	subl	(%rax), %r14d
LBB0_6:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ETIME,4,2                      ## @ETIME
	.comm	_EAGAIN,4,2                     ## @EAGAIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v3d_wait_bo_ioctl              ; -- Begin function v3d_wait_bo_ioctl
	.p2align	2
_v3d_wait_bo_ioctl:                     ; @v3d_wait_bo_ioctl
	.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
	bl	_ktime_get
	mov	x21, x0
	ldr	x0, [x19]
	bl	_nsecs_to_jiffies_timeout
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
	mov	x3, x0
	ldr	w1, [x19, #16]
	mov	x0, x20
	mov	w2, #1
	bl	_drm_gem_dma_resv_wait
	mov	x20, x0
	bl	_ktime_get
	mov	x1, x21
	bl	_ktime_sub
	bl	_ktime_to_ns
	ldr	x8, [x19]
	subs	x8, x8, x0
	csel	x8, x8, xzr, gt
	str	x8, [x19]
Lloh2:
	adrp	x9, _ETIME@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ETIME@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmn	w20, w9
	ccmp	x8, #0, #4, eq
	b.eq	LBB0_5
; %bb.3:
Lloh5:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_5:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ETIME,4,2                      ; @ETIME
	.comm	_EAGAIN,4,2                     ; @EAGAIN
.subsections_via_symbols
