	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wined3d_fence_test
_wined3d_fence_test:                    ## @wined3d_fence_test
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_TRACE
	movq	8(%r12), %rsi
	testq	%rsi, %rsi
	je	LBB0_9
## %bb.1:
	movq	%rbx, %rdi
	callq	_context_reacquire
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	movq	8(%r12), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	_ARB_SYNC@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpl	$0, (%rax,%rcx,4)
	je	LBB0_15
## %bb.3:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_context_acquire
	movq	%rax, %r14
LBB0_4:
	movq	(%r14), %rax
	movq	(%rax), %rax
	movq	_ARB_SYNC@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_10
## %bb.5:
	movl	4(%r12), %edi
	movq	_WINED3DGETDATA_FLUSH@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	je	LBB0_7
## %bb.6:
	movq	_GL_SYNC_FLUSH_COMMANDS_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_7:
	movl	%r15d, %esi
	xorl	%edx, %edx
	callq	_glClientWaitSync
	movl	%eax, %edi
	callq	_GL_EXTCALL
	movq	%rax, %rbx
	leaq	L_.str.3(%rip), %rdi
	callq	_checkGLcall
	leal	-129(%rbx), %eax
	cmpl	$3, %eax
	jae	LBB0_14
## %bb.8:
	cltq
	leaq	l_switch.table.wined3d_fence_test(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	jmp	LBB0_19
LBB0_9:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movq	_WINED3D_FENCE_NOT_STARTED@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_20
LBB0_10:
	movq	_APPLE_FENCE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_16
## %bb.11:
	movl	(%r12), %edi
	callq	_glTestFenceAPPLE
	movl	%eax, %edi
	callq	_GL_EXTCALL
	movq	%rax, %rbx
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_12
LBB0_14:
	leaq	L_.str.4(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_ERR
	movq	_WINED3D_FENCE_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_15:
	leaq	L_.str.2(%rip), %rdi
	callq	_WARN
	movq	_WINED3D_FENCE_WRONG_THREAD@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_20
LBB0_16:
	movq	_NV_FENCE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_21
## %bb.17:
	movl	(%r12), %edi
	callq	_glTestFenceNV
	movl	%eax, %edi
	callq	_GL_EXTCALL
	movq	%rax, %rbx
	leaq	L_.str.6(%rip), %rdi
LBB0_12:
	callq	_checkGLcall
	testq	%rbx, %rbx
	jne	LBB0_18
## %bb.13:
	movq	_WINED3D_FENCE_WAITING@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_18:
	movq	_WINED3D_FENCE_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_21:
	leaq	L_.str.7(%rip), %rdi
	xorl	%eax, %eax
	callq	_ERR
	movq	_WINED3D_FENCE_ERROR@GOTPCREL(%rip), %rax
LBB0_19:
	movl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_context_release
LBB0_20:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fence %p, device %p, flags %#x.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Fence not issued.\n"

	.comm	_WINED3D_FENCE_NOT_STARTED,4,2  ## @WINED3D_FENCE_NOT_STARTED
	.comm	_ARB_SYNC,8,3                   ## @ARB_SYNC
L_.str.2:                               ## @.str.2
	.asciz	"Fence tested from wrong thread.\n"

	.comm	_WINED3D_FENCE_WRONG_THREAD,4,2 ## @WINED3D_FENCE_WRONG_THREAD
	.comm	_WINED3DGETDATA_FLUSH,4,2       ## @WINED3DGETDATA_FLUSH
	.comm	_GL_SYNC_FLUSH_COMMANDS_BIT,4,2 ## @GL_SYNC_FLUSH_COMMANDS_BIT
L_.str.3:                               ## @.str.3
	.asciz	"glClientWaitSync"

	.comm	_WINED3D_FENCE_OK,4,2           ## @WINED3D_FENCE_OK
	.comm	_WINED3D_FENCE_WAITING,4,2      ## @WINED3D_FENCE_WAITING
L_.str.4:                               ## @.str.4
	.asciz	"glClientWaitSync returned %#x.\n"

	.comm	_WINED3D_FENCE_ERROR,4,2        ## @WINED3D_FENCE_ERROR
	.comm	_APPLE_FENCE,8,3                ## @APPLE_FENCE
L_.str.5:                               ## @.str.5
	.asciz	"glTestFenceAPPLE"

	.comm	_NV_FENCE,8,3                   ## @NV_FENCE
L_.str.6:                               ## @.str.6
	.asciz	"glTestFenceNV"

L_.str.7:                               ## @.str.7
	.asciz	"Fence created despite lack of GL support.\n"

	.no_dead_strip	_wined3d_fence_test
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.wined3d_fence_test
l_switch.table.wined3d_fence_test:
	.quad	_WINED3D_FENCE_WAITING
	.quad	_WINED3D_FENCE_OK
	.quad	_WINED3D_FENCE_OK

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wined3d_fence_test
_wined3d_fence_test:                    ; @wined3d_fence_test
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	stp	x1, x21, [sp, #8]
	str	x0, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	ldr	x1, [x20, #8]
	cbz	x1, LBB0_7
; %bb.1:
	mov	x0, x22
	bl	_context_reacquire
	mov	x19, x0
Lloh2:
	adrp	x23, _ARB_SYNC@GOTPAGE
Lloh3:
	ldr	x23, [x23, _ARB_SYNC@GOTPAGEOFF]
	cbnz	x0, LBB0_4
; %bb.2:
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	x9, [x23]
	ldr	w8, [x8, x9, lsl #2]
	cbz	w8, LBB0_12
; %bb.3:
	mov	x0, x22
	mov	x1, #0
	mov	w2, #0
	bl	_context_acquire
	mov	x19, x0
LBB0_4:
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x9, [x23]
	ldr	x9, [x8, x9, lsl #3]
	cbz	x9, LBB0_8
; %bb.5:
	ldr	w0, [x20, #4]
Lloh4:
	adrp	x8, _WINED3DGETDATA_FLUSH@GOTPAGE
Lloh5:
	ldr	x8, [x8, _WINED3DGETDATA_FLUSH@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _GL_SYNC_FLUSH_COMMANDS_BIT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _GL_SYNC_FLUSH_COMMANDS_BIT@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w8, w21
	csel	w1, wzr, w9, eq
	mov	w2, #0
	bl	_glClientWaitSync
	bl	_GL_EXTCALL
	mov	x20, x0
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_checkGLcall
	sub	w8, w20, #129
	cmp	w8, #3
	b.hs	LBB0_10
; %bb.6:
Lloh12:
	adrp	x9, l_switch.table.wined3d_fence_test@PAGE
Lloh13:
	add	x9, x9, l_switch.table.wined3d_fence_test@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	b	LBB0_16
LBB0_7:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
Lloh16:
	adrp	x8, _WINED3D_FENCE_NOT_STARTED@GOTPAGE
Lloh17:
	ldr	x8, [x8, _WINED3D_FENCE_NOT_STARTED@GOTPAGEOFF]
Lloh18:
	ldr	w20, [x8]
	b	LBB0_17
LBB0_8:
Lloh19:
	adrp	x9, _APPLE_FENCE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _APPLE_FENCE@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	ldr	x9, [x8, x9, lsl #3]
	cbz	x9, LBB0_13
; %bb.9:
	ldr	w0, [x20]
	bl	_glTestFenceAPPLE
	bl	_GL_EXTCALL
	mov	x20, x0
Lloh22:
	adrp	x0, l_.str.5@PAGE
Lloh23:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_15
LBB0_10:
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	str	x20, [sp]
Lloh24:
	adrp	x0, l_.str.4@PAGE
Lloh25:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_11:
	bl	_ERR
Lloh26:
	adrp	x8, _WINED3D_FENCE_ERROR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _WINED3D_FENCE_ERROR@GOTPAGEOFF]
	b	LBB0_16
LBB0_12:
Lloh28:
	adrp	x0, l_.str.2@PAGE
Lloh29:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_WARN
Lloh30:
	adrp	x8, _WINED3D_FENCE_WRONG_THREAD@GOTPAGE
Lloh31:
	ldr	x8, [x8, _WINED3D_FENCE_WRONG_THREAD@GOTPAGEOFF]
Lloh32:
	ldr	w20, [x8]
	b	LBB0_17
LBB0_13:
Lloh33:
	adrp	x9, _NV_FENCE@GOTPAGE
Lloh34:
	ldr	x9, [x9, _NV_FENCE@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	cbz	x8, LBB0_18
; %bb.14:
	ldr	w0, [x20]
	bl	_glTestFenceNV
	bl	_GL_EXTCALL
	mov	x20, x0
Lloh36:
	adrp	x0, l_.str.6@PAGE
Lloh37:
	add	x0, x0, l_.str.6@PAGEOFF
LBB0_15:
	bl	_checkGLcall
Lloh38:
	adrp	x8, _WINED3D_FENCE_OK@GOTPAGE
Lloh39:
	ldr	x8, [x8, _WINED3D_FENCE_OK@GOTPAGEOFF]
Lloh40:
	adrp	x9, _WINED3D_FENCE_WAITING@GOTPAGE
Lloh41:
	ldr	x9, [x9, _WINED3D_FENCE_WAITING@GOTPAGEOFF]
	cmp	x20, #0
	csel	x8, x9, x8, eq
LBB0_16:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_context_release
LBB0_17:
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_18:
Lloh42:
	adrp	x0, l_.str.7@PAGE
Lloh43:
	add	x0, x0, l_.str.7@PAGEOFF
	b	LBB0_11
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fence %p, device %p, flags %#x.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Fence not issued.\n"

	.comm	_WINED3D_FENCE_NOT_STARTED,4,2  ; @WINED3D_FENCE_NOT_STARTED
	.comm	_ARB_SYNC,8,3                   ; @ARB_SYNC
l_.str.2:                               ; @.str.2
	.asciz	"Fence tested from wrong thread.\n"

	.comm	_WINED3D_FENCE_WRONG_THREAD,4,2 ; @WINED3D_FENCE_WRONG_THREAD
	.comm	_WINED3DGETDATA_FLUSH,4,2       ; @WINED3DGETDATA_FLUSH
	.comm	_GL_SYNC_FLUSH_COMMANDS_BIT,4,2 ; @GL_SYNC_FLUSH_COMMANDS_BIT
l_.str.3:                               ; @.str.3
	.asciz	"glClientWaitSync"

	.comm	_WINED3D_FENCE_OK,4,2           ; @WINED3D_FENCE_OK
	.comm	_WINED3D_FENCE_WAITING,4,2      ; @WINED3D_FENCE_WAITING
l_.str.4:                               ; @.str.4
	.asciz	"glClientWaitSync returned %#x.\n"

	.comm	_WINED3D_FENCE_ERROR,4,2        ; @WINED3D_FENCE_ERROR
	.comm	_APPLE_FENCE,8,3                ; @APPLE_FENCE
l_.str.5:                               ; @.str.5
	.asciz	"glTestFenceAPPLE"

	.comm	_NV_FENCE,8,3                   ; @NV_FENCE
l_.str.6:                               ; @.str.6
	.asciz	"glTestFenceNV"

l_.str.7:                               ; @.str.7
	.asciz	"Fence created despite lack of GL support.\n"

	.no_dead_strip	_wined3d_fence_test
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.wined3d_fence_test
l_switch.table.wined3d_fence_test:
	.quad	_WINED3D_FENCE_WAITING
	.quad	_WINED3D_FENCE_OK
	.quad	_WINED3D_FENCE_OK

.subsections_via_symbols
