	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wined3d_cs_wait_event
_wined3d_cs_wait_event:                 ## @wined3d_cs_wait_event
	.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	%rdi, %rbx
	leaq	4(%rdi), %r14
	movq	_TRUE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_InterlockedExchange
	movq	_WINED3D_CS_QUEUE_DEFAULT@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	shlq	$2, %rsi
	addq	8(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_wined3d_cs_queue_is_empty
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_WINED3D_CS_QUEUE_MAP@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	shlq	$2, %rsi
	addq	8(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_wined3d_cs_queue_is_empty
	testq	%rax, %rax
	jne	LBB0_4
LBB0_2:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_InterlockedCompareExchange
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	(%rbx), %edi
	movq	_INFINITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_WaitForSingleObject            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_WINED3D_CS_QUEUE_DEFAULT,8,3   ## @WINED3D_CS_QUEUE_DEFAULT
	.comm	_WINED3D_CS_QUEUE_MAP,8,3       ## @WINED3D_CS_QUEUE_MAP
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_INFINITE,4,2                   ## @INFINITE
	.no_dead_strip	_wined3d_cs_wait_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wined3d_cs_wait_event
_wined3d_cs_wait_event:                 ; @wined3d_cs_wait_event
	.cfi_startproc
; %bb.0:
	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	x19, x0
	add	x20, x0, #4
Lloh0:
	adrp	x21, _TRUE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _TRUE@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_InterlockedExchange
	ldr	x8, [x19, #8]
Lloh2:
	adrp	x9, _WINED3D_CS_QUEUE_DEFAULT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _WINED3D_CS_QUEUE_DEFAULT@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x1, x8, x9, lsl #2
	mov	x0, x19
	bl	_wined3d_cs_queue_is_empty
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x19, #8]
Lloh5:
	adrp	x9, _WINED3D_CS_QUEUE_MAP@GOTPAGE
Lloh6:
	ldr	x9, [x9, _WINED3D_CS_QUEUE_MAP@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	add	x1, x8, x9, lsl #2
	mov	x0, x19
	bl	_wined3d_cs_queue_is_empty
	cbnz	x0, LBB0_4
LBB0_2:
Lloh8:
	adrp	x8, _FALSE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	ldr	w2, [x21]
	mov	x0, x20
	bl	_InterlockedCompareExchange
	cbz	x0, LBB0_4
; %bb.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
	ret
LBB0_4:
	ldr	w0, [x19]
Lloh11:
	adrp	x8, _INFINITE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _INFINITE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	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
	b	_WaitForSingleObject
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_WINED3D_CS_QUEUE_DEFAULT,8,3   ; @WINED3D_CS_QUEUE_DEFAULT
	.comm	_WINED3D_CS_QUEUE_MAP,8,3       ; @WINED3D_CS_QUEUE_MAP
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_INFINITE,4,2                   ; @INFINITE
	.no_dead_strip	_wined3d_cs_wait_event
.subsections_via_symbols
