	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function test_wait
_test_wait:                             ## @test_wait
	.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	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	xorl	%eax, %eax
	callq	_mock_fence
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	xorl	%r14d, %r14d
	movq	%rax, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_dma_fence_wait_timeout
	movq	_ETIME@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_3
## %bb.4:
	movq	%rbx, %rdi
	callq	_dma_fence_signal
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_dma_fence_wait_timeout
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_6
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_8
LBB0_3:
	leaq	L_.str(%rip), %rdi
LBB0_6:
	callq	_pr_err
	movl	%r15d, %r14d
LBB0_7:
	movq	%rbx, %rdi
	callq	_dma_fence_signal
	movq	%rbx, %rdi
	callq	_dma_fence_put
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ETIME,4,2                      ## @ETIME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Wait reported complete before being signaled\n"

L_.str.1:                               ## @.str.1
	.asciz	"Wait reported incomplete after being signaled\n"

	.no_dead_strip	_test_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function test_wait
_test_wait:                             ; @test_wait
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	bl	_mock_fence
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	mov	w1, #0
	mov	w2, #0
	bl	_dma_fence_wait_timeout
Lloh3:
	adrp	x8, _ETIME@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ETIME@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_5
; %bb.2:
	mov	x0, x19
	bl	_dma_fence_signal
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	bl	_dma_fence_wait_timeout
	cbz	w0, LBB0_7
; %bb.3:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_4:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_9
LBB0_5:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
LBB0_6:
	neg	w20, w20
	bl	_pr_err
	b	LBB0_8
LBB0_7:
	mov	w20, #0
LBB0_8:
	mov	x0, x19
	bl	_dma_fence_signal
	mov	x0, x19
	bl	_dma_fence_put
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ETIME,4,2                      ; @ETIME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Wait reported complete before being signaled\n"

l_.str.1:                               ; @.str.1
	.asciz	"Wait reported incomplete after being signaled\n"

	.no_dead_strip	_test_wait
.subsections_via_symbols
