	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lima_gem_wait                  ## -- Begin function lima_gem_wait
	.p2align	4, 0x90
_lima_gem_wait:                         ## @lima_gem_wait
	.cfi_startproc
## %bb.0:
	testl	%edx, %edx
	je	LBB0_1
## %bb.2:
	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
	movl	%edx, %ebx
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	_LIMA_GEM_WAIT_WRITE@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movl	%ecx, %edi
	callq	_drm_timeout_abs_to_jiffies
	movq	%rax, %r14
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	movq	%rax, %rcx
	callq	_drm_gem_dma_resv_wait
	movq	_ETIME@GOTPCREL(%rip), %rcx
	movq	%rax, %rdx
	addq	(%rcx), %rdx
	jne	LBB0_7
## %bb.3:
	testq	%r14, %r14
	jne	LBB0_4
## %bb.5:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_1:
	xorl	%eax, %eax
                                        ## kill: def $eax killed $eax killed $rax
	retq
LBB0_4:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
LBB0_6:
	xorl	%eax, %eax
	subq	(%rcx), %rax
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
                                        ## kill: def $eax killed $eax killed $rax
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LIMA_GEM_WAIT_WRITE,4,2        ## @LIMA_GEM_WAIT_WRITE
	.comm	_ETIME,8,3                      ## @ETIME
	.comm	_ETIMEDOUT,8,3                  ## @ETIMEDOUT
	.comm	_EBUSY,8,3                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lima_gem_wait                  ; -- Begin function lima_gem_wait
	.p2align	2
_lima_gem_wait:                         ; @lima_gem_wait
	.cfi_startproc
; %bb.0:
	cbz	w2, LBB0_4
; %bb.1:
	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, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _LIMA_GEM_WAIT_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LIMA_GEM_WAIT_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w22, w8, w2
	mov	x0, x3
	bl	_drm_timeout_abs_to_jiffies
	mov	x19, x0
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	mov	x3, x19
	bl	_drm_gem_dma_resv_wait
Lloh3:
	adrp	x8, _ETIME@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ETIME@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmn	x0, x8
	b.ne	LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh8:
	adrp	x9, _EBUSY@GOTPAGE
Lloh9:
	ldr	x9, [x9, _EBUSY@GOTPAGEOFF]
	cmp	x19, #0
	csel	x8, x9, x8, eq
	ldr	x8, [x8]
	neg	x0, x8
LBB0_3:
	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
                                        ; kill: def $w0 killed $w0 killed $x0
	ret
LBB0_4:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	.cfi_same_value w21
	.cfi_same_value w22
	mov	w0, #0
                                        ; kill: def $w0 killed $w0 killed $x0
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_LIMA_GEM_WAIT_WRITE,4,2        ; @LIMA_GEM_WAIT_WRITE
	.comm	_ETIME,8,3                      ; @ETIME
	.comm	_ETIMEDOUT,8,3                  ; @ETIMEDOUT
	.comm	_EBUSY,8,3                      ; @EBUSY
.subsections_via_symbols
