	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_msm_wait_fence                 ## -- Begin function msm_wait_fence
	.p2align	4, 0x90
_msm_wait_fence:                        ## @msm_wait_fence
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rcx
	cmpq	%rsi, %rcx
	jge	LBB0_3
## %bb.1:
	movl	16(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rdx
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_3:
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.5:
	movq	%rdx, %rdi
	callq	_timeout_to_jiffies
	movq	%rax, %r12
	movl	12(%rbx), %r13d
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_fence_completed
	movl	%r13d, %edi
	movq	%rax, %rsi
	movq	%r12, %rdx
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.6:
	callq	_wait_event_interruptible_timeout
	jmp	LBB0_8
LBB0_4:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_fence_completed
	movq	%rax, %rcx
	movq	_EBUSY@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	subl	(%rdx), %eax
	xorl	%edx, %edx
	testq	%rcx, %rcx
	cmovnel	%edx, %eax
	jmp	LBB0_11
LBB0_7:
	callq	_wait_event_timeout
LBB0_8:
	movl	%eax, %ecx
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	movl	(%rdx), %edx
	addl	%ecx, %edx
	cmovel	%ecx, %eax
	jmp	LBB0_11
LBB0_9:
	movl	8(%rbx), %edx
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	callq	_DBG
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: waiting on invalid fence: %u (of %u)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.1:                               ## @.str.1
	.asciz	"timeout waiting for fence: %u (completed: %u)"

	.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	_msm_wait_fence                 ; -- Begin function msm_wait_fence
	.p2align	2
_msm_wait_fence:                        ; @msm_wait_fence
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x3
	mov	x19, x1
	mov	x20, x0
	ldr	x3, [x0]
	cmp	x3, x1
	b.ge	LBB0_2
; %bb.1:
	ldr	w1, [x20, #16]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x19
	bl	_DRM_ERROR
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_2:
	cbz	x2, LBB0_6
; %bb.3:
	mov	x0, x2
	bl	_timeout_to_jiffies
	mov	x22, x0
	ldr	w23, [x20, #12]
	mov	x0, x20
	mov	x1, x19
	bl	_fence_completed
	mov	x1, x0
	mov	x0, x23
	mov	x2, x22
	cbz	w21, LBB0_7
; %bb.4:
	bl	_wait_event_interruptible_timeout
	cbz	w0, LBB0_8
LBB0_5:
Lloh4:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmn	w0, w8
	csel	w0, w0, wzr, eq
	b	LBB0_10
LBB0_6:
	mov	x0, x20
	mov	x1, x19
	bl	_fence_completed
Lloh7:
	adrp	x8, _EBUSY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	x0, #0
	csneg	w0, wzr, w8, ne
	b	LBB0_10
LBB0_7:
	bl	_wait_event_timeout
	cbnz	w0, LBB0_5
LBB0_8:
	ldr	w2, [x20, #8]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_DBG
Lloh12:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: waiting on invalid fence: %u (of %u)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.1:                               ; @.str.1
	.asciz	"timeout waiting for fence: %u (completed: %u)"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
.subsections_via_symbols
