	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function test_ipc
_test_ipc:                              ## @test_ipc
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_alloc_fence
	movq	%rax, -64(%rbp)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_alloc_fence
	movq	%rax, -56(%rbp)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	leaq	-32(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_init_completion
	movq	$0, -40(%rbp)
	leaq	-48(%rbp), %r14
	movq	_task_ipc@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_INIT_WORK_ONSTACK
	movq	%r14, %rdi
	callq	_schedule_work
	movq	%rbx, %rdi
	callq	_wait_for_completion
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	movq	-40(%rbp), %rdi
	callq	_READ_ONCE
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_6:
	movq	-64(%rbp), %rdi
	callq	_i915_sw_fence_commit
	movq	-56(%rbp), %rdi
	callq	_i915_sw_fence_wait
	movq	-40(%rbp), %rdi
	callq	_READ_ONCE
	testq	%rax, %rax
	jne	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_8:
	movq	%r14, %rdi
	callq	_flush_work
	movq	%r14, %rdi
	callq	_destroy_work_on_stack
	movq	-56(%rbp), %rdi
	callq	_free_fence
	movq	-64(%rbp), %rbx
	jmp	LBB0_9
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_10
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_9:
	movq	%rbx, %rdi
	callq	_free_fence
LBB0_10:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_task_ipc,4,2                   ## @task_ipc
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"worker updated value before i915_sw_fence was signaled\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"worker signaled i915_sw_fence before value was posted\n"

	.no_dead_strip	_test_ipc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function test_ipc
_test_ipc:                              ; @test_ipc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	bl	_alloc_fence
	str	x0, [sp, #8]
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	bl	_alloc_fence
	str	x0, [sp, #16]
	cbz	x0, LBB0_5
; %bb.2:
	add	x19, sp, #8
	add	x20, x19, #32
	mov	x0, x20
	bl	_init_completion
	str	xzr, [sp, #32]
	add	x19, x19, #16
Lloh0:
	adrp	x8, _task_ipc@GOTPAGE
Lloh1:
	ldr	x8, [x8, _task_ipc@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_INIT_WORK_ONSTACK
	mov	x0, x19
	bl	_schedule_work
	mov	x0, x20
	bl	_wait_for_completion
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
	ldr	x0, [sp, #32]
	bl	_READ_ONCE
Lloh3:
	adrp	x21, _EINVAL@GOTPAGE
Lloh4:
	ldr	x21, [x21, _EINVAL@GOTPAGEOFF]
	cbz	x0, LBB0_6
; %bb.3:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	ldr	w8, [x21]
	neg	w20, w8
	b	LBB0_7
LBB0_4:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_5:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_10
LBB0_6:
	mov	w20, #0
LBB0_7:
	ldr	x0, [sp, #8]
	bl	_i915_sw_fence_commit
	ldr	x0, [sp, #16]
	bl	_i915_sw_fence_wait
	ldr	x0, [sp, #32]
	bl	_READ_ONCE
	cbnz	x0, LBB0_9
; %bb.8:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	ldr	w8, [x21]
	neg	w20, w8
LBB0_9:
	mov	x0, x19
	bl	_flush_work
	mov	x0, x19
	bl	_destroy_work_on_stack
	ldr	x0, [sp, #16]
	bl	_free_fence
	ldr	x19, [sp, #8]
LBB0_10:
	mov	x0, x19
	bl	_free_fence
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_task_ipc,4,2                   ; @task_ipc
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"worker updated value before i915_sw_fence was signaled\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"worker signaled i915_sw_fence before value was posted\n"

	.no_dead_strip	_test_ipc
.subsections_via_symbols
