	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function igt_fence_wait
_igt_fence_wait:                        ## @igt_fence_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	%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
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leal	3(%rbx), %eax
	testl	%ebx, %ebx
	cmovnsl	%ebx, %eax
	movq	%rdi, %r12
	sarl	$2, %eax
	movslq	%eax, %r14
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	callq	_mutex_lock
	movq	8(%r12), %rax
	movq	_RCS0@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_mock_request
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movq	%rax, %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	_dma_fence_wait_timeout
	movq	_ETIME@GOTPCREL(%rip), %r15
	addl	(%r15), %eax
	jne	LBB0_3
## %bb.4:
	movq	%r13, %rdi
	callq	_i915_request_add
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	%r13, %rdi
	callq	_dma_fence_is_signaled
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_14
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_16
LBB0_3:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	jmp	LBB0_16
LBB0_6:
	leal	7(%rbx), %eax
	testl	%ebx, %ebx
	cmovnsl	%ebx, %eax
	sarl	$3, %eax
	movslq	%eax, %rdx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_dma_fence_wait_timeout
	addl	(%r15), %eax
	jne	LBB0_7
## %bb.8:
	movq	%r13, %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	_dma_fence_wait_timeout
	testl	%eax, %eax
	jle	LBB0_9
## %bb.10:
	movq	%r13, %rdi
	callq	_dma_fence_is_signaled
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	_dma_fence_wait_timeout
	testl	%eax, %eax
	jg	LBB0_15
## %bb.13:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_14
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_14
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_14
LBB0_11:
	leaq	L_.str.4(%rip), %rdi
LBB0_14:
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	callq	_pr_err
LBB0_15:
	movq	%r12, %rdi
	callq	_mutex_lock
LBB0_16:
	movq	%r12, %rdi
	callq	_mock_device_flush
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HZ,4,2                         ## @HZ
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RCS0,8,3                       ## @RCS0
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ETIME,4,2                      ## @ETIME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fence wait success before submit (expected timeout)!\n"

L_.str.1:                               ## @.str.1
	.asciz	"fence signaled immediately!\n"

L_.str.2:                               ## @.str.2
	.asciz	"fence wait success after submit (expected timeout)!\n"

L_.str.3:                               ## @.str.3
	.asciz	"fence wait timed out (expected success)!\n"

L_.str.4:                               ## @.str.4
	.asciz	"fence unsignaled after waiting!\n"

L_.str.5:                               ## @.str.5
	.asciz	"fence wait timed out when complete (expected success)!\n"

	.no_dead_strip	_igt_fence_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function igt_fence_wait
_igt_fence_wait:                        ; @igt_fence_wait
	.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	x19, x0
Lloh0:
	adrp	x8, _HZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	add	w8, w23, #3
	cmp	w23, #0
	csel	w8, w8, w23, lt
	sbfx	x21, x8, #2, #30
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w20, [x8]
	bl	_mutex_lock
	ldr	x8, [x19, #8]
Lloh6:
	adrp	x9, _RCS0@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RCS0@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	ldr	w0, [x8]
	mov	x1, x21
	bl	_mock_request
	cbz	x0, LBB0_4
; %bb.1:
	mov	x22, x0
	neg	w20, w20
	mov	w1, #0
	mov	x2, x21
	bl	_dma_fence_wait_timeout
Lloh9:
	adrp	x24, _ETIME@GOTPAGE
Lloh10:
	ldr	x24, [x24, _ETIME@GOTPAGEOFF]
	ldr	w8, [x24]
	cmn	w0, w8
	b.ne	LBB0_5
; %bb.2:
	mov	x0, x22
	bl	_i915_request_add
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x22
	bl	_dma_fence_is_signaled
	cbz	x0, LBB0_6
; %bb.3:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_14
LBB0_4:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_16
LBB0_5:
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_16
LBB0_6:
	add	w8, w23, #7
	cmp	w23, #0
	csel	w8, w8, w23, lt
	sbfx	x2, x8, #3, #29
	mov	x0, x22
	mov	w1, #0
	bl	_dma_fence_wait_timeout
	ldr	w8, [x24]
	cmn	w0, w8
	b.ne	LBB0_11
; %bb.7:
	mov	x0, x22
	mov	w1, #0
	mov	x2, x21
	bl	_dma_fence_wait_timeout
	cmp	w0, #1
	b.lt	LBB0_12
; %bb.8:
	mov	x0, x22
	bl	_dma_fence_is_signaled
	cbz	x0, LBB0_13
; %bb.9:
	mov	x0, x22
	mov	w1, #0
	mov	x2, x21
	bl	_dma_fence_wait_timeout
	mov	w21, #0
	cmp	w0, #0
	b.gt	LBB0_15
; %bb.10:
Lloh18:
	adrp	x0, l_.str.5@PAGE
Lloh19:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_14
LBB0_11:
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_14
LBB0_12:
Lloh22:
	adrp	x0, l_.str.3@PAGE
Lloh23:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_14
LBB0_13:
Lloh24:
	adrp	x0, l_.str.4@PAGE
Lloh25:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_14:
	bl	_pr_err
	mov	x21, x20
LBB0_15:
	mov	x0, x19
	bl	_mutex_lock
	mov	x20, x21
LBB0_16:
	mov	x0, x19
	bl	_mock_device_flush
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_HZ,4,2                         ; @HZ
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RCS0,8,3                       ; @RCS0
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ETIME,4,2                      ; @ETIME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fence wait success before submit (expected timeout)!\n"

l_.str.1:                               ; @.str.1
	.asciz	"fence signaled immediately!\n"

l_.str.2:                               ; @.str.2
	.asciz	"fence wait success after submit (expected timeout)!\n"

l_.str.3:                               ; @.str.3
	.asciz	"fence wait timed out (expected success)!\n"

l_.str.4:                               ; @.str.4
	.asciz	"fence unsignaled after waiting!\n"

l_.str.5:                               ; @.str.5
	.asciz	"fence wait timed out when complete (expected success)!\n"

	.no_dead_strip	_igt_fence_wait
.subsections_via_symbols
